From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- src/boost/libs/geometry/test/Jamfile | 57 + src/boost/libs/geometry/test/algorithms/Jamfile | 85 + src/boost/libs/geometry/test/algorithms/append.cpp | 175 + .../libs/geometry/test/algorithms/area/Jamfile | 18 + .../libs/geometry/test/algorithms/area/area.cpp | 242 ++ .../geometry/test/algorithms/area/area_geo.cpp | 203 + .../geometry/test/algorithms/area/area_multi.cpp | 55 + .../geometry/test/algorithms/area/area_sph_geo.cpp | 413 ++ .../geometry/test/algorithms/area/test_area.hpp | 81 + src/boost/libs/geometry/test/algorithms/assign.cpp | 326 ++ .../libs/geometry/test/algorithms/buffer/Jamfile | 31 + .../geometry/test/algorithms/buffer/buffer.cpp | 73 + .../test/algorithms/buffer/buffer_countries.cpp | 248 ++ .../test/algorithms/buffer/buffer_linestring.cpp | 414 ++ .../algorithms/buffer/buffer_linestring_aimes.cpp | 489 +++ .../algorithms/buffer/buffer_multi_linestring.cpp | 226 ++ .../test/algorithms/buffer/buffer_multi_point.cpp | 224 ++ .../algorithms/buffer/buffer_multi_polygon.cpp | 529 +++ .../test/algorithms/buffer/buffer_point.cpp | 41 + .../test/algorithms/buffer/buffer_point_geo.cpp | 47 + .../test/algorithms/buffer/buffer_polygon.cpp | 865 +++++ .../test/algorithms/buffer/buffer_ring.cpp | 50 + .../algorithms/buffer/buffer_with_strategies.cpp | 141 + .../geometry/test/algorithms/buffer/data/gr.wkt | 69 + .../geometry/test/algorithms/buffer/data/it.wkt | 22 + .../geometry/test/algorithms/buffer/data/nl.wkt | 8 + .../geometry/test/algorithms/buffer/data/no.wkt | 95 + .../geometry/test/algorithms/buffer/data/uk.wkt | 48 + .../test/algorithms/buffer/test_buffer.hpp | 550 +++ .../test/algorithms/buffer/test_buffer_geo.hpp | 83 + .../test/algorithms/buffer/test_buffer_svg.hpp | 480 +++ .../algorithms/buffer/test_buffer_svg_per_turn.hpp | 164 + .../libs/geometry/test/algorithms/centroid.cpp | 276 ++ .../geometry/test/algorithms/centroid_multi.cpp | 197 + .../geometry/test/algorithms/check_validity.hpp | 79 + .../libs/geometry/test/algorithms/clear_multi.cpp | 63 + .../test/algorithms/comparable_distance.cpp | 523 +++ .../libs/geometry/test/algorithms/convert.cpp | 338 ++ .../geometry/test/algorithms/convert_multi.cpp | 98 + .../libs/geometry/test/algorithms/convex_hull.cpp | 89 + .../geometry/test/algorithms/convex_hull_multi.cpp | 91 + .../libs/geometry/test/algorithms/correct.cpp | 183 + .../geometry/test/algorithms/correct_closure.cpp | 114 + .../geometry/test/algorithms/correct_multi.cpp | 60 + .../geometry/test/algorithms/covered_by/Jamfile | 23 + .../test/algorithms/covered_by/covered_by.cpp | 197 + .../algorithms/covered_by/covered_by_multi.cpp | 56 + .../test/algorithms/covered_by/covered_by_sph.cpp | 320 ++ .../algorithms/covered_by/covered_by_sph_geo.cpp | 132 + .../test/algorithms/covered_by/test_covered_by.hpp | 184 + .../libs/geometry/test/algorithms/crosses/Jamfile | 21 + .../geometry/test/algorithms/crosses/crosses.cpp | 107 + .../test/algorithms/crosses/crosses_sph.cpp | 119 + .../test/algorithms/crosses/test_crosses.hpp | 110 + .../libs/geometry/test/algorithms/densify.cpp | 227 ++ .../libs/geometry/test/algorithms/detail/Jamfile | 24 + .../geometry/test/algorithms/detail/as_range.cpp | 79 + .../algorithms/detail/calculate_point_order.cpp | 148 + .../geometry/test/algorithms/detail/partition.cpp | 675 ++++ .../test/algorithms/detail/sections/Jamfile | 20 + .../detail/sections/range_by_section.cpp | 105 + .../algorithms/detail/sections/sectionalize.cpp | 363 ++ .../test/algorithms/detail/tupled_output.cpp | 116 + .../libs/geometry/test/algorithms/disjoint/Jamfile | 30 + .../geometry/test/algorithms/disjoint/disjoint.cpp | 165 + .../algorithms/disjoint/disjoint_coverage_a_a.cpp | 387 ++ .../algorithms/disjoint/disjoint_coverage_l_a.cpp | 538 +++ .../algorithms/disjoint/disjoint_coverage_l_l.cpp | 379 ++ .../algorithms/disjoint/disjoint_coverage_p_a.cpp | 292 ++ .../algorithms/disjoint/disjoint_coverage_p_l.cpp | 391 ++ .../algorithms/disjoint/disjoint_coverage_p_p.cpp | 187 + .../test/algorithms/disjoint/disjoint_multi.cpp | 129 + .../disjoint/disjoint_point_box_geometry.cpp | 128 + .../test/algorithms/disjoint/disjoint_seg_box.cpp | 301 ++ .../test/algorithms/disjoint/disjoint_sph.cpp | 327 ++ .../test/algorithms/disjoint/test_disjoint.hpp | 112 + .../algorithms/disjoint/test_disjoint_seg_box.hpp | 62 + .../libs/geometry/test/algorithms/distance/Jamfile | 35 + .../geometry/test/algorithms/distance/distance.cpp | 536 +++ .../test/algorithms/distance/distance_all.cpp | 20 + .../algorithms/distance/distance_brute_force.hpp | 1356 +++++++ .../test/algorithms/distance/distance_ca_ar_ar.cpp | 437 +++ .../test/algorithms/distance/distance_ca_l_ar.cpp | 972 +++++ .../test/algorithms/distance/distance_ca_l_l.cpp | 321 ++ .../test/algorithms/distance/distance_ca_pl_ar.cpp | 671 ++++ .../test/algorithms/distance/distance_ca_pl_l.cpp | 318 ++ .../test/algorithms/distance/distance_ca_pl_pl.cpp | 123 + .../distance/distance_geo_linear_box.cpp | 567 +++ .../test/algorithms/distance/distance_geo_pl_l.cpp | 728 ++++ .../algorithms/distance/distance_se_geo_ar_ar.cpp | 943 +++++ .../algorithms/distance/distance_se_geo_l_ar.cpp | 651 ++++ .../algorithms/distance/distance_se_geo_l_l.cpp | 286 ++ .../algorithms/distance/distance_se_geo_pl_ar.cpp | 687 ++++ .../algorithms/distance/distance_se_geo_pl_pl.cpp | 122 + .../test/algorithms/distance/distance_se_pl_l.cpp | 556 +++ .../test/algorithms/distance/distance_se_pl_pl.cpp | 299 ++ .../test/algorithms/distance/test_distance.hpp | 138 + .../algorithms/distance/test_distance_common.hpp | 611 +++ .../distance/test_distance_geo_common.hpp | 577 +++ .../distance/test_distance_se_common.hpp | 381 ++ .../algorithms/distance/test_empty_geometry.hpp | 213 ++ .../test/algorithms/envelope_expand/Jamfile | 24 + .../test/algorithms/envelope_expand/envelope.cpp | 235 ++ .../algorithms/envelope_expand/envelope_multi.cpp | 63 + .../envelope_expand/envelope_on_spheroid.cpp | 2709 ++++++++++++++ .../test/algorithms/envelope_expand/expand.cpp | 164 + .../envelope_expand/expand_on_spheroid.cpp | 1126 ++++++ .../algorithms/envelope_expand/test_envelope.hpp | 98 + .../test_envelope_expand_on_spheroid.hpp | 360 ++ .../algorithms/envelope_expand/test_expand.hpp | 71 + .../libs/geometry/test/algorithms/equals/Jamfile | 22 + .../geometry/test/algorithms/equals/equals.cpp | 318 ++ .../test/algorithms/equals/equals_multi.cpp | 52 + .../test/algorithms/equals/equals_on_spheroid.cpp | 255 ++ .../geometry/test/algorithms/equals/equals_sph.cpp | 155 + .../test/algorithms/equals/test_equals.hpp | 115 + .../libs/geometry/test/algorithms/for_each.cpp | 130 + .../geometry/test/algorithms/for_each_multi.cpp | 97 + .../geometry/test/algorithms/intersects/Jamfile | 26 + .../test/algorithms/intersects/intersects.cpp | 227 ++ .../intersects/intersects_box_geometry.cpp | 172 + .../algorithms/intersects/intersects_multi.cpp | 63 + .../test/algorithms/intersects/intersects_self.cpp | 133 + .../test/algorithms/intersects/intersects_sph.cpp | 269 ++ .../algorithms/intersects/intersects_sph_geo.cpp | 86 + .../test/algorithms/intersects/test_intersects.hpp | 115 + .../libs/geometry/test/algorithms/is_convex.cpp | 61 + .../libs/geometry/test/algorithms/is_empty.cpp | 335 ++ .../libs/geometry/test/algorithms/is_simple.cpp | 314 ++ .../geometry/test/algorithms/is_simple_geo.cpp | 128 + .../libs/geometry/test/algorithms/is_valid.cpp | 1416 +++++++ .../geometry/test/algorithms/is_valid_failure.cpp | 982 +++++ .../libs/geometry/test/algorithms/is_valid_geo.cpp | 76 + .../libs/geometry/test/algorithms/length/Jamfile | 17 + .../geometry/test/algorithms/length/length.cpp | 55 + .../geometry/test/algorithms/length/length_geo.cpp | 121 + .../test/algorithms/length/length_multi.cpp | 38 + .../geometry/test/algorithms/length/length_sph.cpp | 87 + .../test/algorithms/length/linestring_cases.hpp | 28 + .../geometry/test/algorithms/line_interpolate.cpp | 370 ++ src/boost/libs/geometry/test/algorithms/make.cpp | 137 + .../libs/geometry/test/algorithms/maximum_gap.cpp | 139 + .../geometry/test/algorithms/num_geometries.cpp | 151 + .../test/algorithms/num_geometries_multi.cpp | 57 + .../test/algorithms/num_interior_rings.cpp | 153 + .../test/algorithms/num_interior_rings_multi.cpp | 50 + .../libs/geometry/test/algorithms/num_points.cpp | 94 + .../geometry/test/algorithms/num_points_multi.cpp | 70 + .../libs/geometry/test/algorithms/num_segments.cpp | 291 ++ .../libs/geometry/test/algorithms/overlaps/Jamfile | 24 + .../geometry/test/algorithms/overlaps/overlaps.cpp | 63 + .../test/algorithms/overlaps/overlaps_areal.cpp | 73 + .../test/algorithms/overlaps/overlaps_box.cpp | 65 + .../test/algorithms/overlaps/overlaps_sph.cpp | 153 + .../test/algorithms/overlaps/test_overlaps.hpp | 94 + .../libs/geometry/test/algorithms/overlay/Jamfile | 38 + .../geometry/test/algorithms/overlay/assemble.cpp | 196 + .../algorithms/overlay/debug_sort_by_side_svg.hpp | 123 + .../geometry/test/algorithms/overlay/dissolver.cpp | 217 ++ .../overlay/enrich_intersection_points.cpp | 187 + .../test/algorithms/overlay/get_turn_info.cpp | 901 +++++ .../test/algorithms/overlay/get_turn_info.xls | Bin 0 -> 133120 bytes .../geometry/test/algorithms/overlay/get_turns.cpp | 404 ++ .../algorithms/overlay/get_turns_areal_areal.cpp | 62 + .../overlay/get_turns_areal_areal_sph.cpp | 84 + .../algorithms/overlay/get_turns_linear_areal.cpp | 234 ++ .../overlay/get_turns_linear_areal_sph.cpp | 241 ++ .../algorithms/overlay/get_turns_linear_linear.cpp | 687 ++++ .../overlay/get_turns_linear_linear_geo.cpp | 50 + .../overlay/get_turns_linear_linear_sph.cpp | 442 +++ .../algorithms/overlay/multi_overlay_cases.hpp | 1549 ++++++++ .../algorithms/overlay/multi_overlay_common.hpp | 40 + .../geometry/test/algorithms/overlay/overlay.cpp | 524 +++ .../test/algorithms/overlay/overlay_cases.hpp | 1394 +++++++ .../test/algorithms/overlay/overlay_common.hpp | 464 +++ .../test/algorithms/overlay/relative_order.cpp | 220 ++ .../test/algorithms/overlay/select_rings.cpp | 118 + .../overlay/self_intersection_points.cpp | 279 ++ .../test/algorithms/overlay/sort_by_side.cpp | 268 ++ .../test/algorithms/overlay/sort_by_side_basic.cpp | 348 ++ .../test/algorithms/overlay/split_rings.cpp | 155 + .../test/algorithms/overlay/test_get_turns.hpp | 328 ++ .../geometry/test/algorithms/overlay/traverse.cpp | 1040 ++++++ .../test/algorithms/overlay/traverse_ccw.cpp | 365 ++ .../test/algorithms/overlay/traverse_gmp.cpp | 208 ++ .../test/algorithms/overlay/traverse_multi.cpp | 462 +++ .../libs/geometry/test/algorithms/perimeter.cpp | 63 + .../geometry/test/algorithms/perimeter/Jamfile | 16 + .../test/algorithms/perimeter/perimeter.cpp | 66 + .../test/algorithms/perimeter/perimeter_geo.cpp | 124 + .../perimeter/perimeter_polygon_cases.hpp | 37 + .../test/algorithms/perimeter/perimeter_sph.cpp | 88 + .../geometry/test/algorithms/perimeter_multi.cpp | 37 + .../geometry/test/algorithms/point_on_surface.cpp | 365 ++ .../libs/geometry/test/algorithms/predef_relop.hpp | 33 + .../test/algorithms/pretty_print_geometry.hpp | 69 + .../libs/geometry/test/algorithms/relate/Jamfile | 26 + .../geometry/test/algorithms/relate/nan_cases.hpp | 130 + .../test/algorithms/relate/relate_areal_areal.cpp | 434 +++ .../algorithms/relate/relate_areal_areal_sph.cpp | 115 + .../test/algorithms/relate/relate_linear_areal.cpp | 536 +++ .../algorithms/relate/relate_linear_areal_sph.cpp | 419 +++ .../algorithms/relate/relate_linear_linear.cpp | 446 +++ .../algorithms/relate/relate_linear_linear_sph.cpp | 451 +++ .../relate/relate_pointlike_geometry.cpp | 254 ++ .../test/algorithms/relate/test_relate.hpp | 232 ++ .../geometry/test/algorithms/remove_spikes.cpp | 186 + .../libs/geometry/test/algorithms/reverse.cpp | 75 + .../geometry/test/algorithms/reverse_multi.cpp | 51 + .../test/algorithms/set_operations/Jamfile | 20 + .../algorithms/set_operations/check_turn_less.hpp | 115 + .../algorithms/set_operations/difference/Jamfile | 32 + .../set_operations/difference/difference.cpp | 663 ++++ .../difference/difference_areal_linear.cpp | 260 ++ .../difference/difference_l_a_sph.cpp | 36 + .../difference/difference_linear_linear.cpp | 1542 ++++++++ .../set_operations/difference/difference_multi.cpp | 531 +++ .../difference/difference_multi_areal_linear.cpp | 83 + .../difference/difference_multi_spike.cpp | 121 + .../set_operations/difference/difference_pl_a.cpp | 212 ++ .../set_operations/difference/difference_pl_l.cpp | 674 ++++ .../set_operations/difference/difference_pl_pl.cpp | 244 ++ .../set_operations/difference/test_difference.hpp | 478 +++ .../difference/test_difference_linear_linear.hpp | 186 + .../algorithms/set_operations/intersection/Jamfile | 29 + .../set_operations/intersection/intersection.cpp | 974 +++++ .../intersection/intersection_aa_sph.cpp | 39 + .../intersection_areal_areal_linear.cpp | 391 ++ .../intersection/intersection_linear_linear.cpp | 1617 ++++++++ .../intersection/intersection_multi.cpp | 515 +++ .../intersection/intersection_pl_a.cpp | 190 + .../intersection/intersection_pl_l.cpp | 702 ++++ .../intersection/intersection_pl_pl.cpp | 201 + .../intersection/intersection_segment.cpp | 134 + .../intersection/intersection_tupled.cpp | 365 ++ .../intersection/test_intersection.hpp | 390 ++ .../test_intersection_linear_linear.hpp | 260 ++ .../test/algorithms/set_operations/set_ops_ll.cpp | 17 + .../test/algorithms/set_operations/set_ops_pp.cpp | 16 + .../set_operations/setop_output_type.hpp | 43 + .../set_operations/sym_difference/Jamfile | 21 + .../sym_difference/sym_difference_areal_areal.cpp | 140 + .../sym_difference_linear_linear.cpp | 989 +++++ .../test_sym_difference_linear_linear.hpp | 196 + .../test_get_turns_ll_invariance.hpp | 189 + .../set_operations/test_set_ops_linear_linear.hpp | 381 ++ .../set_operations/test_set_ops_pointlike.hpp | 352 ++ .../test/algorithms/set_operations/union/Jamfile | 27 + .../algorithms/set_operations/union/test_union.hpp | 282 ++ .../union/test_union_linear_linear.hpp | 203 + .../test/algorithms/set_operations/union/union.cpp | 644 ++++ .../set_operations/union/union_aa_geo.cpp | 135 + .../set_operations/union/union_aa_sph.cpp | 106 + .../set_operations/union/union_linear_linear.cpp | 1075 ++++++ .../set_operations/union/union_multi.cpp | 499 +++ .../set_operations/union/union_pl_pl.cpp | 202 + .../geometry/test/algorithms/similarity/Jamfile | 15 + .../similarity/discrete_frechet_distance.cpp | 95 + .../similarity/discrete_hausdorff_distance.cpp | 118 + .../similarity/test_frechet_distance.hpp | 144 + .../similarity/test_hausdorff_distance.hpp | 138 + .../libs/geometry/test/algorithms/simplify.cpp | 311 ++ .../test/algorithms/simplify_countries.cpp | 188 + .../geometry/test/algorithms/simplify_multi.cpp | 65 + .../geometry/test/algorithms/test_centroid.hpp | 146 + .../libs/geometry/test/algorithms/test_convert.hpp | 77 + .../geometry/test/algorithms/test_convex_hull.hpp | 191 + .../libs/geometry/test/algorithms/test_correct.hpp | 54 + .../geometry/test/algorithms/test_for_each.hpp | 277 ++ .../geometry/test/algorithms/test_is_simple.hpp | 121 + .../geometry/test/algorithms/test_is_valid.hpp | 508 +++ .../libs/geometry/test/algorithms/test_length.hpp | 99 + .../libs/geometry/test/algorithms/test_overlay.hpp | 161 + .../geometry/test/algorithms/test_perimeter.hpp | 103 + .../libs/geometry/test/algorithms/test_reverse.hpp | 46 + .../geometry/test/algorithms/test_simplify.hpp | 241 ++ .../libs/geometry/test/algorithms/test_unique.hpp | 39 + .../libs/geometry/test/algorithms/touches/Jamfile | 24 + .../test/algorithms/touches/test_touches.hpp | 142 + .../geometry/test/algorithms/touches/touches.cpp | 226 ++ .../test/algorithms/touches/touches_box.cpp | 66 + .../test/algorithms/touches/touches_multi.cpp | 80 + .../test/algorithms/touches/touches_self.cpp | 43 + .../test/algorithms/touches/touches_sph.cpp | 239 ++ .../libs/geometry/test/algorithms/transform.cpp | 165 + .../geometry/test/algorithms/transform_multi.cpp | 91 + src/boost/libs/geometry/test/algorithms/unique.cpp | 60 + .../libs/geometry/test/algorithms/unique_multi.cpp | 52 + .../libs/geometry/test/algorithms/within/Jamfile | 27 + .../test/algorithms/within/test_within.hpp | 163 + .../geometry/test/algorithms/within/within.cpp | 152 + .../test/algorithms/within/within_areal_areal.cpp | 105 + .../test/algorithms/within/within_linear_areal.cpp | 127 + .../algorithms/within/within_linear_linear.cpp | 108 + .../test/algorithms/within/within_multi.cpp | 54 + .../within/within_pointlike_geometry.cpp | 462 +++ .../geometry/test/algorithms/within/within_sph.cpp | 273 ++ .../test/algorithms/within/within_sph_geo.cpp | 129 + src/boost/libs/geometry/test/arithmetic/Jamfile | 19 + .../geometry/test/arithmetic/cross_product.cpp | 87 + .../libs/geometry/test/arithmetic/dot_product.cpp | 53 + .../libs/geometry/test/arithmetic/general.cpp | 142 + .../test/arithmetic/infinite_line_functions.cpp | 205 + src/boost/libs/geometry/test/concepts/Jamfile | 30 + .../test/concepts/function_asserting_a_point.hpp | 30 + .../test/concepts/function_requiring_a_point.hpp | 29 + .../geometry/test/concepts/linestring_concept.cpp | 77 + .../libs/geometry/test/concepts/point_array.cpp | 29 + .../test/concepts/point_concept_checker.cpp | 76 + .../point_geographic_custom_with_wrong_units.cpp | 29 + .../concepts/point_geographic_with_wrong_units.cpp | 29 + .../point_spherical_custom_with_wrong_units.cpp | 28 + .../concepts/point_spherical_with_wrong_units.cpp | 26 + .../geometry/test/concepts/point_well_formed.cpp | 34 + .../concepts/point_well_formed_non_cartesian.cpp | 64 + .../test/concepts/point_well_formed_traits.cpp | 88 + .../concepts/point_with_incorrect_dimension.cpp | 59 + .../concepts/point_without_coordinate_type.cpp | 54 + .../test/concepts/point_without_dimension.cpp | 56 + .../test/concepts/point_without_getter.cpp | 52 + .../test/concepts/point_without_setter.cpp | 52 + src/boost/libs/geometry/test/core/Jamfile | 29 + src/boost/libs/geometry/test/core/access.cpp | 133 + src/boost/libs/geometry/test/core/assert.cpp | 65 + .../geometry/test/core/coordinate_dimension.cpp | 74 + .../libs/geometry/test/core/coordinate_system.cpp | 101 + .../libs/geometry/test/core/coordinate_type.cpp | 78 + src/boost/libs/geometry/test/core/geometry_id.cpp | 73 + src/boost/libs/geometry/test/core/point_type.cpp | 96 + .../libs/geometry/test/core/radian_access.cpp | 110 + src/boost/libs/geometry/test/core/radius.cpp | 64 + .../libs/geometry/test/core/reverse_dispatch.cpp | 65 + src/boost/libs/geometry/test/core/ring.cpp | 99 + src/boost/libs/geometry/test/core/tag.cpp | 89 + .../geometry/test/core/topological_dimension.cpp | 73 + src/boost/libs/geometry/test/cs_undefined/Jamfile | 21 + .../libs/geometry/test/cs_undefined/common.hpp | 69 + .../libs/geometry/test/cs_undefined/distance.cpp | 113 + .../geometry/test/cs_undefined/envelope_expand.cpp | 53 + .../libs/geometry/test/cs_undefined/index.cpp | 101 + src/boost/libs/geometry/test/cs_undefined/is.cpp | 44 + .../libs/geometry/test/cs_undefined/measure.cpp | 51 + .../libs/geometry/test/cs_undefined/other.cpp | 40 + .../libs/geometry/test/cs_undefined/relops1.cpp | 50 + .../libs/geometry/test/cs_undefined/relops2.cpp | 48 + .../libs/geometry/test/cs_undefined/setops.cpp | 281 ++ .../geometry/test/cs_undefined/test_relops.hpp | 164 + src/boost/libs/geometry/test/formulas/Jamfile | 21 + src/boost/libs/geometry/test/formulas/direct.cpp | 176 + .../geometry/test/formulas/direct_accuracy.cpp | 97 + .../libs/geometry/test/formulas/direct_cases.hpp | 700 ++++ .../test/formulas/direct_cases_antipodal.hpp | 343 ++ .../geometry/test/formulas/direct_meridian.cpp | 115 + .../test/formulas/direct_meridian_cases.hpp | 57 + .../libs/geometry/test/formulas/intersection.cpp | 198 + .../geometry/test/formulas/intersection_cases.hpp | 335 ++ src/boost/libs/geometry/test/formulas/inverse.cpp | 93 + .../libs/geometry/test/formulas/inverse_cases.hpp | 626 ++++ .../test/formulas/inverse_cases_antipodal.hpp | 342 ++ .../test/formulas/inverse_cases_small_angles.hpp | 106 + .../libs/geometry/test/formulas/inverse_karney.cpp | 104 + .../libs/geometry/test/formulas/test_formula.hpp | 97 + .../geometry/test/formulas/vertex_longitude.cpp | 154 + .../test/formulas/vertex_longitude_cases.hpp | 457 +++ src/boost/libs/geometry/test/from_wkt.hpp | 28 + src/boost/libs/geometry/test/geometries/Jamfile | 40 + .../libs/geometry/test/geometries/adapted.cpp | 112 + .../test/geometries/boost_array_as_point.cpp | 50 + .../libs/geometry/test/geometries/boost_fusion.cpp | 71 + .../geometry/test/geometries/boost_polygon.cpp | 174 + .../test/geometries/boost_polygon_overlay.cpp | 122 + .../libs/geometry/test/geometries/boost_range.cpp | 123 + .../libs/geometry/test/geometries/boost_tuple.cpp | 39 + src/boost/libs/geometry/test/geometries/box.cpp | 105 + .../geometry/test/geometries/concepts/check.cpp | 76 + .../geometry/test/geometries/custom_linestring.cpp | 128 + .../geometry/test/geometries/infinite_line.cpp | 90 + .../geometry/test/geometries/initialization.cpp | 252 ++ .../libs/geometry/test/geometries/linestring.cpp | 136 + .../geometry/test/geometries/multi_linestring.cpp | 159 + .../libs/geometry/test/geometries/multi_point.cpp | 135 + .../geometry/test/geometries/multi_polygon.cpp | 166 + src/boost/libs/geometry/test/geometries/point.cpp | 101 + .../libs/geometry/test/geometries/point_xy.cpp | 75 + .../libs/geometry/test/geometries/point_xyz.cpp | 79 + .../libs/geometry/test/geometries/polygon.cpp | 152 + src/boost/libs/geometry/test/geometries/ring.cpp | 155 + .../libs/geometry/test/geometries/segment.cpp | 104 + .../libs/geometry/test/geometry_test_common.hpp | 202 + src/boost/libs/geometry/test/headers/Jamfile | 61 + src/boost/libs/geometry/test/headers/main.cpp | 19 + src/boost/libs/geometry/test/io/Jamfile | 17 + src/boost/libs/geometry/test/io/dsv/Jamfile | 16 + src/boost/libs/geometry/test/io/dsv/dsv_multi.cpp | 99 + src/boost/libs/geometry/test/io/svg/Jamfile | 15 + src/boost/libs/geometry/test/io/svg/svg.cpp | 157 + src/boost/libs/geometry/test/io/wkt/Jamfile | 17 + src/boost/libs/geometry/test/io/wkt/wkt.cpp | 299 ++ src/boost/libs/geometry/test/io/wkt/wkt_multi.cpp | 126 + src/boost/libs/geometry/test/iterators/Jamfile | 25 + .../geometry/test/iterators/closing_iterator.cpp | 174 + .../test/iterators/concatenate_iterator.cpp | 259 ++ .../test/iterators/ever_circling_iterator.cpp | 143 + .../geometry/test/iterators/flatten_iterator.cpp | 368 ++ .../geometry/test/iterators/point_iterator.cpp | 881 +++++ .../geometry/test/iterators/segment_iterator.cpp | 752 ++++ .../test/iterators/test_iterator_common.hpp | 206 + src/boost/libs/geometry/test/minimal.cpp | 83 + src/boost/libs/geometry/test/policies/Jamfile | 16 + src/boost/libs/geometry/test/policies/compare.cpp | 256 ++ .../libs/geometry/test/policies/rescale_policy.cpp | 133 + .../test/robustness/common/common_settings.hpp | 32 + .../test/robustness/common/make_square_polygon.hpp | 46 + .../geometry/test/robustness/convex_hull/Jamfile | 18 + .../robustness/convex_hull/random_multi_points.cpp | 224 ++ .../test/robustness/overlay/areal_areal/Jamfile | 28 + .../areal_areal/general_intersection_precision.cpp | 224 ++ .../overlay/areal_areal/interior_triangles.cpp | 162 + .../overlay/areal_areal/intersection_pies.cpp | 300 ++ .../overlay/areal_areal/intersection_stars.cpp | 182 + .../robustness/overlay/areal_areal/intersects.cpp | 173 + .../overlay/areal_areal/random_ellipses_stars.cpp | 251 ++ .../overlay/areal_areal/recursive_polygons.cpp | 218 ++ .../robustness/overlay/areal_areal/star_comb.cpp | 144 + .../robustness/overlay/areal_areal/star_comb.hpp | 130 + .../overlay/areal_areal/test_overlay_p_q.hpp | 293 ++ .../robustness/overlay/areal_areal/ticket_9081.cpp | 239 ++ .../test/robustness/overlay/buffer/Jamfile | 19 + .../robustness/overlay/buffer/many_ring_buffer.cpp | 301 ++ .../overlay/buffer/multi_point_growth.cpp | 139 + .../overlay/buffer/recursive_polygons_buffer.cpp | 362 ++ .../test/robustness/overlay/linear_areal/Jamfile | 19 + .../recursive_polygons_linear_areal.cpp | 500 +++ src/boost/libs/geometry/test/srs/Jamfile | 31 + .../libs/geometry/test/srs/check_geometry.hpp | 162 + src/boost/libs/geometry/test/srs/proj4.hpp | 330 ++ src/boost/libs/geometry/test/srs/projection.cpp | 95 + .../libs/geometry/test/srs/projection_epsg.cpp | 93 + .../geometry/test/srs/projection_interface_d.cpp | 67 + .../geometry/test/srs/projection_interface_p4.cpp | 124 + .../geometry/test/srs/projection_interface_s.cpp | 96 + .../libs/geometry/test/srs/projection_selftest.cpp | 115 + .../test/srs/projection_selftest_cases.hpp | 3935 ++++++++++++++++++++ src/boost/libs/geometry/test/srs/projections.cpp | 370 ++ .../geometry/test/srs/projections_combined.cpp | 169 + .../libs/geometry/test/srs/projections_static.cpp | 290 ++ src/boost/libs/geometry/test/srs/spar.cpp | 63 + .../libs/geometry/test/srs/srs_transformer.cpp | 108 + .../libs/geometry/test/srs/transformation_epsg.cpp | 57 + .../geometry/test/srs/transformation_interface.cpp | 204 + src/boost/libs/geometry/test/strategies/Jamfile | 46 + .../libs/geometry/test/strategies/andoyer.cpp | 346 ++ .../libs/geometry/test/strategies/cross_track.cpp | 181 + .../test/strategies/crossings_multiply.cpp | 87 + .../libs/geometry/test/strategies/distance.cpp | 117 + .../test/strategies/distance_cross_track.cpp | 116 + .../test/strategies/distance_cross_track_cases.hpp | 518 +++ .../test/strategies/distance_default_result.cpp | 270 ++ .../geometry/test/strategies/douglas_peucker.cpp | 422 +++ .../geometry/test/strategies/envelope_segment.cpp | 134 + .../libs/geometry/test/strategies/franklin.cpp | 86 + .../libs/geometry/test/strategies/haversine.cpp | 266 ++ .../test/strategies/matrix_transformer.cpp | 103 + .../libs/geometry/test/strategies/point_in_box.cpp | 81 + .../geometry/test/strategies/projected_point.cpp | 75 + .../test/strategies/projected_point_ax.cpp | 87 + .../libs/geometry/test/strategies/pythagoras.cpp | 363 ++ .../test/strategies/pythagoras_point_box.cpp | 505 +++ .../test/strategies/segment_intersection.cpp | 218 ++ .../strategies/segment_intersection_collinear.cpp | 527 +++ .../test/strategies/segment_intersection_geo.cpp | 430 +++ .../test/strategies/segment_intersection_geo.hpp | 270 ++ .../test/strategies/segment_intersection_sph.cpp | 299 ++ .../test/strategies/segment_intersection_sph.hpp | 221 ++ .../test/strategies/side_of_intersection.cpp | 108 + .../geometry/test/strategies/spherical_side.cpp | 173 + .../test/strategies/test_projected_point.hpp | 185 + .../libs/geometry/test/strategies/test_within.hpp | 106 + src/boost/libs/geometry/test/strategies/thomas.cpp | 153 + .../libs/geometry/test/strategies/transform_cs.cpp | 149 + .../libs/geometry/test/strategies/transformer.cpp | 119 + .../libs/geometry/test/strategies/vincenty.cpp | 330 ++ .../libs/geometry/test/strategies/winding.cpp | 218 ++ src/boost/libs/geometry/test/string_from_type.hpp | 100 + .../libs/geometry/test/test_common/test_point.hpp | 111 + .../geometry/test/test_common/with_pointer.hpp | 87 + .../test/test_geometries/all_custom_container.hpp | 137 + .../test/test_geometries/all_custom_linestring.hpp | 137 + .../test/test_geometries/all_custom_polygon.hpp | 130 + .../test/test_geometries/all_custom_ring.hpp | 142 + .../copy_on_dereference_geometries.hpp | 177 + .../test/test_geometries/custom_lon_lat_point.hpp | 133 + .../test/test_geometries/custom_segment.hpp | 58 + .../test/test_geometries/wrapped_boost_array.hpp | 151 + src/boost/libs/geometry/test/to_svg.hpp | 412 ++ src/boost/libs/geometry/test/util/Jamfile | 30 + .../libs/geometry/test/util/calculation_type.cpp | 208 ++ .../libs/geometry/test/util/compress_variant.cpp | 77 + .../geometry/test/util/for_each_coordinate.cpp | 84 + .../libs/geometry/test/util/is_implemented.cpp | 88 + src/boost/libs/geometry/test/util/math_abs.cpp | 102 + src/boost/libs/geometry/test/util/math_equals.cpp | 79 + src/boost/libs/geometry/test/util/math_sqrt.cpp | 153 + src/boost/libs/geometry/test/util/number_types.hpp | 187 + .../libs/geometry/test/util/promote_integral.cpp | 547 +++ src/boost/libs/geometry/test/util/range.cpp | 244 ++ src/boost/libs/geometry/test/util/rational.cpp | 61 + .../geometry/test/util/select_most_precise.cpp | 78 + .../libs/geometry/test/util/transform_variant.cpp | 68 + src/boost/libs/geometry/test/util/tuples.cpp | 141 + src/boost/libs/geometry/test/util/write_dsv.cpp | 73 + src/boost/libs/geometry/test/views/Jamfile | 19 + src/boost/libs/geometry/test/views/box_view.cpp | 81 + .../libs/geometry/test/views/closeable_view.cpp | 134 + .../geometry/test/views/reversible_closeable.cpp | 165 + .../libs/geometry/test/views/reversible_view.cpp | 81 + .../libs/geometry/test/views/segment_view.cpp | 86 + 517 files changed, 114451 insertions(+) create mode 100644 src/boost/libs/geometry/test/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/append.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/area/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/area/area.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/area/area_geo.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/area/area_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/area/area_sph_geo.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/area/test_area.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/assign.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/buffer.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/buffer_countries.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/buffer_linestring.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/buffer_linestring_aimes.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/buffer_multi_linestring.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/buffer_multi_point.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/buffer_multi_polygon.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/buffer_point.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/buffer_point_geo.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/buffer_polygon.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/buffer_ring.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/buffer_with_strategies.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/data/gr.wkt create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/data/it.wkt create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/data/nl.wkt create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/data/no.wkt create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/data/uk.wkt create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/test_buffer.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/test_buffer_geo.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/test_buffer_svg.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/buffer/test_buffer_svg_per_turn.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/centroid.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/centroid_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/check_validity.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/clear_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/comparable_distance.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/convert.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/convert_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/convex_hull.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/convex_hull_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/correct.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/correct_closure.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/correct_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/covered_by/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/covered_by/covered_by.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/covered_by/covered_by_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/covered_by/covered_by_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/covered_by/covered_by_sph_geo.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/covered_by/test_covered_by.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/crosses/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/crosses/crosses.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/crosses/crosses_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/crosses/test_crosses.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/densify.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/detail/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/detail/as_range.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/detail/calculate_point_order.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/detail/partition.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/detail/sections/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/detail/sections/range_by_section.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/detail/sections/sectionalize.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/detail/tupled_output.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/disjoint.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_a_a.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_l_a.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_l_l.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_p_a.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_p_l.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_p_p.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/disjoint_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/disjoint_point_box_geometry.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/disjoint_seg_box.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/disjoint_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/test_disjoint.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/disjoint/test_disjoint_seg_box.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_all.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_brute_force.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_ca_ar_ar.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_ca_l_ar.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_ca_l_l.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_ca_pl_ar.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_ca_pl_l.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_ca_pl_pl.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_geo_linear_box.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_geo_pl_l.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_ar_ar.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_l_ar.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_l_l.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_pl_ar.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_pl_pl.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_se_pl_l.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/distance_se_pl_pl.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/test_distance.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/test_distance_common.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/test_distance_geo_common.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/test_distance_se_common.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/distance/test_empty_geometry.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/envelope_expand/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/envelope_expand/envelope.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/envelope_expand/envelope_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/envelope_expand/envelope_on_spheroid.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/envelope_expand/expand.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/envelope_expand/expand_on_spheroid.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/envelope_expand/test_envelope.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/envelope_expand/test_envelope_expand_on_spheroid.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/envelope_expand/test_expand.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/equals/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/equals/equals.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/equals/equals_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/equals/equals_on_spheroid.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/equals/equals_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/equals/test_equals.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/for_each.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/for_each_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/intersects/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/intersects/intersects.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/intersects/intersects_box_geometry.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/intersects/intersects_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/intersects/intersects_self.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/intersects/intersects_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/intersects/intersects_sph_geo.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/intersects/test_intersects.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/is_convex.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/is_empty.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/is_simple.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/is_simple_geo.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/is_valid.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/is_valid_failure.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/is_valid_geo.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/length/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/length/length.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/length/length_geo.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/length/length_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/length/length_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/length/linestring_cases.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/line_interpolate.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/make.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/maximum_gap.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/num_geometries.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/num_geometries_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/num_interior_rings.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/num_interior_rings_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/num_points.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/num_points_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/num_segments.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlaps/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/overlaps/overlaps.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlaps/overlaps_areal.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlaps/overlaps_box.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlaps/overlaps_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlaps/test_overlaps.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/assemble.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/debug_sort_by_side_svg.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/dissolver.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/enrich_intersection_points.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/get_turn_info.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/get_turn_info.xls create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/get_turns.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/get_turns_areal_areal.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/get_turns_areal_areal_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_areal.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_areal_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_linear.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_linear_geo.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_linear_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/multi_overlay_cases.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/multi_overlay_common.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/overlay.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/overlay_cases.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/overlay_common.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/relative_order.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/select_rings.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/self_intersection_points.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/sort_by_side.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/sort_by_side_basic.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/split_rings.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/test_get_turns.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/traverse.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/traverse_ccw.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/overlay/traverse_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/perimeter.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/perimeter/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/perimeter/perimeter.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/perimeter/perimeter_geo.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/perimeter/perimeter_polygon_cases.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/perimeter/perimeter_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/perimeter_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/point_on_surface.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/predef_relop.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/pretty_print_geometry.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/relate/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/relate/nan_cases.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/relate/relate_areal_areal.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/relate/relate_areal_areal_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/relate/relate_linear_areal.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/relate/relate_linear_areal_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/relate/relate_linear_linear.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/relate/relate_linear_linear_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/relate/relate_pointlike_geometry.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/relate/test_relate.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/remove_spikes.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/reverse.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/reverse_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/check_turn_less.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/difference/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/difference/difference.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_areal_linear.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_l_a_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_linear_linear.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_multi_areal_linear.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_multi_spike.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_pl_a.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_pl_l.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_pl_pl.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/difference/test_difference.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/difference/test_difference_linear_linear.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/intersection/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_aa_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_areal_areal_linear.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_linear_linear.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_pl_a.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_pl_l.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_pl_pl.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_segment.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_tupled.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/intersection/test_intersection.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/intersection/test_intersection_linear_linear.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/set_ops_ll.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/set_ops_pp.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/setop_output_type.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/sym_difference_areal_areal.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/sym_difference_linear_linear.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/test_sym_difference_linear_linear.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/test_get_turns_ll_invariance.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/test_set_ops_linear_linear.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/test_set_ops_pointlike.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/union/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/union/test_union.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/union/test_union_linear_linear.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/union/union.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/union/union_aa_geo.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/union/union_aa_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/union/union_linear_linear.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/union/union_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/set_operations/union/union_pl_pl.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/similarity/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/similarity/discrete_frechet_distance.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/similarity/discrete_hausdorff_distance.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/similarity/test_frechet_distance.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/similarity/test_hausdorff_distance.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/simplify.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/simplify_countries.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/simplify_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/test_centroid.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/test_convert.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/test_convex_hull.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/test_correct.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/test_for_each.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/test_is_simple.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/test_is_valid.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/test_length.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/test_overlay.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/test_perimeter.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/test_reverse.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/test_simplify.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/test_unique.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/touches/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/touches/test_touches.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/touches/touches.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/touches/touches_box.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/touches/touches_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/touches/touches_self.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/touches/touches_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/transform.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/transform_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/unique.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/unique_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/within/Jamfile create mode 100644 src/boost/libs/geometry/test/algorithms/within/test_within.hpp create mode 100644 src/boost/libs/geometry/test/algorithms/within/within.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/within/within_areal_areal.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/within/within_linear_areal.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/within/within_linear_linear.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/within/within_multi.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/within/within_pointlike_geometry.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/within/within_sph.cpp create mode 100644 src/boost/libs/geometry/test/algorithms/within/within_sph_geo.cpp create mode 100644 src/boost/libs/geometry/test/arithmetic/Jamfile create mode 100644 src/boost/libs/geometry/test/arithmetic/cross_product.cpp create mode 100644 src/boost/libs/geometry/test/arithmetic/dot_product.cpp create mode 100644 src/boost/libs/geometry/test/arithmetic/general.cpp create mode 100755 src/boost/libs/geometry/test/arithmetic/infinite_line_functions.cpp create mode 100644 src/boost/libs/geometry/test/concepts/Jamfile create mode 100644 src/boost/libs/geometry/test/concepts/function_asserting_a_point.hpp create mode 100644 src/boost/libs/geometry/test/concepts/function_requiring_a_point.hpp create mode 100644 src/boost/libs/geometry/test/concepts/linestring_concept.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_array.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_concept_checker.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_geographic_custom_with_wrong_units.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_geographic_with_wrong_units.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_spherical_custom_with_wrong_units.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_spherical_with_wrong_units.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_well_formed.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_well_formed_non_cartesian.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_well_formed_traits.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_with_incorrect_dimension.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_without_coordinate_type.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_without_dimension.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_without_getter.cpp create mode 100644 src/boost/libs/geometry/test/concepts/point_without_setter.cpp create mode 100644 src/boost/libs/geometry/test/core/Jamfile create mode 100644 src/boost/libs/geometry/test/core/access.cpp create mode 100644 src/boost/libs/geometry/test/core/assert.cpp create mode 100644 src/boost/libs/geometry/test/core/coordinate_dimension.cpp create mode 100644 src/boost/libs/geometry/test/core/coordinate_system.cpp create mode 100644 src/boost/libs/geometry/test/core/coordinate_type.cpp create mode 100644 src/boost/libs/geometry/test/core/geometry_id.cpp create mode 100644 src/boost/libs/geometry/test/core/point_type.cpp create mode 100644 src/boost/libs/geometry/test/core/radian_access.cpp create mode 100644 src/boost/libs/geometry/test/core/radius.cpp create mode 100644 src/boost/libs/geometry/test/core/reverse_dispatch.cpp create mode 100644 src/boost/libs/geometry/test/core/ring.cpp create mode 100644 src/boost/libs/geometry/test/core/tag.cpp create mode 100644 src/boost/libs/geometry/test/core/topological_dimension.cpp create mode 100644 src/boost/libs/geometry/test/cs_undefined/Jamfile create mode 100644 src/boost/libs/geometry/test/cs_undefined/common.hpp create mode 100644 src/boost/libs/geometry/test/cs_undefined/distance.cpp create mode 100644 src/boost/libs/geometry/test/cs_undefined/envelope_expand.cpp create mode 100644 src/boost/libs/geometry/test/cs_undefined/index.cpp create mode 100644 src/boost/libs/geometry/test/cs_undefined/is.cpp create mode 100644 src/boost/libs/geometry/test/cs_undefined/measure.cpp create mode 100644 src/boost/libs/geometry/test/cs_undefined/other.cpp create mode 100644 src/boost/libs/geometry/test/cs_undefined/relops1.cpp create mode 100644 src/boost/libs/geometry/test/cs_undefined/relops2.cpp create mode 100644 src/boost/libs/geometry/test/cs_undefined/setops.cpp create mode 100644 src/boost/libs/geometry/test/cs_undefined/test_relops.hpp create mode 100644 src/boost/libs/geometry/test/formulas/Jamfile create mode 100644 src/boost/libs/geometry/test/formulas/direct.cpp create mode 100644 src/boost/libs/geometry/test/formulas/direct_accuracy.cpp create mode 100644 src/boost/libs/geometry/test/formulas/direct_cases.hpp create mode 100644 src/boost/libs/geometry/test/formulas/direct_cases_antipodal.hpp create mode 100644 src/boost/libs/geometry/test/formulas/direct_meridian.cpp create mode 100644 src/boost/libs/geometry/test/formulas/direct_meridian_cases.hpp create mode 100644 src/boost/libs/geometry/test/formulas/intersection.cpp create mode 100644 src/boost/libs/geometry/test/formulas/intersection_cases.hpp create mode 100644 src/boost/libs/geometry/test/formulas/inverse.cpp create mode 100644 src/boost/libs/geometry/test/formulas/inverse_cases.hpp create mode 100644 src/boost/libs/geometry/test/formulas/inverse_cases_antipodal.hpp create mode 100644 src/boost/libs/geometry/test/formulas/inverse_cases_small_angles.hpp create mode 100644 src/boost/libs/geometry/test/formulas/inverse_karney.cpp create mode 100644 src/boost/libs/geometry/test/formulas/test_formula.hpp create mode 100644 src/boost/libs/geometry/test/formulas/vertex_longitude.cpp create mode 100644 src/boost/libs/geometry/test/formulas/vertex_longitude_cases.hpp create mode 100644 src/boost/libs/geometry/test/from_wkt.hpp create mode 100644 src/boost/libs/geometry/test/geometries/Jamfile create mode 100644 src/boost/libs/geometry/test/geometries/adapted.cpp create mode 100644 src/boost/libs/geometry/test/geometries/boost_array_as_point.cpp create mode 100644 src/boost/libs/geometry/test/geometries/boost_fusion.cpp create mode 100644 src/boost/libs/geometry/test/geometries/boost_polygon.cpp create mode 100644 src/boost/libs/geometry/test/geometries/boost_polygon_overlay.cpp create mode 100644 src/boost/libs/geometry/test/geometries/boost_range.cpp create mode 100644 src/boost/libs/geometry/test/geometries/boost_tuple.cpp create mode 100644 src/boost/libs/geometry/test/geometries/box.cpp create mode 100644 src/boost/libs/geometry/test/geometries/concepts/check.cpp create mode 100644 src/boost/libs/geometry/test/geometries/custom_linestring.cpp create mode 100755 src/boost/libs/geometry/test/geometries/infinite_line.cpp create mode 100644 src/boost/libs/geometry/test/geometries/initialization.cpp create mode 100644 src/boost/libs/geometry/test/geometries/linestring.cpp create mode 100644 src/boost/libs/geometry/test/geometries/multi_linestring.cpp create mode 100644 src/boost/libs/geometry/test/geometries/multi_point.cpp create mode 100644 src/boost/libs/geometry/test/geometries/multi_polygon.cpp create mode 100644 src/boost/libs/geometry/test/geometries/point.cpp create mode 100644 src/boost/libs/geometry/test/geometries/point_xy.cpp create mode 100644 src/boost/libs/geometry/test/geometries/point_xyz.cpp create mode 100644 src/boost/libs/geometry/test/geometries/polygon.cpp create mode 100644 src/boost/libs/geometry/test/geometries/ring.cpp create mode 100644 src/boost/libs/geometry/test/geometries/segment.cpp create mode 100644 src/boost/libs/geometry/test/geometry_test_common.hpp create mode 100644 src/boost/libs/geometry/test/headers/Jamfile create mode 100644 src/boost/libs/geometry/test/headers/main.cpp create mode 100644 src/boost/libs/geometry/test/io/Jamfile create mode 100644 src/boost/libs/geometry/test/io/dsv/Jamfile create mode 100644 src/boost/libs/geometry/test/io/dsv/dsv_multi.cpp create mode 100644 src/boost/libs/geometry/test/io/svg/Jamfile create mode 100644 src/boost/libs/geometry/test/io/svg/svg.cpp create mode 100644 src/boost/libs/geometry/test/io/wkt/Jamfile create mode 100644 src/boost/libs/geometry/test/io/wkt/wkt.cpp create mode 100644 src/boost/libs/geometry/test/io/wkt/wkt_multi.cpp create mode 100644 src/boost/libs/geometry/test/iterators/Jamfile create mode 100644 src/boost/libs/geometry/test/iterators/closing_iterator.cpp create mode 100644 src/boost/libs/geometry/test/iterators/concatenate_iterator.cpp create mode 100644 src/boost/libs/geometry/test/iterators/ever_circling_iterator.cpp create mode 100644 src/boost/libs/geometry/test/iterators/flatten_iterator.cpp create mode 100644 src/boost/libs/geometry/test/iterators/point_iterator.cpp create mode 100644 src/boost/libs/geometry/test/iterators/segment_iterator.cpp create mode 100644 src/boost/libs/geometry/test/iterators/test_iterator_common.hpp create mode 100644 src/boost/libs/geometry/test/minimal.cpp create mode 100644 src/boost/libs/geometry/test/policies/Jamfile create mode 100644 src/boost/libs/geometry/test/policies/compare.cpp create mode 100644 src/boost/libs/geometry/test/policies/rescale_policy.cpp create mode 100644 src/boost/libs/geometry/test/robustness/common/common_settings.hpp create mode 100644 src/boost/libs/geometry/test/robustness/common/make_square_polygon.hpp create mode 100644 src/boost/libs/geometry/test/robustness/convex_hull/Jamfile create mode 100644 src/boost/libs/geometry/test/robustness/convex_hull/random_multi_points.cpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/areal_areal/Jamfile create mode 100755 src/boost/libs/geometry/test/robustness/overlay/areal_areal/general_intersection_precision.cpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/areal_areal/interior_triangles.cpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/areal_areal/intersection_pies.cpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/areal_areal/intersection_stars.cpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/areal_areal/intersects.cpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/areal_areal/random_ellipses_stars.cpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/areal_areal/recursive_polygons.cpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/areal_areal/star_comb.cpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/areal_areal/star_comb.hpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/areal_areal/test_overlay_p_q.hpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/areal_areal/ticket_9081.cpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/buffer/Jamfile create mode 100644 src/boost/libs/geometry/test/robustness/overlay/buffer/many_ring_buffer.cpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/buffer/multi_point_growth.cpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp create mode 100644 src/boost/libs/geometry/test/robustness/overlay/linear_areal/Jamfile create mode 100644 src/boost/libs/geometry/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp create mode 100644 src/boost/libs/geometry/test/srs/Jamfile create mode 100644 src/boost/libs/geometry/test/srs/check_geometry.hpp create mode 100644 src/boost/libs/geometry/test/srs/proj4.hpp create mode 100644 src/boost/libs/geometry/test/srs/projection.cpp create mode 100644 src/boost/libs/geometry/test/srs/projection_epsg.cpp create mode 100644 src/boost/libs/geometry/test/srs/projection_interface_d.cpp create mode 100644 src/boost/libs/geometry/test/srs/projection_interface_p4.cpp create mode 100644 src/boost/libs/geometry/test/srs/projection_interface_s.cpp create mode 100644 src/boost/libs/geometry/test/srs/projection_selftest.cpp create mode 100644 src/boost/libs/geometry/test/srs/projection_selftest_cases.hpp create mode 100644 src/boost/libs/geometry/test/srs/projections.cpp create mode 100644 src/boost/libs/geometry/test/srs/projections_combined.cpp create mode 100644 src/boost/libs/geometry/test/srs/projections_static.cpp create mode 100644 src/boost/libs/geometry/test/srs/spar.cpp create mode 100644 src/boost/libs/geometry/test/srs/srs_transformer.cpp create mode 100644 src/boost/libs/geometry/test/srs/transformation_epsg.cpp create mode 100644 src/boost/libs/geometry/test/srs/transformation_interface.cpp create mode 100644 src/boost/libs/geometry/test/strategies/Jamfile create mode 100644 src/boost/libs/geometry/test/strategies/andoyer.cpp create mode 100644 src/boost/libs/geometry/test/strategies/cross_track.cpp create mode 100644 src/boost/libs/geometry/test/strategies/crossings_multiply.cpp create mode 100644 src/boost/libs/geometry/test/strategies/distance.cpp create mode 100644 src/boost/libs/geometry/test/strategies/distance_cross_track.cpp create mode 100644 src/boost/libs/geometry/test/strategies/distance_cross_track_cases.hpp create mode 100644 src/boost/libs/geometry/test/strategies/distance_default_result.cpp create mode 100644 src/boost/libs/geometry/test/strategies/douglas_peucker.cpp create mode 100644 src/boost/libs/geometry/test/strategies/envelope_segment.cpp create mode 100644 src/boost/libs/geometry/test/strategies/franklin.cpp create mode 100644 src/boost/libs/geometry/test/strategies/haversine.cpp create mode 100644 src/boost/libs/geometry/test/strategies/matrix_transformer.cpp create mode 100644 src/boost/libs/geometry/test/strategies/point_in_box.cpp create mode 100644 src/boost/libs/geometry/test/strategies/projected_point.cpp create mode 100644 src/boost/libs/geometry/test/strategies/projected_point_ax.cpp create mode 100644 src/boost/libs/geometry/test/strategies/pythagoras.cpp create mode 100644 src/boost/libs/geometry/test/strategies/pythagoras_point_box.cpp create mode 100644 src/boost/libs/geometry/test/strategies/segment_intersection.cpp create mode 100644 src/boost/libs/geometry/test/strategies/segment_intersection_collinear.cpp create mode 100644 src/boost/libs/geometry/test/strategies/segment_intersection_geo.cpp create mode 100644 src/boost/libs/geometry/test/strategies/segment_intersection_geo.hpp create mode 100644 src/boost/libs/geometry/test/strategies/segment_intersection_sph.cpp create mode 100644 src/boost/libs/geometry/test/strategies/segment_intersection_sph.hpp create mode 100644 src/boost/libs/geometry/test/strategies/side_of_intersection.cpp create mode 100644 src/boost/libs/geometry/test/strategies/spherical_side.cpp create mode 100644 src/boost/libs/geometry/test/strategies/test_projected_point.hpp create mode 100644 src/boost/libs/geometry/test/strategies/test_within.hpp create mode 100644 src/boost/libs/geometry/test/strategies/thomas.cpp create mode 100644 src/boost/libs/geometry/test/strategies/transform_cs.cpp create mode 100644 src/boost/libs/geometry/test/strategies/transformer.cpp create mode 100644 src/boost/libs/geometry/test/strategies/vincenty.cpp create mode 100644 src/boost/libs/geometry/test/strategies/winding.cpp create mode 100644 src/boost/libs/geometry/test/string_from_type.hpp create mode 100644 src/boost/libs/geometry/test/test_common/test_point.hpp create mode 100644 src/boost/libs/geometry/test/test_common/with_pointer.hpp create mode 100644 src/boost/libs/geometry/test/test_geometries/all_custom_container.hpp create mode 100644 src/boost/libs/geometry/test/test_geometries/all_custom_linestring.hpp create mode 100644 src/boost/libs/geometry/test/test_geometries/all_custom_polygon.hpp create mode 100644 src/boost/libs/geometry/test/test_geometries/all_custom_ring.hpp create mode 100644 src/boost/libs/geometry/test/test_geometries/copy_on_dereference_geometries.hpp create mode 100644 src/boost/libs/geometry/test/test_geometries/custom_lon_lat_point.hpp create mode 100644 src/boost/libs/geometry/test/test_geometries/custom_segment.hpp create mode 100644 src/boost/libs/geometry/test/test_geometries/wrapped_boost_array.hpp create mode 100644 src/boost/libs/geometry/test/to_svg.hpp create mode 100644 src/boost/libs/geometry/test/util/Jamfile create mode 100644 src/boost/libs/geometry/test/util/calculation_type.cpp create mode 100644 src/boost/libs/geometry/test/util/compress_variant.cpp create mode 100644 src/boost/libs/geometry/test/util/for_each_coordinate.cpp create mode 100644 src/boost/libs/geometry/test/util/is_implemented.cpp create mode 100644 src/boost/libs/geometry/test/util/math_abs.cpp create mode 100644 src/boost/libs/geometry/test/util/math_equals.cpp create mode 100644 src/boost/libs/geometry/test/util/math_sqrt.cpp create mode 100644 src/boost/libs/geometry/test/util/number_types.hpp create mode 100644 src/boost/libs/geometry/test/util/promote_integral.cpp create mode 100644 src/boost/libs/geometry/test/util/range.cpp create mode 100644 src/boost/libs/geometry/test/util/rational.cpp create mode 100644 src/boost/libs/geometry/test/util/select_most_precise.cpp create mode 100644 src/boost/libs/geometry/test/util/transform_variant.cpp create mode 100644 src/boost/libs/geometry/test/util/tuples.cpp create mode 100644 src/boost/libs/geometry/test/util/write_dsv.cpp create mode 100644 src/boost/libs/geometry/test/views/Jamfile create mode 100644 src/boost/libs/geometry/test/views/box_view.cpp create mode 100644 src/boost/libs/geometry/test/views/closeable_view.cpp create mode 100644 src/boost/libs/geometry/test/views/reversible_closeable.cpp create mode 100644 src/boost/libs/geometry/test/views/reversible_view.cpp create mode 100644 src/boost/libs/geometry/test/views/segment_view.cpp (limited to 'src/boost/libs/geometry/test') diff --git a/src/boost/libs/geometry/test/Jamfile b/src/boost/libs/geometry/test/Jamfile new file mode 100644 index 000000000..d179fe7c3 --- /dev/null +++ b/src/boost/libs/geometry/test/Jamfile @@ -0,0 +1,57 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2018 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2017, 2018, 2019. +# Modifications copyright (c) 2017-2019 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) + +import os ; +import testing ; + +project boost-geometry-test + : + requirements + . + ../../../boost/geometry/extensions/contrib/ttmath + msvc:on + msvc:/bigobj + clang:-Wno-unneeded-internal-declaration # supress warning by Boost.None + intel:BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE + windows,intel:/bigobj + BOOST_NO_AUTO_PTR # disable the deprecated std::auto_ptr support in SmartPtr and Core + ; + +# Run minimal testset +test-suite boost-geometry-minimal + : + [ run minimal.cpp : : : : minimal ] + ; + +# If not on Travis run all of the tests +if ! [ os.environ TRAVIS ] +{ + +build-project core ; +build-project concepts ; +build-project geometries ; +build-project arithmetic ; +build-project algorithms ; +build-project formulas ; +build-project iterators ; +build-project strategies ; +build-project policies ; +build-project io ; +build-project srs ; +build-project cs_undefined ; +build-project util ; +build-project views ; + +} + diff --git a/src/boost/libs/geometry/test/algorithms/Jamfile b/src/boost/libs/geometry/test/algorithms/Jamfile new file mode 100644 index 000000000..0ff096c95 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/Jamfile @@ -0,0 +1,85 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# Copyright (c) 2018 Adam Wulkiewicz, Lodz, Poland. +# +# This file was modified by Oracle on 2014, 2015, 2016, 2017. +# Modifications copyright (c) 2014-2017, Oracle and/or its affiliates. +# +# Contributed and/or modified by Vissarion Fisikopoulos, on behalf of Oracle +# 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms + : + [ run append.cpp : : : : algorithms_append ] + [ run assign.cpp : : : : algorithms_assign ] + [ run centroid.cpp : : : : algorithms_centroid ] + [ run centroid_multi.cpp : : : : algorithms_centroid_multi ] + [ run comparable_distance.cpp : : : : algorithms_comparable_distance ] + [ run convert.cpp : : : : algorithms_convert ] + [ run convert_multi.cpp : : : : algorithms_convert_multi ] + [ run convex_hull.cpp : : : : algorithms_convex_hull ] + [ run convex_hull_multi.cpp : : : : algorithms_convex_hull_multi ] + [ run correct.cpp : : : : algorithms_correct ] + [ run correct_multi.cpp : : : : algorithms_correct_multi ] + [ run correct_closure.cpp : : : : algorithms_correct_closure ] + [ run densify.cpp : : : : algorithms_densify ] + [ run for_each.cpp : : : : algorithms_for_each ] + [ run for_each_multi.cpp : : : : algorithms_for_each_multi ] + [ run is_convex.cpp : : : : algorithms_is_convex ] + [ run is_empty.cpp : : : : algorithms_is_empty ] + [ run is_simple.cpp : : : : algorithms_is_simple ] + [ run is_simple_geo.cpp : : : : algorithms_is_simple_geo ] + [ run is_valid.cpp : : : : algorithms_is_valid ] + [ run is_valid_failure.cpp : : : : algorithms_is_valid_failure ] + [ run is_valid_geo.cpp : : : : algorithms_is_valid_geo ] + [ run line_interpolate.cpp : : : : algorithms_line_interpolate ] + [ run make.cpp : : : : algorithms_make ] + [ run maximum_gap.cpp : : : : algorithms_maximum_gap ] + [ run num_geometries.cpp : : : : algorithms_num_geometries ] + [ run num_geometries_multi.cpp : : : : algorithms_num_geometries_multi ] + [ run num_interior_rings.cpp : : : : algorithms_num_interior_rings ] + [ run num_interior_rings_multi.cpp : : : : algorithms_num_interior_rings_multi ] + [ run num_points.cpp : : : : algorithms_num_points ] + [ run num_points_multi.cpp : : : : algorithms_num_points_multi ] + [ run num_segments.cpp : : : : algorithms_segments ] + [ run perimeter.cpp : : : : algorithms_perimeter ] + [ run perimeter_multi.cpp : : : : algorithms_perimeter_multi ] + [ run point_on_surface.cpp : : : : algorithms_point_on_surface ] + [ run remove_spikes.cpp : : : : algorithms_remove_spikes ] + [ run reverse.cpp : : : : algorithms_reverse ] + [ run reverse_multi.cpp : : : : algorithms_reverse_multi ] + [ run simplify.cpp : : : : algorithms_simplify ] + [ run simplify_multi.cpp : : : : algorithms_simplify_multi ] + [ run transform.cpp : : : : algorithms_transform ] + [ run transform_multi.cpp : : : : algorithms_transform_multi ] + [ run unique.cpp : : : : algorithms_unique ] + [ run unique_multi.cpp : : : : algorithms_unique_multi ] + ; + +build-project area ; +build-project buffer ; +build-project covered_by ; +build-project crosses ; +build-project detail ; +build-project disjoint ; +build-project distance ; +build-project envelope_expand ; +build-project equals ; +build-project intersects ; +build-project length ; +build-project overlaps ; +build-project overlay ; +build-project perimeter ; +build-project relate ; +build-project set_operations ; +build-project similarity ; +build-project touches ; +build-project within ; diff --git a/src/boost/libs/geometry/test/algorithms/append.cpp b/src/boost/libs/geometry/test/algorithms/append.cpp new file mode 100644 index 000000000..0eda9669c --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/append.cpp @@ -0,0 +1,175 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, 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. + +// 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) + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + + +template +struct do_checks +{ + template + static inline void apply(G const& geometry, + std::size_t size1, + std::size_t = 0, + std::size_t = 0) + { + BOOST_CHECK_EQUAL(bg::num_points(geometry), size1); + } +}; + + +template<> +struct do_checks +{ + template + static inline void apply(G const& geometry, + std::size_t size1, + std::size_t size2 = 0, + std::size_t size3 = 0) + { + do_checks::apply(geometry, size1); + BOOST_CHECK_EQUAL(bg::num_points(geometry[0]), size2); + BOOST_CHECK_EQUAL(bg::num_points(geometry[1]), size3); + } +}; + + + +template +struct test_geometry +{ + template + static inline void apply(G& geometry, bool check) + { + typedef typename bg::point_type::type P; + typedef do_checks checks; + + bg::append(geometry, bg::make_zero

(), -1, 0); + if (check) + { + checks::apply(geometry, 1u, 1u, 0u); + } + + // Append a range + std::vector

v; + v.push_back(bg::make_zero

()); + v.push_back(bg::make_zero

()); + bg::append(geometry, v, -1, 1); + + if (check) + { + checks::apply(geometry, 3u, 1u, 2u); + } + + bg::clear(geometry); + + if (check) + { + do_checks::apply(geometry, 0u); + } + } +}; + + + +template +void test_geometry_and_variant(bool check = true) +{ + G geometry; + boost::variant variant_geometry = G(); + test_geometry::apply(geometry, check); + test_geometry::apply(variant_geometry, check); +} + + +template +void test_multigeometry_and_variant(bool check = true) +{ + typedef typename boost::range_value::type G; + + G geometry; + MG multigeometry; + bg::traits::push_back::apply(multigeometry, geometry); + bg::traits::push_back::apply(multigeometry, geometry); + + boost::variant variant_multigeometry = multigeometry; + test_geometry::apply(multigeometry, check); + test_geometry::apply(variant_multigeometry, check); +} + + +template +void test_all() +{ + test_geometry_and_variant

(false); + test_geometry_and_variant >(false); + test_geometry_and_variant >(false); + test_geometry_and_variant >(); + test_geometry_and_variant >(); + test_geometry_and_variant >(); + test_geometry_and_variant >(); + test_multigeometry_and_variant + < + bg::model::multi_linestring > + >(); + test_multigeometry_and_variant + < + bg::model::multi_polygon > + >(); + + test_geometry_and_variant >(); + test_geometry_and_variant >(); +} + +int test_main(int, char* []) +{ + test_all(); + test_all >(); + test_all >(); + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/area/Jamfile b/src/boost/libs/geometry/test/algorithms/area/Jamfile new file mode 100644 index 000000000..f3c868da7 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/area/Jamfile @@ -0,0 +1,18 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2016 Oracle and/or its affiliates. +# +# Contributed and/or modified by Vissarion Fisikopoulos, 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) + +test-suite boost-geometry-algorithms-area + : + [ run area.cpp : : : : algorithms_area ] + [ run area_sph_geo.cpp : : : : algorithms_area_sph_geo ] + [ run area_geo.cpp : : : : algorithms_area_geo ] + [ run area_multi.cpp : : : : algorithms_area_multi ] + ; + diff --git a/src/boost/libs/geometry/test/algorithms/area/area.cpp b/src/boost/libs/geometry/test/algorithms/area/area.cpp new file mode 100644 index 000000000..ce4115049 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/area/area.cpp @@ -0,0 +1,242 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2015, 2016, 2017. +// Modifications copyright (c) 2015-2017, 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 + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include + +#include +#include +#include +#include +#include + +#include +#include +//#define BOOST_GEOMETRY_TEST_DEBUG + +#include + +template +void test_polygon() +{ + // Rotated square, length=sqrt(2) -> area=2 + test_geometry("POLYGON((1 1,2 2,3 1,2 0,1 1))", 2.0); + test_geometry("POLYGON((1 1,2 2,3 1,2 0,1 1))", 2.0); + test_geometry("POLYGON((0 0,0 7,4 2,2 0,0 0))", 16.0); + test_geometry("POLYGON((1 1,2 1,2 2,1 2,1 1))", -1.0); + test_geometry("POLYGON((0 0,0 7,4 2,2 0,0 0), (1 1,2 1,2 2,1 2,1 1))", 15.0); +} + + +template +void test_all() +{ + test_geometry >("POLYGON((0 0,2 2))", 4.0); + test_geometry >("POLYGON((2 2,0 0))", 4.0); + + test_polygon >(); + test_polygon >(); + + // clockwise rings (second is wrongly ordered) + test_geometry >("POLYGON((0 0,0 7,4 2,2 0,0 0))", 16.0); + test_geometry >("POLYGON((0 0,2 0,4 2,0 7,0 0))", -16.0); + + test_geometry >("POLYGON((0 0,0 7,4 2,2 0,0 0))", 16.0); + + // ccw + test_geometry > + ("POLYGON((0 0,0 7,4 2,2 0,0 0), (1 1,2 1,2 2,1 2,1 1))", -15.0); + + test_geometry > + ("POLYGON((1 0,0 1,-1 0,0 -1,1 0))", 2); + + typedef typename bg::coordinate_type

::type coord_type; + if (BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + { + test_geometry > + ("POLYGON((100000001 100000000, 100000000 100000001, \ + 99999999 100000000, 100000000 99999999))", 2); + } + else if (BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + { + test_geometry > + ("POLYGON((100001 100000, 100000 100001, \ + 99999 100000, 100000 99999))", 2); + } +} + +template +void test_ccw() +{ + typedef typename bg::coordinate_type

::type ct; + bg::model::polygon ccw_polygon; + // counterclockwise rings (second is wrongly ordered) + std::string poly1 = "POLYGON((1 1,2 2,3 1,2 0,1 1))"; + std::string poly2 = "POLYGON((1 1,2 0,3 1,2 2,1 1))"; + std::string poly3 = "POLYGON((0 0,0 7,4 2,2 0,0 0))"; + std::string poly4 = "POLYGON((0 0,2 0,4 2,0 7,0 0))"; + + bg::read_wkt(poly1, ccw_polygon); + ct area1 = bg::area(ccw_polygon); + bg::read_wkt(poly2, ccw_polygon); + ct area2 = bg::area(ccw_polygon); + bg::read_wkt(poly3, ccw_polygon); + ct area3 = bg::area(ccw_polygon); + bg::read_wkt(poly4, ccw_polygon); + ct area4 = bg::area(ccw_polygon); + BOOST_CHECK_CLOSE(area1, -1 * area2, 0.001); + BOOST_CHECK_CLOSE(area3, -1 * area4, 0.001); +} + +template +void test_open(CT expected_area) +{ + typedef bg::model::polygon open_polygon; + test_geometry("POLYGON((1 1,2 2,3 1,2 0))", expected_area); + // Note the triangular testcase used in CCW is not sensible for open/close +} + +template +void test_open_ccw(CT expected_area) +{ + typedef bg::model::polygon open_polygon; + test_geometry("POLYGON((1 1,2 0,3 1,2 2))", expected_area); + // Note the triangular testcase used in CCW is not sensible for open/close +} + +template +void test_poles_ccw() +{ + typedef typename bg::coordinate_type

::type ct; + bg::model::polygon polygon; + + std::string poly1 = "POLYGON((45 45,45 95,95 45,45 45))"; + std::string poly2 = "POLYGON((45 45,95 45,45 95,45 45))"; + std::string poly3 = "POLYGON((45 -45,45 -95,95 -45,45 -45))"; + std::string poly4 = "POLYGON((45 -45,95 -45,45 -95,45 -45))"; + + bg::read_wkt(poly1, polygon); + ct area1 = bg::area(polygon); + bg::read_wkt(poly2, polygon); + ct area2 = bg::area(polygon); + bg::read_wkt(poly3, polygon); + ct area3 = bg::area(polygon); + bg::read_wkt(poly4, polygon); + ct area4 = bg::area(polygon); + BOOST_CHECK_CLOSE(area1, -1 * area2, 0.001); + BOOST_CHECK_CLOSE(area3, -1 * area4, 0.001); +} + +template +void test_empty_input() +{ + bg::model::polygon

poly_empty; + bg::model::ring

ring_empty; + + test_empty_input(poly_empty); + test_empty_input(ring_empty); +} + +void test_large_integers() +{ + typedef bg::model::point int_point_type; + typedef bg::model::point double_point_type; + + bg::model::polygon int_poly; + bg::model::polygon double_poly; + + std::string const polygon_li = "POLYGON((1872000 528000,1872000 192000,\ + 1536119 192000,1536000 528000,1200000 528000,\ + 1200000 863880,1536000 863880,1872000 863880,\ + 1872000 528000))"; + bg::read_wkt(polygon_li, int_poly); + bg::read_wkt(polygon_li, double_poly); + + double int_area = bg::area(int_poly); + double double_area = bg::area(double_poly); + + BOOST_CHECK_CLOSE(int_area, double_area, 0.0001); +} + +void test_variant() +{ + typedef bg::model::point double_point_type; + typedef bg::model::polygon polygon_type; + typedef bg::model::box box_type; + + polygon_type poly; + std::string const polygon_li = "POLYGON((18 5,18 1,15 1,15 5,12 5,12 8,15 8,18 8,18 5))"; + bg::read_wkt(polygon_li, poly); + + box_type box; + std::string const box_li = "BOX(0 0,2 2)"; + bg::read_wkt(box_li, box); + + boost::variant v; + + v = poly; + BOOST_CHECK_CLOSE(bg::area(v), bg::area(poly), 0.0001); + v = box; + BOOST_CHECK_CLOSE(bg::area(v), bg::area(box), 0.0001); +} + +int test_main(int, char* []) +{ + + test_all >(); + test_all >(); + test_all >(); + + typedef bg::model::point pt_crt; + typedef bg::model::point > pt_sph; + typedef bg::model::point > pt_geo; + + // mean Earth's radius^2 + double r2 = bg::math::sqr(bg::get_radius<0>(bg::srs::sphere())); + + test_ccw(); + test_ccw(); + test_ccw(); + + test_open(2.0); + test_open(24726179921.523518 / r2); + test_open(24615492936.977146); + + test_open_ccw(2.0); + test_open_ccw(24726179921.523518 / r2); + test_open_ccw(24615492936.977146); + + test_poles_ccw(); + test_poles_ccw(); + test_poles_ccw(); + +#ifdef HAVE_TTMATH + test_all >(); + test_spherical_geo(); +#endif + + test_large_integers(); + + test_variant(); + + // test_empty_input >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/area/area_geo.cpp b/src/boost/libs/geometry/test/algorithms/area/area_geo.cpp new file mode 100644 index 000000000..5a380653d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/area/area_geo.cpp @@ -0,0 +1,203 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2015, 2016, 2017. +// Modifications copyright (c) 2015-2017, 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 + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +namespace bg = boost::geometry; + +//Testing geographic strategies +template +void test_geo_strategies() +{ + std::string poly = "POLYGON((52 0, 41 -74, -23 -43, -26 28, 52 0))"; + + typedef bg::model::point > pt_geo; + + bg::strategy::area::geographic<> geographic_default; + + bg::strategy::area::geographic + geographic_andoyer1; + bg::strategy::area::geographic + geographic_andoyer2; + bg::strategy::area::geographic + geographic_andoyer3; + bg::strategy::area::geographic + geographic_andoyer4; + bg::strategy::area::geographic + geographic_andoyer5; + + bg::strategy::area::geographic + geographic_thomas1; + bg::strategy::area::geographic + geographic_thomas2; + bg::strategy::area::geographic + geographic_thomas3; + bg::strategy::area::geographic + geographic_thomas4; + bg::strategy::area::geographic + geographic_thomas5; + + bg::strategy::area::geographic + geographic_vincenty1; + bg::strategy::area::geographic + geographic_vincenty2; + bg::strategy::area::geographic + geographic_vincenty3; + bg::strategy::area::geographic + geographic_vincenty4; + bg::strategy::area::geographic + geographic_vincenty5; + + bg::strategy::area::geographic + geographic_andoyer_default; + bg::strategy::area::geographic + geographic_thomas_default; + bg::strategy::area::geographic + geographic_vincenty_default; + + bg::model::polygon geometry_geo; + + //GeographicLib 63316536351834.289 + //PostGIS (v2.2.2) 6.33946+13 + //MS SQL SERVER 632930207487035 + + bg::read_wkt(poly, geometry_geo); + CT area; + CT err = 0.0000001; + + CT area_default = bg::area(geometry_geo); + BOOST_CHECK_CLOSE(area_default, 63316309346280.18, err); + area = bg::area(geometry_geo, geographic_default); + BOOST_CHECK_CLOSE(area, 63316309346280.18, err); + + CT area_less_accurate = bg::area(geometry_geo, geographic_andoyer1); + BOOST_CHECK_CLOSE(area, 63316309346280.18, err); + area = bg::area(geometry_geo, geographic_andoyer2); + BOOST_CHECK_CLOSE(area, 63316309224306.5, err); + area = bg::area(geometry_geo, geographic_andoyer3); + BOOST_CHECK_CLOSE(area, 63316309224411.195, err); + area = bg::area(geometry_geo, geographic_andoyer4); + BOOST_CHECK_CLOSE(area, 63316309224411.094, err); + area = bg::area(geometry_geo, geographic_andoyer5); + BOOST_CHECK_CLOSE(area, 63316309224411.094, err); + + area = bg::area(geometry_geo, geographic_thomas1); + BOOST_CHECK_CLOSE(area, 63316536214315.32, err); + area = bg::area(geometry_geo, geographic_thomas2); + BOOST_CHECK_CLOSE(area, 63316536092341.266, err); + area = bg::area(geometry_geo, geographic_thomas3); + BOOST_CHECK_CLOSE(area, 63316536092445.961, err); + area = bg::area(geometry_geo, geographic_thomas4); + BOOST_CHECK_CLOSE(area, 63316536092445.859, err); + area = bg::area(geometry_geo, geographic_thomas5); + BOOST_CHECK_CLOSE(area, 63316536092445.859, err); + + area = bg::area(geometry_geo, geographic_vincenty1); + BOOST_CHECK_CLOSE(area, 63316536473798.984, err); + area = bg::area(geometry_geo, geographic_vincenty2); + BOOST_CHECK_CLOSE(area, 63316536351824.93, err); + area = bg::area(geometry_geo, geographic_vincenty3); + BOOST_CHECK_CLOSE(area, 63316536351929.625, err); + area = bg::area(geometry_geo, geographic_vincenty4); + BOOST_CHECK_CLOSE(area, 63316536351929.523, err); + CT area_most_accurate = bg::area(geometry_geo, geographic_vincenty5); + BOOST_CHECK_CLOSE(area, 63316536351929.523, err); + + area = bg::area(geometry_geo, geographic_andoyer_default); + BOOST_CHECK_CLOSE(area, 63316309346280.18, err); + area = bg::area(geometry_geo, geographic_thomas_default); + BOOST_CHECK_CLOSE(area, 63316536092341.266, err); + area = bg::area(geometry_geo, geographic_vincenty_default); + BOOST_CHECK_CLOSE(area, 63316536351929.523, err); + + BOOST_CHECK_CLOSE(area_most_accurate, area_less_accurate, .001); + BOOST_CHECK_CLOSE(area_most_accurate, area_default, .001); +/* + // timings and accuracy + std::cout.precision(25); + std::size_t exp_times = 100000; + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_andoyer1); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_andoyer2); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_andoyer3); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_andoyer4); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_andoyer5); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_thomas1); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_thomas2); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_thomas3); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_thomas4); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_thomas5); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_vincenty1); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_vincenty2); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_vincenty3); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_vincenty4); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} + { clock_t startTime = clock(); + for (int j=0; j < exp_times; j++) area = bg::area(geometry_geo, geographic_vincenty5); + std::cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " "; + std::cout << area << std::endl;} +*/ +} + +int test_main(int, char* []) +{ + + test_geo_strategies(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/area/area_multi.cpp b/src/boost/libs/geometry/test/algorithms/area/area_multi.cpp new file mode 100644 index 000000000..37ac0cecf --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/area/area_multi.cpp @@ -0,0 +1,55 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// +// This file was modified by Oracle on 2015, 2016. +// Modifications copyright (c) 2015-2016, Oracle and/or its affiliates. +// +// Contributed and/or modified by Vissarion Fysikopoulos, 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) + + +#include + +#include +#include +#include + +#include + + + + +template +void test_all() +{ + typedef typename bg::model::d2::point_xy pt_crt; + typedef typename bg::model::point > pt_sph; + typedef typename bg::model::point > pt_geo; + + typedef bg::model::multi_polygon > mp_crt; + typedef bg::model::multi_polygon > mp_sph; + typedef bg::model::multi_polygon > mp_geo; + + // mean Earth's radius^2 + double r2 = bg::math::sqr(bg::get_radius<0>(bg::srs::sphere())); + + std::string poly = "MULTIPOLYGON(((0 0,0 7,4 2,2 0,0 0)))"; + test_geometry(poly, 16.0); + test_geometry(poly, 197897454752.69489 / r2); + test_geometry(poly, 197018888665.8331); +} + +int test_main( int , char* [] ) +{ + test_all(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/area/area_sph_geo.cpp b/src/boost/libs/geometry/test/algorithms/area/area_sph_geo.cpp new file mode 100644 index 000000000..dc7d9f628 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/area/area_sph_geo.cpp @@ -0,0 +1,413 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2015, 2016, 2017. +// Modifications copyright (c) 2015-2017, 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 + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +namespace bg = boost::geometry; + +//Testing spherical and geographic strategies +template +void test_spherical_geo() +{ + typedef CT ct; + + //Geographic + + typedef typename bg::model::point + < + ct, 2, bg::cs::geographic + > pt_geo; + + bg::strategy::area::geographic + < + bg::strategy::vincenty, + 5 + > area_geographic; + + bg::model::polygon geometry_geo; + + //Spherical + + typedef typename bg::model::point + < + ct, 2, bg::cs::spherical_equatorial + > pt; + bg::model::polygon geometry; + + // unit-sphere has area of 4-PI. Polygon covering 1/8 of it: + // calculations splitted for ttmath + std::string poly = "POLYGON((0 0,0 90,90 0,0 0))"; + + bg::strategy::area::spherical + < + ct + > strategy_unary(1.0); + + ct const four = 4.0; + ct const eight = 8.0; + ct expected = four * boost::geometry::math::pi() / eight; + bg::read_wkt(poly, geometry); + ct area = bg::area(geometry, strategy_unary); + BOOST_CHECK_CLOSE(area, expected, 0.0001); + + // With strategy, radius 2 -> 4 pi r^2 + bg::strategy::area::spherical + < + ct + > strategy(2.0); + + area = bg::area(geometry, strategy); + ct const two = 2.0; + BOOST_CHECK_CLOSE(area, two * two * expected, 0.0001); + + // Geographic total area of earth is about 510065626583900.6 (WGS84 ellipsoid) + // (510072000 in https://en.wikipedia.org/wiki/Earth) + // So the 1/8 is 6.375820332*10^13 and here we get something close to it + bg::read_wkt(poly, geometry_geo); + area = bg::area(geometry_geo, area_geographic); + //GeoGraphicLib gives: 63758202715511.055 + BOOST_CHECK_CLOSE(area, 63758202715509.844, 0.0001); + + + // Wrangel Island (dateline crossing) + // With (spherical) Earth strategy + poly = "POLYGON((-178.7858 70.7852, 177.4758 71.2333, 179.7436 71.5733, -178.7858 70.7852))"; + + bg::strategy::area::spherical + < + ct + > spherical_earth(6373); + bg::read_wkt(poly, geometry); + area = bg::area(geometry, spherical_earth); + // SQL Server gives: 4537.9654419375 + // PostGIS gives: 4537.9311668307 + // Note: those are Geographic, this test is Spherical + BOOST_CHECK_CLOSE(area, 4506.6389, 0.001); + + bg::read_wkt(poly, geometry_geo); + area = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area, 4537929936.5349159, 0.0001); + + // Wrangel, more in detail + poly = "POLYGON((-178.568604 71.564148,-178.017548 71.449692,-177.833313 71.3461,\ + -177.502838 71.277466 ,-177.439453 71.226929,-177.620026 71.116638,\ + -177.9389 71.037491,-178.8186 70.979965,-179.274445 70.907761,\ + -180 70.9972,179.678314 70.895538,179.272766 70.888596,\ + 178.791016 70.7964,178.617737 71.035538,178.872192 71.217484,\ + 179.530273 71.4383 ,-180 71.535843 ,-179.628601 71.577194,\ + -179.305298 71.551361,-179.03421 71.597748,-178.568604 71.564148))"; + bg::read_wkt(poly, geometry); + area = bg::area(geometry, spherical_earth); + // SQL Server gives: 7669.10402181435 + // PostGIS gives: 7669.55565459832 + BOOST_CHECK_CLOSE(area, 7616.523769, 0.001); + + bg::read_wkt(poly, geometry_geo); + area = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area, 7669498457.4130802, 0.0001); + + // Check more at the equator + /* + select 1,geography::STGeomFromText('POLYGON((-178.7858 10.7852 , 179.7436 11.5733 , \ + 177.4758 11.2333 , -178.7858 10.7852))',4326) .STArea()/1000000.0 + union select 2,geography::STGeomFromText('POLYGON((-178.7858 20.7852 , 179.7436 21.5733 ,\ + 177.4758 21.2333 , -178.7858 20.7852))',4326) .STArea()/1000000.0 + union select 3,geography::STGeomFromText('POLYGON((-178.7858 30.7852 , 179.7436 31.5733 , \ + 177.4758 31.2333 , -178.7858 30.7852))',4326) .STArea()/1000000.0 + union select 0,geography::STGeomFromText('POLYGON((-178.7858 0.7852 , 179.7436 1.5733 , \ + 177.4758 1.2333 , -178.7858 0.7852))',4326) .STArea()/1000000.0 + union select 4,geography::STGeomFromText('POLYGON((-178.7858 40.7852 , 179.7436 41.5733 , \ + 177.4758 41.2333 , -178.7858 40.7852))',4326) .STArea()/1000000.0 + */ + + poly = "POLYGON((-178.7858 0.7852, 177.4758 1.2333, 179.7436 1.5733, -178.7858 0.7852))"; + bg::read_wkt(poly, geometry); + area = bg::area(geometry, spherical_earth); + BOOST_CHECK_CLOSE(area, 14136.09946, 0.001); // SQL Server gives: 14064.1902284513 + bg::read_wkt(poly, geometry_geo); + area = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area, 14064129044.674297, 0.0001); + + poly = "POLYGON((-178.7858 10.7852, 177.4758 11.2333, 179.7436 11.5733, -178.7858 10.7852))"; + bg::read_wkt(poly, geometry); + area = bg::area(geometry, spherical_earth); + BOOST_CHECK_CLOSE(area, 13760.2456, 0.001); // SQL Server gives: 13697.0941155193 + bg::read_wkt(poly, geometry_geo); + area = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area, 13696308940.315653, 0.0001); + + poly = "POLYGON((-178.7858 20.7852, 177.4758 21.2333, 179.7436 21.5733, -178.7858 20.7852))"; + bg::read_wkt(poly, geometry); + area = bg::area(geometry, spherical_earth); + BOOST_CHECK_CLOSE(area, 12987.8682, 0.001); // SQL Server gives: 12944.3970990317 -> -39m^2 + bg::read_wkt(poly, geometry_geo); + area = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area, 12943176284.560806, 0.0001); + + poly = "POLYGON((-178.7858 30.7852, 177.4758 31.2333, 179.7436 31.5733, -178.7858 30.7852))"; + bg::read_wkt(poly, geometry); + area = bg::area(geometry, spherical_earth); + BOOST_CHECK_CLOSE(area, 11856.3935, 0.001); // SQL Server gives: 11838.5338423574 -> -18m^2 + bg::read_wkt(poly, geometry_geo); + area = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area, 11837280445.349375, 0.0001); + + poly = "POLYGON((-178.7858 40.7852, 177.4758 41.2333, 179.7436 41.5733, -178.7858 40.7852))"; + bg::read_wkt(poly, geometry); + area = bg::area(geometry, spherical_earth); + BOOST_CHECK_CLOSE(area, 10404.627685523914, 0.001); + // SQL Server gives: 10412.0607137119, -> +8m^2 + bg::read_wkt(poly, geometry_geo); + area = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area, 10411098789.39222, 0.0001); + + // Concave + poly = "POLYGON((0 40,1 42,0 44,2 43,4 44,3 42,4 40,2 41,0 40))"; + bg::read_wkt(poly, geometry); + area = bg::area(geometry, spherical_earth); + BOOST_CHECK_CLOSE(area, 73538.2958, 0.001); // SQL Server gives: 73604.2047689719 + bg::read_wkt(poly, geometry_geo); + area = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area, 73604208172.719223, 0.0001); + + // With hole POLYGON((0 40,4 40,4 44,0 44,0 40),(1 41,2 43,3 42,1 41)) + poly = "POLYGON((0 40,0 44,4 44,4 40,0 40),(1 41,3 42,2 43,1 41))"; + bg::read_wkt(poly, geometry); + area = bg::area(geometry, spherical_earth); + BOOST_CHECK_CLOSE(area, 133233.844876, 0.001); // SQL Server gives: 133353.335 + bg::read_wkt(poly, geometry_geo); + area = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area, 133353077343.10347, 0.0001); + + // mean Earth's radius^2 + double r2 = bg::math::sqr(bg::get_radius<0>(bg::srs::sphere())); + + // around 0 meridian + { + std::string poly1 = "POLYGON((-10 0,-10 10,0 10,0 0,-10 0))"; + std::string poly2 = "POLYGON((0 0,0 10,10 10,10 0,0 0))"; + std::string poly3 = "POLYGON((-5 0,-5 10,5 10,5 0,-5 0))"; + bg::read_wkt(poly1, geometry); + ct area1 = bg::area(geometry); + bg::read_wkt(poly2, geometry); + ct area2 = bg::area(geometry); + bg::read_wkt(poly3, geometry); + ct area3 = bg::area(geometry); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area2, area3, 0.001); + BOOST_CHECK_CLOSE(area1 * r2, 1233204227903.1848, 0.001); + //geographic + bg::read_wkt(poly1, geometry_geo); + area1 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly2, geometry_geo); + area2 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly3, geometry_geo); + area3 = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area2, area3, 0.001); + BOOST_CHECK_CLOSE(area1, 1227877191611.2805, 0.001); + } + { + std::string poly1 = "POLYGON((-10 -5,-10 5,0 5,0 -5,-10 -5))"; + std::string poly2 = "POLYGON((0 -5,0 5,10 5,10 -5,0 -5))"; + std::string poly3 = "POLYGON((-5 -5,-5 5,5 5,5 -5,-5 -5))"; + bg::read_wkt(poly1, geometry); + ct area1 = bg::area(geometry); + bg::read_wkt(poly2, geometry); + ct area2 = bg::area(geometry); + bg::read_wkt(poly3, geometry); + ct area3 = bg::area(geometry); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area2, area3, 0.001); + BOOST_CHECK_CLOSE(area1 * r2, 1237986107636.0261, 0.001); + //geographic + bg::read_wkt(poly1, geometry_geo); + area1 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly2, geometry_geo); + area2 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly3, geometry_geo); + area3 = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area2, area3, 0.001); + BOOST_CHECK_CLOSE(area1, 1232514639151.6477, 0.001); + } + // around 180 meridian + { + std::string poly1 = "POLYGON((-180 0,-180 10,-170 10,-170 0,-180 0))"; + std::string poly2 = "POLYGON((175 0,175 10,-175 10,-175 0,175 0))"; + std::string poly3 = "POLYGON((170 0,170 10,180 10,180 0,170 0))"; + std::string poly4 = "POLYGON((170 0,170 10,-180 10,-180 0,170 0))"; + std::string poly5 = "POLYGON((180 0,180 10,-170 10,-170 0,180 0))"; + bg::read_wkt(poly1, geometry); + ct area1 = bg::area(geometry); + bg::read_wkt(poly2, geometry); + ct area2 = bg::area(geometry); + bg::read_wkt(poly3, geometry); + ct area3 = bg::area(geometry); + bg::read_wkt(poly4, geometry); + ct area4 = bg::area(geometry); + bg::read_wkt(poly5, geometry); + ct area5 = bg::area(geometry); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area2, area3, 0.001); + BOOST_CHECK_CLOSE(area3, area4, 0.001); + BOOST_CHECK_CLOSE(area4, area5, 0.001); + BOOST_CHECK_CLOSE(area1 * r2, 1233204227903.1833, 0.001); + //geographic + bg::read_wkt(poly1, geometry_geo); + area1 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly2, geometry_geo); + area2 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly3, geometry_geo); + area3 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly4, geometry_geo); + area4 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly5, geometry_geo); + area5 = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area2, area3, 0.001); + BOOST_CHECK_CLOSE(area3, area4, 0.001); + BOOST_CHECK_CLOSE(area4, area5, 0.001); + BOOST_CHECK_CLOSE(area1, 1227877191611.2805, 0.001); + } + { + std::string poly1 = "POLYGON((-180 -5,-180 5,-170 5,-170 -5,-180 -5))"; + std::string poly2 = "POLYGON((175 -5,175 5,-175 5,-175 -5,175 -5))"; + std::string poly3 = "POLYGON((170 -5,170 5,180 5,180 -5,170 -5))"; + std::string poly4 = "POLYGON((170 -5,170 5,180 5,180 -5,170 -5))"; + std::string poly5 = "POLYGON((180 -5,180 5,-170 5,-170 -5,180 -5))"; + bg::read_wkt(poly1, geometry); + ct area1 = bg::area(geometry); + bg::read_wkt(poly2, geometry); + ct area2 = bg::area(geometry); + bg::read_wkt(poly3, geometry); + ct area3 = bg::area(geometry); + bg::read_wkt(poly4, geometry); + ct area4 = bg::area(geometry); + bg::read_wkt(poly5, geometry); + ct area5 = bg::area(geometry); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area2, area3, 0.001); + BOOST_CHECK_CLOSE(area3, area4, 0.001); + BOOST_CHECK_CLOSE(area4, area5, 0.001); + BOOST_CHECK_CLOSE(area1 * r2, 1237986107636.0247, 0.001); + //geographic + bg::read_wkt(poly1, geometry_geo); + area1 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly2, geometry_geo); + area2 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly3, geometry_geo); + area3 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly4, geometry_geo); + area4 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly5, geometry_geo); + area5 = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area2, area3, 0.001); + BOOST_CHECK_CLOSE(area3, area4, 0.001); + BOOST_CHECK_CLOSE(area4, area5, 0.001); + BOOST_CHECK_CLOSE(area1, 1232514639151.6477, 0.001); + } + // around poles + { + std::string poly1 = "POLYGON((0 80,-90 80,-180 80,90 80,0 80))"; + std::string poly2 = "POLYGON((0 80,-90 80,180 80,90 80,0 80))"; + std::string poly3 = "POLYGON((0 -80,90 -80,-180 -80,-90 -80,0 -80))"; + std::string poly4 = "POLYGON((0 -80,90 -80,180 -80,-90 -80,0 -80))"; + bg::read_wkt(poly1, geometry); + ct area1 = bg::area(geometry); + bg::read_wkt(poly2, geometry); + ct area2 = bg::area(geometry); + bg::read_wkt(poly3, geometry); + ct area3 = bg::area(geometry); + bg::read_wkt(poly4, geometry); + ct area4 = bg::area(geometry); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area2, area3, 0.001); + BOOST_CHECK_CLOSE(area3, area4, 0.001); + //geographic + bg::read_wkt(poly1, geometry_geo); + area1 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly2, geometry_geo); + area2 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly3, geometry_geo); + area3 = bg::area(geometry_geo, area_geographic); + bg::read_wkt(poly4, geometry_geo); + area4 = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area2, area3, 0.001); + BOOST_CHECK_CLOSE(area3, area4, 0.001); + } + + { + bg::model::ring aurha; // a'dam-utr-rott.-den haag-a'dam + std::string poly = "POLYGON((4.892 52.373,5.119 52.093,4.479 51.930,\ + 4.23 52.08,4.892 52.373))"; + bg::read_wkt(poly, aurha); + /*if (polar) + { + // Create colatitudes (measured from pole) + BOOST_FOREACH(pt& p, aurha) + { + bg::set<1>(p, ct(90) - bg::get<1>(p)); + } + bg::correct(aurha); + }*/ + bg::strategy::area::spherical + < + ct + > area_spherical(6372.795); + area = bg::area(aurha, area_spherical); + BOOST_CHECK_CLOSE(area, 1476.645675, 0.0001); + //geographic + bg::read_wkt(poly, geometry_geo); + area = bg::area(geometry_geo, area_geographic); + BOOST_CHECK_CLOSE(area, 1481555970.0765088, 0.001); + + // SQL Server gives: 1481.55595960659 + // for select geography::STGeomFromText('POLYGON((4.892 52.373,4.23 52.08, + // 4.479 51.930,5.119 52.093,4.892 52.373))',4326).STArea()/1000000.0 + } + + { + bg::model::polygon geometry_sph; + std::string wkt = "POLYGON((0 0, 5 0, 5 5, 0 5, 0 0))"; + bg::read_wkt(wkt, geometry_sph); + + area = bg::area(geometry_sph, bg::strategy::area::spherical<>(6371228.0)); + BOOST_CHECK_CLOSE(area, 308932296103.83051, 0.0001); + + bg::model::polygon geometry_geo; + bg::read_wkt(wkt, geometry_geo); + + area = bg::area(geometry_geo, bg::strategy::area::geographic<>(bg::srs::spheroid(6371228.0, 6371228.0))); + BOOST_CHECK_CLOSE(area, 308932296103.82574, 0.001); + } +} + +int test_main(int, char* []) +{ + + test_spherical_geo(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/area/test_area.hpp b/src/boost/libs/geometry/test/algorithms/area/test_area.hpp new file mode 100644 index 000000000..bf8b41c88 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/area/test_area.hpp @@ -0,0 +1,81 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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 +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_GEOMETRY_TEST_AREA_HPP +#define BOOST_GEOMETRY_TEST_AREA_HPP + + +#include + +#include +#include +#include + +#include + + +template +void test_area(Geometry const& geometry, + typename bg::default_area_result::type expected_area) +{ + typename bg::default_area_result::type area = bg::area(geometry); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::ostringstream out; + out << typeid(typename bg::coordinate_type::type).name() + << " " + << typeid(typename bg::default_area_result::type).name() + << " " + << "area : " << bg::area(geometry) + << std::endl; + std::cout << out.str(); +#endif + + BOOST_CHECK_CLOSE(area, expected_area, 0.0001); + + // Test with explicitly defined strategies + bg::strategy::area::cartesian<> strategy1; + + area = bg::area(geometry, strategy1); + + bg::strategy::area::cartesian + < + typename bg::coordinate_type::type + > strategy2; + + area = bg::area(geometry, strategy2); + +} + +template +void test_geometry(std::string const& wkt, + typename bg::default_area_result::type expected_area) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + test_area(geometry, expected_area); +} + +template +void test_empty_input(Geometry const& geometry) +{ + try + { + bg::area(geometry); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "A empty_input_exception should have been thrown" ); +} + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/assign.cpp b/src/boost/libs/geometry/test/algorithms/assign.cpp new file mode 100644 index 000000000..aca34a687 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/assign.cpp @@ -0,0 +1,326 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2014 Samuel Debionne, Grenoble, France. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +template +void check_geometry(Geometry const& geometry, std::string const& expected) +{ + std::ostringstream out; + out << bg::wkt(geometry); + BOOST_CHECK_EQUAL(out.str(), expected); +} + +template +void check_assign_points(Points const& points, std::string const& /*expected*/) +{ + Geometry geometry; + bg::assign_points(geometry, points); + check_geometry(geometry, "LINESTRING(1 2,3 4,5 6)"); + + boost::variant v; + bg::assign_points(v, points); +} + +template +void test_assign_linestring_2d() +{ + bg::model::linestring line; + + // Test assignment of plain array (note that this is only possible if adapted c-array is included!) + const double coors[3][2] = { {1, 2}, {3, 4}, {5, 6} }; + check_assign_points >(coors, "LINESTRING(1 2,3 4,5 6)"); + + // Test assignment of point array + Point points[3]; + bg::assign_values(points[0], 1, 2); + bg::assign_values(points[1], 3, 4); + bg::assign_values(points[2], 5, 6); + check_assign_points >(points, "LINESTRING(1 2,3 4,5 6)"); + + // Test assignment of array with different point-type (tuple adaption should be included) + boost::tuple tuples[3]; + tuples[0] = boost::make_tuple(1, 2); + tuples[1] = boost::make_tuple(3, 4); + tuples[2] = boost::make_tuple(5, 6); + check_assign_points >(tuples, "LINESTRING(1 2,3 4,5 6)"); +} + +namespace detail +{ + template + void test_assign_box_or_segment_2d() + { + BoxOrSegment geometry; + bg::assign_values(geometry, 1, 2, 3, 4); + BOOST_CHECK((bg::get(geometry) == 1)); + BOOST_CHECK((bg::get(geometry) == 2)); + BOOST_CHECK((bg::get(geometry) == 3)); + BOOST_CHECK((bg::get(geometry) == 4)); + + bg::assign_zero(geometry); + BOOST_CHECK((bg::get(geometry) == 0)); + BOOST_CHECK((bg::get(geometry) == 0)); + BOOST_CHECK((bg::get(geometry) == 0)); + BOOST_CHECK((bg::get(geometry) == 0)); + + bg::assign_inverse(geometry); + BOOST_CHECK((bg::get(geometry) > 9999)); + BOOST_CHECK((bg::get(geometry) > 9999)); + BOOST_CHECK((bg::get(geometry) < 9999)); + BOOST_CHECK((bg::get(geometry) < 9999)); + } +} + +template +void test_assign_box_or_segment_2d() +{ + detail::test_assign_box_or_segment_2d >(); + detail::test_assign_box_or_segment_2d >(); +} + +template +void test_assign_box_2d() +{ + detail::test_assign_box_or_segment_2d >(); +} + +template +void test_assign_point_3d() +{ + Point p; + bg::assign_values(p, 1, 2, 3); + check_geometry(p, "POINT(1 2 3)"); + + bg::assign_value(p, 123); + check_geometry(p, "POINT(123 123 123)"); + + bg::assign_zero(p); + check_geometry(p, "POINT(0 0 0)"); +} + +template +void test_assign_conversion() +{ + typedef bg::model::box

box_type; + typedef bg::model::ring

ring_type; + typedef bg::model::polygon

polygon_type; + + P p; + bg::assign_values(p, 1, 2); + + box_type b; + bg::assign(b, p); + + BOOST_CHECK_CLOSE((bg::get<0, 0>(b)), 1.0, 0.001); + BOOST_CHECK_CLOSE((bg::get<0, 1>(b)), 2.0, 0.001); + BOOST_CHECK_CLOSE((bg::get<1, 0>(b)), 1.0, 0.001); + BOOST_CHECK_CLOSE((bg::get<1, 1>(b)), 2.0, 0.001); + + + bg::set(b, 1); + bg::set(b, 2); + bg::set(b, 3); + bg::set(b, 4); + + ring_type ring; + bg::assign(ring, b); + + { + typedef bg::model::ring ring_type_ccw; + ring_type_ccw ring_ccw; + // Should NOT compile (currently): bg::assign(ring_ccw, ring); + + } + + typename boost::range_const_iterator::type it = ring.begin(); + BOOST_CHECK_CLOSE(bg::get<0>(*it), 1.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 2.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 1.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 4.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 3.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 4.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 3.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 2.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 1.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 2.0, 0.001); + + BOOST_CHECK_EQUAL(ring.size(), 5u); + + + polygon_type polygon; + + bg::assign(polygon, ring); + BOOST_CHECK_EQUAL(bg::num_points(polygon), 5u); + + ring_type ring2; + bg::assign(ring2, polygon); + BOOST_CHECK_EQUAL(bg::num_points(ring2), 5u); +} + + +template +void test_assign_conversion_variant() +{ + typedef bg::model::box

box_type; + typedef bg::model::ring

ring_type; + typedef bg::model::polygon

polygon_type; + + P p; + bg::assign_values(p, 1, 2); + + box_type b; + boost::variant variant_b(b); + bg::assign(variant_b, p); + + BOOST_CHECK_CLOSE((bg::get<0, 0>(b)), 1.0, 0.001); + BOOST_CHECK_CLOSE((bg::get<0, 1>(b)), 2.0, 0.001); + BOOST_CHECK_CLOSE((bg::get<1, 0>(b)), 1.0, 0.001); + BOOST_CHECK_CLOSE((bg::get<1, 1>(b)), 2.0, 0.001); + + + bg::set(b, 1); + bg::set(b, 2); + bg::set(b, 3); + bg::set(b, 4); + + ring_type ring; + boost::variant variant_ring(ring); + bg::assign(variant_ring, boost::variant(b)); + + { + typedef bg::model::ring ring_type_ccw; + ring_type_ccw ring_ccw; + // Should NOT compile (currently): bg::assign(ring_ccw, ring); + + } + + typename boost::range_const_iterator::type it = ring.begin(); + BOOST_CHECK_CLOSE(bg::get<0>(*it), 1.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 2.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 1.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 4.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 3.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 4.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 3.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 2.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 1.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 2.0, 0.001); + + BOOST_CHECK_EQUAL(ring.size(), 5u); + + + polygon_type polygon; + boost::variant variant_polygon(polygon); + + bg::assign(variant_polygon, boost::variant(ring)); + BOOST_CHECK_EQUAL(bg::num_points(polygon), 5u); + + ring_type ring2; + boost::variant variant_ring2(ring2); + bg::assign(variant_ring2, boost::variant(polygon)); + BOOST_CHECK_EQUAL(bg::num_points(ring2), 5u); +} + + +template +void test_assign_point_2d() +{ + Point p; + bg::assign_values(p, 1, 2); + check_geometry(p, "POINT(1 2)"); + + bg::assign_value(p, 123); + check_geometry(p, "POINT(123 123)"); + + bg::assign_zero(p); + check_geometry(p, "POINT(0 0)"); +} + + + + + +int test_main(int, char* []) +{ + test_assign_point_3d(); + test_assign_point_3d(); + test_assign_point_3d(); + test_assign_point_3d(); + test_assign_point_3d >(); + test_assign_point_3d >(); + test_assign_point_3d >(); + + test_assign_point_2d(); + test_assign_point_2d(); + test_assign_point_2d(); + test_assign_point_2d >(); + test_assign_point_2d >(); + test_assign_point_2d >(); + + test_assign_conversion >(); + test_assign_conversion_variant >(); + + + // Segment (currently) cannot handle array's because derived from std::pair + test_assign_box_2d(); + test_assign_box_2d(); + test_assign_box_2d(); + + test_assign_box_or_segment_2d >(); + test_assign_box_or_segment_2d >(); + test_assign_box_or_segment_2d >(); + + test_assign_linestring_2d >(); + test_assign_linestring_2d >(); + test_assign_linestring_2d >(); + +#ifdef HAVE_TTMATH + // Next 3 need extra traits for c-array with custom type: + // test_assign_point_2d(); + // test_assign_point_3d(); + // test_assign_box_2d(); + + test_assign_point_2d >(); + test_assign_point_3d >(); + test_assign_box_or_segment_2d >(); + test_assign_linestring_2d >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/buffer/Jamfile b/src/boost/libs/geometry/test/algorithms/buffer/Jamfile new file mode 100644 index 000000000..d4278cbc8 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/Jamfile @@ -0,0 +1,31 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2011-2019 Barend Gehrels, Amsterdam, the Netherlands. +# +# 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) + +project boost-geometry-algorithms-buffer + : + requirements + . + ; + +test-suite boost-geometry-algorithms-buffer + : + [ run buffer.cpp : : : : algorithms_buffer ] + [ run buffer_with_strategies.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_with_strategies ] + [ run buffer_point.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_point ] + [ run buffer_point_geo.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_point_geo ] + [ run buffer_linestring.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_linestring ] + [ run buffer_ring.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_ring ] + [ run buffer_polygon.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_polygon ] + [ run buffer_multi_point.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_multi_point ] + [ run buffer_multi_linestring.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_multi_linestring ] + [ run buffer_multi_polygon.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_multi_polygon ] + [ run buffer_linestring_aimes.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_linestring_aimes ] +# Uncomment next line if you want to test this manually; requires access to data/ folder +# [ run buffer_countries.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_countries ] + ; + diff --git a/src/boost/libs/geometry/test/algorithms/buffer/buffer.cpp b/src/boost/libs/geometry/test/algorithms/buffer/buffer.cpp new file mode 100644 index 000000000..04e1055e0 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/buffer.cpp @@ -0,0 +1,73 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2019 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2016. +// Modifications copyright (c) 2016, 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. + +// 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) + + +#include + +#include "geometry_test_common.hpp" + +#include +#include +#include + +#include + +#include +#include +#include "test_common/test_point.hpp" + + +template +void test_all() +{ + typedef typename bg::coordinate_type

::type coordinate_type; + + P p1(0, 0); + P p2(2, 2); + + typedef bg::model::box

box_type; + + box_type b1(p1, p2); + box_type b2; + bg::buffer(b1, b2, coordinate_type(2)); + + box_type expected(P(-2, -2), P(4, 4)); + BOOST_CHECK(bg::equals(b2, expected)); + + boost::variant v(b1); + bg::buffer(v, b2, coordinate_type(2)); + + BOOST_CHECK(bg::equals(b2, expected)); +} + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + + test_all >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_all >(); + test_all >(); +#endif + +#ifdef HAVE_TTMATH + test_all >(); +#endif + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/buffer/buffer_countries.cpp b/src/boost/libs/geometry/test/algorithms/buffer/buffer_countries.cpp new file mode 100644 index 000000000..c80047df3 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/buffer_countries.cpp @@ -0,0 +1,248 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include "test_buffer.hpp" + + +template +std::string read_from_file(std::string const& filename) +{ + MultiPolygon mp; + std::ifstream in(filename.c_str()); + while (in.good()) + { + std::string line; + std::getline(in, line); + if (! line.empty()) + { + typename boost::range_value::type pol; + bg::read_wkt(line, pol); + mp.push_back(pol); + } + } + std::ostringstream out; + if (! mp.empty()) + { + out << std::fixed << std::setprecision(19) << bg::wkt(mp); + } + + BOOST_CHECK(! out.str().empty()); + + return out.str(); +} + + +/* + +Area's from PostGIS: + +query: + with viewy as + ( + select ST_GeomFromText + ( + 'MULTIPOLYGON(((-702580.6096782692475244403 6430990.7687819330021739006,-703230.0475875560659915209 6431039.6897066971287131310,-703260.8830865059280768037 6431616.0447590677067637444,-702209.5818154554581269622 6433969.2453343933448195457,-701931.2830884709255769849 6434497.0344218844547867775,-701467.5260898249689489603 6434786.0182951148599386215,-700756.1945436559617519379 6434833.5779418582096695900,-699921.2983627079520374537 6434065.5660789832472801208,-699643.1109552145935595036 6433585.3568368786945939064,-699086.5135012482060119510 6432576.2640118366107344627,-698993.6730459277750924230 6432239.8116209311410784721,-699797.6224084376590326428 6431375.9207902560010552406,-700292.3262255217414349318 6431087.0551158646121621132,-702580.6096782692475244403 6430990.7687819330021739006)),((-735358.0771448947489261627 7178577.3841606164351105690,-735605.4290534354513511062 7178156.5045146262273192406,-736935.1403709617443382740 7177207.7119220057502388954,-737491.6265054368413984776 7177576.5995239885523915291,-738326.6340058789355680346 7178735.1250268649309873581,-740893.1048661170061677694 7182528.6822584075853228569,-749705.9349937491351738572 7205006.6147208353504538536,-762724.0815250772284343839 7224794.0963690327480435371,-762600.4055708040250465274 7225641.0741515457630157471,-764765.0130692812381312251 7234599.5305097363889217377,-765445.2864775179186835885 7235820.5329339085146784782,-770021.7420635188464075327 7241232.3524428531527519226,-771103.9901530132628977299 7242295.3629226731136441231,-776391.6659656920237466693 7246596.8462748657912015915,-782050.3696411874843761325 7249518.3589066835120320320,-782668.8607320359442383051 7249677.3384689968079328537,-783287.2405033904360607266 7249572.3082885984331369400,-785730.0354093580972403288 7248190.2115479269996285439,-797140.2832156693330034614 7234175.6422693207859992981,-798779.2400786185171455145 7225111.4401018721982836723,-795377.7617179383523762226 7219339.8478290000930428505,-795099.5743104477878659964 7218756.8999792803078889847,-794975.7870366862043738365 7218121.5951453419402241707,-795470.6021732615772634745 7212936.2726683067157864571,-810498.7334303526440635324 7193863.9115921957418322563,-811179.0068385921185836196 7193284.3684667171910405159,-814116.6168811351526528597 7191490.3536884263157844543,-816002.8143331365427002311 7191596.1295820372179150581,-841513.5680797586683183908 7194233.5802007140591740608,-847141.4362563013564795256 7197189.2738139629364013672,-848254.6311642369255423546 7197876.6753672696650028229,-848656.4945260005770251155 7198404.4778307117521762848,-848718.3881628799717873335 7199670.4357275264337658882,-848594.7122086095623672009 7201097.6388064818456768990,-848749.3349813210079446435 7201730.2385471686720848083,-849120.3628441347973421216 7202364.2203078540042042732,-856819.9980638342676684260 7208600.8437178684398531914,-857438.3778351887594908476 7208600.8437178684398531914,-862478.7017393268179148436 7208177.0236210795119404793,-870023.7141863148426637053 7207966.3590856380760669708,-870580.3116402812302112579 7207966.3590856380760669708,-874012.6254999083466827869 7210450.9231998035684227943,-875187.7140447233105078340 7211560.6087152827531099319,-875806.0938160805962979794 7212724.1476780120283365250,-875991.6634072330780327320 7214047.8326450148597359657,-876022.6102256742306053638 7218227.7297820551320910454,-876610.0431785903638228774 7223839.8538713958114385605,-876702.8836339107947424054 7224475.6212571412324905396,-876981.1823608925333246589 7225111.4401018721982836723,-879454.9240853014634922147 7226066.0278311185538768768,-884031.3796713051851838827 7227071.4743356276303529739,-893926.5692079173168167472 7238101.1117624733597040176,-895596.3615698162466287613 7238896.9872776530683040619,-896771.3387951399199664593 7239853.0616000862792134285,-897853.5868846315424889326 7241073.3528286991640925407,-907996.1283297898480668664 7253664.5514006679877638817,-908305.2625557214487344027 7254302.7396087851375341415,-909665.6980527064297348261 7258503.5592825226485729218,-895781.9311609688447788358 7266808.4238847019150853157,-885082.7922618469456210732 7271603.5667797476053237915,-872033.5875925865257158875 7275761.4648210369050502777,-862973.5168759049847722054 7283550.4871917199343442917,-865787.3396446865517646074 7289796.4451190056279301643,-873796.2204098060028627515 7290971.6515730358660221100,-874445.5469996044412255287 7291293.0323402481153607368,-880135.1974935409380123019 7297012.0099565647542476654,-880970.0936744889477267861 7298293.9856944410130381584,-882485.3745831678388640285 7303643.4018597202375531197,-882238.0226746243424713612 7304285.6780861504375934601,-873085.0001831282861530781 7310334.7953147590160369873,-871600.6660928905475884676 7310709.9959785044193267822,-871013.2331399742979556322 7310496.7502252506092190742,-870425.6888675697846338153 7309853.9632561607286334038,-861520.1296041056048125029 7305890.8288697442039847374,-840833.2946715191937983036 7315960.4538994673639535904,-832985.8271680481266230345 7328929.2893263995647430420,-830226.9962277177255600691 7334311.5376756498590111732,-828650.0443211420206353068 7339095.0725443745031952858,-824475.4520969019504263997 7352813.8748141247779130936,-815569.8928334405645728111 7370657.6415467225015163422,-807345.3862146517494693398 7375579.2351953061297535896,-807622.9057052005082368851 7371088.9971275608986616135,-807190.0955249957041814923 7370819.1056331051513552666,-789811.7871782749425619841 7369039.1054780697450041771,-787430.7745896981796249747 7369200.5359869319945573807,-786379.4733186477096751332 7369740.0217997981235384941,-785389.9543649854604154825 7370495.9865155210718512535,-784524.2226850874722003937 7371413.6954120760783553123,-782483.2911408834625035524 7373897.2790033649653196335,-781431.9898698300821706653 7375516.8260253472253680229,-778587.1089631190989166498 7383297.7232969645410776138,-775556.7697847438976168633 7392222.0447648391127586365,-766960.4560667055193334818 7394495.1678112838417291641,-759724.5778456518892198801 7394550.3234224319458007812,-749211.1198571709683164954 7396932.7178549375385046005,-736192.9733258428750559688 7402187.9909061845391988754,-725308.3761550596682354808 7407229.3494948502629995346,-709816.4878993228776380420 7408422.4015268804505467415,-707249.7944001023424789310 7408151.4058539085090160370,-696303.4149119253270328045 7403107.8879097951576113701,-686655.7999228363623842597 7404409.0014582388103008270,-684553.0860612413380295038 7404897.2679815273731946945,-683749.0253792431904003024 7404735.0945201823487877846,-679481.8153386650374159217 7402783.4239942766726016998,-678894.3823857487877830863 7402458.9736336832866072655,-675338.3925718484679237008 7399695.3543038265779614449,-674688.9546625588554888964 7398557.0712014045566320419,-672091.4256643884582445025 7393304.2529149157926440239,-671658.5041646952740848064 7392006.5564168058335781097,-671627.6686657454119995236 7391194.9242857862263917923,-672648.0231183547293767333 7381838.4430372426286339760,-673421.1369819147512316704 7378811.9759865151718258858,-671936.9142111683031544089 7373087.5347176529467105865,-650600.6413692950736731291 7341729.4264621166512370110,-644694.4744657649425789714 7333076.6175461346283555031,-643643.1731947144726291299 7333774.4993700264021754265,-642931.9529680367559194565 7333882.2134874602779746056,-639746.9910169501090422273 7333505.8973950138315558434,-638571.9024721352616325021 7332861.2130459556356072426,-638077.1986550511792302132 7332485.1395546719431877136,-635696.1860664744162932038 7329532.4808910498395562172,-635417.8873394897673279047 7328995.5782044418156147003,-633717.2594786409754306078 7325506.4177591772750020027,-633191.4975236244499683380 7324326.0056811599060893059,-633021.4013416939415037632 7317593.0931803137063980103,-633005.9279324719682335854 7316390.1439637970179319382,-633129.6038867422612383962 7315639.4076945250853896141,-633469.7962506090989336371 7314674.0333597715944051743,-633779.0417960318736732006 7313870.4174501933157444000,-634119.1228404046269133687 7313281.7431463403627276421,-635758.0797033538110554218 7311407.2306827269494533539,-639258.4097718583652749658 7308761.1154594300314784050,-639592.3682442387798801064 7308568.5479629402980208397,-640019.0558524483349174261 7308503.7815833184868097305,-641985.7372962941881269217 7308503.7815833184868097305,-644075.9833749192766845226 7307658.2055283375084400177,-647477.4617355966474860907 7305890.8288697442039847374,-648065.0060080040711909533 7305570.3889232203364372253,-652610.5147755667567253113 7302306.0416051279753446579,-653569.1982302792603150010 7301449.3883516052737832069,-654342.2007743450812995434 7300487.1135643599554896355,-655486.3425007188925519586 7298990.3059588475152850151,-655826.4235450944397598505 7298348.4646951872855424881,-659444.3069958741543814540 7291133.0134554086253046989,-659567.9829501473577693105 7290330.4681210117414593697,-657712.7323165842099115252 7285525.3807995188981294632,-657310.7576353321783244610 7285044.5346792098134756088,-656599.5374086515512317419 7284830.4504301641136407852,-655362.5552269573090597987 7285258.6247859327122569084,-654898.7982283142628148198 7285685.2850175667554140091,-654558.6058644475415349007 7286271.6925147818401455879,-653971.0615920429117977619 7288408.5788867557421326637,-651868.4590499391779303551 7291827.1575358547270298004,-647477.4617355966474860907 7295299.9569906648248434067,-645993.2389648500829935074 7296423.2570062335580587387,-639042.0046817560214549303 7298690.5552950426936149597,-638763.5946352829923853278 7298819.1559704272076487541,-638318.4279915994266048074 7298883.0720631638541817665,-626636.1153497900813817978 7299899.4466651547700166702,-623296.4193065008148550987 7299845.1493975305929780006,-620822.6775820920011028647 7299632.1999242166057229042,-620235.1333096873713657260 7299310.4762344490736722946,-616586.3030404637102037668 7295087.1312795402482151985,-616184.3283592087682336569 7294605.5046063205227255821,-615967.9232691064244136214 7293964.0231761783361434937,-615349.5434977519325911999 7290384.6993595836684107780,-609969.0272297499468550086 7272402.8508998267352581024,-605052.3792798821814358234 7263400.9426858676597476006,-604526.7286443569464609027 7262975.4949916983023285866,-604433.9995085247792303562 7262282.3713537119328975677,-605052.3792798821814358234 7257865.6035474222153425217,-605176.0552341524744406343 7257067.9925211919471621513,-607928.2070050371112301946 7243515.8429014263674616814,-612356.2737098102224990726 7239513.5310624139383435249,-612690.2321821906371042132 7239353.8020243635401129723,-613153.9891808364773169160 7239322.4680012036114931107,-613821.9061255943961441517 7239736.5075368294492363930,-614230.1146983328508213162 7240372.7991492254659533501,-617291.4006951490882784128 7246553.8178517967462539673,-617421.3105409058043733239 7246936.1097532864660024643,-617476.9702863016864284873 7247351.1250555245205760002,-617514.0396767350612208247 7248306.8912714971229434013,-617347.0604405448539182544 7249136.7063253857195377350,-617198.5602398286573588848 7249550.4989193044602870941,-617031.6923231268301606178 7249900.7953358525410294533,-615844.2473148361314088106 7251400.6847681496292352676,-617359.4169040236156433821 7254250.2890685461461544037,-616895.5485858893953263760 7255631.9227854702621698380,-616771.8726316161919385195 7256376.9229258280247449875,-617112.0649954801192507148 7261006.2797204386442899704,-617823.1739026695722714067 7265263.9857233623042702675,-618039.6903122602961957455 7265903.1192052718251943588,-618905.5333116523688659072 7268460.1747035766020417213,-619121.9384017547126859426 7269045.4850603407248854637,-619833.1586284324293956161 7270110.7394062280654907227,-623358.3129433830035850406 7273468.5620510326698422432,-627780.1457566726021468639 7276775.0316838556900620461,-629975.5887540967669337988 7278160.6439954033121466637,-632356.6013426764402538538 7279441.0702628456056118011,-633717.2594786409754306078 7279867.6054819477722048759,-634366.4747489481233060360 7279655.0071296412497758865,-634582.9911585417576134205 7278960.5978231728076934814,-635046.7481571848038583994 7271869.8578517930582165718,-631830.9507071482948958874 7269844.3163336357101798058,-631336.2468900642124935985 7269578.0941229732707142830,-628400.8632373372092843056 7264020.9494932899251580238,-620421.1481788019882515073 7241887.6865395959466695786,-619846.0716893646167591214 7239944.9685657471418380737,-619066.8352538122562691569 7235710.5318127926439046860,-619252.2935254735639318824 7235360.1044908678159117699,-618843.6396747701801359653 7225430.1317164767533540726,-619183.7207191428169608116 7223946.0657785069197416306,-621904.9256715864175930619 7220504.5390589004382491112,-624316.8850786042166873813 7217592.4677235791459679604,-628738.7178918938152492046 7213306.8386734155938029289,-629326.2621643012389540672 7212989.9712846651673316956,-629913.6951172174885869026 7213148.4033825341612100601,-630315.7811179606942459941 7213623.5283982306718826294,-630841.4317534888396039605 7214787.3727535428479313850,-632789.5228423695079982281 7216322.0976330684497952461,-633408.0139332180842757225 7216640.2424348145723342896,-634181.0164772868156433105 7216798.7481244029477238655,-637922.5758823397336527705 7217169.4962707208469510078,-639654.2618811180582270026 7217275.6180500760674476624,-648157.7351438361220061779 7215793.0913441013544797897,-648714.3325978023931384087 7215528.5063093286007642746,-651837.5122314980253577232 7213465.0867246836423873901,-652765.2488677693763747811 7212671.9741857927292585373,-653785.6033203788101673126 7210662.9868646310642361641,-653878.3324562108609825373 7209075.6939942780882120132,-653661.9273661085171625018 7207648.5650895787402987480,-652981.6539578718366101384 7205799.1447007078677415848,-652888.9248220397857949138 7205058.9276083298027515411,-652765.2488677693763747811 7202681.9910357510671019554,-652919.7603209896478801966 7200991.7351339543238282204,-655115.2033184138126671314 7192229.2954357927665114403,-656383.0209990608273074031 7189011.9584304438903927803,-657186.9703615678008645773 7188009.6574359694495797157,-659042.4436341105028986931 7186428.4453326268121600151,-664391.9017641830723732710 7182265.4030445581302046776,-672802.6458910661749541759 7176102.8584930133074522018,-675462.0685261187609285116 7175417.5443301461637020111,-676266.0178886285284534097 7175365.4280199278146028519,-677038.9091132060857489705 7175523.1046035401523113251,-679976.6304752404103055596 7177050.1911828350275754929,-686934.0986498210113495588 7183318.9521107096225023270,-687645.2075570075539872050 7184372.6421100758016109467,-688603.8910117199411615729 7186744.0550359664484858513,-689315.1112383977742865682 7187851.7307325564324855804,-689809.8150554818566888571 7188221.1171403760090470314,-690490.0884637213312089443 7188484.5955257071182131767,-697636.4658141745021566749 7189085.8072432382032275200,-697695.0198663338087499142 7189486.9569816533476114273,-698251.5060008089058101177 7190066.4104806575924158096,-698931.7794090455863624811 7190487.9270409662276506424,-700044.9743169782450422645 7190751.4812934864312410355,-705641.8956750826910138130 7192071.4739870699122548103,-706847.9310383386909961700 7192071.4739870699122548103,-707435.3639912548242136836 7191807.6856330027803778648,-707992.0727647095918655396 7191332.5470526618883013725,-708393.9361264732433483005 7190751.4812934864312410355,-708579.5057176257250830531 7190172.1672446671873331070,-708672.3461729490663856268 7189591.1871162438765168190,-708641.3993545080302283168 7189011.9584304438903927803,-717732.4168896306073293090 7181210.4776329882442951202,-731090.7557848254218697548 7179788.2020574221387505531,-735358.0771448947489261627 7178577.3841606164351105690)),((-688882.1897387016797438264 7412436.5099641056731343269,-694015.2427786719053983688 7418624.0284140892326831818,-697169.2579113173997029662 7418407.8061552522704005241,-698839.1615927076200023293 7418516.6985288234427571297,-699364.7009087415644899011 7418788.0563712492585182190,-699241.0249544712714850903 7419602.5779014062136411667,-697169.2579113173997029662 7421068.9713027896359562874,-696025.2275044348789379001 7421829.9468861259520053864,-694510.0579152472782880068 7421992.6735327132046222687,-689191.4352841245708987117 7420797.5336704570800065994,-687768.9948307690210640430 7420254.4913531979545950890,-687367.0201495141955092549 7419818.8334604389965534210,-687150.5037399205612018704 7418950.7192241176962852478,-688078.1290567035321146250 7413467.8112517688423395157,-688480.2150574468541890383 7412761.3775515491142868996,-688882.1897387016797438264 7412436.5099641056731343269)),((-698468.0224104025401175022 7473833.5146531024947762489,-701374.6856345045380294323 7474653.6489164056256413460,-703230.0475875560659915209 7475583.7647755797952413559,-704157.6729043362429365516 7476567.9621847020462155342,-704374.0779944385867565870 7477114.9677619626745581627,-703755.6982230813009664416 7482205.5315547427162528038,-703632.0222688110079616308 7482918.3282846277579665184,-699735.7287715553538873792 7500351.2504732506349682808,-696087.0098218229832127690 7511500.4964982029050588608,-695870.6047317205229774117 7512214.6175983380526304245,-695901.5515501616755500436 7513038.8378656907007098198,-696241.6325945372227579355 7513698.6733295693993568420,-696767.2832300624577328563 7514083.8343340521678328514,-697447.5566382991382852197 7514302.7473613265901803970,-704126.7260858950903639197 7515018.5136068165302276611,-704837.9463125757174566388 7515018.5136068165302276611,-705518.2197208123980090022 7514797.9966831970959901810,-706384.0627202015602961183 7513753.1013900088146328926,-706693.1969461359549313784 7513038.8378656907007098198,-707157.1765837614657357335 7511719.3362279795110225677,-707589.9867639662697911263 7510400.0602311035618185997,-708053.8550821004901081324 7508862.2448687991127371788,-708826.8576261692214757204 7506994.0948427924886345863,-710187.5157621366670355201 7504467.4917841125279664993,-711671.7385328831151127815 7502326.0925307748839259148,-713650.6651207137620076537 7499692.5552066601812839508,-717948.9332992242416366935 7495028.9645483279600739479,-719402.3205710208276286721 7493766.8251204313710331917,-720608.1332952943630516529 7493000.1262787943705916405,-721907.0091138707939535379 7492726.1545226909220218658,-722618.1180210572201758623 7492890.1811141148209571838,-723731.4242484811693429947 7493658.2508851466700434685,-724133.2876102448208257556 7494316.4315773332491517067,-724597.1559283791575580835 7495412.9975283788517117500,-724689.8850642112083733082 7497058.3359622266143560410,-723576.6901562785496935248 7503149.4548785416409373283,-723051.0395207533147186041 7505565.5006046025082468987,-717979.7687981741037219763 7528337.0292042447254061699,-717083.2016193262534216046 7529327.9761461354792118073,-709074.2095347127178683877 7532468.2375808423385024071,-702395.1514066079398617148 7531311.8393505858257412910,-689315.1112383977742865682 7541787.6536649884656071663,-686068.2556504289386793971 7543996.0762523645535111427,-683718.1898802933283150196 7545210.4222629889845848083,-683130.6456078859046101570 7545375.7677722154185175896,-682326.6962453760206699371 7545210.4222629889845848083,-681491.8000644280109554529 7544271.8755555301904678345,-681120.6608821229310706258 7542836.3568872893229126930,-681584.5292002571513876319 7537540.8627359746024012566,-681460.8532459868583828211 7534342.3719757227227091789,-679389.0862028329866006970 7520903.3390643103048205376,-679265.4102485626935958862 7520133.9395713303238153458,-678770.7064314757008105516 7518042.6464647594839334488,-678306.8381133413640782237 7516722.2886397214606404305,-677750.2406593750929459929 7515512.4231265708804130554,-676327.8002060195431113243 7514248.3154224921017885208,-674534.3318898474099114537 7513203.4945802800357341766,-673730.2712078491458669305 7512214.6175983380526304245,-673482.9192993056494742632 7511609.1241234233602881432,-671287.4763018814846873283 7502985.2102015949785709381,-670669.0965305241988971829 7495138.9401649823412299156,-670978.2307564557995647192 7494534.9820824339985847473,-672184.2661197116831317544 7493000.1262787943705916405,-676451.4761602898361161351 7489052.5557834561914205551,-693396.7516878233291208744 7477662.0120453117415308952,-698468.0224104025401175022 7473833.5146531024947762489)),((-142767.2469423743896186352 6547139.2345692599192261696,-152229.4036598020466044545 6554104.9963345807045698166,-163979.8438299772387836128 6561516.0021916879341006279,-166268.0159632335416972637 6562638.7391632050275802612,-166886.5070540792366955429 6562882.6951917400583624840,-168339.7830063846195116639 6562930.8198394523933529854,-169576.7651880816847551614 6562687.0380198908969759941,-171215.6107315395784098655 6562003.6794201470911502838,-174678.8714096079056616873 6560930.5466297725215554237,-174771.6005454399564769119 6561467.7101931860670447350,-172637.9398654038668610156 6564053.9251385293900966644,-169576.7651880816847551614 6567567.2077301768586039543,-145704.8569849174818955362 6580905.3427298367023468018,-144375.2569868824211880565 6581051.6178714158013463020,-143756.7658960339031182230 6580953.5727541074156761169,-124461.4245983647560933605 6574990.3297461569309234619,-123997.5562802276544971392 6574599.8518867725506424904,-121771.1664643623080337420 6572010.5021970951929688454,-117967.7134224300389178097 6566199.7380468165501952171,-130058.3459564691875129938 6551181.9892134414985775948,-132624.8168167072290088981 6549719.5585852097719907761,-135284.1281322685827035457 6548599.8054481893777847290,-138221.7381748116458766162 6547771.9240455087274312973,-142767.2469423743896186352 6547139.2345692599192261696)),((-106928.6047984238393837586 6581490.8109566625207662582,-108289.1516148999944562092 6581784.9690047213807702065,-113824.1793361222225939855 6583496.2583401361480355263,-113731.4502002901717787609 6584132.9769384199753403664,-113422.2046548673097277060 6584572.3344440879300236702,-108629.2326592727040406317 6591326.2465774957090616226,-108072.6352053063747007400 6591423.1816138168796896935,-107361.5262981198466150090 6591228.2552289562299847603,-105660.7871177797496784478 6589955.0025413725525140762,-105351.5415723540645558387 6589417.2116007748991250992,-104207.3998459831345826387 6582566.6249391864985227585,-104454.7517545237933518365 6582029.3165351273491978645,-106928.6047984238393837586 6581490.8109566625207662582)),((-519150.8017779086367227137 6649348.9302046010270714760,-519769.4041882483870722353 6649545.2418169863522052765,-520233.1611868914333172143 6649890.6622821614146232605,-520356.8371411645784974098 6650581.3694077720865607262,-520016.7560967890312895179 6654131.8595868386328220367,-519800.2396871982491575181 6655514.0480420421808958054,-519367.3181875022710300982 6655859.7204466462135314941,-518625.2624618746340274811 6655859.7204466462135314941,-518346.8524154016631655395 6655365.0190682355314493179,-517233.6575074690044857562 6650433.6728300666436553001,-517295.5511443483410403132 6649791.7917294288054108620,-517821.3130993648082949221 6649545.2418169863522052765,-519150.8017779086367227137 6649348.9302046010270714760)),((100094.8125781164126237854 6684726.0087605575099587440,98548.6961704877467127517 6684924.5976608581840991974,87664.0989997017313726246 6686905.0463614761829376221,86952.8787730239710072055 6687103.6882660342380404472,85283.0864111249684356153 6688045.2524453820660710335,84540.9193660061137052253 6688936.4502402693033218384,82963.9674594304087804630 6691364.4189215200021862984,82469.1523228522128192708 6692405.6823790417984127998,81819.8257330566557357088 6693843.4366568028926849365,82438.3168239023507339880 6697660.7728029768913984299,83365.9421406824840232730 6700140.4544257819652557373,84633.7598213294113520533 6700339.2401692178100347519,88066.0736809566442389041 6699495.9075616495683789253,99321.6987145564635284245 6696173.4326590122655034065,100651.4100320827565155923 6695726.6230171313509345055,101177.0606676079914905131 6695379.4386507561430335045,103588.9087551346019608900 6692158.0223465478047728539,104269.2934828625002410263 6691215.9836819367483258247,105073.2428453723114216700 6689679.5164131233468651772,105475.2175266272242879495 6688540.5088516287505626678,105506.1643450683186529204 6687846.5876310169696807861,105413.3238897450355580077 6687203.0110306832939386368,104918.6200726608949480578 6686856.1890392992645502090,100713.1923494708753423765 6684875.5739196399226784706,100094.8125781164126237854 6684726.0087605575099587440)),((-484394.4077234524884261191 7006049.7621033526957035065,-490053.2227184362709522247 7006307.4369544526562094688,-498587.6427995953708887100 7015743.4408356416970491409,-500319.3287983737536706030 7018115.9862014595419168472,-508451.7741982779698446393 7033717.6659270338714122772,-508637.3437894305097870529 7055102.4795240126550197601,-508389.9918808870133943856 7055724.8110826518386602402,-507616.8780173270497471094 7056708.9933504080399870872,-498123.8858009495306760073 7060807.9525244953110814095,-493052.6150783703196793795 7061896.6329905483871698380,-492372.3416701336973346770 7062000.6893656672909855843,-491599.3391260649659670889 7062000.6893656672909855843,-480220.0381381948245689273 7059562.5416110474616289139,-477838.9142301268293522298 7058731.8781612580642104149,-476849.3952764644636772573 7057953.9569422556087374687,-476107.3395508368266746402 7057020.9627588037401437759,-475334.2256872769212350249 7055206.4469419745728373528,-470015.6030561570660211146 7042719.9294385062530636787,-459409.4159318468300625682 7040650.0641330182552337646,-458883.7652963215950876474 7040908.6746784290298819542,-458172.5450696410262025893 7041010.9660405069589614868,-457523.2184798454400151968 7040959.9133565612137317657,-451957.1326206909143365920 7039717.6081727687269449234,-450472.9098499444080516696 7039303.8600313169881701469,-450442.0743509945459663868 7038631.7747488524764776230,-455296.7173444888903759420 7030305.4587014671415090561,-456564.5350251329946331680 7028961.1894702669233083725,-462347.0259743899223394692 7024828.9599360972642898560,-469551.8460575111676007509 7020129.0798942381516098976,-481518.6913177887327037752 7009863.6067247306928038597,-484394.4077234524884261191 7006049.7621033526957035065)),((-509564.9691062106285244226 7027153.0635162591934204102,-512842.7715126176481135190 7030511.4449932724237442017,-519243.6422332319198176265 7034647.9294924885034561157,-520635.1358681463170796633 7035010.0486788097769021988,-521315.4092763858498074114 7035993.1596986297518014908,-522521.4446396389394067228 7038941.5453599998727440834,-522304.9282300453633069992 7039458.8500605020672082901,-521129.9510047245421446860 7041994.8189928056672215462,-520820.7054592988570220768 7042564.8758499575778841972,-520140.4320510621764697134 7042668.6794203175231814384,-515038.2145100419293157756 7042978.6072979765012860298,-514481.6170560755999758840 7042668.6794203175231814384,-511049.3031964483670890331 7038165.5582551229745149612,-507678.7716542092384770513 7030925.8527166405692696571,-507555.0956999360932968557 7030201.8163049044087529182,-507555.0956999360932968557 7029477.8457472492009401321,-507709.7184726503328420222 7028702.9669241644442081451,-508018.9640180732239969075 7028135.2044416479766368866,-508884.6956979711540043354 7027256.6662269476801156998,-509564.9691062106285244226 7027153.0635162591934204102)),((-296666.4429640754242427647 6730809.2905607484281063080,-297748.8023730582208372653 6729365.0000257585197687149,-300438.9491875665844418108 6726228.4902110705152153969,-302201.5820047889137640595 6724685.4097353378310799599,-317013.1968522862880490720 6718269.7042935220524668694,-322022.5739379832521080971 6717125.4435921907424926758,-324929.2371620881021954119 6716976.5386439291760325432,-328918.1484756816644221544 6717324.8229897394776344299,-330216.9129747668630443513 6717672.9432423794642090797,-336308.5381499582435935736 6714740.2493202565237879753,-346822.1074579276028089225 6708430.6989329699426889420,-347533.3276846053777262568 6707535.9388622017577290535,-348182.6542744037578813732 6706443.5887363040819764137,-350841.9655899651115760207 6701827.5188080035150051117,-351800.5377251863828860223 6698999.9858346609398722649,-351614.9681340338429436088 6698355.5290799643844366074,-351553.1858166428864933550 6697709.8733980739489197731,-351614.9681340338429436088 6696173.4326590122655034065,-351955.1604978977702558041 6694735.2678222069516777992,-352202.5124064384144730866 6694091.1478441227227449417,-352480.8111334230052307248 6693545.2294893041253089905,-353624.9528597967582754791 6692206.9114117827266454697,-354614.4718134562717750669 6691563.1693708989769220352,-363829.1653028520522639155 6688887.4024045290425419807,-364416.8208947507082484663 6688737.7637376058846712112,-372487.3726577727356925607 6688540.5088516287505626678,-373971.7067480076220817864 6688540.5088516287505626678,-378857.4078794342931360006 6688737.7637376058846712112,-380310.6838317424990236759 6688887.4024045290425419807,-384175.9191910657682456076 6689630.4641125248745083809,-388350.4000958118122071028 6690572.1413981299847364426,-394349.2961351711419411004 6691959.2574109639972448349,-396328.3340424958732910454 6693346.4307649247348308563,-408759.0476209077169187367 6705550.4764933045953512192,-417386.1968378960737027228 6714740.2493202565237879753,-417866.3178016852471046150 6716183.2003521975129842758,-418684.9613369812141172588 6718170.0024194139987230301,-420973.2447897259262390435 6722298.0005760667845606804,-426972.1408290852559730411 6731556.1845118729397654533,-427497.7914646104909479618 6731854.3516772650182247162,-439681.0418149904580786824 6730411.3097816780209541321,-441443.6746322099352255464 6729862.7735847430303692818,-467572.8081501893466338515 6717821.8609223226085305214,-467789.3245597829227335751 6716430.3385093230754137039,-468160.3524225967703387141 6715982.5962533196434378624,-468809.7903318835305981338 6715882.9223695350810885429,-469459.1169216819689609110 6716082.2713566971942782402,-472303.8865089045721106231 6717524.2072677453979849815,-476200.1800061601679772139 6720358.1752467108890414238,-477900.8078670090180821717 6728567.7653740793466567993,-477900.8078670090180821717 6729315.8875402389094233513,-477684.4027769066160544753 6729962.6187606593593955040,-473169.7295082937343977392 6733249.7686292603611946106,-471097.9624651398626156151 6734046.0274155708029866219,-468809.7903318835305981338 6732900.8022920805960893631,-465377.3651527651236392558 6732153.9642069246619939804,-464697.0917445255909115076 6732103.2211532425135374069,-463367.3804270021500997245 6732302.9677236676216125488,-458234.3273870319826528430 6734245.8216936066746711731,-453967.1173464538296684623 6736388.9867214597761631012,-453627.0363020811346359551 6736836.4176607690751552582,-452575.6237115394324064255 6739229.5325915897265076637,-452390.1654398753307759762 6739927.8440811540931463242,-452513.8413941484759561718 6740624.7796155549585819244,-453085.4669793718494474888 6741509.3617311874404549599,-453595.9781641488079912961 6741971.0771495644003152847,-467263.5626047664554789662 6742320.2533843247219920158,-474468.3826878877007402480 6741921.7089691357687115669,-493825.6176224390510469675 6752750.3917194996029138565,-509224.8880618350813165307 6752200.3463254561647772789,-515223.7841011944110505283 6751251.5156823564320802689,-517171.8751900779898278415 6750852.5330523196607828140,-519552.8877786547527648509 6750103.8644746709614992142,-520511.4599138760240748525 6749455.3496915753930807114,-521253.6269589948933571577 6748506.8395475624129176140,-521655.4903207585448399186 6747159.4591391524299979210,-521717.3839576378813944757 6744165.4814152186736464500,-522119.3586388928233645856 6740076.9900818299502134323,-524160.1788636056007817388 6737136.2137496760115027428,-524685.9408186221262440085 6736887.1902486104518175125,-532478.3051741536473855376 6733847.6727800481021404266,-533189.4140813400736078620 6733996.7073211427778005600,-533746.1228547976352274418 6734295.1432984098792076111,-535137.5051702208584174514 6735391.2361996844410896301,-537425.7886229683645069599 6736189.1397955883294343948,-538167.9556680872337892652 6736338.2172435978427529335,-538817.3935773740522563457 6736238.2937905825674533844,-541229.2416649034712463617 6735441.8203898128122091293,-541723.9454819876700639725 6735192.6693880939856171608,-544383.2567975489655509591 6732950.1157429544255137444,-550072.9072914826683700085 6727074.7735988246276974678,-557185.1095582658890634775 6729265.1621820526197552681,-561328.5323250824585556984 6731107.4303566515445709229,-562318.1625982332043349743 6731755.7383567309007048607,-558966.1100914680864661932 6740426.2644657352939248085,-553325.9967709350166842341 6741712.2116987816989421844,-546022.2136604981496930122 6745512.3655102550983428955,-544816.1782972421497106552 6745961.7356973951682448387,-541136.5125290714204311371 6748457.4316534223034977913,-541816.7859373081009835005 6750153.2823813902214169502,-543733.9302077505271881819 6754448.3974975654855370522,-544352.3099791079293936491 6751950.8608885398134589195,-544414.2036159901181235909 6750502.8103392431512475014,-544630.7200255808420479298 6749854.2637134613469243050,-545403.7225696495734155178 6748905.7070041354745626450,-545929.3732051748083904386 6748556.0680754212662577629,-546949.8389772782102227211 6748057.1489544212818145752,-557048.9658210255438461900 6746779.8974972786381840706,-557791.1328661444131284952 6746600.2720435233786702156,-563839.4547594159375876188 6746959.3472899133339524269,-577871.9444908523000776768 6747658.3231466887518763542,-582046.4253955984022468328 6750203.9585106121376156807,-584087.2456203140318393707 6751500.9796426724642515182,-574532.3597670543240383267 6757244.5433394722640514374,-573419.1648591215489432216 6757745.2861772757023572922,-572769.7269498319365084171 6757844.2153189647942781448,-570419.6611796963261440396 6757794.7505974583327770233,-569090.0611816612072288990 6758044.5954917315393686295,-568595.3573645771248266101 6758343.7359562143683433533,-568224.2181822720449417830 6758793.8165175551548600197,-567945.9194552875123918056 6760243.3462205436080694199,-567945.9194552875123918056 6760992.9501268640160560608,-569368.2485891545657068491 6769694.5714717023074626923,-569492.0358629161491990089 6770395.5073453346267342567,-569955.9041810504859313369 6772247.1268248278647661209,-570172.3092711528297513723 6772847.9084392869845032692,-570759.8535435602534562349 6773848.8294274490326642990,-571749.2611777313286438584 6774550.1244038157165050507,-576820.5319003105396404862 6776503.1116253528743982315,-577562.6989454294089227915 6776652.9309746790677309036,-580345.6862152611138299108 6776753.3529545711353421211,-585416.8456183490343391895 6776753.3529545711353421211,-583221.4026209219591692090 6785020.3456817232072353363,-567945.9194552875123918056 6792845.0460455110296607018,-567389.3220013211248442531 6793146.9183306964114308357,-565688.5828209810424596071 6795655.7299079764634370804,-565472.0664113903185352683 6796258.2495336793363094330,-565131.9853670147713273764 6799421.9422668581828474998,-539281.1505760198924690485 6802636.4299470074474811554,-537920.6037595437373965979 6802887.6607939898967742920,-537487.6822598505532369018 6803239.6503190854564309120,-530746.6191753724124282598 6811785.0676737958565354347,-529788.0470401511993259192 6813344.8049502596259117126,-528334.7710878457874059677 6816464.0953564802184700966,-527314.3053157423855736852 6818880.6518225604668259621,-525737.2420896753901615739 6820592.5748667381703853607,-519800.2396871982491575181 6823714.6641129478812217712,-517295.5511443483410403132 6824420.2928618714213371277,-516646.1132350615225732327 6824521.3092674687504768372,-515038.2145100419293157756 6824420.2928618714213371277,-511018.3563780072727240622 6823966.3693792633712291718,-503968.1590675974148325622 6823815.6716964272782206535,-500937.7085697310394607484 6824822.9151354199275374413,-500412.0579342058044858277 6825074.8363033309578895569,-477777.1319127358729019761 6840455.9986039269715547562,-471067.1269661900005303323 6845252.9463985934853553772,-466830.6411050704773515463 6850253.9696522578597068787,-461202.8842480161692947149 6858243.5609792144969105721,-459842.3374315428663976490 6860874.3301865793764591217,-456224.3426612690673209727 6869482.4721138169988989830,-455853.3147984552197158337 6870900.3640763349831104279,-455513.2337540825246833265 6872370.1356682535260915756,-451926.2971217410522513092 6888451.3487260565161705017,-452080.8085749612073414028 6892157.9926208704710006714,-454245.4160734384204261005 6900799.5060561988502740860,-459069.2235679829027503729 6909094.0329884337261319160,-459347.6336144558736123145 6909653.4035110054537653923,-459471.3095687262248247862 6910314.7279802327975630760,-459316.6867960147792473435 6911079.8647817652672529221,-457121.1324790993239730597 6918670.8410148052498698235,-451215.0768950632773339748 6930758.7002626033499836922,-452328.2718029959360137582 6932136.9039406375959515572,-459811.3906131017720326781 6941996.8956455085426568985,-461542.9652923917165026069 6945218.3859691601246595383,-461790.4285204235929995775 6945781.5711939493194222450,-461914.1044746939442120492 6946446.0665490739047527313,-461914.1044746939442120492 6947213.1862867726013064384,-460460.8285223885322920978 6960216.4198623634874820709,-460306.0944301859126426280 6961035.5885519329458475113,-460089.6893400835106149316 6961599.8879740536212921143,-459378.4691134057356975973 6962727.3147383863106369972,-458450.8437966256169602275 6963495.9969000769779086113,-460151.5829769656993448734 6967188.0293207084760069847,-471252.5852378512499853969 6967289.3793843016028404236,-479725.2230016194516792893 6965545.9311952916905283928,-480498.2255456881248392165 6965341.8000272838398814201,-491382.8227164713316597044 6961702.6430851500481367111,-494320.4327590144239366055 6959448.2372251432389020920,-498402.0732084428891539574 6956221.0161899179220199585,-500968.6553881721338257194 6951510.4893854716792702675,-505328.7058840707759372890 6944809.6918431045487523079,-526293.8395436417777091265 6942662.3653290001675486565,-527747.2268154383637011051 6942559.8543665027245879173,-528489.2825410659424960613 6942712.9771497584879398346,-529447.8546762871555984020 6943429.1226814882829785347,-529976.8448965380666777492 6944058.2645517345517873764,-529015.0444960824679583311 6947366.2139230202883481979,-527778.1736338793998584151 6949669.3476609392091631889,-525644.5129538433393463492 6952739.1353130275383591652,-517759.4194624854717403650 6962112.2008093828335404396,-514172.4828301439411006868 6966213.3620561584830284119,-510523.6525609202799387276 6968930.5431283572688698769,-506812.9286548172240145504 6969854.5729465251788496971,-505421.4350199028267525136 6970161.8679190166294574738,-503906.3767502064583823085 6971136.8320272667333483696,-501587.1464790178579278290 6973035.2043069805949926376,-496763.3389844733756035566 6977501.6763582713901996613,-485847.7949952490744180977 6987879.3680515941232442856,-485074.6811316891689784825 6988805.7774775763973593712,-484765.5469057575101032853 6989370.7456465400755405426,-484301.6785876204376108944 6990708.3542606756091117859,-483683.1874967747135087848 6994618.0482657440006732941,-483590.4583609426626935601 6995492.8107249001041054726,-482044.3419533139676786959 7003782.8049474963918328285,-467139.8866504933102987707 7021213.6930979220196604729,-462347.0259743899223394692 7024828.9599360972642898560,-460646.2867940498399548233 7025603.6477430770173668861,-459873.1729304898763075471 7025603.6477430770173668861,-456997.4565248289727605879 7025189.3310140827670693398,-452668.3528473686310462654 7024983.6683287052437663078,-447349.8415357400663197041 7027049.4621537392958998680,-445618.1555369588313624263 7027876.8226692667230963707,-429074.8546906802803277969 7035785.7280582245439291000,-415530.9462043329258449376 7036872.6628930959850549698,-414943.4019319283543154597 7036561.4830648237839341164,-411047.2197541639907285571 7035993.1596986297518014908,-402203.5541275819996371865 7034802.8288447102531790733,-401492.3339009042829275131 7034906.3449965324252843857,-399575.1896304617985151708 7035372.3705378724262118340,-385351.0077358777634799480 7042512.3223147960379719734,-377156.6686990942107513547 7046810.1867410531267523766,-374342.7346108242636546493 7047276.7238292396068572998,-371405.1245682783192023635 7047484.4553862772881984711,-369889.9549790907767601311 7047484.4553862772881984711,-369024.1119797016144730151 7047380.5889292778447270393,-357521.1350375611218623817 7038216.7792665986344218254,-348491.8998198266490362585 7030771.2148909578099846840,-347471.4340477260411716998 7030047.1925449492409825325,-345337.7733676899224519730 7028961.1894702669233083725,-343821.2679446131805889308 7031238.3010051175951957703,-343266.0063245359924621880 7031959.4539151135832071304,-343049.6012344364426098764 7032631.1619424512609839439,-343142.3303702656994573772 7033355.4194014230743050575,-347997.1960027425084263086 7043341.2922983570024371147,-351120.2643169468501582742 7047690.8870053039863705635,-352264.2947238293709233403 7049142.2134381914511322975,-352821.0034972869325429201 7049504.9931898834183812141,-353594.0060413556639105082 7050385.9920698264613747597,-354799.9300851204316131771 7052562.3267318932339549065,-355171.0692674226011149585 7053805.3343668170273303986,-355356.6388585751410573721 7054635.2962300619110465050,-354799.9300851204316131771 7055672.1704734433442354202,-354026.9275410517002455890 7056606.4997908826917409897,-352975.6262699983781203628 7057384.1023639896884560585,-342389.4766540309065021574 7058931.3191051157191395760,-341664.2301715115318074822 7059230.4899098463356494904,-340829.4453100546961650252 7059355.0543599035590887070,-340031.6185195372090674937 7059106.4876597877591848373,-339345.1112198169576004148 7058732.4383816169574856758,-338899.8332566422177478671 7058203.2344924295321106911,-338510.2150388660957105458 7057549.3410466406494379044,-337285.7006401418475434184 7054780.6931206267327070236,-337063.0616585530224256217 7053131.8355975281447172165,-332783.4951544989598914981 7051214.2909560613334178925,-327557.6016592083615250885 7040650.0641330182552337646,-325975.9743340178392827511 7039086.4692494664341211319,-322795.6878015432157553732 7036665.2083219364285469055,-320878.4322116123512387276 7035940.6495621176436543465,-318621.2068967971717938781 7035476.0802941126748919487,-309066.2097240461735054851 7037286.0983680160716176033,-306685.1971354694105684757 7039252.8183029191568493843,-306283.2224542145268060267 7039717.6081727687269449234,-300840.9238688215264119208 7047328.0035564331337809563,-300655.4655971602187491953 7048053.6005296036601066589,-301057.4402784151607193053 7048467.6176822083070874214,-301892.3364593632286414504 7048624.2784440144896507263,-302510.7162307205144315958 7048467.6176822083070874214,-307829.3388618432218208909 7046344.9821726074442267418,-308757.0754981145728379488 7045670.8101515313610434532,-309097.1565424872678704560 7045101.8355482658371329308,-309344.5084510279120877385 7044480.3351130951195955276,-317662.5234420846682041883 7042512.3223147960379719734,-318497.4196230327361263335 7042616.1251992043107748032,-319888.9132579499855637550 7043186.2265946781262755394,-320940.3258484916877932847 7043755.0641425708308815956,-328825.4193398524075746536 7049919.0859430814161896706,-329938.6142477851244620979 7051318.2075183065608143806,-334712.9958884173538535833 7060579.1393866641446948051,-335436.5725785738904960454 7062011.5247577866539359093,-345925.3176400973461568356 7085700.3273308007046580315,-345832.5885042680893093348 7087313.0469446722418069839,-345554.2897772835567593575 7087990.9518432654440402985,-344379.2012324686511419713 7090333.4216981232166290283,-342091.0290992152295075357 7094396.8940942101180553436,-331979.5457919891341589391 7111767.0194333102554082870,-331577.4597912430181168020 7112340.7957691308110952377,-331082.7559741588775068521 7112706.4776853527873754501,-327526.7661602584994398057 7115057.9622176717966794968,-323073.9865285278065130115 7117408.6407044371590018272,-322702.8473462227848358452 7117879.3493779106065630913,-322548.2245735113392584026 7118558.3705776063725352287,-322888.4169373752665705979 7119133.9567664228379726410,-323290.3916186302085407078 7119500.1409429926425218582,-323970.6650268668890930712 7119761.3350805733352899551,-325547.7282529338262975216 7120022.7260320717468857765,-327217.5206148328143171966 7120074.2901339065283536911,-330185.9661563285626471043 7119864.6483984775841236115,-333154.5230173127492889762 7119708.2675620289519429207,-334669.6926065003499388695 7120126.0427638562396168709,-336370.4317868376383557916 7121014.9235066156834363937,-337700.0317848726408556104 7122374.8803893411532044411,-338473.1456484326045028865 7123315.5991421435028314590,-339679.0696921973722055554 7125721.8406816367059946060,-339988.3152376202051527798 7126716.2602372914552688599,-340421.2367373161832801998 7128756.9069768153131008148,-340606.6950089774909429252 7130274.9713758537545800209,-340606.6950089774909429252 7131896.7979978239163756371,-339864.6392833498539403081 7152341.7575662042945623398,-339771.7988280265708453953 7153023.7466275608167052269,-339215.3126935514737851918 7154335.9240338336676359177,-338380.3051931121735833585 7155228.4729645876213908195,-336741.4596496514277532697 7156174.6245612036436796188,-326444.4067512757028453052 7160797.3695420371368527412,-322486.4422561203828081489 7169945.3185568284243345261,-315436.1336262193508446217 7186270.5503361336886882782,-313642.6653100471594370902 7197242.8650309965014457703,-313209.8551298452657647431 7212459.8563267467543482780,-325795.0801614772644825280 7199618.1586596202105283737,-326753.6522966985357925296 7198878.5228944523259997368,-350903.8592268444481305778 7185690.0477500427514314651,-357861.3274014250491745770 7188273.3185697188600897789,-359129.0337625779211521149 7188854.0116235781461000443,-359994.8767619699356146157 7189750.6675885217264294624,-376321.7725181461428292096 7216586.5188759565353393555,-379506.7344692326732911170 7222728.4333535833284258842,-379815.9800146555644460022 7224052.0884321387857198715,-379846.8155136054265312850 7225482.3899835590273141861,-382258.7749206232838332653 7236350.8898326409980654716,-385845.7115529647562652826 7242188.9024894414469599724,-388845.2152323900372721255 7246914.8814502703025937080,-392370.3695473405532538891 7251272.8605816522613167763,-395957.3061796791735105217 7255525.2811666997149586678,-402203.5541275819996371865 7263241.4929156471043825150,-404058.9160806335275992751 7266542.3048335723578929901,-404553.6198977176682092249 7267714.0249515157192945480,-404460.8907618884695693851 7268406.0951544297859072685,-397317.8529961553285829723 7292788.3670299844816327095,-381733.1242850980488583446 7326150.4946560785174369812,-377558.6433803490945138037 7337912.6026934264227747917,-376383.5548355370992794633 7339470.1102552358061075211,-366457.6411194635438732803 7349637.6401906181126832962,-365870.0968470561201684177 7350014.7357774116098880768,-364014.7348940045922063291 7350498.0494048753753304482,-357180.9426736971363425255 7352059.6247507967054843903,-355634.9375855597318150103 7352167.5918185878545045853,-355047.3933131523081101477 7351898.3553642285987734795,-354552.5781765769352205098 7351413.4043160993605852127,-354367.0085854243952780962 7350659.2898099292069673538,-353872.3047683374024927616 7350337.0061289258301258087,-349141.2264096250291913748 7348561.4872619006782770157,-348368.2238655562978237867 7348561.4872619006782770157,-345461.4493219630676321685 7349044.9045187048614025116,-336896.0824223656672984362 7351305.4476988706737756729,-336741.4596496514277532697 7352059.6247507967054843903,-336525.0545595490257255733 7356152.7590438164770603180,-337421.7330578909022733569 7357068.5847051348537206650,-338565.8747842646553181112 7357768.6180988922715187073,-339638.6607170382048934698 7357959.4943135073408484459,-341070.5633271117694675922 7357068.5847051348537206650,-341627.1607810780988074839 7356852.5161710949614644051,-349945.1757721348549239337 7355075.5119649851694703102,-350687.3428172536659985781 7355075.5119649851694703102,-374095.3827022807672619820 7356313.9225882794708013535,-375857.9042000090121291578 7356529.9761815508827567101,-377434.9674260788015089929 7356852.5161710949614644051,-383526.5926012673298828304 7359223.5853684665635228157,-397534.2580862577306106687 7360086.4123517451807856560,-398554.7238583611906506121 7356368.6142240101471543312,-398647.4529941903892904520 7355506.0050766775384545326,-402512.7996730048907920718 7337697.0645915912464261055,-403966.0756253130966797471 7338126.5988389421254396439,-410645.2450729091069661081 7338824.9327172618359327316,-411449.1944354160805232823 7338824.9327172618359327316,-424374.6118309149169363081 7332592.8358689714223146439,-430775.4825515291304327548 7324165.3088273415341973305,-440113.9633146864944137633 7316871.5715599860996007919,-441381.7809953305986709893 7316443.2056702664121985435,-442989.7910398386302404106 7316443.2056702664121985435,-455915.2084353374084457755 7316925.9872876051813364029,-460398.9348855091957375407 7318265.8529948890209197998,-484054.2153595885611139238 7334311.5376756498590111732,-484549.0304961639340035617 7334795.4259652942419052124,-487146.5594943342730402946 7338449.9260353958234190941,-487672.2101298595080152154 7339524.6838094489648938179,-487795.8860841326531954110 7340277.7217413242906332016,-487517.5873571481206454337 7342051.3544057011604309082,-487548.5341755892150104046 7342804.6364329317584633827,-487734.1037667416967451572 7343450.1433990737423300743,-488135.9671285054064355791 7343933.2437204523012042046,-489032.7569463356630876660 7344041.0982611542567610741,-489589.3544003019924275577 7343718.8945121262222528458,-492403.2884885747916996479 7339201.3120461301878094673,-492650.6403971154359169304 7338610.7239055326208472252,-493052.6150783703196793795 7337105.0426507415249943733,-493021.6682599292253144085 7335440.2702085031196475029,-492928.9391241000266745687 7334795.4259652942419052124,-491042.7416720986366271973 7328136.1856125276535749435,-485322.1443597238394431770 7317569.5495664961636066437,-483806.8634510450647212565 7305998.1589573910459876060,-483714.1343152130139060318 7305249.9621166158467531204,-484023.3798606386990286410 7303697.7255198266357183456,-484889.2228600278613157570 7301556.6574587998911738396,-485909.6886321313213557005 7300059.6450568856671452522,-487115.6126758931786753237 7299364.7697884002700448036,-488383.3190370460506528616 7299150.2931946692988276482,-490053.2227184362709522247 7299417.7159931827336549759,-500535.7338884761556982994 7303643.4018597202375531197,-501617.9819779677200131118 7304392.9861292643472552299,-507276.7969729543547146022 7311085.0218444764614105225,-507493.2020630567567422986 7311675.0732801137492060661,-507616.8780173270497471094 7313174.3129446320235729218,-507802.4476084795896895230 7313817.3732218593358993530,-511915.1461958375293761492 7319337.8339232783764600754,-521068.0573678423534147441 7323092.6648230087012052536,-527716.2799969972111284733 7327331.1827524537220597267,-534024.4215817794902250171 7333398.1884740386158227921,-534921.1000801213085651398 7334366.0751424813643097878,-535910.6190337808802723885 7335064.0723519250750541687,-537178.4367144248681142926 7335601.1994602633640170097,-540146.8822559206746518612 7336407.0562121253460645676,-544785.2314788039075210690 7333184.3220268506556749344,-547722.9528408382320776582 7330766.6467525400221347809,-548619.6313391772564500570 7329853.9057584553956985474,-549423.5807016870239749551 7328888.1247963691130280495,-552268.4616083981236442924 7323628.9683988010510802269,-552361.1907442301744595170 7322716.8687183316797018051,-552144.6743346365401521325 7321912.6177066862583160400,-550444.0464737876318395138 7316871.5715599860996007919,-546795.2162045668810606003 7307068.6501135462895035744,-545465.6162065317621454597 7304072.6075961450114846230,-544445.1504344283603131771 7303268.7329980144277215004,-543795.7125251415418460965 7302948.2079297648742794991,-542868.0872083613649010658 7302145.9897665642201900482,-542156.8669816836481913924 7301021.8672180408611893654,-541940.4618915813043713570 7300487.1135643599554896355,-540548.9682566639967262745 7290651.8225432001054286957,-540858.2138020896818488836 7289957.7827585916966199875,-541476.5935734441736713052 7289850.6726551959291100502,-547970.3047493788180872798 7292414.2180133098736405373,-549083.4996573114767670631 7293162.7263257186859846115,-550042.0717925328062847257 7294018.4720156816765666008,-550846.0211550425738096237 7294872.7719973642379045486,-551247.9958362975157797337 7295514.3279841132462024689,-552206.5679715187288820744 7298722.8977807499468326569,-552515.8135169416200369596 7300059.6450568856671452522,-552546.7603353826561942697 7300754.5821008244529366493,-552330.2439257890218868852 7301449.3883516052737832069,-551526.2945632792543619871 7302520.6048074951395392418,-551124.3198820272227749228 7303910.9784320062026381493,-551804.4819707726128399372 7308246.4561829632148146629,-552144.6743346365401521325 7308783.0904304319992661476,-557154.0514203335624188185 7316067.9224346978589892387,-560524.5829625726910308003 7319713.4673932855948805809,-564915.4689574239309877157 7324272.8903694152832031250,-568007.8130921697011217475 7327331.1827524537220597267,-569213.7371359316166490316 7328780.4796105446293950081,-569955.9041810504859313369 7329800.7528070313856005669,-571285.5041790854884311557 7331895.0597502989694476128,-572429.5345859680091962218 7334203.8176293242722749710,-575521.7674012253992259502 7340760.6255087079480290413,-576233.0989473944064229727 7342588.9630549391731619835,-576573.1799917670432478189 7344041.0982611542567610741,-577129.7774457334307953715 7346676.9306908566504716873,-577268.8154897345229983330 7349194.1014714818447828293,-577253.4534000037238001823 7349798.8627920215949416161,-576449.5040374967502430081 7359709.0229227598756551743,-575985.6357193596195429564 7361972.6634850092232227325,-574656.0357213246170431376 7363591.2837319280952215195,-573542.8408133919583633542 7364130.3809066936373710632,-568286.0004996630595996976 7366503.6677023600786924362,-562627.2968241675989702344 7370927.3331355582922697067,-562503.6208698945119976997 7371845.0929058594629168510,-558112.7348750460660085082 7387460.6773691773414611816,-557865.3829665025696158409 7388165.0084091825410723686,-556504.7248305380344390869 7389462.0636020163074135780,-553690.7907422651769593358 7392006.5564168058335781097,-549361.6870648048352450132 7396606.9521838556975126266,-541940.4618915813043713570 7404517.6976240603253245354,-541631.2163461584132164717 7405114.6755043659359216690,-541445.7580744943115860224 7405872.7220549043267965317,-539652.1784388336818665266 7414335.5076649766415357590,-538693.7176231037592515349 7422426.8887438448145985603,-538600.8771677832119166851 7424111.9521764740347862244,-538291.6316223575267940760 7424709.0696901064366102219,-528798.5280864888336509466 7441684.9049287764355540276,-528396.5534052366856485605 7442229.6465787151828408241,-526417.5154979120707139373 7443863.5129646947607398033,-524716.8876370631624013186 7444789.7393481815233826637,-521253.6269589948933571577 7446533.6286841230466961861,-518377.7992338399053551257 7447078.5152014587074518204,-517728.4726440443191677332 7447297.1084670927375555038,-516677.0600535026169382036 7448005.1261356342583894730,-516275.0853722477331757545 7448496.3416110388934612274,-513615.8853761776117607951 7456840.9701854353770613670,-513553.9917392954230308533 7458533.3387779006734490395,-514512.5638745166943408549 7461918.0069793518632650375,-514728.9689646190381608903 7462573.4907166687771677971,-518687.0447792655904777348 7471700.5883307904005050659,-521624.6548218086827546358 7478374.5869022384285926819,-521933.9003672315157018602 7479029.8906536586582660675,-522645.1205939092906191945 7480070.2945414464920759201,-523046.9839556729421019554 7480563.3530168291181325912,-524067.4497277764021418989 7481384.3986715553328394890,-526479.4091347942594438791 7482698.7262673750519752502,-530901.2419480838580057025 7484834.6896913861855864525,-535848.8367163898656144738 7488176.6438662633299827576,-541105.5657106303842738271 7493438.3433833224698901176,-542775.3580725293140858412 7495357.3164986893534660339,-545898.5377062249463051558 7496894.0233288249000906944,-547228.0263847715687006712 7498319.6308487802743911743,-547351.8136585331521928310 7499856.9274073811247944832,-543362.7910254455637186766 7544934.3906168844550848007,-543208.2795722252922132611 7545706.2707003252580761909,-542806.3048909704666584730 7546259.7905436092987656593,-537011.4574782375711947680 7548368.4992670519277453423,-534043.0119367417646571994 7549030.5716537795960903168,-533504.8935182493878528476 7548932.1518849516287446022,-533152.4560103978728875518 7548733.3279079142957925797,-532354.6292198804439976811 7547871.8829430760815739632,-528953.1508592030731961131 7547694.3573386920616030693,-524685.9408186221262440085 7545375.7677722154185175896,-523881.9914561150944791734 7545210.4222629889845848083,-508761.0197437008027918637 7542725.6989457299932837486,-503504.2907494603423401713 7542230.2410548646003007889,-498896.9996645094943232834 7542725.6989457299932837486,-499731.7845259663299657404 7543720.0881354566663503647,-501061.4958434926229529083 7544326.5199617613106966019,-515100.1081469241180457175 7547583.6295554768294095993,-531727.9004867146722972393 7554389.6878355210646986961,-535463.4486392636317759752 7553722.5784520916640758514,-540412.9358389149419963360 7555725.6721437172964215279,-541720.3832582823233678937 7564745.5551264593377709389,-540973.3181555690243840218 7572438.5017515700310468674,-539479.0766306512523442507 7575617.7549175210297107697,-537517.9611613443121314049 7580976.2699969690293073654,-541813.7803110589738935232 7579468.4106733193621039391,-543401.4188887506024912000 7572606.0290160523727536201,-545269.1373052808921784163 7554723.5626798011362552643,-546950.1729357491713017225 7550718.4179797386750578880,-548631.2085662202443927526 7545214.9930646773427724838,-552361.1907442301744595170 7534563.4486953206360340118,-554247.3881962315645068884 7531806.7938464414328336716,-554927.7729239594191312790 7531531.4404878914356231689,-555638.8818311459617689252 7531476.8867755979299545288,-557958.0007828433299437165 7531973.2405976857990026474,-559473.2816915222210809588 7532524.1871358714997768402,-568842.7092731178272515535 7539140.4077039826661348343,-575892.9065835303626954556 7544326.5199617613106966019,-579542.7387281695846468210 7542881.0575838973745703697,-581597.2512502502650022507 7538882.0674366783350706100,-582157.6335669015534222126 7533387.0918295802548527718,-579758.1419428536901250482 7527510.9738995777443051338,-579170.5976704462664201856 7525363.3668284397572278976,-579356.1672615987481549382 7524481.7385187903419137001,-579758.1419428536901250482 7523931.1683868365362286568,-580500.3089879725594073534 7523820.9798069568350911140,-589158.4050233991583809257 7528116.1310436213389039040,-590364.4403866550419479609 7528722.7238455498591065407,-590797.2505668598460033536 7529382.5146479764953255653,-594291.5693828605581074953 7537981.6177929006516933441,-594477.1389740130398422480 7538699.5863360874354839325,-594507.9744729629019275308 7539526.8421414215117692947,-594538.9212914011441171169 7543720.0881354566663503647,-591075.5492938415845856071 7558912.3560458663851022720,-591038.4799034082097932696 7559476.5824041925370693207,-590945.7507675761589780450 7559908.8388476064428687096,-587884.4647707627154886723 7565285.9010660173371434212,-587049.5685898117953911424 7566713.4577158931642770767,-579170.5976704462664201856 7581785.9207013463601469994,-578706.7293523119296878576 7582340.4458873094990849495,-564637.2815499305725097656 7595721.0870233085006475449,-553721.7375607063295319676 7605005.9760906687006354332,-550726.7979804017813876271 7608345.4135369891300797462,-548032.0870667698327451944 7611351.3489257842302322388,-547475.4896128034451976418 7612576.5869784224778413773,-547753.7883397880941629410 7613243.4136294042691588402,-548526.9022033452056348324 7613133.3411337248980998993,-560184.5019181999377906322 7604839.3427863111719489098,-579510.6787148189032450318 7585779.9151765964925289154,-583190.5671219720970839262 7582119.5895048100501298904,-585416.8456183490343391895 7579734.1062304284423589706,-588595.6849974404321983457 7575166.4594591846689581871,-590655.0955771155422553420 7572207.9582950612530112267,-591861.0196208803681656718 7569449.3521843859925866127,-594328.5274538027588278055 7565297.4575516693294048309,-596239.6604717412265017629 7563371.5499128662049770355,-600104.8958310673478990793 7558415.6560810878872871399,-600878.0096946244593709707 7558304.7739343997091054916,-601589.1186018137959763408 7558359.5180620308965444565,-603722.7792818470625206828 7559077.7971014725044369698,-604341.1590532043483108282 7559410.4817635063081979752,-604650.4045986272394657135 7559963.3952792305499315262,-603227.9641452716896310449 7539857.0941298268735408783,-598898.8604678113479167223 7508862.2448687991127371788,-601589.1186018137959763408 7506114.7613255186006426811,-606072.8450519855832681060 7500569.7742751771584153175,-606412.9260963583365082741 7499966.7742423238232731819,-607062.3640056450385600328 7496345.6157262232154607773,-607464.2273674088064581156 7495851.5490331957116723061,-608793.9386849350994452834 7492726.1545226909220218658,-610742.0297738186782225966 7487682.9021548954769968987,-618401.7012963209999725223 7442711.2787298168987035751,-616184.3283592087682336569 7439561.0136069916188716888,-615906.0296322270296514034 7439016.6555541269481182098,-614019.8321802256396040320 7433083.3396282317116856575,-613896.1562259553465992212 7432376.4882230628281831741,-614823.7815427355235442519 7430526.9147069631144404411,-616184.3283592087682336569 7428243.0212605353444814682,-619709.4826741593424230814 7423568.6777871046215295792,-622925.3914436870254576206 7421449.5475499229505658150,-638726.6365643379976972938 7418788.0563712492585182190,-640365.4821077958913519979 7418732.9238223517313599586,-641849.7048785451333969831 7419059.6192177310585975647,-643148.3580581390997394919 7419656.1524058720096945763,-644075.9833749192766845226 7420579.6864177007228136063,-644292.4997845129109919071 7421285.4633120549842715263,-644539.9630125447874888778 7422752.1748917521908879280,-645127.5072849522111937404 7432104.4586815088987350464,-645189.2896023431094363332 7434661.4039742629975080490,-645096.4491470198845490813 7437165.3010793505236506462,-644941.9376937996130436659 7437981.7554277461022138596,-644292.4997845129109919071 7439179.5473105553537607193,-641107.5378334262641146779 7443318.8525478057563304901,-637582.4948379641864448786 7446044.1072282148525118828,-636871.1632917951792478561 7447078.5152014587074518204,-636623.8113832544768229127 7447788.0827978411689400673,-636345.6239757612347602844 7449477.0995066165924072266,-636531.0822474224260076880 7462465.3537021325901150703,-634706.6671128120506182313 7476951.2756828563287854195,-631088.8949815207161009312 7491354.2706713257357478142,-624255.1027612133184447885 7510510.2550652492791414261,-624718.8597598591586574912 7510785.0565796466544270515,-628676.8242550116265192628 7515018.5136068165302276611,-631428.9760258934693410993 7519417.6984367296099662781,-631645.3811159958131611347 7520078.0798785584047436714,-631929.9137344639748334885 7536007.3507909551262855530,-631985.5734798597404733300 7536470.6476539000868797302,-632059.7122607295168563724 7538423.1922929277643561363,-631837.0732791435439139605 7540872.3651104364544153214,-631391.7953159686876460910 7541567.9585998225957155228,-630557.0104545118520036340 7542361.9494845289736986160,-629499.3639724837848916650 7543488.2180768847465515137,-627130.8191668741637840867 7551672.0716077527031302452,-621348.3282176200300455093 7560738.1781936613842844963,-621008.1358537561027333140 7561345.9525353331118822098,-620111.4573554142843931913 7565827.8790837377309799194,-620729.9484462627442553639 7565995.0630998956039547920,-621472.0041718903230503201 7565884.0716371666640043259,-623110.9610348395071923733 7564832.2231024028733372688,-626234.0293490438489243388 7562508.4646861730143427849,-630018.8920360166812315583 7555141.8220489416271448135,-630204.4616271691629663110 7554776.6895123803988099098,-630965.1077077591326087713 7553317.9241124149411916733,-631206.2257248162059113383 7552986.2984898770228028297,-631651.6150074822362512350 7552921.0492999963462352753,-632022.6428702960256487131 7553119.1857457403093576431,-632226.6914969196077436209 7553450.8170948037877678871,-632282.3512423154897987843 7556269.9622159684076905251,-632263.8722068442730233073 7556701.0433939341455698013,-631837.0732791435439139605 7557961.5868970239534974098,-628089.2799826069967821240 7566991.0689534870907664299,-627007.1432126038707792759 7568762.5962103353813290596,-623543.7712150443112477660 7573636.8009063620120286942,-619307.5079929071944206953 7581009.0137706603854894638,-614607.2651331418892368674 7590887.6317691532894968987,-614359.9132245983928442001 7591720.5208720434457063675,-613555.9638620885089039803 7594665.1462415019050240517,-613586.9106805296614766121 7595498.2452233731746673584,-614112.5613160548964515328 7595830.9100026590749621391,-614792.9460437856614589691 7595553.2549406941980123520,-615844.2473148361314088106 7594831.3587708855047821999,-618812.6928563290275633335 7592220.7775808572769165039,-620482.5965377192478626966 7590332.4891860084608197212,-623141.7965337893692776561 7590277.5168613130226731300,-623018.1205795190762728453 7608901.8606251943856477737,-622987.2850805692141875625 7610571.4441312914714217186,-620451.5383997869212180376 7623330.6740666655823588371,-619956.8345827028388157487 7624781.3151242770254611969,-615163.9739065994508564472 7633152.0074393870308995247,-615102.0802697172621265054 7634828.4906064746901392937,-614978.4043154468527063727 7635609.2590998029336333275,-614607.2651331418892368674 7636336.4125423133373260498,-605268.8956894756993278861 7642952.9402038650587201118,-604267.0202723346883431077 7644261.3506676610559225082,-603413.5337364242877811193 7645100.8640749985352158546,-593506.0990558217745274305 7645737.5061285542324185371,-592634.1334844402736052871 7645569.9848064649850130081,-590945.7507675761589780450 7644428.8433526214212179184,-583499.7013479066081345081 7645782.8100005267187952995,-582850.3747581081697717309 7645615.4890336738899350166,-581180.5823962091235443950 7645670.6582383047789335251,-580036.4406698354287073016 7646286.8084915485233068466,-579046.9217161758570000529 7647125.5371557772159576416,-578119.2963993957964703441 7648187.3202392403036355972,-571687.4788603404304012656 7655576.1483199028298258781,-570017.6864984413841739297 7657705.2339517800137400627,-568595.3573645771248266101 7660170.3822070378810167313,-564235.1955491844564676285 7670151.6414698222652077675,-563987.8436406437540426850 7670825.3199614593759179115,-564328.0360045077977702022 7671273.7985344389453530312,-565070.2030496265506371856 7671161.2723834570497274399,-565595.7423656606115400791 7670655.6322282897308468819,-566338.0207302706548944116 7669590.7257001409307122231,-567265.6460470508318394423 7667626.3301212359219789505,-568162.3245453898562118411 7664542.7202141098678112030,-569461.0890444751130416989 7661178.6958307139575481415,-577871.9444908523000776768 7650929.2628415934741497040,-579201.5444888873025774956 7649363.0664271879941225052,-580469.3621695314068347216 7648915.6693822499364614487,-582077.2608945482643321157 7648691.4770984323695302010,-582788.4811212287750095129 7648748.2799130156636238098,-597600.2072882173815742135 7653426.8951496751978993416,-600976.8614024488488212228 7654300.2713927906006574631,-598584.7168647940270602703 7662862.7428454048931598663,-597063.4247036112938076258 7661618.9416700415313243866,-594855.5139232198707759380 7661719.6247330401092767715,-594336.0971791782649233937 7661786.6129962932318449020,-593593.9301340593956410885 7662122.9755862103775143623,-584767.5190285505959764123 7668749.5301919383928179741,-584334.5975288546178489923 7669253.4285087063908576965,-584025.3519834318431094289 7669871.2794329514726996422,-583932.6228475997922942042 7670768.1509353239089250565,-584767.5190285505959764123 7670768.1509353239089250565,-591372.4383757885079830885 7670610.9888196662068367004,-591724.9872031311970204115 7670342.1238500587642192841,-592504.2236386835575103760 7669466.7117092106491327286,-593747.2170728817582130432 7668557.6738326698541641235,-594396.6549821684602648020 7668120.8651574626564979553,-595157.3010627584299072623 7667784.2386079188436269760,-595713.8985167248174548149 7667784.2386079188436269760,-596530.3156622046371921897 7668120.8651574626564979553,-598478.4067510853055864573 7669938.3391573987901210785,-597995.9480779886944219470 7671183.4946518354117870331,-599239.0528316752752289176 7675371.7275347234681248665,-591632.2580672991462051868 7690264.7426660489290952682,-583561.5949847858864814043 7701524.7897592484951019287,-576233.0989473944064229727 7711221.1246676445007324219,-571501.9092691878322511911 7717824.3887505372986197472,-571161.8282248151954263449 7718446.1837435495108366013,-570141.3624527116771787405 7721947.3952255463227629662,-569955.9041810504859313369 7722738.7454501269385218620,-573790.1927219354547560215 7719179.8410347662866115570,-577624.5925823088036850095 7714549.7747569298371672630,-582664.8051669556880369782 7707837.9005845338106155396,-597043.6098342511104419827 7691334.1557144531980156898,-619369.4016297865891829133 7666785.1488293502479791641,-622585.1990798230981454253 7663477.0502433264628052711,-623605.6648519237060099840 7662524.1280005862936377525,-631954.6266614214982837439 7657369.8722159853205084801,-633377.0671147770481184125 7660450.5904816919937729836,-634242.7987946749199181795 7661347.9715940030291676521,-644601.7453299356857314706 7666281.4131772564724087715,-648621.6034619703423231840 7667122.5390420444309711456,-655022.4741825846722349524 7669365.7246035486459732056,-656290.2918632287764921784 7670094.6794743090867996216,-660186.4740409930236637592 7672676.3729850547388195992,-661547.1321769604692235589 7674079.4069835711270570755,-667453.0764415052253752947 7681099.8598617259413003922,-668721.0054416406201198697 7682729.6276842541992664337,-669184.8737597776344045997 7683966.1445693038403987885,-669153.8156218453077599406 7684753.5647499328479170799,-668844.6813959137070924044 7686384.3149067135527729988,-668009.7852149627869948745 7687508.6565122948959469795,-667112.9953971325885504484 7688409.2208956573158502579,-666525.4511247250484302640 7688801.6313156671822071075,-665103.1219908607890829444 7689195.4793882267549633980,-654849.3723743992159143090 7690264.7426660489290952682,-634428.3683858275180682540 7695555.5464410297572612762,-628800.6115287760039791465 7695048.4914979264140129089,-624780.6420772472629323602 7695385.5110735064372420311,-618503.4473109061364084482 7696118.5749691501259803772,-617266.5764487031847238541 7696681.4423376144841313362,-617483.0928582940250635147 7697412.8062782948836684227,-617977.9079948721919208765 7697862.8488564118742942810,-638912.0948359991889446974 7701411.8169762650504708290,-641447.6188777990173548460 7701467.5932758646085858345,-642282.6263782383175566792 7701243.2736175647005438805,-643364.8744677299400791526 7700622.6767362505197525024,-644849.0972384791821241379 7699327.6982208164408802986,-648572.1776080582058057189 7697333.9501986689865589142,-650334.6991057891864329576 7695340.7228882731869816780,-651076.7548314168816432357 7695002.8946825573220849037,-658918.7676798402098938823 7693753.0400504823774099350,-689222.2707830744329839945 7694935.6145458146929740906,-691201.3086903991643339396 7695837.0555134583264589310,-692932.9946891774889081717 7697920.2210562909021973610,-693613.2680974169634282589 7699046.2631236556917428970,-694077.1364155513001605868 7701130.3050026390701532364,-694107.9719145011622458696 7702088.0560450982302427292,-694077.1364155513001605868 7702933.1348811537027359009,-693829.7845070078037679195 7703609.5088090514764189720,-689500.6808295502560213208 7708739.2431454947218298912,-689098.5948288041399791837 7709191.5786064267158508301,-683501.6734706996940076351 7710770.0903161438181996346,-664237.2789914688328281045 7715340.3573290472850203514,-662752.9449012310942634940 7715622.5974873211234807968,-662196.3474472648231312633 7715284.6826785169541835785,-661268.7221304846461862326 7714380.9408367108553647995,-657341.7044537704205140471 7710543.8724155491217970848,-653167.1122295331442728639 7707724.8342732694000005722,-651590.0490034633548930287 7707555.9483984513208270073,-650755.2641420065192505717 7708570.5378203485161066055,-645498.5351477660005912185 7717146.7529787486419081688,-646271.5376918347319588065 7718219.7379818670451641083,-650044.0439153286861255765 7720082.5254447590559720993,-651188.1856416997034102678 7720931.0242721689864993095,-651930.2413673300761729479 7722003.1185607267543673515,-652177.7045953619526699185 7722567.8995877066627144814,-652208.6514138031052425504 7723528.5505657941102981567,-652115.8109584797639399767 7724376.0091261854395270348,-651713.8362772277323529124 7724998.3388804411515593529,-651219.0211406495654955506 7725336.6846215771511197090,-644076.0946944104507565498 7727395.3631055718287825584,-640458.2112436279421672225 7727994.7370103215798735619,-639530.5859268477652221918 7727881.3713351078331470490,-638200.8746093214722350240 7727316.1963596548885107040,-636531.0822474224260076880 7727371.9589690761640667915,-630593.9685254540527239442 7732517.9178758235648274422,-630161.0470257580745965242 7733367.8027516771107912064,-630408.5102537928614765406 7733933.4269130388274788857,-631459.9228443345054984093 7734837.8610719582065939903,-638850.3125186110846698284 7738404.0893538175150752068,-639716.0441985090728849173 7738460.1370096830651164055,-642035.2744696948211640120 7738177.0496157137677073479,-647663.0313267491292208433 7736762.1780209625139832497,-652919.7603209896478801966 7735517.0721114641055464745,-654404.0944112273864448071 7735347.7729902314022183418,-655331.7197280074469745159 7735517.0721114641055464745,-658702.2512702465755864978 7736875.6759526571258902550,-659227.9019057718105614185 7737272.2188107650727033615,-648961.6845063430955633521 7760288.7283806502819061279,-648095.9528264451073482633 7761366.3798615131527185440,-646333.3200092256302013993 7762445.6152568906545639038,-645003.8313306790078058839 7762901.1521260682493448257,-641583.7626150393625721335 7762207.8391226036474108696,-640210.8593350844457745552 7762514.3120678337290883064,-638745.1155998090980574489 7762616.3361555505543947220,-638411.1571274314774200320 7762377.7368747051805257797,-638207.1085008051013574004 7762072.0872090365737676620,-637743.2401826707646250725 7760845.3187552774325013161,-637001.0731375518953427672 7759448.0945486947894096375,-634211.9632957250578328967 7757904.6196566373109817505,-631367.0823890140745788813 7755974.9503435604274272919,-630192.1051636904012411833 7755236.3097380781546235085,-628831.5583472142461687326 7754555.3368382360786199570,-628212.9559368772897869349 7754329.2444388270378112793,-626697.8976671809796243906 7754612.9332659207284450531,-621070.0294906354974955320 7756031.1275500915944576263,-619616.7535383300855755806 7756484.6460112733766436577,-616493.5739046344533562660 7757960.8111166683956980705,-614916.6219980559544637799 7758869.7401065547019243240,-614514.5359973098384216428 7759379.6298020500689744949,-614731.0524069034727290273 7760061.0347683196887373924,-615565.9485878542764112353 7760004.8277892693877220154,-617544.9864951762137934566 7759153.3939628023654222488,-618534.5054488385794684291 7758300.6250465279445052147,-619956.8345827028388157487 7758017.0029918318614363670,-625182.7280779933789744973 7756995.8059862777590751648,-626883.4672583335777744651 7757051.9907327210530638695,-629388.1558011806337162852 7758472.0703078443184494972,-642715.5478779342956840992 7769435.4249468790367245674,-643890.5251032579690217972 7770230.0911059072241187096,-644230.7174671218963339925 7770742.3806787393987178802,-644447.1225572242401540279 7771481.0963116846978664398,-644385.2289203420514240861 7772277.6141412789002060890,-644075.9833749192766845226 7774041.0589115936309099197,-643272.0340124093927443027 7776087.9705479899421334267,-642529.9782867818139493465 7777169.2983204172924160957,-637273.2492925412952899933 7783260.7100063404068350792,-633587.3496328842593356967 7782827.5264575220644474030,-629282.9588823814410716295 7783853.6354435244575142860,-628874.7503096428699791431 7783920.8857878400012850761,-626110.3533947735559195280 7783169.2740341397002339363,-625219.7974684268701821566 7782349.6796530755236744881,-624681.7903694228734821081 7781290.1600545877590775490,-620884.4598994828993454576 7780072.1718377582728862762,-618874.5864932112162932754 7779048.2127118976786732674,-616802.7081305660540238023 7778250.9848882425576448441,-615967.9232691064244136214 7778080.5270859887823462486,-614267.1840887691359966993 7778136.8678835537284612656,-601094.4147847268031910062 7781779.6237544631585478783,-601218.0907390000065788627 7782577.2220012359321117401,-601558.2831028639338910580 7783146.5177188478410243988,-601991.0932830687379464507 7783545.4806583048775792122,-603444.4805548653239384294 7784229.0558050507679581642,-605980.0045966622419655323 7784343.2643696963787078857,-607495.2855053411331027746 7784000.6438278378918766975,-610216.4904577818233519793 7783090.3447639672085642815,-617854.2320405989885330200 7783944.2595225675031542778,-627798.7361116348765790462 7792058.6766033601015806198,-628522.2014823001809418201 7792469.8080844217911362648,-628763.4308188485447317362 7792811.1688131410628557205,-628911.8197000763611868024 7793222.3410503147169947624,-628856.2712741717696189880 7793804.1375226667150855064,-628522.2014823001809418201 7808301.6504280986264348030,-624799.2324322096537798643 7809284.9224720466881990433,-624298.2947236419422551990 7809867.9519115211442112923,-619010.6189109602710232139 7812371.1263486817479133606,-617841.7642576318467035890 7812783.3599924026057124138,-617470.7363948180573061109 7812645.2602546168491244316,-616802.7081305660540238023 7811067.2737040109932422638,-616542.9997585467062890530 7810690.5234388047829270363,-611669.6550905987387523055 7809102.0406789267435669899,-610154.5968209024285897613 7807559.3439071569591760635,-609196.0246856812154874206 7806817.3156746942549943924,-606660.2780049017164856195 7805502.4915853813290596008,-604279.3767358134500682354 7804816.9980592103675007820,-603568.1565091356169432402 7805160.5595074025914072990,-601805.6350114046363160014 7807159.3224412053823471069,-601589.1186018137959763408 7807788.4659607233479619026,-613667.2833528829505667090 7817038.3112460924312472343,-620179.4735642888117581606 7818410.7478845994919538498,-623260.5744304652325809002 7827969.2937268922105431557,-620922.8651238083839416504 7828243.9923413861542940140,-620440.5177702001528814435 7828381.5516211669892072678,-614545.4828157508745789528 7833885.1464064409956336021,-611422.3031820552423596382 7836293.2464565103873610497,-608113.6652766984188929200 7839620.5575723936781287193,-607680.7437770023243501782 7840252.4017933402210474014,-607000.4703687657602131367 7841515.0088626490905880928,-606536.6020506286295130849 7844958.0876820059493184090,-606505.7665516787674278021 7845934.3455576533451676369,-606722.1716417811112478375 7846508.4183434061706066132,-607557.0678227320313453674 7846795.3676944626495242119,-608051.8829593074042350054 7846451.5672775181010365486,-612628.3385453084483742714 7842547.4375017834827303886,-627013.2657845990033820271 7836236.4720418369397521019,-640210.8593350844457745552 7830618.5294065307825803757,-642251.5682403087848797441 7829930.7611689064651727676,-643210.2516950184945017099 7829987.4883399996906518936,-644385.2289203420514240861 7830733.4385857777670025826,-647539.3553724788362160325 7834286.7872466091066598892,-647786.7072810223326086998 7834859.9775811564177274704,-652332.3273680733982473612 7852827.9567057034000754356,-653105.3299121421296149492 7856334.5611695535480976105,-653600.0337292291224002838 7858692.8719285270199179649,-653507.3045933970715850592 7861281.0070635043084621429,-653352.6818206856260076165 7862202.4039036324247717857,-651342.6970949226524680853 7872913.1762971458956599236,-651188.1856416997034102678 7873720.4263095399364829063,-650074.9907337670447304845 7878101.7436213130131363869,-648281.4110981064150109887 7879254.8272750088945031166,-647601.1376898697344586253 7879543.2295036436989903450,-646859.0819642421556636691 7879484.4684734027832746506,-643086.5757407482014968991 7877525.2677725153043866158,-640118.0188797640148550272 7873893.0491695394739508629,-640056.1252428817097097635 7872164.7161779273301362991,-629573.6140728419413790107 7864964.1596209304407238960,-629017.0166188755538314581 7864676.3131026867777109146,-628151.1736194863915443420 7864791.7405201056972146034,-625615.6495776894735172391 7868131.6093980763107538223,-615689.6245421246858313680 7868879.8776304749771952629,-613555.9638620885089039803 7869571.1948427958413958549,-613215.8828177158720791340 7870205.5454059662297368050,-614236.2372703280998393893 7872854.6742497216910123825,-614669.1587700240779668093 7873258.1816226178780198097,-616184.3283592087682336569 7873834.5395373199135065079,-628244.0140748068224638700 7873834.5395373199135065079,-629357.0976632511010393500 7873028.7295439839363098145,-629666.3432086739921942353 7872509.6873413408175110817,-630346.6166169105563312769 7872278.5984832206740975380,-631088.8949815207161009312 7872509.6873413408175110817,-631645.3811159958131611347 7872970.2266021808609366417,-634026.3937045753700658679 7875333.7323903553187847137,-646797.1883273599669337273 7891606.5970635982230305672,-646920.8642816302599385381 7892358.6498228590935468674,-647601.1376898697344586253 7929017.7337389001622796059,-647508.5198735289741307497 7929947.4355408484116196632,-646055.1326017323881387711 7936453.7502605682238936424,-645560.3174651570152491331 7936918.2089397581294178963,-641973.3808328154264017940 7938952.1220390647649765015,-640643.6695152892498299479 7939533.3110576542094349861,-636407.4062931521330028772 7939940.4002927672117948532,-634143.8357673621503636241 7936511.0737917013466358185,-633494.5091775637120008469 7936057.7277084160596132278,-632919.3213686350500211120 7935500.0260215764865279198,-632659.7243161040823906660 7935117.0222576120868325233,-632566.8838607836514711380 7934663.7600552150979638100,-630563.1330265041906386614 7923679.3942342167720198631,-630253.8874810814158990979 7922519.5037977732717990875,-627965.6040283339098095894 7919967.7048245184123516083,-625027.9939857907593250275 7918112.3364293584600090981,-624193.2091243311297148466 7918169.7293285047635436058,-623667.5584888058947399259 7918575.8748366609215736389,-621410.2218544994248077273 7929076.6727590663358569145,-621255.4877622968051582575 7929889.9528987463563680649,-621224.6522633469430729747 7931689.0539463944733142853,-621472.0041718903230503201 7932386.1485914569348096848,-623110.9610348395071923733 7934535.3372363187372684479,-623574.7180334853474050760 7935058.6634809840470552444,-626234.0293490438489243388 7936337.2216532435268163681,-627248.2612296637380495667 7938883.4789800271391868591,-628287.3173567267367616296 7941184.4087877087295055389,-628361.4561375963967293501 7941673.2349743219092488289,-628324.2754276689374819398 7942860.1574493637308478355,-628231.5462918396806344390 7943383.2248314805328845978,-628336.6318911476992070675 7946281.0648511294275522232,-627347.2242569765076041222 7948200.7963023874908685684,-626512.3280760284978896379 7949307.2264501005411148071,-624626.1306240271078422666 7951286.8429214227944612503,-607526.1210042909951880574 7937732.3360116407275199890,-604959.6501440529245883226 7945990.3089706096798181534,-604526.7286443569464609027 7946514.4317998429760336876,-603908.2375535083701834083 7946862.8197974404320120811,-594291.5693828605581074953 7950704.7460147030651569366,-580809.5545333953341469169 7946514.4317998429760336876,-570790.8003620014060288668 7939940.4002927672117948532,-569059.1143632201710715890 7937848.8862027619034051895,-568038.6485911195632070303 7936046.6402133628726005554,-567543.8334545441903173923 7939649.8891198858618736267,-577686.3748996997019276023 7956470.2657709643244743347,-578552.2178990889806300402 7957461.0562970871105790138,-579201.5444888873025774956 7957811.6297755213454365730,-585849.7671180422184988856 7961250.4654107410460710526,-600908.8451935743214562535 7973854.5646767467260360718,-603011.5590551693458110094 7976307.5482310401275753975,-606474.8197332376148551702 7981392.7043655235320329666,-607155.0931414770893752575 7982621.2739381669089198112,-607278.7690957474987953901 7983380.7848828043788671494,-607124.1463230360532179475 7984257.8544951751828193665,-606598.4956875108182430267 7985779.1793417986482381821,-605918.2222792713437229395 7987066.1763894865289330482,-605423.5184621871449053288 7987591.6951222568750381470,-604093.8071446608519181609 7988061.0070491367951035500,-603259.0222832040162757039 7987884.2743858611211180687,-602052.9869199481327086687 7987124.0974934734404087067,-599362.7287859484786167741 7984902.1427120426669716835,-598002.1819694723235443234 7983323.1031430726870894432,-592157.9087028243811801076 7980866.1458319267258048058,-591199.3365676031680777669 7980750.6109452126547694206,-589715.1137968567200005054 7981335.0378831140697002411,-588787.3771605853689834476 7982094.4188393997028470039,-588323.6201619423227384686 7982736.8375867586582899094,-587921.5341611960902810097 7983323.1031430726870894432,-587736.0758895347826182842 7984082.8955660937353968620,-587086.7492997364606708288 7991981.7917336644604802132,-587148.5316171273589134216 7998599.8071651859208941460,-588972.8354322465602308512 7998659.5048527289181947708,-589715.1137968567200005054 7999069.8074542861431837082,-600723.2756024218397215009 8018431.1903368635103106499,-601001.6856488976627588272 8019841.6262504709884524345,-601032.5211478475248441100 8020722.7544771777465939522,-600692.3287839834811165929 8021546.0100588807836174965,-600259.4072842875029891729 8022015.9684993848204612732,-599641.0275129302171990275 8022369.3560171527788043022,-597909.4528336402727290988 8022133.8330243593081831932,-597352.8553796738851815462 8021781.7261899784207344055,-579263.3268062783172354102 8020195.1228845063596963882,-564575.3879130483837798238 8023133.1108342297375202179,-565008.3094127443619072437 8023662.8540255660191178322,-565750.4764578632311895490 8024014.8375328881666064262,-570667.1244077309966087341 8027955.9372333325445652008,-574934.2231288179755210876 8035959.6835891595110297203,-576047.5293562418082728982 8041203.3859719289466738701,-575398.0914469521958380938 8044386.2614203300327062607,-568780.8156362384324893355 8074868.7607897184789180756,-557123.2159213837003335357 8099415.4077767068520188332,-556411.9956947058672085404 8099770.9718487747013568878,-531241.4343119477853178978 8095199.9599894564598798752,-530777.5659938134485855699 8094784.3578436682000756264,-523387.1763195369276218116 8085590.8264067573472857475,-520604.1890497052227146924 8078301.7823860766366124153,-523418.1231379780219867826 8075223.3722695205360651016,-525180.6446357091190293431 8071908.7092198366299271584,-530004.4521302535431459546 8062743.2399211293086409569,-530282.8621767265722155571 8061797.1660845065489411354,-530375.5913125586230307817 8061029.4598552510142326355,-529509.7483131694607436657 8060852.4880412127822637558,-527809.0091328292619436979 8062092.4423149190843105316,-519645.6169144868035800755 8070607.0664195213466882706,-512502.5791487537208013237 8078065.9861865304410457611,-511915.1461958375293761492 8079487.6984174475073814392,-511729.5766046849894337356 8080315.7336701834574341774,-511853.2525589553406462073 8082983.0015429081395268440,-512224.2804217691300436854 8084522.7927242331206798553,-512038.8221501078805886209 8085471.9587688622996211052,-511513.0601950914133340120 8086953.7778820274397730827,-510801.9512879048706963658 8088199.5612933477386832237,-509657.8095615311176516116 8088970.0614235829561948776,-508173.5867907846113666892 8089326.8369318321347236633,-507183.9565176310716196895 8089207.9098701998591423035,-501679.8756148499087430537 8087546.5450903130695223808,-498278.3972541697439737618 8086123.2997940145432949066,-494351.3795774555183015764 8084049.1083461018279194832,-493392.6961227458668872714 8083041.4553312528878450394,-493021.6682599292253144085 8081560.6246658340096473694,-476138.2863692779210396111 8080257.0879299435764551163,-454245.4160734384204261005 8084879.3560339370742440224,-434517.1532760704285465181 8085530.6454274784773588181,-428394.4699629495735280216 8085887.2568110255524516106,-421375.2194709808682091534 8087310.4571631234139204025,-420787.6751985733862966299 8087665.4457213776186108589,-415252.6474773511872626841 8092885.2754072621464729309,-413459.1791611818480305374 8095022.3914114953950047493,-412902.5817072155186906457 8095438.0067971935495734215,-407460.2831218225182965398 8098643.8299443535506725311,-398090.8555402240599505603 8099118.6540870815515518188,-395555.3314984271419234574 8096386.8503993386402726173,-375548.6586545861791819334 8093538.9718917291611433029,-374590.0865193649078719318 8093419.9777843467891216278,-374126.3295207218616269529 8093953.0092434845864772797,-373848.0307937372708693147 8094725.5984799610450863838,-373105.8637486184597946703 8097099.4171333312988281250,-373013.0232932979706674814 8097870.8354736315086483955,-373445.9447929911548271775 8098405.8947522128000855446,-375517.7118361450848169625 8100306.1672385381534695625,-373353.2156571618979796767 8107378.2808270510286092758,-353594.0060413556639105082 8104999.4823208879679441452,-336803.3532865336164832115 8104584.8323190966621041298,-336153.9153772468562237918 8104168.7077577663585543633,-335720.9938775508198887110 8103633.2355586560443043709,-335473.6419690073234960437 8101554.1788671789690852165,-340142.9380103316507302225 8063392.6046885224059224129,-340668.5886458568857051432 8061857.1564218187704682350,-346172.7808681320748291910 8047923.3855891823768615723,-347533.3276846053777262568 8045328.6519893314689397812,-356500.6692654576618224382 8032309.9628600981086492538,-357180.9426736971363425255 8031545.2727268235757946968,-371528.8005225515225902200 8025720.1701402561739087105,-373291.3220202797092497349 8025720.1701402561739087105,-374002.6535664487164467573 8025486.0238025076687335968,-374497.3573835357092320919 8025074.2742424802854657173,-376476.3952908575301989913 8023133.1108342297375202179,-380743.6053314356831833720 8018666.8085988098755478859,-383186.5115568946348503232 8015143.2477811425924301147,-383650.2685555405332706869 8013498.2314808340743184090,-384701.5698265910032205284 8010739.5907647507265210152,-385443.7368717098142951727 8009448.5301577858626842499,-387762.9671428956207819283 8005811.6842027688398957253,-390855.0886386617203243077 8002057.5707713356241583824,-391318.9569567959988489747 8001531.0388874337077140808,-396977.7719517826335504651 7996607.6954028932377696037,-410150.5412558221141807735 7986188.9895308613777160645,-428023.4421001357259228826 7971519.4539741594344377518,-444937.8821287222090177238 7956937.6391611676663160324,-446576.7276721801026724279 7951985.7540601119399070740,-444412.1201737028895877302 7948491.8471077596768736839,-444288.4442194325383752584 7946746.1300195800140500069,-446947.7555349938920699060 7939592.3324004504829645157,-457152.1906170316506177187 7936279.6902406839653849602,-458636.4133877781569026411 7936046.6402133628726005554,-472334.8333273456664755940 7940116.0101028466597199440,-485198.4684054506942629814 7945349.3450317038223147392,-486064.2000853514764457941 7946397.7474213298410177231,-487362.9645844366750679910 7947096.2047789441421627998,-488939.9164910123799927533 7947444.6196987228468060493,-488816.2405367420287802815 7945816.0284071099013090134,-484703.6532688753213733435 7938487.3286702623590826988,-483745.0811336541082710028 7937615.7876238562166690826,-478395.6230035843909718096 7935116.1855694446712732315,-476818.5597775146015919745 7934651.8379749609157443047,-461945.0512931350385770202 7930701.8574735634028911591,-450089.5255236518569290638 7928426.0700377598404884338,-437083.6241363113513216376 7926986.5002805441617965698,-431332.0800054954597726464 7928612.6971967080608010292,-428641.9331909842439927161 7929599.8290184363722801208,-427652.4142373219365254045 7930585.4177934592589735985,-426879.4116932532051578164 7931805.5106822047382593155,-425982.6218754229485057294 7934884.8448570137843489647,-425271.4016487451735883951 7936163.1643258137628436089,-424281.8826950828079134226 7937208.6147723263129591942,-423261.4169229822000488639 7937963.7641881788149476051,-421715.3005153535632416606 7938196.8735358677804470062,-420231.0777446070569567382 7937673.1199985975399613380,-420014.6726545047131367028 7936104.1698461314663290977,-420540.3232900327420793474 7934535.3372363187372684479,-424776.6978316610329784453 7926986.5002805441617965698,-425580.6471941680065356195 7925768.6496634082868695259,-430311.7255528832902200520 7918865.5747225023806095123,-439062.6620436331722885370 7908146.5803291602060198784,-439928.5050430223345756531 7907162.4612843301147222519,-441783.7556765854824334383 7905079.8117816951125860214,-442804.2214486860902979970 7904210.4574564984068274498,-444041.0923108891001902521 7903574.7026513786986470222,-445401.7504468564875423908 7903112.2934198155999183655,-446613.7970626135356724262 7904153.1706698574125766754,-447615.6724797518108971417 7904430.6510812835767865181,-447819.8324258666834793985 7905264.1952711287885904312,-447560.0127343560452573001 7906271.4045023387297987938,-447077.6653807478141970932 7906966.1530205719172954559,-447102.3783077053376473486 7909014.9291894510388374329,-447442.4593520780326798558 7910404.9956699227914214134,-448741.3351706544635817409 7911100.1249789213761687279,-454771.1780284548876807094 7909999.4984067715704441071,-456162.5603438781108707190 7909536.6952618248760700226,-478302.7825482639018446207 7899235.8357792533934116364,-491630.1746250148280523717 7884100.5738423708826303482,-493794.7821234891889616847 7878562.6237914720550179482,-492836.0986687795375473797 7877639.2308822218328714371,-491444.6050338622881099582 7878101.7436213130131363869,-487393.9114028777694329619 7881620.2998192440718412399,-483528.6760435517062433064 7885370.3156496034935116768,-482044.3419533139676786959 7887680.5423115734010934830,-480065.3040459921467117965 7889585.4105068510398268700,-474159.2484619561000727117 7895247.1371755367144942284,-473046.0535540234413929284 7896114.0029696635901927948,-470634.0941470055840909481 7897269.8401443120092153549,-466583.2891965269809588790 7898600.7080383989959955215,-454270.1290003930917009711 7897339.7704329593107104301,-450472.9098499444080516696 7892647.3448372408747673035,-457677.7299330656533129513 7883407.9262647209689021111,-465253.6891984947724267840 7875966.9064698787406086922,-468747.8966950041940435767 7870493.6025127945467829704,-470757.7701012758770957589 7866230.6901292670518159866,-472056.5346003610757179558 7863008.5110506629571318626,-471438.1548290037899278104 7861627.1391602978110313416,-470355.7954200209933333099 7860764.2205183506011962891,-468995.2486035448382608593 7860130.6614692062139511108,-467170.8334689344046637416 7860073.7079596631228923798,-465222.7423800536780618131 7860821.1792277200147509575,-462965.5170652384986169636 7862317.7935662930831313133,-449885.3655775369843468070 7874238.0992266517132520676,-449545.2845331642893142998 7874872.8415861083194613457,-417908.6192081868648529053 7888958.7861862424761056900,-405141.1641701250919140875 7892877.6015834482386708260,-405419.4628971096826717257 7892242.8005322674289345741,-405481.2452144978451542556 7891317.7338765235617756844,-405048.3237148046609945595 7890856.0748362485319375992,-403471.2604887348716147244 7890510.2649546498432755470,-400533.7617656830116175115 7891260.5448511671274900436,-399946.2174932755879126489 7891490.7593107977882027626,-392092.0708203559624962509 7896923.7363782888278365135,-390329.4380031364853493869 7899062.8409217316657304764,-389989.3569587609381414950 7899583.7110878406092524529,-389278.1367320832214318216 7900972.0410501854494214058,-388906.9975497781415469944 7902475.1732425810769200325,-389030.6735040513449348509 7903226.8516251333057880402,-389308.9722310330835171044 7903921.3198626032099127769,-389463.5950037444708868861 7904731.8913677185773849487,-389339.9190494741778820753 7905542.5499553047120571136,-388288.6177784237079322338 7906526.4577142242342233658,-371776.2637505833990871906 7909420.5819912413135170937,-366179.2310729877208359540 7909942.1676476104184985161,-365468.1221658011781983078 7909593.8144744606688618660,-365127.9298019372508861125 7908957.6059122346341609955,-364695.0083022412727586925 7907683.8908374262973666191,-363025.2159403422265313566 7905542.5499553047120571136,-361355.4235784432385116816 7904210.4574564984068274498,-358819.7882171550882048905 7902823.1978990947827696800,-347687.8391378283849917352 7898657.7445303853601217270,-342956.7607791131595149636 7897385.7666010018438100815,-338627.7684211440500803292 7896691.8994352342560887337,-337854.6545575840864330530 7896807.8170167505741119385,-336463.1609226696891710162 7897328.7397193964570760727,-332783.4951544989598914981 7899178.7949187774211168289,-330340.5889290400082245469 7900451.0750676412135362625,-327557.6016592083615250885 7902359.1685902904719114304,-325454.8877976133371703327 7903921.3198626032099127769,-322610.1182103907340206206 7906005.1081433007493615150,-317569.7943062526173889637 7905772.9920665649697184563,-310643.2729501131107099354 7905079.8117816951125860214,-309715.5363138446118682623 7904963.7670821649953722954,-294532.7822840393055230379 7902069.8936612438410520554,-286091.0913387122564017773 7900335.1015232149511575699,-279411.9218911162461154163 7898657.7445303853601217270,-272114.3726721629500389099 7897963.7604385204613208771,-267197.7247222980367951095 7897558.9311591358855366707,-266300.9349044677801430225 7897558.9311591358855366707,-243356.7633375749283004552 7898022.6654283953830599785,-241872.5405668284511193633 7898311.5771233001723885536,-241254.0494759799330495298 7898716.6549362447112798691,-238254.6571160458843223751 7902591.1796781029552221298,-237265.1381623835477512330 7903574.7026513786986470222,-235997.3204817394434940070 7904037.3485315758734941483,-231049.8370329246390610933 7904442.5254707075655460358,-225112.8346304446749854833 7903285.5894157476723194122,-214815.6704125776886940002 7899930.1450427724048495293,-213547.9640514248167164624 7898427.5195798724889755249,-207054.2528754901140928268 7888199.1726722167804837227,-202817.8783338590001221746 7879311.9254743885248899460,-198303.3163847402029205114 7864159.2944969339296221733,-197499.3670222304062917829 7861108.6719145486131310463,-197406.6378863983263727278 7854322.9903283994644880295,-206590.4958768442447762936 7842088.7466019783169031143,-218062.5260005436139181256 7828384.0264736581593751907,-219515.9132723430811893195 7825863.6018082415685057640,-220165.2398621386382728815 7824547.3261055797338485718,-228668.8244443450530525297 7804931.5168131841346621513,-229503.7206252959731500596 7801962.8116733245551586151,-229967.5889434302516747266 7799165.9901413545012474060,-230987.9433960424503311515 7791122.9890504982322454453,-230833.3206233310338575393 7789584.1477357083931565285,-230122.2117161444912198931 7787646.4188266834244132042,-233028.8749402464891318232 7774495.6529850922524929047,-241223.2139770300709642470 7760230.8845638977363705635,-243820.6316557092068251222 7754952.5976637555286288261,-244500.9050639487104490399 7752400.4817456733435392380,-244624.5810182190325576812 7748997.4949481822550296783,-244531.8518823869817424566 7748317.0801725182682275772,-243758.8493383182503748685 7746333.7345695439726114273,-243264.0342017428774852306 7744237.2962538497522473335,-243387.7101560160517692566 7743387.8288928037509322166,-244253.5531554052140563726 7740215.7584408791735768318,-247098.3227426278463099152 7733140.9131102850660681725,-257766.5148233086511027068 7719122.5119865983724594116,-258725.0869585298933088779 7718106.5176235372200608253,-261384.3982740912178996950 7716186.9059361387044191360,-266053.5829959242837503552 7713590.4577351678162813187,-268867.5170841970248147845 7710939.0473806681111454964,-275855.9320772158680483699 7702143.8372883778065443039,-274155.1928968757856637239 7698314.5398941654711961746,-272519.4642991611035540700 7698975.0949414372444152832,-272516.3473534178920090199 7697357.2623224668204784393,-272609.0764892499428242445 7696455.6417993549257516861,-277030.9093025395413860679 7681663.0372278438881039619,-281329.1774810499628074467 7674472.6987986862659454346,-282225.8559793890453875065 7673462.6303668050095438957,-284019.3242955583846196532 7671498.8558065248653292656,-293976.1848300729761831462 7663141.4353222837671637535,-302881.8554130255361087620 7656360.6491416683420538902,-322300.8726649678428657353 7651321.1642825948074460030,-329351.0699753776425495744 7649754.8876640545204281807,-338009.2773302983259782195 7649418.2626522267237305641,-338937.0139665668830275536 7649530.4693442350253462791,-339740.9633290767087601125 7649530.4693442350253462791,-341781.7835537895443849266 7648915.6693822499364614487,-342956.7607791131595149636 7648244.1193120013922452927,-364911.5247118348488584161 7629915.0750255472958087921,-363427.1906215971685014665 7627626.5736464858055114746,-362066.6438051210134290159 7628017.4850903516635298729,-355449.3679944071918725967 7630194.1779232611879706383,-354861.8237219997681677341 7630473.0900402618572115898,-333463.7685627356404438615 7641309.2897129449993371964,-326413.4599328346084803343 7647068.7463837368413805962,-324960.1839805291965603828 7648411.6991747170686721802,-324372.6397081217728555202 7648691.4770984323695302010,-322919.3637558164191432297 7648971.0638155350461602211,-321094.9486212031333707273 7648803.4717040760442614555,-319486.9385766951018013060 7648411.6991747170686721802,-313395.3134015065152198076 7646566.3073770552873611450,-312684.0931748287985101342 7646286.8084915485233068466,-312158.4425393007113598287 7645056.1682350542396306992,-311601.8450853343820199370 7642204.4286880698055028915,-311478.1691310640308074653 7641421.3775979960337281227,-311663.7387222165707498789 7640638.4065871639177203178,-312034.7665850303601473570 7639912.2529215859249234200,-312745.9868117081350646913 7637788.1106125405058264732,-313395.3134015065152198076 7633152.0074393870308995247,-313178.9083114041713997722 7630976.0818669088184833527,-312158.4425393007113598287 7627793.7029229244217276573,-311756.4678580457693897188 7627292.5268949223682284355,-308509.6122700798441655934 7624893.1614138623699545860,-307891.1211792313260957599 7624614.2515343185514211655,-303995.0503209582529962063 7623330.6740666655823588371,-303160.0428205188945867121 7623163.6420952957123517990,-301026.4934599740663543344 7623330.6740666655823588371,-297810.5846904463833197951 7623051.8210429241880774498,-297099.3644637686084024608 7622829.7898213807493448257,-294285.4303754958673380315 7621714.9129134071990847588,-293759.7797399706323631108 7621379.5180489635095000267,-293172.2354675631504505873 7620933.9533155616372823715,-287853.7241559345857240260 7615137.3490979662165045738,-287451.6381551884114742279 7614636.9998754765838384628,-286956.9343381042708642781 7613355.0917105199769139290,-287513.5317920706002041698 7611963.1416269848123192787,-287946.4532917637843638659 7611461.5962992021813988686,-297594.1796003439812920988 7601724.4468441186472773552,-298119.8302358720684424043 7601334.8734614141285419464,-298676.4276898383977822959 7601001.9700494939461350441,-310364.9742231313721276820 7595830.9100026590749621391,-313920.9640370317501947284 7595165.5948593234643340111,-315528.9740815397817641497 7595054.1812129532918334007,-316920.4677164570312015712 7595609.6653147395700216293,-318126.3917602189467288554 7596388.0507764695212244987,-320043.5360306614311411977 7598054.9133349964395165443,-320631.0803030688548460603 7598444.3202559091150760651,-321465.9764840169227682054 7598722.0799155151471495628,-324681.8852535446058027446 7599332.8663364639505743980,-326351.6776154435938224196 7599389.3044943222776055336,-329165.5003842251608148217 7598777.1127414396032691002,-331299.1610642612795345485 7597276.3588367188349366188,-349048.4972737929783761501 7581065.3174151051789522171,-349821.4998178616515360773 7579956.4910924797877669334,-350780.0719530829228460789 7577017.4980224715545773506,-350965.6415442354627884924 7576297.5412886310368776321,-351120.2643169468501582742 7575464.7264766618609428406,-371961.7220222446485422552 7563227.1312596565112471581,-372549.2662946521304547787 7562895.8749925643205642700,-377651.3725161811453290284 7560627.2625664165243506432,-378393.5395613000146113336 7560516.3485384276136755943,-379537.6812876737676560879 7560903.8576568057760596275,-383062.8356026242836378515 7562231.8118909848853945732,-389339.9190494741778820753 7565274.5438470402732491493,-397565.2049046988249756396 7569094.1052962355315685272,-398802.0757669018348678946 7569371.0050793765112757683,-414077.5589325363398529589 7569704.1353127425536513329,-416025.7613409111509099603 7569482.0468867029994726181,-414881.5082950461073778570 7564555.4867092901840806007,-414696.0500233848579227924 7563891.2803057739511132240,-414263.1285236888215877116 7563503.8198585631325840950,-408140.5565300591406412423 7559852.4908225871622562408,-407645.8527129750582389534 7559576.1326336478814482689,-405883.2198957527289167047 7559410.4817635063081979752,-384577.8938723206520080566 7556811.9024301227182149887,-362314.1070331557421013713 7552776.8266814928501844406,-343760.8214611142175272107 7548081.0225019408389925957,-341472.5380083666532300413 7547363.7690549744293093681,-339864.6392833498539403081 7547196.9893733970820903778,-335968.4571055855485610664 7548357.1669921502470970154,-326722.7054782574414275587 7552335.2238851115107536316,-325547.7282529338262975216 7552942.3347980938851833344,-323970.6650268668890930712 7554047.2722464054822921753,-323537.7435271708527579904 7554434.4556715320795774460,-322331.8194834089372307062 7556148.3642748873680830002,-319023.1815780492033809423 7562673.9831030741333961487,-319301.3689855425618588924 7564057.0277022607624530792,-318961.2879411698668263853 7564777.4328891141340136528,-315467.0804446604452095926 7568596.7473595784977078438,-313951.9108554728445596993 7569758.7612766847014427185,-311045.2476313680526800454 7570423.4747220156714320183,-309715.5363138446118682623 7570645.5903452932834625244,-295800.5999646834097802639 7570312.4193167928606271744,-292893.9367405814118683338 7569316.1825163029134273529,-289492.5696993924793787301 7567045.6756457220762968063,-278546.1902112183161079884 7558968.4980991361662745476,-264414.7374524663900956511 7549848.3991315234452486038,-251612.9960112378757912666 7542230.2410548646003007889,-237141.4622081132256425917 7535720.3350925231352448463,-231513.5940315676853060722 7532027.7978241583332419395,-230740.5914874989539384842 7529327.9761461354792118073,-230245.8876704148133285344 7528116.1310436213389039040,-229441.8269884137844201177 7526629.0999384159222245216,-225050.9409935653093270957 7519913.4744136407971382141,-224154.1511757350235711783 7517713.3279058709740638733,-222731.8220418679120484740 7514797.9966831970959901810,-220412.5917706821055617183 7510125.2724285703152418137,-219701.3715440043597482145 7509136.7898908061906695366,-206095.6807402688718866557 7490478.0977485328912734985,-202570.5264253183559048921 7485929.9104192750528454781,-202106.7694266724865883589 7485492.1190162533894181252,-201302.7087446714285761118 7485272.4438472837209701538,-200560.6530190438206773251 7485382.2806511241942644119,-199787.5391554866801016033 7486477.5790026420727372169,-194469.0278438552340958267 7484121.5190278962254524231,-188129.9394406319479458034 7480289.8218887671828269958,-182347.5598108662525191903 7475857.3263881225138902664,-181883.6914927319739945233 7475418.5295847235247492790,-176039.4182260840607341379 7456677.5100805619731545448,-175946.6890902519808150828 7455914.6764129670336842537,-175142.7397277450072579086 7443754.2639988819137215614,-175390.0916362856514751911 7442011.1962630506604909897,-175853.8486349315207917243 7440540.6407940434291958809,-176472.3397257800679653883 7439233.4532788544893264771,-177338.1827251692302525043 7438253.9913258319720625877,-178049.4029518470051698387 7437110.0377145763486623764,-177956.5624965265451464802 7436349.1286853188648819923,-174307.8435467940871603787 7417809.6096018599346280098,-169267.5196426559996325523 7393792.0168038709089159966,-168649.0285518103046342731 7390977.9059561742469668388,-165309.4438280122994910926 7379298.8314456325024366379,-164845.6868293664301745594 7377946.8761517070233821869,-157269.7275639401341322809 7361758.0114582711830735207,-153775.5200674307125154883 7357284.6592334136366844177,-151951.1049328174558468163 7347860.9245307389646768570,-149786.6087538343272171915 7336944.2758245058357715607,-145210.1531678305182140321 7317622.4263066947460174561,-144437.0393042733776383102 7316122.3325622798874974251,-129718.1535926052310969681 7294178.3575482182204723358,-118153.2830135825643083081 7287927.5555360559374094009,-116205.1919246989855309948 7287126.6845920952036976814,-97497.2835799460444832221 7278907.7899014819413423538,-62864.5654797602182952687 7261591.0334556419402360916,-58040.7579852129128994420 7255897.8630520133301615715,-57391.4313954173485399224 7254834.3475495018064975739,-50928.6670379237402812578 7241869.5298562953248620033,-48547.6544493441469967365 7236774.8955561565235257149,-46939.7557243273477070034 7233327.9344458756968379021,-43785.6292721906356746331 7221986.6204860499128699303,-43878.4697275110956979915 7221298.6330675203353166580,-43723.8469547996719484217 7220663.1227116677910089493,-42517.8115915465459693223 7218704.4958674106746912003,-29221.3663332339092448819 7203262.2267202856019139290,-22322.7861692835504072718 7198941.0594396125525236130,-16883.4932101425183645915 7196979.0933433379977941513,-13018.1465313280514237704 7195236.4839738700538873672,-9183.8579904459147655871 7192704.6780755193904042244,-8719.9896723088095313869 7192281.5234471354633569717,-8348.9618094949983060360 7191384.5792159922420978546,-9060.1820361727550334763 7190277.9254292584955692291,-12523.4427142439144517994 7188800.4774872828274965286,-15151.8072113641555915819 7188273.3185697188600897789,-15739.3514837687544059008 7188009.6574359694495797157,-17934.7944811958222999237 7186849.7671871241182088852,-19357.2349345513357548043 7185637.8634417597204446793,-22573.1437040790115133859 7180526.0465760026127099991,-23222.4702938745722349267 7179315.1152911577373743057,-23748.1209294026375573594 7176944.6104523604735732079,-24026.4196563843906915281 7175207.9441003389656543732,-24057.3664748254886944778 7174418.4873064290732145309,-23933.6905205551593098789 7172997.4369678078219294548,-23624.4449751294814632274 7171734.2435828270390629768,-19047.9893891284882556647 7155333.7633468983694911003,-18615.0678894324810244143 7154126.8833253327757120132,-14193.2350761429133854108 7144419.5832378705963492393,-12554.3895326850124547491 7141903.8511276524513959885,-11070.0554424473011749797 7139859.8072505984455347061,-5998.8960393593388289446 7132945.1507118921726942062,-1453.3872717966128220723 7126454.6479702983051538467,6802.8454018663251190446 7114535.5168764470145106316,7143.0377657331036971300 7114013.2940712310373783112,14069.5591218697554722894 7103259.0684288404881954193,15708.4046653304885694524 7099869.9713335065171122551,16636.0299821106345916633 7097523.1800195593386888504,17099.8983002449058403727 7095647.7857606485486030579,17161.7919371271018462721 7094917.8248328994959592819,16914.3287090923840878531 7093250.6669076913967728615,16357.7312551260511099827 7091948.5844065481796860695,15986.7033923122398846317 7091374.9708274621516466141,15646.6223479395266622305 7090854.2729036491364240646,13141.9338050896112690680 7088093.8515161555260419846,12554.3895326850124547491 7087833.5123058557510375977,12678.0654869553382013692 7088511.4617120213806629181,13296.4452583126330864616 7089708.3704364756122231483,13729.3667580058081512107 7090177.6229659169912338257,15120.8603929230575886322 7092416.4693086668848991394,15337.3768025166773441015 7093146.1998539250344038010,15461.0527567870049097110 7093980.4742726171389222145,15399.1591199048089038115 7094708.8481437452137470245,14533.4274400068607064895 7096324.9029302448034286499,12152.4148514301032264484 7098357.9154378520324826241,9926.0250355647694959771 7099765.4169691428542137146,7514.0656285469149224809 7101017.1566209914162755013,4916.6479498677708761534 7102111.5584062384441494942,3308.6379053569012285152 7102269.0941189657896757126,1886.1974520013864093926 7102164.5080816512927412987,1236.8708622029926118557 7102008.4765428882092237473,0.0000000000000000000 7101431.1302505927160382271,-3865.2353593232346611330 7099556.3123803008347749710,-5751.5441308158542597084 7099088.1933918865397572517,-7946.9871282400890777353 7098983.6493452610448002815,-8781.8833091910055372864 7099139.6213106811046600342,-9524.0503543098602676764 7099348.7149004405364394188,-11781.2756691250579024199 7100703.4522398170083761215,-14440.5869846863988641417 7102529.9080452322959899902,-15801.1338011597163131228 7103780.5822782544419169426,-19109.8830260078502760734 7108896.1305201593786478043,-25758.1056551655856310390 7117618.0292343124747276306,-27767.9790614372977870516 7119133.9567664228379726410,-30334.5612411665752006229 7120230.8664008406922221184,-32715.5738297433344996534 7120440.5178420627489686012,-39772.0050316395572735928 7119290.5144223310053348541,-42406.4921007521479623392 7118537.4854326220229268074,-47044.8413236353298998438 7116844.4668464977294206619,-61132.9908004702592734247 7114691.9835692644119262695,-62431.6439800642110640183 7115265.9720149785280227661,-63359.3806163355911849067 7116102.5801986549049615860,-64317.9527515568333910778 7117618.0292343124747276306,-65245.5780683369812322780 7118558.3705776063725352287,-67441.0210657612187787890 7119133.9567664228379726410,-68987.1374733898846898228 7119185.7032449971884489059,-70378.6311083042965037748 7119029.1476632580161094666,-72852.3728327131248079240 7118297.0280052861198782921,-75047.9271496285946341231 7117147.3361070714890956879,-76068.2816022407932905480 7116520.1650381507351994514,-80026.3574168844934320077 7113489.7894850960001349449,-79500.7067813592584570870 7112237.3926360346376895905,-77150.6410112235898850486 7110930.8694202639162540436,-57855.1883940603875089437 7110774.4770652083680033684,-56203.9863871237321291119 7110994.0287472624331712723,-50971.9703198407660238445 7112811.2030738070607185364,-43439.3143363315102760680 7115037.0863102758303284645,-34014.3383288285258458927 7116102.5801986549049615860,-33148.4953294393417309038 7115946.0856116190552711487,-32035.3004215066757751629 7115162.7187287099659442902,-29437.7714233362967206631 7111818.5297639798372983932,-26891.2267519497254397720 7107538.4878966500982642174,-25665.3765193335239018779 7104772.2481803689152002335,-24799.5335199443434248678 7103103.0153247127309441566,-23067.8475211631484853569 7100547.4494800595566630363,-13049.0933497691494267201 7091374.9708274621516466141,-11224.6782151587249245495 7089708.3704364756122231483,2999.3923599340528198809 7077844.5566999809816479683,9493.1035358687622647267 7073477.1131620751693844795,13667.5844406176784104900 7071294.8535670163109898567,14316.9110304132391320309 7071190.6753119593486189842,15584.7287110573306563310 7071503.2141794422641396523,16357.7312551260511099827 7071294.8535670163109898567,18769.6906621439047739841 7068542.7249169526621699333,24150.0956106547164381482 7060495.8343626335263252258,26221.9739732998568797484 7057227.4555320134386420250,27551.5739713349103112705 7053702.6916324980556964874,28386.4701522858267708216 7051318.2075183065608143806,30056.2625141848257044330 7047328.0035564331337809563,37724.9509154403349384665 7026842.4494658457115292549,37879.5736881545890355483 7026223.6754355067387223244,39394.7432773421678575687 7017703.5450261589139699936,39673.0420043239137157798 7015691.0640749577432870865,39827.6647770353374653496 7012802.3316875854507088661,39703.9888227650153567083 7010533.2681854963302612305,39425.6900957804318750277 7008832.6830489663407206535,38034.1964608660127851181 7000744.1420908663421869278,37477.5990068996834452264 6999455.6372812390327453613,36642.7028259487633476965 6998529.4734485764056444168,36086.1053719824340078048 6998272.2350947232916951180,30798.4295593036804348230 6995389.6200752491131424904,22696.8196583493372600060 6988188.6528307721018791199,19295.3412976691397489049 6984693.0072716111317276955,3586.9366323414842554484 6967700.7002976760268211365,204.8278630594293474587 6961354.9044529246166348457,4.1188211586421843435 6960748.3811523709446191788,730.4784985846645213314 6960382.4234024332836270332,3123.1796336956126651785 6960984.8607404958456754684,6431.8175390525138936937 6962521.7795065864920616150,7668.6884012583386720507 6962830.0843350710347294807,8379.9086279360963089857 6962880.8238509008660912514,9616.7794901390898303362 6962624.5464622424915432930,13605.6908037354824045906 6960369.8807924287393689156,16419.6248920082471158821 6958730.6571325277909636497,17501.8729814998150686733 6958013.1413981756195425987,18398.6627993300935486332 6957194.2821242287755012512,19109.8830260078502760734 6956221.0161899179220199585,19604.5868430948212335352 6955145.0120533993467688560,20810.5108868567149329465 6953047.0633922005072236061,24242.9360659780104469974 6947366.2139230202883481979,26036.4043821473351272289 6945729.6511862622573971748,26562.0550176725701021496 6945371.3754870649427175522,27149.5992900800010829698 6945218.3859691601246595383,40446.0445483926378074102 6942457.3447160013020038605,42177.7305471738291089423 6942662.3653290001675486565,47589.0823141257424140349 6950231.5565550718456506729,47929.2746779896842781454 6950795.0945429606363177299,48207.5734049714374123141 6951409.3390278974547982216,48640.3835851762123638764 6952892.4528996841982007027,48795.0063578876361134462 6954479.9785400191321969032,49351.6038118539654533379 6957809.0179931297898292542,49568.1202214475852088071 6958577.2276446707546710968,54391.9277159920675330795 6970264.7331179445609450340,55010.4188068405928788707 6971443.9915941450744867325,60205.2541641988791525364 6976475.1092778826132416725,60761.8516181652157683857 6976731.6462687784805893898,61473.0718448429688578472 6976885.4245519321411848068,74274.8132860686309868470 6978579.2146231736987829208,97713.7999895368266152218 6977039.0209598978981375694,98270.3974435031559551135 6976936.0685286289080977440,98981.6176701837539440021 6976576.5771750826388597488,100032.9189412342238938436 6975190.5151413669809699059,101022.4378948965604649857 6974317.9738076440989971161,101486.3062130308389896527 6974164.2449267618358135223,104887.6732542198005830869 6973907.7903467118740081787,107948.9592510360380401835 6973754.0693561760708689690,110731.9465208677138434723 6973959.8935649544000625610,111968.8173830707091838121 6974267.1616508271545171738,131789.9206357591319829226 6971702.0295296050608158112,142736.3001239332952536643 6969598.2566089574247598648,145364.6646210535254795104 6968520.4514044271782040596,150559.6112979030585847795 6966316.1764631457626819611,152816.9479322094703093171 6964982.6451792847365140915,155105.1200654629501514137 6963342.4759793952107429504,159434.2237429232918657362 6959857.6795340720564126968,163485.0286933990428224206 6956118.3314620824530720711,167381.2108711662003770471 6952995.0962426476180553436,168896.3804603509488515556 6951869.0399288795888423920,170411.5500495385203976184 6950743.1420124322175979614,183151.5091733760491479188 6940771.3688324391841888428,184450.1623529700154904276 6939492.4941559778526425362,186491.0938971740542910993 6936530.2116574672982096672,187727.9647593770641833544 6934435.6625089757144451141,189521.4330755491973832250 6930605.8057489953935146332,190047.0837110744323581457 6928819.8021876635029911995,191593.2001187031273730099 6923412.4016031753271818161,194128.8354799913067836314 6914339.2039271770045161247,194407.1342069730453658849 6913066.0045715495944023132,194437.9697059229074511677 6912402.9866241440176963806,194695.7856465998629573733 6896365.8756385929882526398,194747.2152513485925737768 6882968.0210112361237406731,192613.6658908037352375686 6874853.6870781192556023598,192922.8001167353359051049 6871508.5254627736285328865,192211.5798900575900916010 6869430.8607410807162523270,187656.9429242505284491926 6859341.4470536075532436371,181450.7699930359667632729 6835510.8029802357777953148,181203.4180844924703706056 6833190.3922358248382806778,180894.1725390696374233812 6831576.9023750508204102516,176843.3675885938573628664 6815608.4350056154653429985,176565.0688616092957090586 6815005.9218393582850694656,175853.8486349315207917243 6813948.6433141799643635750,154765.0390210902260150760 6794701.8020724281668663025,148487.8442547491285949945 6787326.9754436798393726349,147900.2999823417048901320 6787176.7781377770006656647,146694.3759385798184666783 6789934.7506418079137802124,142581.6773512218496762216 6797011.1910111699253320694,141839.6216255942417774349 6798015.1014129379764199257,140788.2090350497164763510 6798768.2063146326690912247,130274.7510465715749887750 6804797.7405615402385592461,129656.2599557230423670262 6804746.7220581844449043274,129161.5561386389017570764 6804345.0982658406719565392,128975.9865474863763665780 6803692.2307787518948316574,134511.0142687086190562695 6791239.5852784086018800735,142272.4318057961936574429 6778656.0165675682947039604,142921.8697150858060922474 6778606.4248035736382007599,143478.4671690521354321390 6778355.9459475129842758179,144004.1178045773704070598 6778005.2164214923977851868,144189.6873957299103494734 6776603.3514611618593335152,143200.1684420675737783313 6773949.2166879503056406975,142519.8950338308932259679 6772997.6602753000333905220,140942.8318077611329499632 6771096.5037884619086980820,136211.7534490487014409155 6765642.7242298284545540810,134511.0142687086190562695 6764042.4606979787349700928,133552.4421334873768500984 6763342.0733725214377045631,131511.6219087745703291148 6762192.8922931132838129997,126038.3765049404610181227 6759893.2189029902219772339,123750.0930521957634482533 6759244.1019327081739902496,121152.6753735166130354628 6758744.5259030275046825409,116885.4653329384746029973 6758744.5259030275046825409,115463.0248795801308006048 6759143.8964259419590234756,115122.9438352074066642672 6759643.4970304546877741814,111041.1920662905613426119 6765992.9195979200303554535,109835.2680225258372956887 6768744.9549126578494906425,108969.4250231366459047422 6768443.9900079276412725449,104269.2934828625002410263 6765443.4166989130899310112,103310.7213476412580348551 6764742.9084688900038599968,95969.7575272797112120315 6759293.3955801734700798988,80613.9016892919171368703 6750852.5330523196607828140,78387.5118734265852253884 6750054.4468685286119580269,77892.6967368512123357505 6749555.4357385458424687386,77954.5903737334156176075 6748956.3753528706729412079,84448.1902301768859615549 6744514.7519229725003242493,85068.5737523678835714236 6744607.9531195899471640587,96074.8431265876861289144 6748157.2177806487306952477,97157.2025355704972753301 6748706.9895085664466023445,97961.1518980803084559739 6749504.7636540355160832405,100125.6480770662747090682 6752040.7322811791673302650,100366.8774136145802913234 6752250.4959800848737359047,100700.8358859949512407184 6752430.7856468530371785164,102290.2555755406501702964 6753349.7319445507600903511,103094.2049380504759028554 6753299.0361882746219635010,103712.6960288961709011346 6752999.9017133433371782303,104609.3745272380474489182 6752251.2149737980216741562,105413.3238897450355580077 6750653.5882240496575832367,106310.1137075753067620099 6730660.1351233590394258499,106186.4377533049846533686 6729912.0686262054368853569,105815.2985699999990174547 6729265.1621820526197552681,101300.7366218783135991544 6724785.1914182389155030251,97435.5012625550734810531 6721153.1737744640558958054,91374.7115863163780886680 6716579.2334731891751289368,89952.3824524492665659636 6715585.3395559396594762802,87880.5040898041188484058 6714540.9331694291904568672,86736.4736829215835314244 6714143.7467630458995699883,85375.8155469570338027552 6714044.0953743606805801392,75759.0360568151081679389 6715982.5962533196434378624,72914.2664695953135378659 6716827.8153850547969341278,72233.9930613558244658634 6716777.1677711084485054016,51763.5632188718227553181 6710764.8671130761504173279,50279.3404481253455742262 6709871.2812930857762694359,42610.6520468670059926808 6701381.8283900208771228790,43064.2789718502899631858 6701007.0742961307987570763,43754.6824537495340337045 6700735.9331194628030061722,45888.3431337856382015161 6700735.9331194628030061722,49413.4974487361614592373 6701579.3939626310020685196,50372.0695839574036654085 6702225.3560402169823646545,50774.0442652094789082184 6702671.0925624407827854156,51639.8872646014933707193 6704409.2511069858446717262,52103.7555827357718953863 6705749.3941652383655309677,52443.8366271113118273206 6706294.8788479296490550041,53309.6796265004959423095 6707039.5279338592663407326,54453.8213528742635389790 6707437.7983302054926753044,59679.6035286736441776156 6708082.7945359824225306511,61102.0439820291576324962 6708082.7945359824225306511,65492.9299768776327255182 6708082.7945359824225306511,66296.9906588786834618077 6707983.2172337938100099564,77645.3448283077304949984 6705005.0416132481768727303,78789.4865546814980916679 6704409.2511069858446717262,79717.1118714616459328681 6703664.8422080753371119499,80150.0333711576531641185 6703266.7560733892023563385,80737.5776435650768689811 6702225.3560402169823646545,80892.2004162765078945085 6701629.7685904707759618759,80923.0359152263699797913 6700983.8536843284964561462,80737.5776435650768689811 6700239.7573901163414120674,80459.2789165805006632581 6699644.3149194410070776939,80057.3042353255877969787 6699198.9223657045513391495,78913.1625089518202003092 6698801.0541552761569619179,76903.1777831888757646084 6698652.4835701789706945419,76161.1220575612533139065 6698703.0186938904225826263,74120.1905133572145132348 6699347.3243200285360217094,71770.1247432215459411964 6699694.8561883503571152687,71244.4741076963109662756 6699446.7962147807702422142,62122.5097541297654970549 6694339.0450256969779729843,61936.9401629800777300261 6693793.1100867912173271179,62184.2920715207292232662 6693248.4608231084421277046,62864.5654797602182952687 6692306.2962902672588825226,64379.7350689449667697772 6690572.1413981299847364426,64812.6565686409740010276 6690174.8719813767820596695,65431.1476594894993468188 6689927.1012506941333413124,68987.1374733898846898228 6689332.4108338663354516029,78387.5118734265852253884 6688341.8319851234555244446,100744.1391679119842592627 6681805.1349956169724464417,101424.4125761514733312652 6681756.1299759773537516594,109247.7237501212366623804 6682646.8198239812627434731,111226.7616574430867331102 6683042.4755222806707024574,112680.0376097484549973160 6683786.2531834430992603302,115030.1033798869466409087 6685567.8164087301120162010,117194.7108783613221021369 6686509.2034763842821121216,118307.9057862939953338355 6686807.1536996848881244659,119080.9083303627121495083 6686905.0463614761829376221,132686.5991340981854591519 6688540.5088516287505626678,154239.3883855649910401553 6690174.8719813767820596695,158908.5731073980568908155 6680073.2087286934256553650,157084.1579727876232936978 6656945.3261903403326869011,156836.8060642441269010305 6654675.3291309745982289314,156558.5073372623883187771 6653096.7032059691846370697,155661.7175194292794913054 6650334.7957205474376678467,154765.0390210902260150760 6648608.2778596915304660797,152384.0264325134630780667 6645355.0285463603213429451,151177.9910692603443749249 6644074.7730702105909585953,150683.2872521733806934208 6643729.5977886170148849487,140540.8571265090431552380 6639296.2930648280307650566,137139.3787658288492821157 6639148.7998142978176474571,135871.6724046760064084083 6638951.3190174130722880363,122482.3866910429060226306 6634324.4684879593551158905,120998.0526008051965618506 6633437.9595231357961893082,116390.6501963602640898898 6630043.3960066903382539749,114659.0755170731426915154 6628519.7884833589196205139,111443.1667475454742088914 6625126.0206480631604790688,110700.9997024266194785014 6624193.0823077233508229256,109773.3743856464716373011 6622570.4257791340351104736,108969.4250231366459047422 6620703.9979277048259973526,108289.1516148999944562092 6618689.4539327388629317284,107948.9592510360380401835 6617216.3961567794904112816,107763.3896598835272016004 6615693.5772022884339094162,107979.9060694743093336001 6611619.0300757139921188354,108536.5035234406386734918 6609263.1620539985597133636,95363.7342194011725950986 6608135.2838680362328886986,90632.6558606859180144966 6609705.2774426080286502838,88313.4255895001260796562 6609999.0332648092880845070,86983.8255914650653721765 6609902.0555871129035949707,79748.0586899027402978390 6604506.3188261361792683601,78572.9701450878783361986 6603231.0086531080305576324,75975.5524664087279234082 6599947.3558878600597381592,75171.6031038989167427644 6599114.1223738146945834160,73718.2158321023016469553 6598231.2304569184780120850,63142.8642067419714294374 6594410.2218072060495615005,55505.1226239247334888205 6592696.6615649545565247536,50403.0164023956676828675 6591962.3375045266002416611,47960.1101769395536393858 6591472.8832935625687241554,44589.6899541916864109226 6590297.7480696095153689384,41404.6166836138800135814 6588878.0462712580338120461,38899.9281407639646204188 6587508.4432779615744948387,34199.7966004898116807453 6582566.6249391864985227585,32993.8725567279179813340 6581296.1196682117879390717,31942.4599661862121138256 6579829.5697773406282067299,30829.2650582535461580846 6577482.7885235277935862541,30179.9384684551514510531 6576456.0180761599913239479,29345.0422875042349915020 6575674.7659990629181265831,28262.7941980126670387108 6575186.2792139910161495209,26964.0296989274793304503 6575088.3038974460214376450,25356.1309739106764027383 6575332.6287153083831071854,23964.6373389934269653168 6575723.1413118075579404831,13729.3667580058081512107 6578850.9004119643941521645,10946.3794881741414428689 6580318.3320494303479790688,6338.9770837320520513458 6582616.2731604762375354767,-10513.4579884809681971092 6587801.4071046337485313416,-15368.3236209549431805499 6589220.9231394883245229721,-17470.9261630587170657236 6589759.9347267141565680504,-21243.4323865527221641969 6590542.5246952790766954422,-22944.1715668928191007581 6590688.9712123088538646698,-28386.4701522858267708216 6590640.5078765731304883957,-64256.0591146746373851784 6585159.4724248666316270828,-70966.1753807117347605526 6583740.6566685084253549576,-75171.6031038989167427644 6582664.6892674667760729790,-79191.4612359364109579474 6581394.1688646301627159119,-83056.6965952596365241334 6579976.0018110657110810280,-85499.6028207185881910846 6577678.7972948485985398293,-85344.9800480071717174724 6576603.6216455642133951187,-85344.9800480071717174724 6575967.4849601816385984421,-85623.2787749889248516411 6574550.2519700163975358009,-86427.2281374987360322848 6573525.0780129041522741318,-86891.0964556358376285061 6573231.2148195700719952583,-87416.7470911610726034269 6572987.1281669437885284424,-88653.6179533640679437667 6572840.8203256204724311829,-89333.8913616007339442149 6573183.0299939680844545364,-100558.5695767594588687643 6580366.7346454048529267311,-101331.6834403194079641253 6581100.0247781453654170036,-101393.4657577103789662942 6581784.9690047213807702065,-101146.1138491668825736269 6582371.9082093313336372375,-99569.0506230999453691766 6584132.9769384199753403664,-99136.2404428951704176143 6584474.2473884969949722290,-96755.2278543184220325202 6585159.4724248666316270828,-96384.0886720133712515235 6585600.1175798885524272919,-96136.7367634698894107714 6586137.6591189010068774223,-96260.4127177402115194127 6586823.0226584235206246376,-97064.4733997412695316598 6587556.8881699843332171440,-103186.9340738797036465257 6592941.3333000577986240387,-103515.6605301919189514592 6593018.0150606799870729446,-104547.5922098470764467493 6593186.1885973056778311729,-121833.0601012445113155991 6594068.5390184000134468079,-128543.0650477903691353276 6593773.9415692239999771118,-129068.8270028068363899365 6593529.0687755867838859558,-129377.9612287412892328575 6592991.2204331913962960243,-129037.8801843657420249656 6592451.8208384830504655838,-127646.3865494513302110136 6591472.8832935625687241554,-124461.4245983647560933605 6588095.7907635690644383430,-124275.8550072122307028621 6587556.8881699843332171440,-124214.0726898212742526084 6586921.1377092571929097176,-124399.5309614825528115034 6586285.4363561803475022316,-125481.7790509741316782311 6583740.6566685084253549576,-125729.2422790088457986712 6583203.2716363826766610146,-126100.2701418226497480646 6582762.7547638705000281334,-126564.1384599597658962011 6582371.9082093313336372375,-127089.7890954850008711219 6582175.7876954572275280952,-127677.3333678924245759845 6582029.3165351273491978645,-148209.5455277645669411868 6584474.2473884969949722290,-156744.0769284148991573602 6580855.5288042686879634857,-177307.2359067281358875334 6572644.9266350185498595238,-179688.2484953048988245428 6573623.0347399692982435226,-185192.3293980888556689024 6574990.3297461569309234619,-186166.3749425292480736971 6575124.5387979382649064064,-187511.5596692746621556580 6575234.6516581308096647263,-189397.7571212760522030294 6574892.3567600846290588379,-202199.4985625045374035835 6572450.4443286526948213577,-215310.4855491530615836382 6570643.5257586129009723663,-223690.3941770891542546451 6571033.8161583300679922104,-224927.2650392949872184545 6571522.0567965423688292503,-225700.2675833608664106578 6572304.1460169507190585136,-225947.7308113955950830132 6572890.4099519327282905579,-226195.0827199390623718500 6574111.4288358055055141449,-226658.8397185821086168289 6574403.9163672123104333878,-227308.2776278717501554638 6574355.7246823841705918312,-229936.6421249919803813100 6571131.7432721024379134178,-230214.9408519737189635634 6570691.8715392947196960449,-231482.7585326178232207894 6568495.1498176343739032745,-231699.1636227201961446553 6567957.5282158264890313148,-231513.5940315676853060722 6567371.4393543517217040062,-219825.0474982746818568558 6563174.7845095358788967133,-218544.8733541518449783325 6562004.3818928413093090057,-218081.1163555059756617993 6562530.9020095784217119217,-217765.6369185995426960289 6562735.8640607446432113647,-217394.6090557857241947204 6562619.2440684689208865166,-217227.6298195955459959805 6562325.9450527308508753777,-217134.9006837634951807559 6561975.5805613631382584572,-215465.1083218644780572504 6557761.3089584950357675552,-218000.6323636642773635685 6550597.2664701351895928383,-218464.5006817985267844051 6550255.9927347600460052490,-219113.8272715969360433519 6550110.2629772489890456200,-228359.5788989222201053053 6548356.4466876452788710594,-229039.8523071616946253926 6548306.8290311563760042191,-236213.8368913330778013915 6552106.6863311016932129860,-237543.4368893681094050407 6553178.6718548554927110672,-238749.3609331300249323249 6553813.0525497095659375191,-244593.6341997779381927103 6555420.8014626977965235710,-265837.1779058218817226589 6558151.1655460912734270096,-266486.5044956202618777752 6558151.1655460912734270096,-270630.0385819252696819603 6556980.7734949644654989243,-272361.7245807064464315772 6555470.4619060028344392776,-274340.7624880283256061375 6550547.8107175137847661972,-274680.8435324038728140295 6549086.7198353800922632217,-274495.3852607397129759192 6548015.2655762238427996635,-273691.3245787415071390569 6546457.1623187074437737465,-269918.9296747387270443141 6543828.4419597163796424866,-271001.8456811748910695314 6540638.4371511004865169525,-273315.0646998595329932868 6541884.1233676308766007423,-273649.9137281669536605477 6544135.2785705877467989922,-277698.1583303528605028987 6550078.8726683063432574272,-285318.0887946435250341892 6556493.2176425578072667122,-296326.3619196998770348728 6563712.0942877801135182381,-300624.5187787191243842244 6566103.2751583149656653404,-302912.6909119753981940448 6567225.4069060487672686577,-308509.6122700798441655934 6569911.3416102193295955658,-314261.1564008957357145846 6571962.1486793523654341698,-318806.6651684584212489426 6573378.9364791419357061386,-320909.3790300505934283137 6573867.3161043440923094749,-323599.6371640530414879322 6574257.7592431930825114250,-325578.6750713749206624925 6574013.4663015846163034439,-326197.0548427322064526379 6573769.3564727697521448135,-327774.1180687991436570883 6572498.8007120154798030853,-329443.9104306981316767633 6570643.5257586129009723663,-331515.6774738520616665483 6569519.6981390863656997681,-344472.0416877919342368841 6567029.6466476824134588242,-352944.6794515572837553918 6566395.4785974835976958275,-353594.0060413556639105082 6566297.6077411789447069168,-361139.0184883408364839852 6563906.3705149488523602486,-362252.2133962735533714294 6563468.2893692338839173317,-379754.0863777761696837842 6553665.8564450433477759361,-382629.8027834370732307434 6551717.2906227651983499527,-385010.8153720138361677527 6549184.3867120612412691116,-385722.0355986944050528109 6548258.7896054740995168686,-388968.8911866603302769363 6541443.7060142951086163521,-389649.1645948970108292997 6539594.1744699953123927116,-395338.8150888335076160729 6522536.1427857801318168640,-395555.3314984271419234574 6520302.7428543651476502419,-406532.6578050423413515091 6486396.6404237886890769005,-409099.1286652804119512439 6484511.5183053677901625633,-412624.2829802309279330075 6482674.6582738365978002548,-413737.4778881635866127908 6482143.8033350799232721329,-415098.0247046397416852415 6482094.7548869289457798004,-421838.9764696267084218562 6483109.8733296152204275131,-423354.2573783026891760528 6483448.3897058935835957527,-424498.3991046764422208071 6483979.1541199050843715668,-426724.6776010505273006856 6485719.5549450898543000221,-427436.0091472195344977081 6486589.1091404585167765617,-428023.4421001357259228826 6487604.7774988533928990364,-428796.4446442044572904706 6489974.0513618225231766701,-431517.6495966479997150600 6494908.6856395686045289040,-431795.9483236297382973135 6495392.4503537956625223160,-438691.6341808193828910589 6500570.8665431030094623566,-439371.9075890560052357614 6500910.0963339135050773621,-439928.5050430223345756531 6501104.2968212217092514038,-440670.5607686528237536550 6501104.2968212217092514038,-442587.7050390924559906125 6500814.3923815786838531494,-443670.0644480752525851130 6500378.0730656441301107407,-445834.5606270612333901227 6499457.9207693589851260185,-446576.7276721801026724279 6498586.8420996433123946190,-446855.0263991618412546813 6498102.8909656442701816559,-447813.7098538743448443711 6497424.8492318037897348404,-448401.1428067905362695456 6497182.9911710228770971298,-449019.5225781478220596910 6497133.6794784562662243843,-451153.1832581810886040330 6497666.8886055145412683487,-452111.7553934023017063737 6498392.7005846193060278893,-457677.7299330656533129513 6503671.5180009743198752403,-463707.5727908660774119198 6510649.9604480331763625145,-464758.8740619165473617613 6511959.0404964704066514969,-487579.3696745390770956874 6509534.2639653859660029411,-492650.6403971154359169304 6507693.2483937256038188934,-493578.2657138984068296850 6507014.4215451674535870552,-494368.0775010754005052149 6506141.3271888131275773048,-495464.5744853881769813597 6504833.1662141699343919754,-495742.8732123727677389979 6504348.8502035420387983322,-497196.2604841693537309766 6503477.4317235788330435753,-499020.6756187797873280942 6502896.0720003144815564156,-502112.7971145459450781345 6502314.7530601238831877708,-505761.6273837667540647089 6502266.8056578664109110832,-517109.9815531958010978997 6502508.8121071672067046165,-520820.7054592988570220768 6502896.0720003144815564156,-530159.1862224561627954245 6500378.0730656441301107407,-540734.4265283253043889999 6486493.5703135132789611816,-551340.7249721267726272345 6479824.5810984466224908829,-561947.0234159281244501472 6475960.9393837330862879753,-563214.8410965750226750970 6470410.8720269836485385895,-564977.3625943033257499337 6460960.2800550907850265503,-564513.6055956602795049548 6460575.1449917182326316833,-564235.1955491844564676285 6460093.4043032908812165260,-562689.1904610469937324524 6457010.1961755231022834778,-562565.5145067767007276416 6456383.1840558908879756927,-562781.9195968790445476770 6454891.0991322873160243034,-563214.8410965750226750970 6453638.6548310611397027969,-563895.1145048117032274604 6452772.3683655355125665665,-566183.3979575593257322907 6450220.8311815606430172920,-574315.8433574606897309422 6447044.8063102504238486290,-574656.0357213246170431376 6446611.4752407195046544075,-576263.9344463442685082555 6443292.9624209115281701088,-576758.6382634283509105444 6442187.4891776861622929573,-578088.3495809546438977122 6438534.0316680874675512314,-578737.7874902414623647928 6438581.6127114910632371902,-579170.5976704462664201856 6438965.7314497744664549828,-582046.4253955984022468328 6441658.0011166380718350410,-583035.8330297694774344563 6443005.0682396311312913895,-585076.7645739734871312976 6446419.9300056621432304382,-585231.3873466849327087402 6446997.3500893814489245415,-585200.4405282466905191541 6447622.2697355588898062706,-584551.1139384482521563768 6449450.1864814916625618935,-584520.1671200072159990668 6450268.3057826254516839981,-584798.4658469917485490441 6451472.7611525235697627068,-587395.9948451621457934380 6456623.8567919051274657249,-588849.1594779762672260404 6458310.8421387113630771637,-593734.8606094029964879155 6462117.1803809301927685738,-608979.5082760875811800361 6467950.4582427898421883583,-610309.1082741225836798549 6468288.3572993138805031776,-611082.2221376826055347919 6468337.3242838028818368912,-612380.9866367677459493279 6468143.8890122128650546074,-613525.1283631415572017431 6467758.4210167797282338142,-615689.6245421246858313680 6466745.1769030587747693062,-616431.6802677522646263242 6465925.2618505218997597694,-616864.6017674482427537441 6464672.5433970680460333824,-616926.4954043276375159621 6463900.5587546769529581070,-616493.5739046344533562660 6461297.7216064278036355972,-616462.6270861934171989560 6460575.1449917182326316833,-616648.1966773458989337087 6459080.9204000355675816536,-617142.9004944300977513194 6457924.4423432126641273499,-618039.6903122602961957455 6456576.3459163447842001915,-618843.6396747701801359653 6455757.4328499510884284973,-619740.4294926003785803914 6455131.7287068972364068031,-621472.0041718903230503201 6454553.7440260341390967369,-629388.1558011806337162852 6452626.9561679409816861153,-630037.3710714877815917134 6452482.9330037198960781097,-630810.4849350476870313287 6452579.4681103099137544632,-632047.3557972507551312447 6452964.2331628119572997093,-633129.6038867422612383962 6453542.1074361680075526237,-635912.7024760651402175426 6455564.2900025611743330956,-636469.2999300315277650952 6456576.3459163447842001915,-636592.9758843046147376299 6457201.9853167394176125526,-636592.9758843046147376299 6457924.4423432126641273499,-635634.2924295922275632620 6468675.2390704853460192680,-634057.3405230136122554541 6472824.2370138922706246376,-633191.4975236244499683380 6473548.0531108947470784187,-617421.3105409058043733239 6481902.2164400974288582802,-613555.9638620885089039803 6483448.3897058935835957527,-611793.3310448691481724381 6483931.4865742065012454987,-610432.8955478841671720147 6483592.9504946963861584663,-609907.1335928677581250668 6483303.6574793346226215363,-609350.5361389013705775142 6482288.5153391053900122643,-609041.2905934784794226289 6481080.9779284242540597916,-608793.9386849350994452834 6480598.0469208294525742531,-608144.6120951366610825062 6480356.5050043519586324692,-605516.2475980191957205534 6479679.9120374908670783043,-604774.0805529003264382482 6479727.7290563872084021568,-604217.4830989340553060174 6479921.4342703213915228844,-586437.3113904496422037482 6493844.2239179955795407295,-573728.4104045444400981069 6505803.2786012487486004829,-573326.3244037983240559697 6506238.4881842527538537979,-562379.9449156242189928889 6519720.2007216988131403923,-562039.7525517601752653718 6520205.4166752127930521965,-561514.2132357262307778001 6521322.7271694773808121681,-559318.6589188107755035162 6527488.8217860972508788109,-559256.8766014197608456016 6528121.2326617483049631119,-559627.9044642335502430797 6529287.5419454993680119514,-560988.4512807097053155303 6532591.2870305376127362251,-560926.5576438275165855885 6533369.6954847564920783043,-558947.5197365056956186891 6540373.2428789725527167320,-558143.5703739959280937910 6541200.3828694252297282219,-547228.0263847715687006712 6546846.3099766355007886887,-545187.2061600559391081333 6547139.2345692599192261696,-542558.8416629385901615024 6547139.2345692599192261696,-534488.2898999165045097470 6548989.0541141862049698830,-532756.4925816440954804420 6549573.6629438968375325203,-532261.7887645600130781531 6549866.6843251455575227737,-531179.5406750683905556798 6551181.9892134414985775948,-530066.3457671357318758965 6553422.3482725294306874275,-528953.1508592030731961131 6558102.8932447293773293495,-528056.3610413699643686414 6562687.0380198908969759941,-523294.4471837076707743108 6566347.3337222440168261528,-517790.2549614353338256478 6571082.1642288379371166229,-508142.6399723435170017183 6581344.3519815802574157715,-507400.4729272246477194130 6582273.8473684089258313179,-506905.7691101405071094632 6583398.1841057818382978439,-506441.9007920034346170723 6586431.9832690181210637093,-506225.4957019010325893760 6588878.0462712580338120461,-506194.5488834627903997898 6590395.9045603703707456589,-506101.8197476307395845652 6595635.6715642046183347702,-506132.6552465806016698480 6596370.3236654140055179596,-506318.2248377330834046006 6596958.3042418546974658966,-505761.6273837667540647089 6608380.5921446401625871658,-503968.1590675974148325622 6623061.9129843506962060928,-503566.1843863425310701132 6623995.9613394439220428467,-502854.8528401735238730907 6624094.5212316401302814484,-498092.9389825084363110363 6623798.8451065737754106522,-493207.2378510817652568221 6623061.9129843506962060928,-492496.0176244039903394878 6622914.7114246273413300514,-491135.4708079306874424219 6621784.9565870827063918114,-487177.5063127753674052656 6619720.2741699311882257462,-485105.7392696214956231415 6619426.1703810859471559525,-483064.8077254174277186394 6619623.1816156450659036636,-481425.8508624683017842472 6620458.3212403720244765282,-479075.8964118210133165121 6622030.6729902913793921471,-472149.2637361931265331805 6629011.4551815437152981758,-471809.1826918176375329494 6629355.8341757701709866524,-471345.3143736833590082824 6629896.2461983226239681244,-468840.6258308333926834166 6633782.5244615664705634117,-468531.3802854105597361922 6634423.1525730984285473824,-469799.1979660546639934182 6640872.0837478553876280785,-470850.6105565963662229478 6654329.7067407211288809776,-470479.4713742913445457816 6654822.9246394680812954903,-468500.4334669694653712213 6656007.3373144594952464104,-467387.2385590368066914380 6656450.5591909773647785187,-458265.2742054730770178139 6658919.0068900147452950478,-453255.8971197761129587889 6659214.5313891069963574409,-443577.3353122460539452732 6659758.3385743526741862297,-432352.5457775960676372051 6661041.0492092268541455269,-422179.1688334906357340515 6663708.9564904095605015755,-411913.0627535531530156732 6662078.6332148471847176552,-404337.2148076153243891895 6659954.8999988278374075890,-402821.9338989393436349928 6659708.2214982789009809494,-400410.0858114127186127007 6660350.8807510212063789368,-399358.6732208681642077863 6660893.3415082683786749840,-397936.2327675126725807786 6661880.5986261591315269470,-396915.8783149004448205233 6662375.6940869214013218880,-390793.3063212707638740540 6660992.3462550239637494087,-390051.1392761518945917487 6660794.3379595801234245300,-383217.3470558444969356060 6658277.8815929768607020378,-382691.6964203192619606853 6657980.9694618340581655502,-382320.6685575054725632071 6657635.2074515735730528831,-381083.7976952996104955673 6655514.0480420421808958054,-380341.6306501807994209230 6654625.0655641015619039536,-379444.8408323504845611751 6653984.2765384409576654434,-378177.1344711976125836372 6653491.1091670170426368713,-377373.0737891966127790511 6653392.1951259449124336243,-375177.6307917723315767944 6653392.1951259449124336243,-367508.9423905140138231218 6653392.1951259449124336243,-337112.5988319564494304359 6657833.1393120000138878822,-335009.8849703642772510648 6665585.3860762137919664383,-335442.8064700574614107609 6666721.1978914896026253700,-335535.5356058895122259855 6667364.4083972629159688950,-335442.8064700574614107609 6669686.8621351048350334167,-334731.5862433796864934266 6675818.3632567543536424637,-329505.6927480890881270170 6687895.4508803253993391991,-317569.7943062526173889637 6700339.2401692178100347519,-308416.8831342477933503687 6708281.9527898402884602547,-295367.7897844786639325321 6721651.8780053677037358284,-293821.6733768528210930526 6724338.2434999896213412285,-284204.8938867108663544059 6738381.9839703468605875969,-275144.7118505381513386965 6750453.5700151724740862846,-273753.2182156209019012749 6751500.9796426724642515182,-272794.6460804024827666581 6752001.5482317414134740829,-270382.6866733846254646778 6752699.5199452098459005356,-267877.9981305347173474729 6753198.9040106711909174919,-267321.4006765683880075812 6753448.4277819134294986725,-266270.0994055179180577397 6753998.5576991466805338860,-265466.0387235168600454926 6754897.0035624913871288300,-264940.3880879916250705719 6756046.5910426154732704163,-264816.7121337184216827154 6756895.9841181430965662003,-264909.5525890417629852891 6757544.9133904082700610161,-265095.0108607030124403536 6758144.7874324973672628403,-265713.5019515515887178481 6759143.8964259419590234756,-266146.3121317534823901951 6759543.2865942474454641342,-266795.7500410431530326605 6759793.0053844498470425606,-273907.8409883351414464414 6754448.3974975654855370522,-287080.6102923746220767498 6742071.0710735591128468513,-292677.5316504790680482984 6736039.8856896292418241501,-296666.4429640754242427647 6730809.2905607484281063080)),((-575738.2838108161231502891 7445662.3215868351981043816,-581489.8279416320146992803 7445770.2241512890905141830,-582386.6177594651235267520 7445825.5493218069896101952,-582974.0507123813731595874 7446151.8189138257876038551,-588138.0505707897245883942 7449095.3408749038353562355,-589189.3518418401945382357 7449914.4276374652981758118,-594477.1389740130398422480 7454604.6953015578910708427,-594693.5440641153836622834 7455040.9381962884217500687,-596363.3364260144298896194 7460335.7556891534477472305,-601156.1971021178178489208 7479304.9535188870504498482,-601218.0907390000065788627 7480946.8646880760788917542,-601156.1971021178178489208 7482698.7262673750519752502,-600723.2756024218397215009 7484888.7174664484336972237,-599022.5364220845513045788 7492726.1545226909220218658,-598682.4553777090040966868 7493328.3919804077595472336,-597878.3946957107400521636 7494370.7231308631598949432,-593332.9972476392285898328 7498868.1786772878840565681,-592838.1821110638557001948 7499308.1117766723036766052,-589467.7618883160175755620 7502216.2121196007356047630,-586159.0126634679036214948 7502326.0925307748839259148,-584643.8430742803029716015 7502107.5190071118995547295,-583221.4026209219591692090 7501613.0834732400253415108,-582015.3672576688695698977 7500954.2805386865511536598,-578675.8938533620676025748 7498759.5326921911910176277,-577222.5065815654816105962 7497496.7834186805412173271,-575305.3623111229389905930 7495797.2470681583508849144,-574439.5193117309827357531 7494809.0180133040994405746,-573821.1395403764909133315 7493658.2508851466700434685,-566090.6688217271585017443 7470661.5068180840462446213,-565935.9347295245388522744 7469951.2167844949290156364,-564915.4689574239309877157 7452313.8906287150457501411,-564884.6334584740689024329 7451494.5500295581296086311,-565039.2562311855144798756 7450732.0305376620963215828,-565379.3372755582677200437 7450131.5305778924375772476,-566987.3473200662992894650 7448060.6635185629129409790,-568131.4890464399941265583 7447460.1744271237403154373,-575738.2838108161231502891 7445662.3215868351981043816)),((-559164.0361460965359583497 7503149.4548785416409373283,-559967.9855086063034832478 7503315.2842772519215941429,-560462.6893256932962685823 7503698.3460194766521453857,-569832.2282267800765112042 7514194.0817999914288520813,-570172.3092711528297513723 7514797.9966831970959901810,-578706.7293523119296878576 7533405.3470081146806478500,-578923.2457619027700275183 7534066.9279908332973718643,-579510.6787148189032450318 7536933.3768309159204363823,-579603.5191701422445476055 7537705.8451215503737330437,-579572.5723517010919749737 7538422.3980714641511440277,-576820.5319003105396404862 7542119.5918227070942521095,-576294.8812647825106978416 7542505.9771181223914027214,-575583.6610381047939881682 7542284.6723198099061846733,-574470.4661301720188930631 7541567.9585998225957155228,-565533.9600482695968821645 7533956.3959615742787718773,-560648.2589168429840356112 7526188.9937526304274797440,-557586.9729200295405462384 7515347.9150803945958614349,-557215.9450572157511487603 7513973.5884437793865799904,-557185.1095582658890634775 7512324.6404690435156226158,-557370.5678299271967262030 7504962.3078959751874208450,-557617.9197384706931188703 7504248.8576145675033330917,-558421.8691009776666760445 7503259.5462272781878709793,-559164.0361460965359583497 7503149.4548785416409373283)),((-664793.8764454351039603353 7516393.0264545530080795288,-670947.3952575059374794364 7517053.1489270376041531563,-671534.8282104220706969500 7517328.1836316678673028946,-673823.1116631695767864585 7518758.9579390995204448700,-674936.3065711023518815637 7519473.5533458655700087547,-675771.2027520503615960479 7520353.2224902408197522163,-676111.2837964259088039398 7521013.6840607589110732079,-676327.8002060195431113243 7521784.5582381589338183403,-676729.7748872715746983886 7523985.6687162136659026146,-677719.2938409339403733611 7534066.9279908332973718643,-677688.3470224929042160511 7534893.4879543641582131386,-677317.3191596789984032512 7537375.6853555440902709961,-676698.8280688333325088024 7539635.8654353143647313118,-664360.9549457419198006392 7563116.1797363320365548134,-663000.2968097745906561613 7564499.3038628213107585907,-657496.2159069934859871864 7570035.6849991707131266594,-656970.6765909566311165690 7570534.5317315002903342247,-646673.5123730896739289165 7580288.4833432398736476898,-640643.6695152892498299479 7585004.0025708498433232307,-639530.5859268477652221918 7585836.2537989197298884392,-635789.0265217948472127318 7588389.7062006164342164993,-635139.5886125080287456512 7588501.0231859032064676285,-633902.7177503022830933332 7587778.3908720752224326134,-632851.3051597605226561427 7583506.1376072801649570465,-632789.5228423695079982281 7582729.0567086441442370415,-632789.5228423695079982281 7581840.8322850158438086510,-632974.9811140308156609535 7580954.1081317737698554993,-633500.7430690473411232233 7579679.4093241794034838676,-634799.3962486413074657321 7578126.0998761691153049469,-635417.8873394897673279047 7577571.6791742900386452675,-636407.4062931521330028772 7576241.0730336820706725121,-637891.6290638985810801387 7573968.7197279091924428940,-639654.2618811180582270026 7571088.2456444287672638893,-640303.5884709164965897799 7569758.7612766847014427185,-650755.2641420065192505717 7548357.1669921502470970154,-657248.8639984499895945191 7535060.1998698618263006210,-662010.8891756035154685378 7524646.4415445849299430847,-664793.8764454351039603353 7516393.0264545530080795288)),((-638417.3910189151065424085 7589943.6933768726885318756,-639252.1758803747361525893 7589943.6933768726885318756,-639870.6669712205184623599 7590277.5168613130226731300,-640087.0720613228622823954 7590887.6317691532894968987,-639437.7454715273343026638 7592165.9916837643831968307,-638479.1733363060047850013 7593886.9354436751455068588,-633562.5253864382393658161 7597221.5368494736030697823,-632913.1987966427113860846 7597442.8280005119740962982,-632263.8722068442730233073 7597276.3588367188349366188,-631769.1683897601906210184 7596720.7541195014491677284,-631614.4342975575709715486 7596165.1896145483478903770,-631583.5987986077088862658 7595332.0182546870782971382,-631583.5987986077088862658 7592942.4283110080286860466,-631830.9507071482948958874 7592220.7775808572769165039,-632882.2519782016752287745 7591442.8144898163154721260,-634799.3962486413074657321 7590610.1554144909605383873,-636005.4316118971910327673 7590221.1456497646868228912,-638417.3910189151065424085 7589943.6933768726885318756)),((-627625.5229839611565694213 7595664.6758304946124553680,-628305.7963921978371217847 7595887.5224618297070264816,-628738.7178918938152492046 7596276.6193867400288581848,-630439.4570722338976338506 7600834.0224557518959045410,-630655.8621623362414538860 7601501.4306786367669701576,-628305.7963921978371217847 7609568.5682490030303597450,-628058.4444836571346968412 7610404.8903153417631983757,-624440.5610328745096921921 7609848.3341843830421566963,-624100.3686690105823799968 7609235.1069969609379768372,-624155.3604974618647247553 7608345.4135369891300797462,-626728.7331661308417096734 7597720.7515125907957553864,-627625.5229839611565694213 7595664.6758304946124553680)),((-625924.7838036210741847754 7611796.5575865879654884338,-626821.5736214512726292014 7611963.1416269848123192787,-627347.2242569765076041222 7612353.2551147406920790672,-628738.7178918938152492046 7616976.7891307510435581207,-628460.4191649092826992273 7618592.9562537530437111855,-628212.9559368772897869349 7619261.9116027252748608589,-626821.5736214512726292014 7621603.1129946140572428703,-625832.0546677918173372746 7622550.9550202786922454834,-624997.1584868408972397447 7622606.1590891517698764801,-622245.1180354503449052572 7622662.7687654243782162666,-621595.6801261607324704528 7622327.3324233889579772949,-621564.7333077224902808666 7621491.3147064875811338425,-621750.4142183633521199226 7620655.1874711913987994194,-623729.3408061967929825187 7614190.4231539648026227951,-624347.8318970424588769674 7613021.6662818389013409615,-625244.5103953843936324120 7612129.9297544891014695168,-625924.7838036210741847754 7611796.5575865879654884338)),((-618132.4194480923470109701 7634046.1933538932353258133,-621657.5737630429212003946 7634883.5821420866996049881,-621904.9256715864175930619 7635442.1603071531280875206,-622028.6016258567105978727 7636279.7017440479248762131,-621781.2497173132142052054 7636895.0966819357126951218,-619802.3231294825673103333 7639688.1229722509160637856,-617359.4169040236156433821 7640358.9228347931057214737,-613370.3942709360271692276 7640695.1496747722849249840,-616308.0043134819716215134 7636000.5781193887814879417,-617112.0649954801192507148 7634995.5760108726099133492,-618132.4194480923470109701 7634046.1933538932353258133)),((-680904.2557920205872505903 7688971.5201006643474102020,-675585.7444803890539333224 7686665.2835735436528921127,-674256.0331628656713292003 7686046.0731141436845064163,-672307.9420739820925518870 7683404.2137830695137381554,-667484.1345794375520199537 7675427.1118102883920073509,-667143.9422155736247077584 7674753.2296862173825502396,-665072.1751724197529256344 7668860.4051676299422979355,-664701.0359901146730408072 7667570.8004183741286396980,-651930.2413673300761729479 7662468.6353409998118877411,-645714.9402378683444112539 7661347.9715940030291676521,-644972.7731927494751289487 7661178.6958307139575481415,-643828.6314663757802918553 7660395.1128663672134280205,-636160.0543846086366102099 7654344.2149505326524376869,-629078.9102557577425613999 7648748.2799130156636238098,-628831.5583472142461687326 7647293.0925275487825274467,-628769.6647103348514065146 7645670.6582383047789335251,-629913.6951172174885869026 7639074.1129465876147150993,-630408.5102537928614765406 7637565.6519075101241469383,-634737.6139312532031908631 7630249.2361390953883528709,-636160.0543846086366102099 7628799.1669095354154706001,-646611.7300556986592710018 7621881.7125919712707400322,-650136.8843706492334604263 7620153.0732755511999130249,-650878.9400962768122553825 7619986.1105338940396904945,-652332.3273680733982473612 7620488.4144801758229732513,-653661.9273661085171625018 7621212.5285919252783060074,-654342.2007743450812995434 7622215.5235715247690677643,-653600.0337292291224002838 7623442.4991875784471631050,-652981.6539578718366101384 7623832.9964729128405451775,-652301.3805496323620900512 7624893.1614138623699545860,-651651.9426403455436229706 7626232.2308252081274986267,-651466.3730491930618882179 7626956.8878510380163788795,-651497.4311871253885328770 7627960.8358448566868901253,-651744.7830956659745424986 7628351.5634496649727225304,-652363.1628670232603326440 7628799.1669095354154706001,-653198.0590479741804301739 7628909.4645963711664080620,-654837.0159109233645722270 7628799.1669095354154706001,-655981.0463178058853372931 7628239.6666702739894390106,-666092.6409445203607901931 7622103.9170802831649780273,-669710.4130758116953074932 7619317.0919895535334944725,-697385.7743209081236273050 7610126.5069936262443661690,-703662.9690872520441189408 7611183.1746214488521218300,-704095.8905869452282786369 7611684.9021986331790685654,-705703.7893119648797437549 7613633.3917428404092788696,-706445.8450375924585387111 7614692.1469864565879106522,-706693.1969461359549313784 7615249.0547652505338191986,-708672.3461729490663856268 7620153.0732755511999130249,-708703.1816718989284709096 7620988.9450392834842205048,-708393.9361264732433483005 7624390.5687281526625156403,-706909.7133557267952710390 7625784.7772830910980701447,-705703.7893119648797437549 7626232.2308252081274986267,-701065.4400890816468745470 7626566.2313562659546732903,-700261.4907265718793496490 7626399.1288499012589454651,-699271.9717729095136746764 7625617.6918163308873772621,-698869.9970916574820876122 7625060.0302770650014281273,-698189.7236834180075675249 7623889.6152115678414702415,-693736.9440516872564330697 7622048.7166286185383796692,-675245.5521165251266211271 7629412.3537727268412709236,-670947.3952575059374794364 7631477.4989179829135537148,-670390.7978035395499318838 7631923.6771551398560404778,-669988.8231222846079617739 7632371.2883725911378860474,-669895.9826669641770422459 7633375.9461823049932718277,-670050.6054396756226196885 7634101.2792629031464457512,-670359.8509851013077422976 7634659.8003760473802685738,-670978.2307564557995647192 7634995.5760108726099133492,-671751.3446200157050043344 7634883.5821420866996049881,-676698.8280688333325088024 7632650.4807734247297048569,-679574.6557939854683354497 7630976.0818669088184833527,-680811.5266561885364353657 7630416.4226354788988828659,-686748.6403781569097191095 7629636.1832222435623407364,-688511.0505563967162743211 7629748.1003992343321442604,-689469.6226916179293766618 7630695.5437986664474010468,-690026.2201455842005088925 7631980.3557103760540485382,-690521.0352821595733985305 7634046.1933538932353258133,-690211.7897367367986589670 7635777.9702437324449419975,-683841.8658345636213198304 7644105.5374458534643054008,-677162.6963869676692411304 7647068.7463837368413805962,-675894.8787063235649839044 7647740.1933232387527823448,-671473.0458930339664220810 7650426.5703271478414535522,-670297.9573482191190123558 7651210.5432822806760668755,-669339.3852129979059100151 7652050.0132930614054203033,-668690.0586231994675472379 7653392.2282215254381299019,-668535.4358504880219697952 7654121.2745546055957674980,-668164.4079876742325723171 7656585.2678927034139633179,-668226.1903050652472302318 7657425.3278924627229571342,-668628.2763058113632723689 7657817.5622460534796118736,-669886.2978712664917111397 7657906.9017260335385799408,-678925.2178846986498683691 7654793.3406463116407394409,-681058.8785647319164127111 7653224.7407988160848617554,-681986.6152010033838450909 7653337.0033232029527425766,-682604.9949723606696352363 7653616.7598327985033392906,-704126.7260858950903639197 7666561.8454829007387161255,-705518.2197208123980090022 7668019.0880806446075439453,-703879.3741773545043542981 7678797.4141988204792141914,-703539.2931329789571464062 7679414.6216089874505996704,-688696.6201475491980090737 7687508.6565122948959469795,-683563.5671075818827375770 7689476.7540199654176831245,-682821.4000624630134552717 7689589.5502855889499187469,-680904.2557920205872505903 7688971.5201006643474102020)),((-690180.9542377869365736842 7564002.2430113358423113823,-694695.5161869085859507322 7564777.4328891141340136528,-697200.2047297556418925524 7565607.4966493323445320129,-693984.2959602307528257370 7573802.7585255075246095657,-693365.9161888734670355916 7574910.6972285006195306778,-691355.9314631104934960604 7577516.9976580627262592316,-690459.1416452802950516343 7578459.4101906763389706612,-687799.9416492101736366749 7580954.1081317737698554993,-687243.3441952437860891223 7581397.5572497285902500153,-683377.9975164294010028243 7582674.1387760406360030174,-682481.3190180874662473798 7582506.5915821185335516930,-682357.6430638171732425690 7581785.9207013463601469994,-687738.0480123279849067330 7566215.6559154046699404716,-689036.8125114131253212690 7564555.4867092901840806007,-689500.6808295502560213208 7564222.7786708874627947807,-690180.9542377869365736842 7564002.2430113358423113823)),((-713558.0473043757956475019 7618759.8886554623022675514,-714485.6726211558561772108 7618815.0654288716614246368,-716124.5181646137498319149 7620041.2961338991299271584,-716495.5460274276556447148 7620488.4144801758229732513,-714269.1562115622218698263 7624669.4704670021310448647,-711764.4676687123719602823 7626622.8702922686934471130,-711084.1942604756914079189 7626845.0114367129281163216,-710434.8676706772530451417 7626566.2313562659546732903,-710311.1917164069600403309 7625896.6382192233577370644,-711238.8170331871369853616 7622941.6076344205066561699,-711702.5740318329771980643 7621546.3104290068149566650,-712568.5283507134299725294 7619595.8091768035665154457,-712970.5030319682555273175 7619093.5637132814154028893,-713558.0473043757956475019 7618759.8886554623022675514)),((-690057.2782835166435688734 7650259.1478064712136983871,-693829.7845070078037679195 7651545.6351253492757678032,-694478.9997773149516433477 7651770.1125533133745193481,-696736.3364116213051602244 7654121.2745546055957674980,-696860.0123658917145803571 7654960.8624124936759471893,-696705.5009126714430749416 7655688.4453540705144405365,-694819.1921411788789555430 7657537.4504156326875090599,-694262.5946872124914079905 7657929.8921899255365133286,-692932.9946891774889081717 7658433.0779828028753399849,-691912.5289170768810436130 7658152.9436111617833375931,-690737.5516917532077059150 7657537.4504156326875090599,-686037.3088319879025220871 7653616.7598327985033392906,-685697.1164681239752098918 7653112.4799216054379940033,-685480.7113780215149745345 7652441.9721416393294930458,-685789.9569234472000971437 7651713.2873035967350006104,-686377.3898763634497299790 7651490.4235533857718110085,-690057.2782835166435688734 7650259.1478064712136983871)),((-767300.5371110781561583281 7646229.8225794527679681778,-770887.4737434196285903454 7646509.5207542572170495987,-776144.2027376601472496986 7648356.3087900653481483459,-778216.0811003053095191717 7657480.5823117960244417191,-777968.6178722705226391554 7658210.0183924464508891106,-776267.8786919304402545094 7660225.8581922017037868500,-774567.2508310816483572125 7661235.5914379972964525223,-752952.6792622238863259554 7668356.5327569469809532166,-752303.3526724282419309020 7668524.5538538070395588875,-751684.9729010709561407566 7668187.1017607403919100761,-750819.0185821906197816133 7667122.5390420444309711456,-749551.3122210348956286907 7664822.8869000077247619629,-749087.4439029005588963628 7663532.5502214934676885605,-749056.4970844595227390528 7662691.8191753616556525230,-750200.6388108332175761461 7661795.8945489320904016495,-752365.2463093076366931200 7661458.7392884017899632454,-754096.8209885975811630487 7661795.8945489320904016495,-755797.5601689376635476947 7661683.5078104771673679352,-756508.7803956154966726899 7661571.1227236548438668251,-757158.1069854138186201453 7661235.5914379972964525223,-757652.8108024980174377561 7660898.4608781281858682632,-765476.2332959589548408985 7653561.3317578630521893501,-766094.6130673162406310439 7652329.7227487266063690186,-767300.5371110781561583281 7646229.8225794527679681778)),((-743428.7402274052146822214 7669814.3195266835391521454,-744263.6364083561347797513 7670039.3338285284116864204,-745222.2085435773478820920 7672621.0086415195837616920,-745717.0236801527207717299 7674753.2296862173825502396,-745407.7781347299460321665 7675427.1118102883920073509,-736254.8669627250637859106 7685765.1272280197590589523,-731802.0873309944290667772 7689589.5502855889499187469,-728678.9076972960028797388 7692177.8419745219871401787,-724659.0495652613462880254 7695442.6619901461526751518,-724102.4521112949587404728 7695779.9016436329111456871,-722834.6344306508544832468 7696455.6417993549257516861,-719742.4016153935808688402 7696794.3451119465753436089,-718814.7762986134039238095 7696849.8849710999056696892,-718505.5307531905127689242 7696229.8479412319138646126,-718350.9079804790671914816 7695498.3946791412308812141,-718505.5307531905127689242 7694767.0115071609616279602,-721907.0091138707939535379 7686609.8177584111690521240,-722834.6344306508544832468 7684866.2912695864215493202,-723731.4242484811693429947 7683853.4313346464186906815,-731863.8696483825333416462 7675875.8605245305225253105,-732358.5734654695261269808 7675427.1118102883920073509,-733502.8265113317174836993 7674753.2296862173825502396,-743428.7402274052146822214 7669814.3195266835391521454)),((-685635.3341507357545197010 7733423.8133532665669918060,-687738.0480123279849067330 7734216.3565954193472862244,-691448.7719184310408309102 7737101.2504727263003587723,-691696.1238269745372235775 7737780.6634278474375605583,-691788.8529628065880388021 7739480.2764370609074831009,-691819.7997812448302283883 7740329.3078640596941113472,-691634.2301900923484936357 7741122.5701952194795012474,-691015.7390992465661838651 7742424.6700222818180918694,-685573.4405138535657897592 7748033.6259813448414206505,-684584.0328796824906021357 7748885.4488587854430079460,-683223.4860632063355296850 7748488.3005979405716061592,-680564.0634281565435230732 7746333.7345695439726114273,-679883.7900199170690029860 7745200.6845221538096666336,-679945.6836567992577329278 7744010.0824914481490850449,-680687.7393824269529432058 7738800.7118177721276879311,-681244.3368363932240754366 7736423.3244223734363913536,-681646.4228371393401175737 7735856.0891268383711576462,-683377.9975164294010028243 7733875.9867491759359836578,-684027.4354257161030545831 7733593.0697105331346392632,-685635.3341507357545197010 7733423.8133532665669918060)),((-703260.8830865059280768037 7746674.6618245746940374374,-704157.6729043362429365516 7746674.6618245746940374374,-704714.2703583025140687823 7746958.0654037864878773689,-708208.4778548119356855750 7749168.7306836582720279694,-717825.2573449538322165608 7759890.9843808347359299660,-718258.1788446470163762569 7760572.4351671617478132248,-718196.2852077677380293608 7761366.3798615131527185440,-714176.4270757301710546017 7766820.7554353112354874611,-711702.5740318329771980643 7769093.4759708065539598465,-710682.2195792207494378090 7769946.0237154727801680565,-706600.5791297951946035028 7770970.3944133082404732704,-704219.5665412184316664934 7771196.7774734115228056908,-698777.2679558254312723875 7768979.4963971134275197983,-698035.1009107065619900823 7768639.2048939717933535576,-697045.5819570441963151097 7767843.0682328445836901665,-696210.7970955873606726527 7766650.5538066504523158073,-695715.8706395179033279419 7765400.5477899685502052307,-695654.0883221297990530729 7764660.9911908647045493126,-695468.5187309773173183203 7759209.5946496361866593361,-696303.4149119253270328045 7752797.8342572487890720367,-696519.9313215189613401890 7752059.2978702094405889511,-697602.1794110105838626623 7750244.8079027310013771057,-698900.9439100957242771983 7748771.7717254515737295151,-701158.2805444021942093968 7747297.3882506629452109337,-702487.8805424371967092156 7746730.7704066531732678413,-703260.8830865059280768037 7746674.6618245746940374374)),((-831216.5151813800912350416 7748033.6259813448414206505,-832144.1404981602681800723 7748033.6259813448414206505,-836596.9201298909028992057 7748488.3005979405716061592,-838297.6593102309852838516 7748714.0154124023392796516,-840493.2136271464405581355 7749394.6697850516065955162,-841513.5680797586683183908 7750188.6734056873247027397,-841637.2440340289613232017 7751039.1043900754302740097,-841575.3503971467725932598 7752003.3541585551574826241,-840864.2414899603463709354 7753251.1599986683577299118,-828835.5025928033282980323 7771481.0963116846978664398,-828186.1760030050063505769 7771254.5000919839367270470,-825836.1102328692795708776 7769093.4759708065539598465,-825403.0774136820109561086 7768581.5021328534930944443,-821321.4369642564561218023 7756484.6460112733766436577,-821105.0318741539958864450 7755747.3858311343938112259,-827629.5785490386188030243 7748885.4488587854430079460,-828124.2823661256115883589 7748430.7505138125270605087,-831216.5151813800912350416 7748033.6259813448414206505)),((-732606.0366935014026239514 7769093.4759708065539598465,-734987.0492820809595286846 7769605.6889409003779292107,-734863.2620083165820688009 7770572.0912204943597316742,-733966.5835099775576964021 7771367.0809285240247845650,-729761.1557867904193699360 7773698.9026612853631377220,-729080.8823785508284345269 7774041.0589115936309099197,-728431.5557887553004547954 7773927.0051164235919713974,-723545.7433378373971208930 7772846.1385993212461471558,-722927.3635664801113307476 7772505.6739396685734391212,-722680.0116579394089058042 7771822.9480177508667111397,-723020.2040218034526333213 7771196.7774734115228056908,-723483.9610204464988783002 7770798.6670958334580063820,-732606.0366935014026239514 7769093.4759708065539598465)),((-803139.2905745200114324689 7783545.4806583048775792122,-803201.1842113992897793651 7782691.4057300575077533722,-804376.1614367229631170630 7779958.0274736341089010239,-804870.8652538099559023976 7779503.1064727054908871651,-808797.9942500125616788864 7781324.5936553860083222389,-811209.9536570303607732058 7781837.6318025905638933182,-813003.4219732024939730763 7781837.6318025905638933182,-816373.8421959504485130310 7780584.9204607559368014336,-818878.6420582886785268784 7780412.9757186239585280418,-819651.6446023574098944664 7780584.9204607559368014336,-821692.5761465615360066295 7782348.8596929777413606644,-822280.0090994776692241430 7783601.8620031997561454773,-822929.4470087644876912236 7785708.9791850121691823006,-823331.3103705309331417084 7787134.6291069323197007179,-825712.3229591076960787177 7797510.9036505632102489471,-825866.9457318191416561604 7798366.6473784530535340309,-826083.4621414127759635448 7804874.9768173359334468842,-826547.2191400558222085238 7838645.1134567204862833023,-826238.0849141242215409875 7839277.0828192858025431633,-825124.8900061915628612041 7840194.1517706615850329399,-820208.2420563237974420190 7842604.0526296412572264671,-816590.3586055439664050937 7841456.5425315601751208305,-811055.2195648277411237359 7838415.2631706120446324348,-809509.2144766930723562837 7837211.6059288652613759041,-808983.4525216766633093357 7836579.8089068550616502762,-804221.5386640115175396204 7830274.0186152849346399307,-804066.9158913000719621778 7829414.6665635276585817337,-804963.7057091303868219256 7828440.5358255095779895782,-806633.4980710294330492616 7827410.0282281637191772461,-807313.7714792659971863031 7827180.3123987615108489990,-808055.8272048936923965812 7827295.1694429172202944756,-810993.4372474396368488669 7829128.1687867753207683563,-811302.6827928624115884304 7826321.5173279317095875740,-808086.7740233347285538912 7791351.6153712701052427292,-803139.2905745200114324689 7783545.4806583048775792122)),((-661918.1600397742586210370 7817105.8563358392566442490,-664453.6840815711766481400 7817564.6846419069916009903,-665721.5017622152809053659 7818136.6114055309444665909,-667514.9700783874141052365 7819280.5943950461223721504,-668844.6813959137070924044 7820710.9189692307263612747,-669926.9294854053296148777 7822370.8705623568966984749,-670050.6054396756226196885 7823287.5438298834487795830,-669895.9826669641770422459 7824088.0749338585883378983,-669586.7371215414023026824 7824660.4941557068377733231,-668566.3826689291745424271 7825519.3071479909121990204,-666556.5092626574914902449 7825920.2985368277877569199,-663093.1372650979319587350 7825519.3071479909121990204,-662381.9170384173048660159 7825232.9566187048330903053,-660557.5019038068130612373 7824088.0749338585883378983,-660124.5804041108349338174 7823686.9743719510734081268,-659104.2259515015175566077 7821913.3997483728453516960,-658856.8740429580211639404 7821226.4211233425885438919,-658764.0335876375902444124 7820483.0542908245697617531,-658825.9272245168685913086 7819510.0708995973691344261,-659382.5246784832561388612 7818251.3314756704494357109,-659908.1753140112850815058 7817735.8256493629887700081,-661145.0461762142367660999 7817163.9291197257116436958,-661918.1600397742586210370 7817105.8563358392566442490)),((-664732.0941280469996854663 7866173.6906613605096936226,-665504.9853526245569810271 7866289.1409389581531286240,-666680.1852169277844950557 7868016.1309835584834218025,-666834.6966701479395851493 7868764.3877861686050891876,-666896.5903070301283150911 7871473.1617560992017388344,-665938.0181718089152127504 7875966.9064698787406086922,-664175.4966740807285532355 7878101.7436213130131363869,-663649.7347190642030909657 7878562.6237914720550179482,-663000.2968097745906561613 7878331.3497779136523604393,-662783.8917196722468361259 7877639.2308822218328714371,-662722.1094022812321782112 7876947.1753730922937393188,-664330.0081273008836433291 7867728.3755705067887902260,-664732.0941280469996854663 7866173.6906613605096936226)),((-327217.5206148328143171966 8122256.1049753436818718910,-328176.0927500540274195373 8122375.5594781693071126938,-329258.3408395484439097345 8123268.8481088783591985703,-330680.7812929039355367422 8124818.6841298276558518410,-331732.0825639544054865837 8126606.3827060386538505554,-338071.1709671777207404375 8141164.8613730743527412415,-337700.0317848726408556104 8141761.9490661276504397392,-337174.3811493474058806896 8142239.3096001911908388138,-335071.6672877524397335947 8144091.8439540863037109375,-334453.2875163979479111731 8144390.6066143354400992393,-331144.5382915498339571059 8144868.1355154002085328102,-324619.9916166624170728028 8145644.2928006444126367569,-322733.7941646638792008162 8145526.1860490273684263229,-322177.1967106975498609245 8145225.8720280602574348450,-321311.3537113055353984237 8144150.9932781057432293892,-320352.7815760842640884221 8142478.8614945756271481514,-320229.1056218139710836112 8141642.1836746307089924812,-324372.6397081217728555202 8123090.6107930103316903114,-324867.4548446971457451582 8122673.2389830201864242554,-327217.5206148328143171966 8122256.1049753436818718910)),((-359716.5780349853448569775 8132032.1771923750638961792,-366117.4487555996165610850 8132032.1771923750638961792,-366890.5626191567280329764 8132151.7883329940959811211,-367447.1600731230573728681 8132569.4760318957269191742,-381949.5293752003926783800 8152639.8082044757902622223,-382166.0457847940269857645 8153357.7678188877180218697,-382166.0457847940269857645 8154254.7761839749291539192,-380496.2534228921867907047 8159700.9549947949126362801,-379846.8155136054265312850 8161079.0209944993257522583,-378269.8636070268694311380 8162516.6373222228139638901,-372827.5650216366630047560 8164612.7600420080125331879,-371312.3954324491205625236 8164732.8952381443232297897,-359902.1476261378847993910 8156049.5478410180658102036,-359376.3856711214175447822 8155571.3019034899771213531,-357861.3274014250491745770 8153237.8159430967643857002,-349141.2264096250291913748 8138178.4206436891108751297,-348955.6568184724892489612 8137461.9215934518724679947,-349203.1200465043657459319 8134417.8906672578305006027,-349728.7706820324528962374 8134001.6030156211927533150,-351800.5377251863828860223 8133224.9385366979986429214,-354088.7098584398045204580 8132807.2141293892636895180,-359716.5780349853448569775 8132032.1771923750638961792)),((-650940.8337331590009853244 7781665.4537310823798179626,-652239.4869127529673278332 7779104.3557837270200252533,-655579.0716365509433671832 7773188.2564562307670712471,-656011.9931362469214946032 7772618.0685839969664812088,-659908.1753140112850815058 7768013.2965631103143095970,-661175.9929946553893387318 7767388.8718715608119964600,-665690.5549437770387157798 7765626.7650331659242510796,-667731.4864879810484126210 7764944.8611572692170739174,-669246.6560771686490625143 7764660.9911908647045493126,-669772.3067126938840374351 7765172.7010596394538879395,-671503.9927114722086116672 7769889.7436121432110667229,-671782.1801189655670896173 7771310.7903017997741699219,-671627.6686657454119995236 7772049.5611863331869244576,-666896.5903070301283150911 7782976.1550377663224935532,-665041.2283539786003530025 7786791.8826122293248772621,-671318.4231203197268769145 7796484.5903450027108192444,-676111.2837964259088039398 7785995.4823604188859462738,-676513.3697971692308783531 7785538.5590157033875584602,-677440.9951139522017911077 7785708.9791850121691823006,-678677.8659761551534757018 7786392.7490999111905694008,-687583.4252396165393292904 7795058.8264241442084312439,-702920.8020421331748366356 7792377.4401110168546438217,-703353.7235418263589963317 7792776.6830875966697931290,-717670.6345722425030544400 7814132.3829986350610852242,-718289.0143435968784615397 7815390.4386823251843452454,-721257.5712045810651034117 7821627.3914837995544075966,-721504.9231131245614960790 7822314.4064546646550297737,-721443.1407957336632534862 7823229.4241122854873538017,-715351.4043010538443922997 7828440.5358255095779895782,-714856.7004839696455746889 7828841.8880936847999691963,-713898.1283487484324723482 7828900.0508747342973947525,-712259.2828052905388176441 7827581.5979150198400020599,-709538.0778528470546007156 7824660.4941557068377733231,-706415.0095386425964534283 7822141.5135000469163060188,-705240.0323133190395310521 7821341.1879651453346014023,-704590.5944040322210639715 7821111.6560192611068487167,-702889.8552236921386793256 7821168.3172089494764804840,-702456.9337239961605519056 7821683.8504735743626952171,-702395.1514066079398617148 7822542.3261973010376095772,-726576.1938357037724927068 7843695.1129715852439403534,-727287.4140623816056177020 7844040.4415323473513126373,-731771.0291930621024221182 7839047.0068216221407055855,-731771.0291930621024221182 7837326.6151750516146421432,-730750.6747404498746618629 7832795.7048286721110343933,-730626.9987861795816570520 7832050.9958565970882773399,-730657.9456046206178143620 7831076.7324042050167918205,-731059.9202858755597844720 7829414.6665635276585817337,-731369.1658312984509393573 7828900.0508747342973947525,-731987.5456026557367295027 7828555.4119750792160630226,-732791.4949651627102866769 7828670.2898664269596338272,-737491.6265054368413984776 7830790.1717676045373082161,-744634.6642711699241772294 7834230.0278706122189760208,-745840.6996344230137765408 7834859.9775811564177274704,-746922.9477239146362990141 7835719.9476449796929955482,-748159.8185861204983666539 7837383.1912799999117851257,-748376.2236762228421866894 7838071.6365813584998250008,-748592.7400858164764940739 7839677.3573641553521156311,-748561.7932673753239214420 7843064.4278551321476697922,-753942.3095353774260729551 7848059.0666098510846495628,-754375.2310350706102326512 7848576.4335481449961662292,-754622.5829436141066253185 7849150.7067721011117100716,-755395.4741681915475055575 7851850.8092466006055474281,-755271.7982139212545007467 7852655.8140139542520046234,-751128.2641276133945211768 7861511.7600345788523554802,-738883.2314598453231155872 7884909.0200083097442984581,-737244.2745968961389735341 7884965.9531716629862785339,-736471.2720528275240212679 7884736.1452953089028596878,-735512.6999176061945036054 7883870.5845353407785296440,-733193.5809659088263288140 7881388.9321941649541258812,-732296.7911480785114690661 7880235.5228319214656949043,-731616.5177398419473320246 7879139.1787895429879426956,-730874.3506947230780497193 7877178.4070259826257824898,-730750.6747404498746618629 7874584.8250432880595326424,-730626.9987861795816570520 7873834.5395373199135065079,-729946.6140584516106173396 7872625.2344198366627097130,-719495.0497068528784438968 7864850.1802075924351811409,-715784.3258007498225197196 7864043.8767328895628452301,-709723.6474439995363354683 7868016.1309835584834218025,-711980.9840783060062676668 7884332.0245320610702037811,-714702.1890307466965168715 7890971.9028529813513159752,-714825.8649850197834894061 7891549.4058504449203610420,-714578.5130764764035120606 7892472.8369492143392562866,-713248.8017589501105248928 7893918.7326100040227174759,-706384.0627202015602961183 7901375.5957725411280989647,-701776.6603157594799995422 7901664.8440894046798348427,-698746.3211373842786997557 7898773.6923043765127658844,-688109.1871946330647915602 7886756.0343129066750407219,-687336.0733310730429366231 7885542.9970754394307732582,-686068.2556504289386793971 7883177.9580443715676665306,-685511.6581964626675471663 7881908.5846560634672641754,-684181.9468789363745599985 7878562.6237914720550179482,-683934.5949703956721350551 7877121.3249458475038409233,-683130.6456078859046101570 7859786.2546087922528386116,-684243.8405158185632899404 7846279.7762876143679022789,-684367.6277895801467821002 7843178.0795488543808460236,-682914.2405177834443747997 7824374.1760758152231574059,-682079.3443368354346603155 7822943.3661821372807025909,-656692.2665444836020469666 7809731.3453689971938729286,-655300.7729095664108172059 7809160.0521987508982419968,-654558.6058644475415349007 7809331.2093394454568624496,-649363.7705070892116054893 7812131.7817999981343746185,-642189.7859229178866371512 7815962.2014425937086343765,-640148.9656982050510123372 7816763.4007026748731732368,-639314.0695172541309148073 7816706.7724281931295990944,-628862.3938461641082540154 7813446.1090800398960709572,-628522.2014823001809418201 7812759.6914533944800496101,-630222.9406626402633264661 7802989.8662061607465147972,-630501.2393896249122917652 7802133.6009787861257791519,-631212.5709357938030734658 7801048.7123676566407084465,-646055.1326017323881387711 7784000.6438278378918766975,-647477.4617355966474860907 7782691.4057300575077533722,-648652.5502804114948958158 7781951.8044139267876744270,-649332.8236886481754481792 7781723.4609073279425501823,-650940.8337331590009853244 7781665.4537310823798179626)),((-673606.5952535760588943958 7826722.5511717032641172409,-674627.0610256794607266784 7826779.2543275719508528709,-675276.4989349662791937590 7827123.6062415624037384987,-675523.8508435097755864263 7827696.4610423119738698006,-676760.7217057127272710204 7831764.6046938020735979080,-676791.5572046625893563032 7832624.0170202022418379784,-676637.0457514424342662096 7841112.9844846883788704872,-676049.5014790350105613470 7848633.3005767501890659332,-675183.6584796457318589091 7852886.3040355583652853966,-674998.2002079845406115055 7853633.0654424177482724190,-671442.0990745929302647710 7861339.4196276441216468811,-671009.2888943881262093782 7861856.2454785956069827080,-668257.1371235062833875418 7864791.7405201056972146034,-665690.5549437770387157798 7862143.9846739172935485840,-665350.4738994014915078878 7861453.3461393844336271286,-665319.5270809632493183017 7860590.4473247332498431206,-666803.8611712008714675903 7831994.2532315347343683243,-667298.5649882850702852011 7830503.6219702130183577538,-667607.8105337079614400864 7829874.2407008716836571693,-668628.2763058113632723689 7828900.0508747342973947525,-670916.4484390676952898502 7827581.5979150198400020599,-673606.5952535760588943958 7826722.5511717032641172409)),((-810777.0321573371766135097 7841801.7689958875998854637,-814147.5636995763052254915 7842260.4425088372081518173,-814889.6194252038840204477 7842604.0526296412572264671,-821321.4369642564561218023 7846508.4183434061706066132,-822434.6318721891148015857 7847254.5506350584328174591,-824289.9938252406427636743 7850989.0049488563090562820,-824815.6444607658777385950 7852310.0921453200280666351,-824877.5380976480664685369 7853115.1457784250378608704,-824475.4520969019504263997 7855587.7400682382285594940,-824228.1001883612480014563 7856334.5611695535480976105,-823795.1786886652698740363 7856852.7012757556512951851,-819064.2116494412766769528 7860590.4473247332498431206,-818321.9332848311169072986 7860821.1792277200147509575,-812694.1764277797192335129 7859612.2967918114736676216,-809973.0827948274090886116 7858980.4908027257770299911,-806416.9816614357987418771 7858117.8740360643714666367,-802025.9843470960622653365 7854897.6998469531536102295,-801778.6324385525658726692 7854207.7225553095340728760,-801747.7969396027037873864 7846221.2731461282819509506,-801995.1488481462001800537 7845416.9524751473218202591,-805891.3310259105637669563 7843064.4278551321476697922,-806478.7639788266969844699 7842777.6198937362059950829,-809169.0221128291450440884 7842088.7466019783169031143,-810777.0321573371766135097 7841801.7689958875998854637)),((-805242.0044361121254041791 7863756.2724463250488042831,-814271.2396538465982303023 7863871.6858208188787102699,-815013.2953794742934405804 7864100.8601484736427664757,-815539.0573344907024875283 7864619.3253505919128656387,-815693.5687877108575776219 7868707.3692137449979782104,-815446.2168791702715680003 7872164.7161779273301362991,-817950.9054220173275098205 7873546.3550861412659287453,-825062.9963693093741312623 7877121.3249458475038409233,-829948.6975007359869778156 7876256.8436097716912627220,-831309.2443172121420502663 7875852.9685768820345401764,-832329.7100893127499148250 7875966.9064698787406086922,-833350.1758614162681624293 7876717.6112698679789900780,-838946.9859000294236466289 7880869.1077992143109440804,-839379.9073997226078063250 7881273.2510386267676949501,-839720.0997635865351185203 7881850.0129269957542419434,-839720.0997635865351185203 7882831.0454295976087450981,-833937.6088143324013799429 7893398.0451419055461883545,-833102.8239528727717697620 7894553.4665402770042419434,-831865.8417711785295978189 7895190.1264471393078565598,-827382.2266404979163780808 7894842.4535497147589921951,-809849.4068405569996684790 7895478.9297529878094792366,-809416.3740213698474690318 7896114.0029696635901927948,-806478.7639788266969844699 7899756.9260776657611131668,-801191.1994856364326551557 7901839.5646060863509774208,-800232.6273504151031374931 7901896.8338320590555667877,-787616.3441808507777750492 7892531.6991114467382431030,-786750.5011814616154879332 7891549.4058504449203610420,-786565.0429098003078252077 7890683.0639442158862948418,-795656.0604449228849261999 7866116.6916231373324990273,-796367.3919910918921232224 7864964.1596209304407238960,-797975.2907161087496206164 7864676.3131026867777109146,-805242.0044361121254041791 7863756.2724463250488042831)),((-801995.1488481462001800537 7904963.7670821649953722954,-803695.8880284862825646996 7905253.1529692234471440315,-803633.9943916040938347578 7906178.2622187910601496696,-802922.7741649263771250844 7907394.6201119190081954002,-801345.7109388565877452493 7909709.9304114840924739838,-800356.3033046883065253496 7910578.4592534480616450310,-798593.6704874660354107618 7911563.0240568816661834717,-797789.7211249590618535876 7911795.3183526406064629555,-797047.6653993285726755857 7911679.1703105298802256584,-795346.9262189912842586637 7909479.3680197680369019508,-795408.7085363793885335326 7908494.8666790891438722610,-795934.4704913959139958024 7908030.6968740494921803474,-796491.0679453621851280332 7907683.8908374262973666191,-801129.3058487570378929377 7905021.0600231559947133064,-801995.1488481462001800537 7904963.7670821649953722954)),((-954626.5271892031887546182 7925129.6127497013658285141,-955399.5297332719201222062 7925187.0590954320505261421,-958028.0055498805595561862 7926406.2782483883202075958,-958677.4434591701719909906 7926755.4090198026970028877,-959728.6334107293514534831 7930180.2969843065366148949,-959419.4991847977507859468 7930877.2520577358081936836,-955523.3170070333871990442 7930411.4932919247075915337,-953513.3322812705300748348 7929540.6768891820684075356,-952307.5195569969946518540 7928786.5801868764683604240,-952029.1095105211716145277 7928322.6224836604669690132,-952369.3018743880093097687 7927683.1600318755954504013,-954626.5271892031887546182 7925129.6127497013658285141)),((-787430.7745896981796249747 7941686.0055912025272846222,-787894.6429078353103250265 7942150.7870398368686437607,-787770.9669535622233524919 7944826.7693878216668963432,-787430.7745896981796249747 7945525.2904836768284440041,-782885.2658221382880583405 7949598.1104610562324523926,-782297.7215497308643534780 7949889.2152951927855610847,-780040.4962349156849086285 7950471.2491385219618678093,-779174.6532355237286537886 7950530.3562806798145174980,-778525.2153262369101867080 7950239.4362448817119002342,-778587.1089631190989166498 7949249.5958655448630452156,-778958.1368259328883141279 7944419.4159345766529440880,-779112.7595986443338915706 7943662.1531161759048700333,-779947.7670990836340934038 7942441.6040757866576313972,-787430.7745896981796249747 7941686.0055912025272846222)),((-720670.0269321736413985491 7956470.2657709643244743347,-720546.3509779033483937383 7955596.4309239611029624939,-720670.0269321736413985491 7954782.0477885073050856590,-727813.0646979068405926228 7949772.4785993508994579315,-728493.4494256346952170134 7949481.3782793292775750160,-731430.9481486893491819501 7948725.2825949238613247871,-732203.9506927580805495381 7948608.5639465516433119774,-737058.8163252320373430848 7949366.3244531759992241859,-737831.8188693007687106729 7949540.6872226530686020851,-740614.8061391324736177921 7950530.3562806798145174980,-741635.2719112358754500747 7951403.6031045736744999886,-742099.0289098789216950536 7951985.7540601119399070740,-744943.9098165928153321147 7958511.1471517411991953850,-745685.9655422203941270709 7960493.1864522015675902367,-746366.2389504598686471581 7964516.5794345876201987267,-746613.5908590005710721016 7967083.5220405189320445061,-746520.9730426626047119498 7968893.2158791339024901390,-745562.2895879501011222601 7971811.1980586852878332138,-745222.2085435773478820920 7972452.7385530890896916389,-741697.0542286268901079893 7976659.0013084486126899719,-741295.0795473719481378794 7977125.9482289021834731102,-740583.9706401826115325093 7977477.4395719552412629128,-737986.4416420122142881155 7977477.4395719552412629128,-737151.5454610640881583095 7977360.2739647664129734039,-736378.5429169953567907214 7977008.7881000870838761330,-734554.1277823849814012647 7976833.9978371746838092804,-733997.5303284185938537121 7977068.3144723521545529366,-733626.5024656048044562340 7977827.2644502716138958931,-734182.9886000799015164375 7978353.8205026816576719284,-734739.5860540462890639901 7978645.8299302291125059128,-735574.5935544855892658234 7978820.8727197982370853424,-742501.0035911338636651635 7979522.3471052441745996475,-743428.7402274052146822214 7979580.2100927950814366341,-744109.0136356446892023087 7979405.1496189218014478683,-744634.6642711699241772294 7978878.7303074216470122337,-752674.4918547333218157291 7966966.5182834491133689880,-748716.4160400867694988847 7957752.2556198462843894958,-748376.2236762228421866894 7957054.4870444852858781815,-747943.3021765268640592694 7956646.2615891080349683762,-746428.1325873392634093761 7956179.1160528566688299179,-745438.6136336798081174493 7955247.6384827783331274986,-744170.7959530327934771776 7953558.2269180696457624435,-743583.3630001166602596641 7952276.7415983201935887337,-743336.0110915759578347206 7951694.5681378180161118507,-741913.4593187292339280248 7946455.3561793249100446701,-741449.7023200833937153220 7943139.6945446738973259926,-741635.2719112358754500747 7942267.4056255519390106201,-749767.7173111372394487262 7930818.2989529734477400780,-774876.4963765044230967760 7910288.8690335713326931000,-775402.1470120325684547424 7909884.8373241545632481575,-776175.2608755896799266338 7909709.9304114840924739838,-776824.4761458968278020620 7909942.1676476104184985161,-777443.0785562365781515837 7910463.9978594612330198288,-792594.8857675979379564524 7928379.8841866310685873032,-792934.9668119734851643443 7929076.6727590663358569145,-793089.5895846848143264651 7929773.5257634706795215607,-793336.9414932255167514086 7932386.1485914569348096848,-793182.3187205140711739659 7933316.2661125017330050468,-792409.3161764453398063779 7933373.7748991921544075012,-790801.3061319373082369566 7933083.3077363111078739166,-789502.6529523433418944478 7932269.6828811541199684143,-788543.9694976309547200799 7930585.4177934592589735985,-786565.0429098003078252077 7929773.5257634706795215607,-782452.4556419336004182696 7932154.8916895156726241112,-760343.0689365004654973745 7946514.4317998429760336876,-760775.9904361936496570706 7947096.2047789441421627998,-765816.3143403317080810666 7953150.1910642273724079132,-772000.6686513522872701287 7956761.6365282991901040077,-773237.6508330465294420719 7957403.3632442764937877655,-777566.7545105068711563945 7958802.3871165215969085693,-778432.4861904048593714833 7958743.2149719782173633575,-781679.3417783735785633326 7957228.8182288901880383492,-782545.1847777627408504486 7957286.5099434768781065941,-783194.5113675611792132258 7957520.2183597078546881676,-787616.3441808507777750492 7959442.8189643006771802902,-791790.9364050909643992782 7963933.4582474185153841972,-791914.6123593612574040890 7964633.5450868243351578712,-788605.8631345131434500217 7969008.5686866920441389084,-785420.9011834264965727925 7971577.0452094133943319321,-785668.2530919699929654598 7974964.7744164736941456795,-789688.1112240046495571733 7982152.3016326762735843658,-793336.9414932255167514086 7993269.8519307244569063187,-793522.5110843779984861612 7994733.5469595398753881454,-793491.5642659397562965751 7995671.4061694080010056496,-789750.0048608868382871151 8005634.5332959173247218132,-785822.8758646814385429025 8013733.6948617883026599884,-785420.9011834264965727925 8014378.8262904621660709381,-783751.1088215275667607784 8016493.4368419172242283821,-782792.5366863062372431159 8017491.9634408326819539070,-780133.2253707449417561293 8016904.7155841961503028870,-779360.2228266762103885412 8016728.9942470602691173553,-770300.0407905034953728318 8012853.1757603893056511879,-769001.2762914182385429740 8012148.5812776368111371994,-768753.9243828747421503067 8011502.1624122951179742813,-769001.2762914182385429740 8010739.5907647507265210152,-770361.9344273856841027737 8010210.9706140225753188133,-772124.3446056226966902614 8006924.9379145596176385880,-765228.7700679242843762040 7990693.9523769477382302284,-764548.4966596876038238406 7989641.0427555870264768600,-763868.2232514509232714772 7989171.6321176402270793915,-763651.8181613485794514418 7990050.8529532160609960556,-765129.9183600998949259520 8004928.2938264198601245880,-757549.5063150412170216441 8008575.9065968403592705727,-751448.1963441522093489766 8006331.3369063120335340500,-750819.6864991351030766964 8008857.0530969668179750443,-755478.8524667968740686774 8015665.8727857079356908798,-757869.3272120916517451406 8022075.6411512596532702446,-758951.6866210744483396411 8026368.0272229677066206932,-758704.2233930396614596248 8027367.8694736715406179428,-756725.1854857178404927254 8031073.4454955356195569038,-742841.1959549977909773588 8041025.3970633633434772491,-741202.3504115398973226547 8041085.4333740184083580971,-740522.0770033032167702913 8040908.9322353173047304153,-739934.5327308957930654287 8039494.5276033077389001846,-730286.8064223156543448567 8043265.7350367736071348190,-729173.7228338741697371006 8044031.6221584426239132881,-707466.3108096930664032698 8064043.7281609382480382919,-702487.8805424371967092156 8068655.7719786865636706352,-700508.8426351153757423162 8070607.0664195213466882706,-698746.3211373842786997557 8074868.7607897184789180756,-698220.6705018590437248349 8075341.8639872856438159943,-697633.1262294516200199723 8075756.5997826606035232544,-696829.1768669418524950743 8075815.2102414192631840706,-696087.0098218229832127690 8075579.2793005006387829781,-695128.4376866045640781522 8074927.3642917294055223465,-694046.1895971101475879550 8073981.2402468603104352951,-692778.2605969748692587018 8072323.2547035785391926765,-686408.4480142928659915924 8057190.8337126951664686203,-686377.3898763634497299790 8056186.7913654660806059837,-690644.7112364327767863870 8042500.1383879883214831352,-693798.7263690782710909843 8034369.8655051235109567642,-699055.5666828071698546410 8028014.1747573809698224068,-703972.2146326749352738261 8022899.0452594198286533356,-704460.6845582755049690604 8017467.8551338436082005501,-704479.2749132377794012427 8016939.3951310329139232635,-704386.4344579173484817147 8016516.6962206689640879631,-704126.7260858950903639197 8016164.2186422776430845261,-703737.1078681189101189375 8015952.9937641918659210205,-699655.3560992020647972822 8014296.5964280683547258377,-699228.7798104838002473116 8014156.2369969626888632774,-698746.3211373842786997557 8014261.9290954815223813057,-698375.2932745704893022776 8014437.5926568955183029175,-697466.1469932614127174020 8015248.9537850487977266312,-692500.0731894843047484756 8016551.3739738147705793381,-691139.4150535169756039977 8018079.2572728907689452171,-687119.6682409706991165876 8021781.7261899784207344055,-686593.9062859541736543179 8022251.4877907298505306244,-685728.1746060563018545508 8022075.6411512596532702446,-684398.4632885300088673830 8021310.5129202296957373619,-684274.7873342595994472504 8020606.6046414244920015335,-685542.6050149037037044764 8013322.3785514980554580688,-686222.8784231403842568398 8012030.8735322710126638412,-687088.7214225324569270015 8010915.3831741800531744957,-692932.9946891774889081717 8005987.3612213982269167900,-697280.5774021089309826493 8004509.4375922940671443939,-704553.4136941075557842851 8005811.0507594170048832893,-708734.1284903400810435414 8000709.9760819813236594200,-709630.8069886791054159403 7995846.6352075962349772453,-709878.2702167109819129109 7995085.8629775904119014740,-710465.8144891184056177735 7994616.1119595533236861229,-723267.5559303440386429429 7987826.3474211450666189194,-728926.2596058394992724061 7986656.5289644505828619003,-734832.3151898783398792148 7985194.4066915316507220268,-736965.9758699116064235568 7984550.3039665548130869865,-736842.2999156413134187460 7983790.4642846547067165375,-734121.2062826890032738447 7983790.4642846547067165375,-723236.6091119057964533567 7985719.7945190295577049255,-714702.1890307466965168715 7988821.2787511013448238373,-713588.8828033227473497391 7989523.6873462749645113945,-712723.0398039335850626230 7989581.4167081136256456375,-712011.8195772558683529496 7989348.3950684312731027603,-711393.4398058985825628042 7988061.0070491367951035500,-707311.6880369817372411489 7974263.7251747092232108116,-707621.0449018958024680614 7973622.0301446886733174324,-710898.6246693232096731663 7969242.6415702234953641891,-718876.5586160043021664023 7960608.4105123337358236313,-720670.0269321736413985491 7956470.2657709643244743347)),((-761301.6410717188846319914 8009859.4229130959138274193,-764672.1726139578968286514 8010270.5494405198842287064,-765105.0941136539913713932 8010797.6947713699191808701,-766867.6156113849719986320 8018842.5753356879577040672,-766991.2915656553814187646 8019723.7977412352338433266,-766960.4560667055193334818 8020546.9436763981357216835,-766063.6662488752044737339 8020900.4735544379800558090,-763682.6536602984415367246 8020253.0886142896488308907,-763002.3802520589670166373 8020019.1129028648138046265,-758054.8968032441334798932 8015494.8317113332450389862,-756354.1576229040510952473 8013262.7754890210926532745,-756013.9652590401237830520 8010915.3831741800531744957,-756354.1576229040510952473 8010152.8711501006036996841,-757219.8893028020393103361 8010093.2932578660547733307,-761301.6410717188846319914 8009859.4229130959138274193)),((-314415.7791736071230843663 8154254.7761839749291539192,-319394.2094408630509860814 8157366.1753244427964091301,-330618.8876560217468068004 8167308.6114223692566156387,-334886.2090160911320708692 8167428.7901212638244032860,-340328.3962819929001852870 8166529.9781254148110747337,-346265.5100039612734690309 8164853.0323724383488297462,-347285.8644565735012292862 8163834.4085745373740792274,-347285.8644565735012292862 8162936.2459341324865818024,-353130.2490427098236978054 8161138.3053241176530718803,-354923.7173588819568976760 8160958.9447254370898008347,-355665.7730845095939002931 8161199.0991994673386216164,-367725.4588001076481305063 8168688.0861030211672186852,-368838.6537080403068102896 8169587.1586798103526234627,-372425.5903403817792423069 8173004.6682517323642969131,-374157.1650196717237122357 8178705.0871962811797857285,-374373.6814292625058442354 8179425.5645581595599651337,-374930.2788832288933917880 8182547.5026265401393175125,-374930.2788832288933917880 8183448.0348873659968376160,-373074.9169301773654296994 8203416.1640427159145474434,-372951.2409759070142172277 8204198.6678917976096272469,-369302.4107066861470229924 8208416.5876278001815080643,-364880.5778933937544934452 8210707.7649166425690054893,-364262.1981220393208786845 8211009.2139681084081530571,-360551.4742159362649545074 8212034.3190615437924861908,-358325.0844000709475949407 8212575.6871830569580197334,-356500.6692654576618224382 8212575.6871830569580197334,-355758.6135398300248198211 8212274.3916364107280969620,-342523.9505989083554595709 8206730.1735943248495459557,-342091.0290992152295075357 8206187.4960609087720513344,-333772.9027886672411113977 8195470.6866239896044135094,-333432.8217442945460788906 8194809.9391960911452770233,-333494.6040616855025291443 8192464.1212498266249895096,-328083.2522947335965000093 8180025.7274808306246995926,-317507.9006693732226267457 8175105.2581908330321311951,-310921.5716770977014675736 8169886.7297789873555302620,-306778.0375907898996956646 8162635.0137194916605949402,-314415.7791736071230843663 8154254.7761839749291539192)),((-298985.5619157699984498322 8220299.1448121173307299614,-299418.5947349572088569403 8220841.3329649502411484718,-299634.9998250596108846366 8221565.9059020085260272026,-299851.4049151591607369483 8223196.1274644229561090469,-299727.7289608888677321374 8225974.6323513938114047050,-299511.3238707864657044411 8226880.4422335214912891388,-298831.0504625497851520777 8228271.2331709414720535278,-288626.7267000032588839531 8243452.6631679208949208260,-284483.1926136954571120441 8246179.0146229611709713936,-282133.1268435569945722818 8246601.6288391575217247009,-268774.6766288737417198718 8248480.1329240286722779274,-267970.7272663667681626976 8248541.8635866008698940277,-267414.2411318888189271092 8248298.8702376186847686768,-267166.7779038569424301386 8247752.9276838572695851326,-266857.6436779224895872176 8246238.7635718090459704399,-266084.5298143653781153262 8241818.2048465302214026451,-266053.5829959242837503552 8241091.4344580508768558502,-277804.0231660994468256831 8233529.1847231518477201462,-286183.9317940355394966900 8232924.6855317205190658569,-286895.0407012220821343362 8232924.6855317205190658569,-291718.9595152577967382967 8231594.6123727718368172646,-292213.6633323419373482466 8231049.8974807532504200935,-298490.8580986858578398824 8222834.4047459559515118599,-298985.5619157699984498322 8220299.1448121173307299614)),((-320321.8347576460218988359 8229962.5458649722859263420,-319827.1309405590291135013 8235040.7570098340511322021,-319827.1309405590291135013 8235947.8917335318401455879,-320260.0524402550654485822 8236492.7484609037637710571,-326908.2750694099231623113 8241939.3764892881736159325,-329351.0699753776425495744 8242847.3550463952124118805,-330124.1838389376061968505 8242908.8208849569782614708,-330835.4040656153811141849 8242725.9506133524700999260,-331330.1078826995217241347 8242182.1615991787984967232,-331082.7559741588775068521 8241455.5734806824475526810,-331391.8902000904781743884 8239578.8471431769430637360,-332628.8723817847203463316 8237702.3775628153234720230,-333092.6293804305605590343 8237158.9565887460485100746,-333865.7432439905242063105 8237037.6451956499367952347,-334329.6115621248027309775 8237582.7997531481087207794,-337112.5988319564494304359 8242242.0963095873594284058,-342152.8114166033337824047 8250783.7109698904678225517,-342369.3278261969680897892 8251511.2134703490883111954,-342462.0569620290189050138 8252358.8198936972767114639,-341936.4063265009317547083 8252358.8198936972767114639,-339400.7709652127814479172 8251874.3368008276447653770,-322517.3890745614771731198 8245452.0349454907700419426,-321713.3283925604191608727 8244482.2581625692546367645,-317229.6019423886900767684 8238549.9323515286669135094,-317600.7411246937117539346 8234497.5308964215219020844,-320321.8347576460218988359 8229962.5458649722859263420)),((-131418.8927729424904100597 8450002.4812638033181428909,-128852.3105932132166344672 8443217.6614618655294179916,-125358.1030967037950176746 8433582.1149839032441377640,-125296.3207793128385674208 8432711.8850616905838251114,-125636.4018236883857753128 8431904.8170470520853996277,-127646.3865494513302110136 8429172.3116981964558362961,-128357.6067761290905764326 8429419.5413138214498758316,-129470.8016840617492562160 8430413.9085405077785253525,-130305.6978650098317302763 8430350.8623820859938859940,-132160.9484985729504842311 8428116.6498009692877531052,-134943.9357684046262875199 8422655.4660612400621175766,-135871.6724046760064084083 8404748.7486409302800893784,-140293.5052179655758664012 8369126.5888590998947620392,-140540.8571265090431552380 8368263.9417213918641209602,-141221.1305347457237076014 8366662.4036922659724950790,-145488.4518948150798678398 8368079.4977552164345979691,-152724.2187963774194940925 8375657.2470140000805258751,-153404.4922046140709426254 8378000.7946866620332002640,-153373.5453861758287530392 8378925.4125343877822160721,-148240.4923462056613061577 8399056.8686607982963323593,-148059.1528957030095625669 8399737.8898180592805147171,-147652.9480737982376012951 8400726.4732431881129741669,-147220.0265741050534415990 8401407.8715051133185625076,-146539.7531658655498176813 8401716.9709801133722066879,-145983.1557118992204777896 8401220.8147236928343772888,-145612.1278490854019764811 8401716.9709801133722066879,-145364.6646210535254795104 8402581.9839985016733407974,-141190.1837163046002388000 8420607.5621528327465057373,-140602.7507633884088136256 8423585.7077235877513885498,-140386.2343537948036100715 8425571.2122797425836324692,-140293.5052179655758664012 8427432.9978936556726694107,-140448.1279906769923400134 8428923.3022035919129848480,-143045.5456693561282008886 8448880.8431634176522493362,-143756.7658960339031182230 8453677.0226260423660278320,-156218.3149733956088311970 8456916.9774842560291290283,-156991.4288369555724784732 8456730.2986293677240610123,-157424.3503366515797097236 8456043.9804964791983366013,-156991.4288369555724784732 8455484.2490402068942785263,-154455.7934756673930678517 8452742.9660407453775405884,-151796.4821601060393732041 8451061.2907705008983612061,-150621.5049347824242431670 8446391.3914110194891691208,-151208.9378876986156683415 8442720.4902771990746259689,-161258.6388775336963590235 8433457.5345053281635046005,-161815.2363315000548027456 8433767.9831401184201240540,-165927.9349188579944893718 8437185.1261108089238405228,-169236.5728242177283391356 8440233.3476771246641874313,-170009.5753682836075313389 8441476.8137898929417133331,-170071.4690051658253651112 8442346.2903630267828702927,-169947.7930508954741526395 8443156.2970731183886528015,-169174.6791873355396091938 8444649.7919906452298164368,-176874.3144070349808316678 8447947.1719167567789554596,-183429.8079003578168340027 8449939.2668903525918722153,-184233.7572628676134627312 8450250.6365618128329515457,-185316.0053523592068813741 8451309.2576242219656705856,-186398.3647613420034758747 8453240.8157563824206590652,-186800.3394425969163421541 8454798.0473017022013664246,-188470.1318044959043618292 8462278.6146730221807956696,-188439.1849860548099968582 8463214.1092274021357297897,-188284.5622133433935232460 8464213.0597421079874038696,-185563.4685803939064498991 8466771.9181299507617950439,-184264.7040813087369315326 8467521.0319710131734609604,-181265.3117213746591005474 8468456.9699385277926921844,-177740.1574064241431187838 8468643.9471145477145910263,-176967.0435428642085753381 8468270.2222475465387105942,-164165.3021016385464463383 8470204.4483535364270210266,-160949.3933321108634117991 8471015.7343615088611841202,-158846.6794705158390570432 8471641.6255598831921815872,-149817.5555722754215821624 8475826.3957046549767255783,-146972.6746655615570489317 8479513.8849765919148921967,-160949.3933321108634117991 8502995.4172549173235893250,-167226.5880984519608318806 8505066.4277327470481395721,-172947.1854108295519836247 8506384.6276615001261234283,-173472.8360463547869585454 8505819.4621988646686077118,-174215.0030914736271370202 8505819.4621988646686077118,-179193.4333587295259349048 8506069.2861623000353574753,-179409.9497683231602422893 8506634.6967900414019823074,-179224.3801771706202998757 8507701.4831505790352821350,-177338.1827251692302525043 8513666.3284741286188364029,-172205.1296852019149810076 8520012.6112211719155311584,-157640.7554267539526335895 8535683.0980203952640295029,-157022.3756553966668434441 8536124.2363177780061960220,-144931.7431213575182482600 8542869.1372172459959983826,-144251.4697131208667997271 8542427.5922357551753520966,-144066.0114414595882408321 8541606.7752905581146478653,-143323.8443963407189585268 8537572.8084496092051267624,-144282.4165315619611646980 8509897.8982137348502874374,-143231.1152605086681433022 8505379.9191853515803813934,-129563.5308198938146233559 8501615.7458084020763635635,-115926.8931977172323968261 8499923.0623582229018211365,-115463.0248795801308006048 8499296.1079841032624244690,-115524.9185164623195305467 8498356.2282211538404226303,-118678.9336491077992832288 8479889.9833878260105848312,-122575.1158268721337663010 8461406.7763581350445747375,-129594.4776383320713648573 8457478.3888761196285486221,-129779.9359099933644756675 8458288.2701066788285970688,-132130.0016801318561192602 8460034.9014685377478599548,-133026.7914979621418751776 8460283.1714041661471128464,-133459.7129976581491064280 8459598.0924596134573221207,-133645.2825888106599450111 8458599.9938295967876911163,-133366.9838618260982912034 8456916.9774842560291290283,-131975.4902269116719253361 8451247.8256347682327032089,-131418.8927729424904100597 8450002.4812638033181428909)),((-122977.0905081270466325805 8508642.7878556754440069199,-125512.7258694152260432020 8508830.7921410575509071350,-126904.2195043324754806235 8509522.0657078959047794342,-127213.4650497553229797632 8510211.8223970048129558563,-130274.7510465715749887750 8518065.2058855388313531876,-131635.2978630448924377561 8533415.0009105317294597626,-131758.9738173180376179516 8535179.6204684469848871231,-131511.6219087745703291148 8539904.5999362692236900330,-131295.2168186721683014184 8541923.6505688149482011795,-131047.7535906402918044478 8542869.1372172459959983826,-123564.6347805344703374431 8563139.6324080415070056915,-122296.8170998903806321323 8564088.0930764134973287582,-121616.5436916508915601298 8564404.1221806351095438004,-120750.7006922617147210985 8564468.5591860376298427582,-117658.5791964956006268039 8564277.2990620024502277374,-110948.4629304584959754720 8562886.0322308056056499481,-110329.9718396128009771928 8561811.1747258920222520828,-109371.3997043915587710217 8547157.2547364681959152222,-109402.3465228326531359926 8546210.9867958705872297287,-113298.5287005969876190647 8516304.7046306654810905457,-113453.1514733084186445922 8515300.2185145672410726547,-113917.0197914426826173440 8512598.6735706087201833725,-114164.3716999861644580960 8511656.8606676571071147919,-114597.1818801909394096583 8510965.3857190217822790146,-122977.0905081270466325805 8508642.7878556754440069199)),((-92951.7748123833152931184 8551198.1008841041475534439,-104145.6175285921781323850 8551449.4778003897517919540,-106712.0883888302196282893 8553280.9716154523193836212,-107485.2022523901687236503 8554543.7577994950115680695,-106835.7643431033793604001 8559852.6179195307195186615,-104516.6453914059820817783 8578775.7893092986196279526,-98301.3442619442648719996 8589683.3030100073665380478,-97775.5823069277830654755 8590192.3755585104227066040,-89735.8660428556468104944 8589303.3496326003223657608,-86025.2534562438231660053 8587145.7811966780573129654,-85468.6560022774938261136 8586638.7480191215872764587,-84386.4079127859295113012 8584100.4570038504898548126,-84293.5674574654694879428 8583213.9983862955123186111,-85004.7876841432298533618 8578521.6460732165724039078,-91251.0356320432183565572 8554734.7635270673781633377,-92951.7748123833152931184 8551198.1008841041475534439)))' + ,0) as p1 + ) + select 10 as w,ST_NumGeometries(p1),ST_Area(ST_Buffer(p1, 10.0 * 1000, 25)),ST_NumGeometries(ST_Buffer(p1, 10.0 * 1000, 25))from viewy + union all select 20 as w,ST_NumGeometries(p1),ST_Area(ST_Buffer(p1, 20.0 * 1000, 25)),ST_NumGeometries(ST_Buffer(p1, 20.0 * 1000, 25))from viewy + union all select 50 as w,ST_NumGeometries(p1),ST_Area(ST_Buffer(p1, 50.0 * 1000, 25)),ST_NumGeometries(ST_Buffer(p1, 50.0 * 1000, 25))from viewy + union all select 100 as w,ST_NumGeometries(p1),ST_Area(ST_Buffer(p1, 100.0 * 1000, 25)),ST_NumGeometries(ST_Buffer(p1, 100.0 * 1000, 25))from viewy + union all select -10 as w,ST_NumGeometries(p1),ST_Area(ST_Buffer(p1, -10.0 * 1000, 25)),ST_NumGeometries(ST_Buffer(p1, -10.0 * 1000, 25))from viewy + union all select -20 as w,ST_NumGeometries(p1),ST_Area(ST_Buffer(p1, -20.0 * 1000, 25)),ST_NumGeometries(ST_Buffer(p1, -20.0 * 1000, 25))from viewy + union all select -50 as w,ST_NumGeometries(p1),ST_Area(ST_Buffer(p1, -50.0 * 1000, 25)),ST_NumGeometries(ST_Buffer(p1, -50.0 * 1000, 25))from viewy + union all select -100 as w,ST_NumGeometries(p1),ST_Area(ST_Buffer(p1, -100.0 * 1000, 25)),ST_NumGeometries(ST_Buffer(p1, -100.0 * 1000, 25))from viewy + +Checked are 10,20,50,100 kilometer, inflate/deflate + +But for many, in the unit tests below, distance of 1,2,5 k are kept too +because they could cause self-intersections in the past + +Values are not identical. We might check area with less precision. + +gr: + 336277774579 + 442312549699 + 680433051228 + 910463608938 + + 139313936462 + 96993175731 + 31392586710 + 2033070670 + +it: + 655017269701 + 749348852219 + 1018311961402 + 1436442592714 + + 477946399339 + 404696093915 + 238752534654 + 69771921799 + +nl: + 123407901256 + 145045853638 + 201203536326 + 303295187184 + + 64669284652 + 46684337476 + 10245330928 + 0 + +no: + 2102032030338 + 2292165016326 + 2725461758029 + 3374949015149 + + 1361202945650 + 1089854028969 + 649632754053 + 306749522531 + +uk: + 857680535981 + 970483182932 + 1247820319617 + 1659854829029 + + 572557777232 + 479260087245 + 274834862993 + 78209736228 + +*/ + +template +void test_one(std::string const& caseid, std::string const& wkt, double expected_area, double distance, + ut_settings settings = ut_settings()) +{ + bg::strategy::buffer::join_round join_round(100); + bg::strategy::buffer::end_flat end_flat; + + // Test with a high tolerance, even a difference of 1000 is only ~1.0e-6% + + settings.tolerance = 10000.0; + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) + // in case robustness policies are changed, areas should be adapted + settings.tolerance = boost::starts_with(caseid, "no") ? 200000.0 : 100000.0; +#endif + + test_one(caseid, wkt, join_round, end_flat, + expected_area, distance * 1000.0, settings); +} + + +template +void test_all() +{ + typedef bg::model::polygon pt; + typedef bg::model::multi_polygon mpt; + + std::string base_folder = "data/"; + std::string gr = read_from_file(base_folder + "gr.wkt"); + std::string it = read_from_file(base_folder + "it.wkt"); + std::string nl = read_from_file(base_folder + "nl.wkt"); + std::string no = read_from_file(base_folder + "no.wkt"); + std::string uk = read_from_file(base_folder + "uk.wkt"); + + test_one("gr10", gr, 336279815682, 10); + test_one("gr20", gr, 442317491749, 20); + test_one("gr50", gr, 680442278645, 50); + test_one("gr100", gr, 910474621215, 100); + + test_one("gr10", gr, 139313156846, -10); + test_one("gr20", gr, 96991350242, -20); + test_one("gr50", gr, 31391928002, -50); + test_one("gr100", gr, 2035400805, -100); + + test_one("it1", it, 569862998347, 1); + test_one("it2", it, 579239208963, 2); + test_one("it5", it, 607625463736, 5); + test_one("it10", it, 655018578530, 10); + test_one("it20", it, 749353305743, 20); + test_one("it50", it, 1018323115670, 50); + test_one("it100", it, 1436451405439, 100); + + test_one("it1", it, 551474421881, -1); + test_one("it2", it, 542617730624, -2); + test_one("it5", it, 517402445790, -5); + test_one("it10", it, 477945510429, -10); + test_one("it20", it, 404693983797, -20); + test_one("it50", it, 238748449624, -50); + test_one("it100", it, 69768648896, -100); + test_one("it200", it, 0, -200); + + test_one("nl1", nl, 97391170774, 1); + test_one("nl2", nl, 100816707832, 2); + test_one("nl5", nl, 110239801028, 5); + test_one("nl10", nl, 123408274536, 10); + test_one("nl20", nl, 145046915403, 20); + test_one("nl50", nl, 201207309002, 50); + test_one("nl100", nl, 303300936340, 100); + + test_one("nl1", nl, 90095050333, -1); + test_one("nl2", nl, 86601861798, -2); + test_one("nl5", nl, 77307843754, -5); + test_one("nl10", nl, 64668870425, -10); + test_one("nl20", nl, 46683531062, -20); + test_one("nl50", nl, 10244523910, -50); + test_one("nl100", nl, 0, -100); + + test_one("no1", no, 1819566570720, 1); + test_one("no2", no, 1865041238129, 2, ut_settings::ignore_validity()); + test_one("no5", no, 1973615533600, 5); + test_one("no10", no, 2102034240506, 10); + test_one("no20", no, 2292171257647, 20); + test_one("no50", no, 2725475403816, 50); + test_one("no100", no, 3374987120112, 100); + + test_one("no1", no, 1725145487969, -1); + test_one("no2", no, 1678942603503, -2); + test_one("no5", no, 1547329249723, -5); + test_one("no10", no, 1361198873951, -10); + test_one("no20", no, 1089847815351, -20); + test_one("no50", no, 649622162382, -50); + test_one("no100", no, 306739133606, -100); + + test_one("uk1", uk, 733080790315, 1); + test_one("uk2", uk, 749555939251, 2); + test_one("uk5", uk, 793752660191, 5); + test_one("uk10", uk, 857682286960, 10); + test_one("uk20", uk, 970488082763, 20); + test_one("uk50", uk, 1247830325401, 50); + test_one("uk100", uk, 1659861958875, 100); + + test_one("uk1", uk, 699378146599, -1); + test_one("uk2", uk, 683086442146, -2); + test_one("uk5", uk, 637325279340, -5); + test_one("uk10", uk, 572556625332, -10); + test_one("uk20", uk, 479258129205, -20); + test_one("uk50", uk, 274828071591, -50); + test_one("uk100", uk, 78205461294, -100); +} + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + + test_all >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER) + test_all >(); +#endif + + return 0; +} + diff --git a/src/boost/libs/geometry/test/algorithms/buffer/buffer_linestring.cpp b/src/boost/libs/geometry/test/algorithms/buffer/buffer_linestring.cpp new file mode 100644 index 000000000..6cc99260c --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/buffer_linestring.cpp @@ -0,0 +1,414 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2012-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2016. +// Modifications copyright (c) 2016, 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) + +#include "test_buffer.hpp" + +#include +#include + +#include + +#include +#include +#include "test_common/test_point.hpp" + + +static std::string const simplex = "LINESTRING(0 0,4 5)"; +static std::string const simplex_vertical = "LINESTRING(0 0,0 1)"; +static std::string const simplex_horizontal = "LINESTRING(0 0,1 0)"; + +static std::string const straight = "LINESTRING(0 0,4 5,8 10)"; +static std::string const one_bend = "LINESTRING(0 0,4 5,7 4)"; +static std::string const two_bends = "LINESTRING(0 0,4 5,7 4,10 6)"; + +static std::string const bend_near_start1 = "LINESTRING(0 0,1 0,5 2)"; +static std::string const bend_near_start2 = "LINESTRING(0 0,1 0,2 1.5,5 3)"; + +static std::string const overlapping = "LINESTRING(0 0,4 5,7 4,10 6, 10 2,2 2)"; +static std::string const curve = "LINESTRING(2 7,3 5,5 4,7 5,8 7)"; +static std::string const tripod = "LINESTRING(5 0,5 5,1 8,5 5,9 8)"; // with spike + +static std::string const degenerate0 = "LINESTRING()"; +static std::string const degenerate1 = "LINESTRING(5 5)"; +static std::string const degenerate2 = "LINESTRING(5 5,5 5)"; +static std::string const degenerate3 = "LINESTRING(5 5,5 5,5 5)"; +static std::string const degenerate4 = "LINESTRING(5 5,5 5,4 4,5 5,5 5)"; + +static std::string const for_collinear = "LINESTRING(2 0,0 0,0 4,6 4,6 0,4 0)"; +static std::string const for_collinear2 = "LINESTRING(2 1,2 0,0 0,0 4,6 4,6 0,4 0,4 1)"; + +static std::string const chained2 = "LINESTRING(0 0,1 1,2 2)"; +static std::string const chained3 = "LINESTRING(0 0,1 1,2 2,3 3)"; +static std::string const chained4 = "LINESTRING(0 0,1 1,2 2,3 3,4 4)"; + +static std::string const field_sprayer1 = "LINESTRING(76396.40464822574 410095.6795147947,76397.85016212701 410095.211865792,76401.30666443033 410095.0466387949,76405.05892643372 410096.1007777959,76409.45103273794 410098.257640797,76412.96309264141 410101.6522238015)"; +static std::string const aimes120 = "LINESTRING(-2.505218 52.189211,-2.505069 52.189019,-2.504941 52.188854)"; +static std::string const aimes167 = "LINESTRING(-2.378569 52.312133,-2.37857 52.312127,-2.378544 52.31209)"; +static std::string const aimes175 = "LINESTRING(-2.3116 52.354326,-2.311555 52.35417,-2.311489 52.354145,-2.311335 52.354178)"; +static std::string const aimes171 = "LINESTRING(-2.393161 52.265087,-2.393002 52.264965,-2.392901 52.264891)"; +static std::string const aimes181 = "LINESTRING(-2.320686 52.43505,-2.320678 52.435016,-2.320697 52.434978,-2.3207 52.434977,-2.320741 52.434964,-2.320807 52.434964,-2.320847 52.434986,-2.320903 52.435022)"; + +static std::string const crossing = "LINESTRING(0 0,10 10,10 0,0 10)"; + +// Simplified cases from multi_linestring tesets: +static std::string const mikado1 = "LINESTRING(11.406143344709896325639419956133 0.75426621160409546007485914742574,12 1,11.403846153846153299582510953769 0.75)"; + +static std::string const mysql_report_2015_03_02a = "LINESTRING(0 0,0 5,5 5,5 0,0 0)"; // closed +static std::string const mysql_report_2015_03_02b = "LINESTRING(0 1,0 5,5 5,5 0,1 0)"; // not closed, 1 difference +static std::string const mysql_report_2015_03_02c = "LINESTRING(0 2,0 5,5 5,5 0,2 0)"; // not closed, 2 difference + +static std::string const mysql_report_2015_04_01 = "LINESTRING(103 5,107 2,111 4,116 -1,115 0,112 4)"; + +static std::string const mysql_report_2015_04_10a = "LINESTRING(1.922421e+307 1.520384e+308, 15 42, 89 -93,-89 -22)"; +static std::string const mysql_report_2015_04_10b = "LINESTRING(15 42, 89 -93,-89 -22, 1.922421e+307 1.520384e+308)"; +static std::string const mysql_report_2015_04_10c = "LINESTRING(15 42, 1.922421e+307 1.520384e+308, 89 -93,-89 -22)"; +static std::string const mysql_report_2015_04_10d = "LINESTRING(1.922421e+307 1.520384e+308, 1.923421e+307 1.521384e+308, 15 42, 89 -93,-89 -22)"; +static std::string const mysql_report_2015_04_10e = "LINESTRING(15 42, 89 -93,-89 -22, 1.922421e+307 1.520384e+308, 1.923421e+307 1.521384e+308)"; +static std::string const mysql_report_2015_04_10f = "LINESTRING(15 42, 1.922421e+307 1.520384e+308, 1.923421e+307 1.521384e+308, 89 -93,-89 -22)"; +static std::string const mysql_report_2015_04_10g = "LINESTRING(15 42, 89 -93,-89 -22)"; + +static std::string const mysql_report_2015_06_11 = "LINESTRING(" + "-155.9300341531310000 4.1672727531600900, -14.0079144546799000 " + "-12.2485554508160000, 176.9503531590800000 -3.0930641354495000, " + "32.6863251871831000 -17.9691125862157000, -17.7739746299451000 " + "41.3177973084700000, -36.0310834162082000 59.9486214620753000, " + "153.1574937017440000 46.3007892930418000, 172.7795126069240000 " + "19.5367061763707000, -85.6306040220105000 35.0128339347489000, " + "-61.1404987988716000 0.3278080608359490, -127.5034592987520000 " + "18.6202802642343000, 114.5567005754250000 -83.7227732658958000, " + "-66.1134822881378000 -75.2141906159065000, -93.7363999307791000 " + "49.3124773443269000, -8.7182702071584100 56.2071174970861000, " + "7.7959787229988800 60.8845281744769000, 13.0420633931840000 " + "58.8150539662759000, -89.9754374613871000 26.4546501154335000, " + "-44.5746548960799000 -88.8122262334508000, -178.4807616092640000 " + "10.7770331393820000, 161.8238702890570000 -42.3894892597522000, " + "136.2382890452810000 28.6261570633511000, 49.6788041059295000 " + "61.7724885566963000, 52.7876201424690000 -61.9246644395984000, " + "-162.7456296900030000 11.7183989853218000, 115.6208648232840000 " + "51.0941612539320000, -48.7772321835054000 50.4339743128205000)"; + +static std::string const mysql_report_2015_09_08a = "LINESTRING(1 1, 2 1, 1.765258e+308 4, -1 1, 10 4)"; +static std::string const mysql_report_2015_09_08b = "LINESTRING(2199023255556 16777218, 32770 8194, 1.417733e+308 7.823620e+307, -8 -9, 2147483649 20)"; +static std::string const mysql_report_2015_09_08c = "LINESTRING(-5 -8, 2 8, 2.160023e+307 1.937208e+307, -4 -3, -5 -4, 8796093022208 281474976710653)"; + +static std::string const mysql_23023665 = "LINESTRING(0 0, 0 5, 5 5, 5 0, 0 0)"; + +static std::string const mysql_25662426 = "LINESTRING(170 4756, 168 4756, 168 4759, 168 4764, 171 4764, 171 4700)"; +static std::string const mysql_25662426a = "LINESTRING(170 4756, 168 4756, 168 4759, 168 4764, 171 4764, 171 4750)"; + +static std::string const issue_596 = "LINESTRING(292979.660 6688731.370, 292979.600 6688733.420, 292979.540 6688735.440, 292979.540 6688735.500)"; + +template +void test_all() +{ + typedef bg::model::linestring

linestring; + typedef bg::model::polygon polygon; + + bg::strategy::buffer::join_miter join_miter; + bg::strategy::buffer::join_round join_round(100); + bg::strategy::buffer::join_round_by_divide join_round_by_divide(4); + bg::strategy::buffer::end_flat end_flat; + bg::strategy::buffer::end_round end_round(100); + + // For testing MySQL issues, which uses 32 by default + bg::strategy::buffer::end_round end_round32(32); + bg::strategy::buffer::join_round join_round32(32); + + const ut_settings settings; + + // Simplex (join-type is not relevant) + test_one("simplex", simplex, join_miter, end_flat, 19.209, 1.5); + test_one("simplex", simplex, join_miter, end_round, 26.2733, 1.5); + + // Should be about PI + 2 + test_one("simplex_vertical", simplex_vertical, join_round, end_round, 5.14, 1); + test_one("simplex_horizontal", simplex_horizontal, join_round, end_round, 5.14, 1); + + // Should be a bit less than PI + 2 + test_one("simplex_vertical32", simplex_vertical, join_round32, end_round32, 5.12145, 1); + test_one("simplex_horizontal32", simplex_horizontal, join_round32, end_round32, 5.12145, 1); + + test_one("simplex_asym_neg", simplex, join_miter, end_flat, 3.202, +1.5, settings, -1.0); + test_one("simplex_asym_pos", simplex, join_miter, end_flat, 3.202, -1.0, settings, +1.5); + // Do not work yet: + // test_one("simplex_asym_neg", simplex, join_miter, end_round, 3.202, +1.5, settings, -1.0); + // test_one("simplex_asym_pos", simplex, join_miter, end_round, 3.202, -1.0, settings, +1.5); + + // Generates (initially) a reversed polygon, with a negative area, which is reversed afterwards in assign_parents + test_one("simplex_asym_neg_rev", simplex, join_miter, end_flat, 3.202, +1.0, settings, -1.5); + test_one("simplex_asym_pos_rev", simplex, join_miter, end_flat, 3.202, -1.5, settings, +1.0); + + test_one("straight", straight, join_round, end_flat, 38.4187, 1.5); + test_one("straight", straight, join_miter, end_flat, 38.4187, 1.5); + + // One bend/two bends (tests join-type) + test_one("one_bend", one_bend, join_round, end_flat, 28.488, 1.5); + test_one("one_bend", one_bend, join_miter, end_flat, 28.696, 1.5); + test_one("one_bend", one_bend, join_round_by_divide, end_flat, 28.488, 1.5); + + test_one("one_bend", one_bend, join_round, end_round, 35.5603, 1.5); + test_one("one_bend", one_bend, join_miter, end_round, 35.7601, 1.5); + + test_one("two_bends", two_bends, join_round, end_round, 46.2995, 1.5); + test_one("two_bends", two_bends, join_round, end_flat, 39.235, 1.5); + test_one("two_bends", two_bends, join_round_by_divide, end_flat, 39.235, 1.5); + test_one("two_bends", two_bends, join_miter, end_flat, 39.513, 1.5); + test_one("two_bends_left", two_bends, join_round, end_flat, 20.028, 1.5, settings, 0.0); + test_one("two_bends_left", two_bends, join_miter, end_flat, 20.225, 1.5, settings, 0.0); + test_one("two_bends_right", two_bends, join_round, end_flat, 19.211, 0.0, settings, 1.5); + test_one("two_bends_right", two_bends, join_miter, end_flat, 19.288, 0.0, settings, 1.5); + + test_one("bend_near_start1", bend_near_start1, join_round, end_flat, 109.2625, 9.0); + test_one("bend_near_start2", bend_near_start2, join_round, end_flat, 142.8709, 9.0); + + // Next (and all similar cases) which a offsetted-one-sided buffer has to be fixed. TODO + //test_one("two_bends_neg", two_bends, join_miter, end_flat, 99, +1.5, settings, -1.0); + //test_one("two_bends_pos", two_bends, join_miter, end_flat, 99, -1.5, settings, +1.0); + //test_one("two_bends_neg", two_bends, join_round, end_flat,99, +1.5, settings, -1.0); + //test_one("two_bends_pos", two_bends, join_round, end_flat, 99, -1.5, settings, +1.0); + + test_one("overlapping150", overlapping, join_round, end_flat, 65.6786, 1.5); + test_one("overlapping150", overlapping, join_miter, end_flat, 68.140, 1.5); + + // Different cases with intersection points on flat and (left/right from line itself) + test_one("overlapping_asym_150_010", overlapping, join_round, end_flat, 48.308, 1.5, settings, 0.25); + test_one("overlapping_asym_150_010", overlapping, join_miter, end_flat, 50.770, 1.5, settings, 0.25); + test_one("overlapping_asym_150_075", overlapping, join_round, end_flat, 58.506, 1.5, settings, 0.75); + test_one("overlapping_asym_150_075", overlapping, join_miter, end_flat, 60.985, 1.5, settings, 0.75); + test_one("overlapping_asym_150_100", overlapping, join_round, end_flat, 62.514, 1.5, settings, 1.0); + test_one("overlapping_asym_150_100", overlapping, join_miter, end_flat, 64.984, 1.5, settings, 1.0); + + // Having flat end + test_one("for_collinear", for_collinear, join_round, end_flat, 68.561, 2.0); + test_one("for_collinear", for_collinear, join_miter, end_flat, 72, 2.0); +#if defined(BOOST_GEOMETRY_TEST_FAILURES) + test_one("for_collinear2", for_collinear2, join_round, end_flat, 74.387, 2.0); + test_one("for_collinear2", for_collinear2, join_miter, end_flat, 78.0, 2.0); +#endif + + test_one("curve", curve, join_round, end_flat, 58.1944, 5.0, settings, 3.0); + test_one("curve", curve, join_miter, end_flat, 58.7371, 5.0, settings, 3.0); + + test_one("tripod", tripod, join_miter, end_flat, 74.25, 3.0); + test_one("tripod", tripod, join_miter, end_round, 116.6336, 3.0); + + test_one("chained2", chained2, join_round, end_flat, 11.3137, 2.5, settings, 1.5); + test_one("chained3", chained3, join_round, end_flat, 16.9706, 2.5, settings, 1.5); + test_one("chained4", chained4, join_round, end_flat, 22.6274, 2.5, settings, 1.5); + + test_one("field_sprayer1", field_sprayer1, join_round, end_flat, 324.3550, 16.5, settings, 6.5); + test_one("field_sprayer1", field_sprayer1, join_round, end_round, 718.761877, 16.5, settings, 6.5); + test_one("field_sprayer1", field_sprayer1, join_miter, end_round, 718.939628, 16.5, settings, 6.5); + + test_one("degenerate0", degenerate0, join_round, end_round, 0.0, 3.0); + test_one("degenerate1", degenerate1, join_round, end_round, 28.25, 3.0); + test_one("degenerate2", degenerate2, join_round, end_round, 28.2503, 3.0); + test_one("degenerate3", degenerate3, join_round, end_round, 28.2503, 3.0); + test_one("degenerate4", degenerate4, join_round, end_round, 36.7410, 3.0); + test_one("degenerate4", degenerate4, join_round, end_flat, 8.4853, 3.0); + + { + // These tests do test behaviour in end_round strategy: + // -> it should generate closed pieces, also for an odd number of points. + // It also tests behaviour in join_round strategy: + // -> it should generate e.g. 4 points for a full circle, + // so a quarter circle does not get points in between + using bg::strategy::buffer::join_round; + using bg::strategy::buffer::end_round; + + double const d10 = 1.0; + + test_one("mysql_report_2015_03_02a_3", mysql_report_2015_03_02a, join_round(3), end_round(3), 38.000, d10); + test_one("mysql_report_2015_03_02a_4", mysql_report_2015_03_02a, join_round(4), end_round(4), 38.000, d10); + test_one("mysql_report_2015_03_02a_5", mysql_report_2015_03_02a, join_round(5), end_round(5), 38.790, d10); + test_one("mysql_report_2015_03_02a_6", mysql_report_2015_03_02a, join_round(6), end_round(6), 38.817, d10); + test_one("mysql_report_2015_03_02a_7", mysql_report_2015_03_02a, join_round(7), end_round(7), 38.851, d10); + test_one("mysql_report_2015_03_02b_3", mysql_report_2015_03_02b, join_round(3), end_round(3), 36.500, d10); + test_one("mysql_report_2015_03_02b_4", mysql_report_2015_03_02b, join_round(4), end_round(4), 36.500, d10); + test_one("mysql_report_2015_03_02b_5", mysql_report_2015_03_02b, join_round(5), end_round(5), 37.346, d10); + test_one("mysql_report_2015_03_02b_6", mysql_report_2015_03_02b, join_round(6), end_round(6), 37.402, d10); + test_one("mysql_report_2015_03_02b_7", mysql_report_2015_03_02b, join_round(7), end_round(7), 37.506, d10); + test_one("mysql_report_2015_03_02c_3", mysql_report_2015_03_02c, join_round(2), end_round(3), 32.500, d10); + test_one("mysql_report_2015_03_02c_4", mysql_report_2015_03_02c, join_round(4), end_round(4), 32.500, d10); + test_one("mysql_report_2015_03_02c_5", mysql_report_2015_03_02c, join_round(5), end_round(5), 33.611, d10); + test_one("mysql_report_2015_03_02c_6", mysql_report_2015_03_02c, join_round(6), end_round(6), 33.719, d10); + test_one("mysql_report_2015_03_02c_7", mysql_report_2015_03_02c, join_round(7), end_round(7), 33.901, d10); + + // Testing the asymmetric end caps with odd number of points + double const d15 = 1.5; + test_one("mysql_report_2015_03_02c_asym1", mysql_report_2015_03_02c, join_round(7), end_round(7), 39.714, d10, settings, d15); + test_one("mysql_report_2015_03_02c_asym2", mysql_report_2015_03_02c, join_round(7), end_round(7), 46.116, d15, settings, d10); + + double const d100 = 10; + test_one("mysql_report_2015_04_01", mysql_report_2015_04_01, join_round(32), end_round(32), 632.234, d100); + } + + { + // Check on validity, with high precision because areas are all very small + ut_settings settings(1.0e-10, true); + + test_one("aimes120", aimes120, join_miter, end_flat, 1.62669948622351512e-08, 0.000018, settings); + test_one("aimes120", aimes120, join_round, end_round, 1.72842078427493107e-08, 0.000018, settings); + + test_one("aimes167", aimes167, join_miter, end_flat, 1.88900628472765675e-09, 0.000018, settings); + test_one("aimes167", aimes167, join_round, end_round, 2.85734813587623648e-09, 0.000018, settings); + + test_one("aimes175", aimes175, join_miter, end_flat, 2.81111809385947709e-08, 0.000036, settings); + test_one("aimes175", aimes175, join_round, end_round, 3.21215765097804251e-08, 0.000036, settings); + + test_one("aimes171", aimes171, join_miter, end_flat, 1.1721873249825876e-08, 0.000018, settings); + test_one("aimes171", aimes171, join_round, end_round, 1.2739093335767393e-08, 0.000018, settings); + test_one("aimes171", aimes171, join_round_by_divide, end_round, 1.2739093335767393e-08, 0.000018, settings); + + test_one("aimes181", aimes181, join_miter, end_flat, 2.1729405830228643e-08, 0.000036, settings); + test_one("aimes181", aimes181, join_round, end_round, 2.57415564419716247e-08, 0.000036, settings); + test_one("aimes181", aimes181, join_round_by_divide, end_round, 2.57415564419716247e-08, 0.000036, settings); + } + + { + // Expectations can also be 1702.56530051454502 2140.78725663358819 + // so we increase tolerance + ut_settings settings(0.5); + test_one("crossing", crossing, join_round32, end_flat, 1702.1, 20.0, settings); + test_one("crossing", crossing, join_round32, end_round32, 2140.4, 20.0, settings); + } + + test_one("mikado1", mikado1, join_round32, end_round32, 5441135039.0979, 41751.0); + + { + // This case gave a spike (invalid result) up to 1.70 + // Fixed by general form for line/line intersection in miter calculation + using bg::strategy::buffer::join_round; + using bg::strategy::buffer::end_round; + test_one("issue_596", issue_596, join_round(12), end_round(12), 0.12462779, 0.015); + test_one("issue_596", issue_596, join_miter, end_round(12), 0.12462807, 0.015); + } + + test_one("mysql_report_2015_06_11", + mysql_report_2015_06_11, join_round32, end_round32, + 27862.733459829971, + 5.9518403867035365); + + test_one("mysql_report_2015_09_08a", mysql_report_2015_09_08a, join_round32, end_round32, 0.0, 1.0); + test_one("mysql_report_2015_09_08b", mysql_report_2015_09_08b, join_round32, end_round32, 0.0, 1099511627778.0); + test_one("mysql_report_2015_09_08c", mysql_report_2015_09_08c, join_round32, end_round32, 0.0, 0xbe); + + test_one("mysql_23023665_1", mysql_23023665, join_round32, end_flat, 459.1051, 10); + test_one("mysql_23023665_2", mysql_23023665, join_round32, end_flat, 6877.7097, 50); + + test_one("mysql_25662426", mysql_25662426, join_round32, end_round32, 1, 0, 1660.6673, 10); + + // Test behaviour with different buffer sizes, generating internally turns on different locations + test_one("mysql_25662426a_05", mysql_25662426a, join_round32, end_round32, 27.6156, 0.5); + test_one("mysql_25662426a_1", mysql_25662426a, join_round32, end_round32, 54.9018, 1.0); + test_one("mysql_25662426a_2", mysql_25662426a, join_round32, end_round32, 103.6072, 2.0); + test_one("mysql_25662426a_3", mysql_25662426a, join_round32, end_round32, 152.1163, 3.0); + test_one("mysql_25662426a_4", mysql_25662426a, join_round32, end_round32, 206.4831, 4.0); + test_one("mysql_25662426a_5", mysql_25662426a, join_round32, end_round32, 266.8505, 5.0); + test_one("mysql_25662426a_10", mysql_25662426a, join_round32, end_round32, 660.7355, 10.0); + + test_one("mysql_25662426a_05", mysql_25662426a, join_round32, end_flat, 26.8352, 0.5); + test_one("mysql_25662426a_1", mysql_25662426a, join_round32, end_flat, 53.3411, 1.0); + test_one("mysql_25662426a_2", mysql_25662426a, join_round32, end_flat, 97.3644, 2.0); + test_one("mysql_25662426a_3", mysql_25662426a, join_round32, end_flat, 138.0697, 3.0); + test_one("mysql_25662426a_4", mysql_25662426a, join_round32, end_flat, 181.5115, 4.0); + test_one("mysql_25662426a_5", mysql_25662426a, join_round32, end_flat, 227.8325, 5.0); + test_one("mysql_25662426a_10", mysql_25662426a, join_round32, end_flat, 534.1084, 10.0); + + // Asymmetric buffers + // Mostly left + test_one("mysql_25662426a_mostly_left_05", mysql_25662426a, join_round32, end_round32, 15.6638, 0.5, settings, 0.05); + test_one("mysql_25662426a_mostly_left_1", mysql_25662426a, join_round32, end_round32, 32.9553, 1.0, settings, 0.1); + test_one("mysql_25662426a_mostly_left_2", mysql_25662426a, join_round32, end_round32, 72.1159, 2.0, settings, 0.2); + test_one("mysql_25662426a_mostly_left_3", mysql_25662426a, join_round32, end_round32, 116.3802, 3.0, settings, 0.3); + test_one("mysql_25662426a_mostly_left_4", mysql_25662426a, join_round32, end_round32, 165.9298, 4.0, settings, 0.4); + test_one("mysql_25662426a_mostly_left_5", mysql_25662426a, join_round32, end_round32, 220.8054, 5.0, settings, 0.5); + test_one("mysql_25662426a_mostly_left_10", mysql_25662426a, join_round32, end_round32, 577.3742, 10.0, settings, 1.0); + + // Mostly right + test_one("mysql_25662426a_mostly_right_05", mysql_25662426a, join_round32, end_round32, 14.3419, 0.05, settings, 0.5); + test_one("mysql_25662426a_mostly_right_1", mysql_25662426a, join_round32, end_round32, 27.1955, 0.1, settings, 1.0); + test_one("mysql_25662426a_mostly_right_2", mysql_25662426a, join_round32, end_round32, 43.1821, 0.2, settings, 2.0); + test_one("mysql_25662426a_mostly_right_3", mysql_25662426a, join_round32, end_round32, 54.4337, 0.3, settings, 3.0); + test_one("mysql_25662426a_mostly_right_4", mysql_25662426a, join_round32, end_round32, 75.6376, 0.4, settings, 4.0); + test_one("mysql_25662426a_mostly_right_5", mysql_25662426a, join_round32, end_round32, 102.6952, 0.5, settings, 5.0); + test_one("mysql_25662426a_mostly_right_10", mysql_25662426a, join_round32, end_round32, 260.1850, 1.0, settings, 10.0); + + // Left + test_one("mysql_25662426a_left_05", mysql_25662426a, join_round32, end_round32, 14.2803, 0.5, settings, 0.0); + test_one("mysql_25662426a_left_1", mysql_25662426a, join_round32, end_round32, 30.1214, 1.0, settings, 0.0); + test_one("mysql_25662426a_left_2", mysql_25662426a, join_round32, end_round32, 66.4858, 2.0, ut_settings(0.01, false), 0.0); // It has a self touching point + test_one("mysql_25662426a_left_3", mysql_25662426a, join_round32, end_round32, 108.3305, 3.0, settings, 0.0); + test_one("mysql_25662426a_left_4", mysql_25662426a, join_round32, end_round32, 155.5128, 4.0, settings, 0.0); + test_one("mysql_25662426a_left_5", mysql_25662426a, join_round32, end_round32, 208.1289, 5.0, settings, 0.0); + test_one("mysql_25662426a_left_10", mysql_25662426a, join_round32, end_round32, 554.8818, 10.0, settings, 0.0); + + // Right + test_one("mysql_25662426a_right_05", mysql_25662426a, join_round32, end_round32, 12.9451, 0.0, settings, 0.5); + test_one("mysql_25662426a_right_1", mysql_25662426a, join_round32, end_round32, 24.3902, 0.0, settings, 1.0); + test_one("mysql_25662426a_right_2", mysql_25662426a, join_round32, end_round32, 37.5607, 0.0, settings, 2.0); + test_one("mysql_25662426a_right_3", mysql_25662426a, join_round32, end_round32, 46.2741, 0.0, settings, 3.0); + test_one("mysql_25662426a_right_4", mysql_25662426a, join_round32, end_round32, 70.2429, 0.0, settings, 4.0); + test_one("mysql_25662426a_right_5", mysql_25662426a, join_round32, end_round32, 95.7545, 0.0, settings, 5.0); + test_one("mysql_25662426a_right_10", mysql_25662426a, join_round32, end_round32, 244.5337, 0.0, settings, 10.0); + + // Flat end for one-sided buffer + test_one("mysql_25662426a_left_05", mysql_25662426a, join_round32, end_flat, 14.0853, 0.5, settings, 0.0); + test_one("mysql_25662426a_right_05", mysql_25662426a, join_round32, end_flat, 12.7500, 0.0, settings, 0.5); + test_one("mysql_25662426a_left_25", mysql_25662426a, join_round32, end_flat, 82.1318, 2.5, settings, 0.0); + test_one("mysql_25662426a_right_25", mysql_25662426a, join_round32, end_flat, 39.0000, 0.0, settings, 2.5); +} + +template +void test_invalid() +{ + typedef bg::model::linestring

linestring; + typedef bg::model::polygon polygon; + + bg::strategy::buffer::end_round end_round32(32); + bg::strategy::buffer::join_round join_round32(32); + + // Linestring contains extreme differences causing numeric errors. Empty geometry is returned + test_one("mysql_report_2015_04_10a", mysql_report_2015_04_10a, join_round32, end_round32, 0.0, 100.0); + test_one("mysql_report_2015_04_10b", mysql_report_2015_04_10b, join_round32, end_round32, 0.0, 100.0); + test_one("mysql_report_2015_04_10c", mysql_report_2015_04_10c, join_round32, end_round32, 0.0, 100.0); + test_one("mysql_report_2015_04_10d", mysql_report_2015_04_10d, join_round32, end_round32, 0.0, 100.0); + test_one("mysql_report_2015_04_10e", mysql_report_2015_04_10e, join_round32, end_round32, 0.0, 100.0); + test_one("mysql_report_2015_04_10f", mysql_report_2015_04_10f, join_round32, end_round32, 0.0, 100.0); + + // The equivalent, valid, case + test_one("mysql_report_2015_04_10g", mysql_report_2015_04_10g, join_round32, end_round32, 86527.871, 100.0); +} + +#ifdef HAVE_TTMATH +#include +#endif + + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + + test_all >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER) + test_all >(); +#endif + + test_invalid >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_invalid >(); +#endif + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/buffer/buffer_linestring_aimes.cpp b/src/boost/libs/geometry/test/algorithms/buffer/buffer_linestring_aimes.cpp new file mode 100644 index 000000000..e14954466 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/buffer_linestring_aimes.cpp @@ -0,0 +1,489 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include + +#include + +#include + + +// Test cases of the list sent by Aimes on geometry list at 2012 Jul 19. +// Complete list at: http://boost-geometry.203548.n3.nabble.com/file/n4025063/BufferProblems.txt +template +void test_aimes() +{ + static std::string testcases[] = + { + "LINESTRING(-3.031075 52.22385,-3.030809 52.223579,-3.030424 52.223207,-3.030212 52.222931,-3.030013 52.222764,-3.029721 52.222584,-3.029469 52.222443,-3.029218 52.222319,-3.028886 52.222187,-3.028859 52.222176,-3.028815 52.222158,-3.028563 52.222016,-3.028462 52.221945,-3.028407 52.221881,-3.028351 52.22179,-3.028301 52.221718,-3.028203 52.221601,-3.028151 52.221552,-3.027982 52.221422,-3.027871 52.221353,-3.027755 52.221293,-3.027573 52.22121,-3.027493 52.221179,-3.027463 52.221165,-3.027147 52.221065,-3.027045 52.221039,-3.026812 52.220989,-3.026691 52.220968,-3.026602 52.220957,-3.026111 52.220898,-3.025715 52.220861,-3.025332 52.220842,-3.025011 52.220845,-3.024587 52.220849,-3.024339 52.220869,-3.024213 52.220881,-3.024103 52.220905,-3.023904 52.220966,-3.023687 52.221027,-3.023575 52.221054,-3.023409 52.221077,-3.023317 52.221072,-3.023259 52.221049,-3.023028 52.220905,-3.022859 52.220819,-3.022799 52.220774,-3.022739 52.220688)", + "LINESTRING(-3.056646 52.20421,-3.055298 52.204143,-3.054991 52.204119,-3.053966 52.204125,-3.053793 52.204126)", + "LINESTRING(-3.040117 52.307787,-3.040012 52.307874,-3.03999 52.30792,-3.039986 52.307973,-3.040054 52.308123,-3.040092 52.308238,-3.040125 52.308398,-3.040165 52.308558,-3.040194 52.308587,-3.040539 52.30889,-3.040868 52.309147,-3.041196 52.309396,-3.042401 52.310114,-3.042414 52.310121,-3.042758 52.31032,-3.04277 52.310327,-3.042779 52.310353,-3.042771 52.31038,-3.042746 52.310444,-3.042627 52.310704,-3.042601 52.310799,-3.042588 52.310846,-3.042588 52.310941,-3.042596 52.311007,-3.04261 52.311035,-3.04264 52.311099,-3.042646 52.311111,-3.042662 52.311134,-3.042681 52.311161,-3.042708 52.311199,-3.042792 52.311275,-3.042808 52.31129,-3.042908 52.311364,-3.04294 52.311385,-3.042996 52.311423,-3.043232 52.311542,-3.043424 52.311632,-3.043447 52.311641,-3.043452 52.311643,-3.043537 52.311677,-3.043725 52.311728,-3.043876 52.311759,-3.044048 52.311784,-3.044325 52.311813,-3.044963 52.31187,-3.045654 52.311927,-3.046044 52.31196,-3.04609 52.311963,-3.046235 52.311979,-3.046374 52.312015,-3.046477 52.312058,-3.046587 52.312109,-3.046654 52.312147,-3.046771 52.312228,-3.046962 52.312372,-3.047043 52.312443,-3.047089 52.312498,-3.04711 52.312547,-3.047112 52.312586,-3.047113 52.312607,-3.047105 52.312666,-3.047067 52.312722)", + "LINESTRING(-3.054162 52.34456,-3.054088 52.344534,-3.054014 52.344508,-3.053926 52.34449,-3.053823 52.344491,-3.053632 52.344493,-3.053368 52.344513,-3.053149 52.344551,-3.053076 52.34457,-3.053033 52.344588,-3.053003 52.344598)", + "LINESTRING(-3.032714 52.342934,-3.032658 52.342814,-3.032617 52.342701,-3.032583 52.342606,-3.032554 52.342502,-3.032517 52.342439,-3.032453 52.34233,-3.032374 52.3422,-3.032325 52.342121,-3.032288 52.342056,-3.032252 52.342028)", + "LINESTRING(-3.041066 52.338221,-3.040547 52.33801,-3.040399 52.337939,-3.040398 52.337921,-3.040427 52.337894,-3.040456 52.337867,-3.040499 52.337849)", + "LINESTRING(-3.044091 52.565713,-3.044077 52.565734,-3.044071 52.565742,-3.044028 52.565796,-3.043992 52.565879,-3.043952 52.565959,-3.043915 52.566,-3.043857 52.56604,-3.043741 52.566113,-3.043492 52.566223,-3.042615 52.566563,-3.042425 52.566646,-3.042294 52.566683,-3.041932 52.566745,-3.041648 52.566791,-3.041445 52.566841,-3.041226 52.566924,-3.041066 52.566992,-3.04089 52.567056,-3.040865 52.56708,-3.040858 52.5671,-3.040879 52.567118,-3.040944 52.567135,-3.041034 52.567137,-3.041288 52.567141,-3.041822 52.567144,-3.042107 52.567134,-3.042245 52.567142,-3.04229 52.56715,-3.042558 52.567247,-3.042736 52.56729,-3.042918 52.567326,-3.043082 52.567338,-3.043388 52.567401,-3.043848 52.567532,-3.043908 52.567568,-3.043923 52.567577,-3.043938 52.567603,-3.04394 52.567657,-3.043941 52.567711,-3.043895 52.56798,-3.043869 52.568115,-3.043868 52.568138,-3.043869 52.568158)", + "LINESTRING(-3.039713 52.536795,-3.039808 52.536825,-3.039958 52.536844,-3.040172 52.536885,-3.040322 52.536924,-3.040476 52.536964,-3.04061 52.536989,-3.040678 52.536992,-3.040773 52.536986,-3.040949 52.536958,-3.041148 52.536905,-3.041312 52.536857,-3.041544 52.536777,-3.04173 52.536705,-3.041942 52.536634,-3.042081 52.5366,-3.042204 52.53659,-3.042324 52.536587,-3.042414 52.536591,-3.042491 52.536598,-3.042595 52.536619,-3.042767 52.536683,-3.042916 52.536749,-3.043007 52.536786,-3.043108 52.5368)", + "LINESTRING(-3.049078 52.571837,-3.049229 52.571855,-3.04964 52.571857,-3.049841 52.571858,-3.049967 52.571873,-3.05006 52.571903,-3.050094 52.571922,-3.050135 52.57194,-3.050228 52.571958,-3.05033 52.571969,-3.050391 52.571987,-3.050413 52.572027,-3.050421 52.572072,-3.050386 52.572205)", + "LINESTRING(-2.983733 52.233609,-2.98371 52.233684,-2.983736 52.233793,-2.98379 52.233906,-2.983869 52.233994,-2.984058 52.234121,-2.984225 52.234228,-2.984382 52.234341,-2.984557 52.234481,-2.984695 52.234575,-2.984716 52.234589,-2.984758 52.234617,-2.984943 52.234694,-2.984978 52.234706,-2.985031 52.234722,-2.98506 52.234731,-2.985343 52.234799,-2.985594 52.234867,-2.985755 52.234917,-2.986071 52.23497,-2.9863 52.235006,-2.986458 52.235044,-2.986602 52.235109,-2.987015 52.23534,-2.987215 52.235464,-2.987423 52.235617,-2.987637 52.235785,-2.987968 52.23602,-2.988192 52.236213,-2.988438 52.236386,-2.988512 52.236449,-2.988579 52.236505,-2.98865 52.236583,-2.98869 52.236656,-2.988721 52.236744,-2.988612 52.236848,-2.988548 52.236932,-2.988497 52.237107,-2.988432 52.237336,-2.988372 52.237567,-2.98833 52.237709,-2.988286 52.23788,-2.988233 52.23807,-2.988249 52.238145,-2.988291 52.238321,-2.988323 52.238505,-2.988379 52.238624,-2.988435 52.238727,-2.988438 52.238732,-2.988466 52.238777,-2.988485 52.238809,-2.988525 52.238854,-2.98858 52.238916,-2.988715 52.239098,-2.988806 52.239204,-2.988865 52.239275,-2.988962 52.239393,-2.989045 52.239474,-2.989244 52.239629,-2.989254 52.239636,-2.989273 52.239649,-2.989508 52.239816,-2.989534 52.239835,-2.989747 52.23998,-2.989769 52.239996,-2.98982 52.240033,-2.989843 52.240055,-2.989949 52.240152,-2.989956 52.240159,-2.99002 52.240248,-2.990074 52.240334,-2.990079 52.24034,-2.990089 52.240357,-2.990106 52.240401,-2.99015 52.240512,-2.990268 52.240793,-2.990336 52.24095,-2.990425 52.241123,-2.990472 52.241198,-2.990617 52.241383,-2.990723 52.241527,-2.990784 52.241601,-2.990811 52.241633,-2.990859 52.241753,-2.990892 52.241854,-2.99094 52.241995,-2.990947 52.242025,-2.990958 52.24207,-2.991023 52.242175,-2.991122 52.242333,-2.991202 52.242485,-2.991276 52.242624,-2.991408 52.242809,-2.991639 52.2431,-2.99172 52.243202,-2.991734 52.243222,-2.991897 52.243461,-2.991944 52.243547,-2.992072 52.243781,-2.992267 52.244138,-2.992431 52.244408,-2.992503 52.244532,-2.992657 52.244802,-2.992761 52.245063,-2.9928 52.245305,-2.992813 52.245622,-2.992822 52.245701,-2.99281 52.245784,-2.992793 52.245867,-2.992771 52.245927,-2.992736 52.245978,-2.992646 52.246076,-2.992573 52.246144,-2.992455 52.246276,-2.992316 52.246468,-2.992432 52.246557,-2.99253 52.246568,-2.992901 52.246565,-2.993581 52.246527,-2.993926 52.246509,-2.994191 52.246514)", + "LINESTRING(-3.012501 52.228425,-3.012694 52.22837,-3.012848 52.228308,-3.012946 52.22824,-3.013055 52.228146,-3.013123 52.228048,-3.013182 52.227904,-3.013242 52.227742,-3.013269 52.227632,-3.01327 52.227553,-3.013245 52.227479,-3.013151 52.227332,-3.013072 52.227223,-3.012938 52.227095,-3.012779 52.226936,-3.01271 52.226867,-3.012639 52.226817,-3.012452 52.226743,-3.012278 52.226685,-3.01201 52.226616,-3.011707 52.226519,-3.011541 52.226458,-3.011388 52.22638,-3.011334 52.226352,-3.011111 52.226206,-3.010983 52.226107,-3.010893 52.226012,-3.010832 52.225905,-3.010825 52.225845,-3.010841 52.225687,-3.010858 52.225516,-3.010857 52.225451,-3.010844 52.225405,-3.010747 52.225247,-3.01062 52.225123,-3.010467 52.224893,-3.010372 52.224658)", + "LINESTRING(-2.998218 52.230123,-2.998074 52.230203,-2.998066 52.230206,-2.997957 52.230258,-2.997863 52.230302,-2.997049 52.230561,-2.996351 52.230783,-2.995741 52.230976,-2.995552 52.231032)", + "LINESTRING(-3.005291 52.231131,-3.005218 52.2312,-3.005076 52.23132,-3.004901 52.231443,-3.004725 52.231551,-3.004586 52.231621,-3.004439 52.231667,-3.004381 52.231685,-3.004236 52.231693,-3.004106 52.231684,-3.003877 52.231653,-3.003705 52.231618,-3.003613 52.231587,-3.003529 52.231549,-3.003019 52.231279,-3.002922 52.231244,-3.002789 52.231196,-3.002657 52.231144,-3.002492 52.231112,-3.002372 52.231091,-3.002239 52.231073,-3.001708 52.231062,-3.001596 52.231053,-3.000959 52.230853,-3.000714 52.230758,-3.00005 52.2305,-2.999016 52.230131,-2.999001 52.230122)", + "LINESTRING(-3.031075 52.22385,-3.030809 52.223579,-3.030424 52.223207,-3.030212 52.222931,-3.030013 52.222764,-3.029721 52.222584,-3.029469 52.222443,-3.029218 52.222319,-3.028886 52.222187,-3.028859 52.222176,-3.028815 52.222158,-3.028563 52.222016,-3.028462 52.221945,-3.028407 52.221881,-3.028351 52.22179,-3.028301 52.221718,-3.028203 52.221601,-3.028151 52.221552,-3.027982 52.221422,-3.027871 52.221353,-3.027755 52.221293,-3.027573 52.22121,-3.027493 52.221179,-3.027463 52.221165,-3.027147 52.221065,-3.027045 52.221039,-3.026812 52.220989,-3.026691 52.220968,-3.026602 52.220957,-3.026111 52.220898,-3.025715 52.220861,-3.025332 52.220842,-3.025011 52.220845,-3.024587 52.220849,-3.024339 52.220869,-3.024213 52.220881,-3.024103 52.220905,-3.023904 52.220966,-3.023687 52.221027,-3.023575 52.221054,-3.023409 52.221077,-3.023317 52.221072,-3.023259 52.221049,-3.023028 52.220905,-3.022859 52.220819,-3.022799 52.220774,-3.022739 52.220688)", + "LINESTRING(-3.005281 52.202464,-3.005919 52.202654,-3.006134 52.202718,-3.007138 52.202939,-3.007725 52.20309)", + "LINESTRING(-3.003371 52.210074,-3.003224 52.21001,-3.003195 52.209997,-3.003094 52.209988,-3.003007 52.209981,-3.002994 52.20998,-3.002952 52.209994,-3.002853 52.210026,-3.002667 52.210068,-3.002566 52.21008,-3.002539 52.210084,-3.002326 52.210102,-3.002318 52.210103,-3.00231 52.210104,-3.002164 52.210134,-3.001964 52.21022,-3.001792 52.210359)", + "LINESTRING(-2.968498 52.185726,-2.968594 52.185677,-2.968762 52.185642,-2.968969 52.185608,-2.969272 52.185575,-2.970091 52.185526,-2.970473 52.185443,-2.971035 52.185384,-2.971959 52.185251,-2.972754 52.185111,-2.973037 52.185044,-2.973168 52.185016,-2.973851 52.184803,-2.97401 52.184739,-2.974271 52.184602,-2.974856 52.184364,-2.97488 52.184356,-2.975153 52.184265,-2.975391 52.184212,-2.975741 52.184173,-2.97598 52.184125,-2.976288 52.184004,-2.976831 52.183673,-2.977132 52.183471,-2.977414 52.183259,-2.977612 52.183012,-2.978006 52.182385,-2.978157 52.182251,-2.97863 52.181886)", + "LINESTRING(-2.898438 52.177673,-2.897173 52.178057,-2.896867 52.178131,-2.89675 52.178159,-2.896383 52.178233,-2.896087 52.178291,-2.895818 52.178337,-2.895512 52.178384,-2.895118 52.178441,-2.894593 52.178499,-2.894339 52.178519,-2.894317 52.178514,-2.894308 52.178511,-2.894282 52.178504,-2.894217 52.178425,-2.894159 52.178354,-2.894028 52.178134,-2.894001 52.178031,-2.893855 52.177495,-2.893851 52.177478,-2.893683 52.17713,-2.893553 52.176988,-2.893238 52.176731,-2.893127 52.176628,-2.892918 52.176433,-2.892613 52.176056,-2.892122 52.175233,-2.892067 52.175113,-2.891895 52.174561,-2.891781 52.174335,-2.891634 52.174134,-2.891492 52.17394,-2.891344 52.173699,-2.891083 52.173401,-2.89083 52.173169,-2.890577 52.172964,-2.890468 52.172913,-2.890384 52.172882,-2.890276 52.172865,-2.890107 52.17286,-2.890063 52.172851,-2.889975 52.172834,-2.889808 52.17278,-2.889709 52.172725,-2.889451 52.172532,-2.88907 52.172247,-2.888619 52.171957,-2.888574 52.171916)", + "LINESTRING(-3.001027 52.270697,-3.001233 52.270714,-3.00157 52.270711,-3.001614 52.270715,-3.001658 52.270719,-3.001746 52.270736,-3.002 52.270828)", + "LINESTRING(-3.002514 52.270973,-3.002616 52.270954,-3.00282 52.270916,-3.002878 52.27088,-3.002978 52.270771,-3.003022 52.270752,-3.003066 52.270743,-3.003124 52.270734)", + "LINESTRING(-2.944639 52.25447,-2.944459 52.254529,-2.944255 52.254603,-2.944087 52.254655,-2.943732 52.254787,-2.943453 52.25489,-2.943209 52.254982,-2.943098 52.255011,-2.942917 52.255063,-2.94283 52.255093,-2.94258 52.255195,-2.942226 52.255335,-2.942051 52.255401,-2.941816 52.255507,-2.941631 52.255602,-2.941497 52.255668,-2.941335 52.255741,-2.941207 52.2558,-2.941149 52.255815,-2.941074 52.255876,-2.94107 52.255945,-2.941106 52.255995,-2.941153 52.256023,-2.94152 52.25616,-2.941797 52.256259,-2.94205 52.256349,-2.9425 52.256509,-2.942615 52.256533,-2.942714 52.256543,-2.94282 52.256546,-2.943027 52.256522,-2.943226 52.256496,-2.943459 52.256443,-2.943774 52.256373,-2.944095 52.256291,-2.944325 52.256228,-2.944471 52.256187,-2.94475 52.256106,-2.944948 52.256054,-2.945042 52.256035,-2.945176 52.256027,-2.945305 52.256026,-2.94547 52.256032,-2.945731 52.256048,-2.945977 52.256064,-2.94623 52.256087,-2.946353 52.256107,-2.94647 52.256139,-2.946483 52.256142,-2.946595 52.256185,-2.946689 52.256202,-2.946889 52.256233,-2.946994 52.256232)", + "LINESTRING(-2.983733 52.233609,-2.98371 52.233684,-2.983736 52.233793,-2.98379 52.233906,-2.983869 52.233994,-2.984058 52.234121,-2.984225 52.234228,-2.984382 52.234341,-2.984557 52.234481,-2.984695 52.234575,-2.984716 52.234589,-2.984758 52.234617,-2.984943 52.234694,-2.984978 52.234706,-2.985031 52.234722,-2.98506 52.234731,-2.985343 52.234799,-2.985594 52.234867,-2.985755 52.234917,-2.986071 52.23497,-2.9863 52.235006,-2.986458 52.235044,-2.986602 52.235109,-2.987015 52.23534,-2.987215 52.235464,-2.987423 52.235617,-2.987637 52.235785,-2.987968 52.23602,-2.988192 52.236213,-2.988438 52.236386,-2.988512 52.236449,-2.988579 52.236505,-2.98865 52.236583,-2.98869 52.236656,-2.988721 52.236744,-2.988612 52.236848,-2.988548 52.236932,-2.988497 52.237107,-2.988432 52.237336,-2.988372 52.237567,-2.98833 52.237709,-2.988286 52.23788,-2.988233 52.23807,-2.988249 52.238145,-2.988291 52.238321,-2.988323 52.238505,-2.988379 52.238624,-2.988435 52.238727,-2.988438 52.238732,-2.988466 52.238777,-2.988485 52.238809,-2.988525 52.238854,-2.98858 52.238916,-2.988715 52.239098,-2.988806 52.239204,-2.988865 52.239275,-2.988962 52.239393,-2.989045 52.239474,-2.989244 52.239629,-2.989254 52.239636,-2.989273 52.239649,-2.989508 52.239816,-2.989534 52.239835,-2.989747 52.23998,-2.989769 52.239996,-2.98982 52.240033,-2.989843 52.240055,-2.989949 52.240152,-2.989956 52.240159,-2.99002 52.240248,-2.990074 52.240334,-2.990079 52.24034,-2.990089 52.240357,-2.990106 52.240401,-2.99015 52.240512,-2.990268 52.240793,-2.990336 52.24095,-2.990425 52.241123,-2.990472 52.241198,-2.990617 52.241383,-2.990723 52.241527,-2.990784 52.241601,-2.990811 52.241633,-2.990859 52.241753,-2.990892 52.241854,-2.99094 52.241995,-2.990947 52.242025,-2.990958 52.24207,-2.991023 52.242175,-2.991122 52.242333,-2.991202 52.242485,-2.991276 52.242624,-2.991408 52.242809,-2.991639 52.2431,-2.99172 52.243202,-2.991734 52.243222,-2.991897 52.243461,-2.991944 52.243547,-2.992072 52.243781,-2.992267 52.244138,-2.992431 52.244408,-2.992503 52.244532,-2.992657 52.244802,-2.992761 52.245063,-2.9928 52.245305,-2.992813 52.245622,-2.992822 52.245701,-2.99281 52.245784,-2.992793 52.245867,-2.992771 52.245927,-2.992736 52.245978,-2.992646 52.246076,-2.992573 52.246144,-2.992455 52.246276,-2.992316 52.246468,-2.992432 52.246557,-2.99253 52.246568,-2.992901 52.246565,-2.993581 52.246527,-2.993926 52.246509,-2.994191 52.246514)", + "LINESTRING(-2.96971 52.385285,-2.969713 52.385302,-2.969795 52.385527,-2.969832 52.385568,-2.969956 52.38576,-2.970018 52.385883,-2.970042 52.386056,-2.970042 52.386067,-2.970029 52.386343,-2.970014 52.386442,-2.970008 52.386483,-2.970029 52.386586,-2.970032 52.386601,-2.970046 52.38667,-2.970131 52.386944,-2.970207 52.387072,-2.970265 52.387126,-2.970375 52.387143,-2.970425 52.387133,-2.970477 52.387106,-2.970477 52.38709,-2.970472 52.386848,-2.970485 52.386677,-2.970516 52.386575,-2.970655 52.386395,-2.970876 52.386204,-2.971034 52.386111,-2.971198 52.386032,-2.971267 52.386004,-2.97138 52.385958,-2.971639 52.385807,-2.971826 52.385679,-2.972103 52.385586,-2.97241 52.385483,-2.972753 52.385377,-2.973047 52.385311,-2.973623 52.385203,-2.973844 52.385136,-2.974009 52.385057,-2.974682 52.384692,-2.97509 52.384475,-2.975346 52.384353,-2.975663 52.384199,-2.975822 52.384099,-2.976126 52.383856,-2.976248 52.383782,-2.976406 52.383709,-2.976808 52.383507,-2.97691 52.383452,-2.977112 52.383324,-2.977314 52.383143,-2.977415 52.383034,-2.977529 52.382898,-2.9776 52.382799,-2.977628 52.382736,-2.977656 52.382637,-2.977696 52.382474,-2.977693 52.38234,-2.977622 52.382209,-2.977479 52.382031,-2.977175 52.381694,-2.97694 52.381417,-2.976698 52.381146,-2.976623 52.381043,-2.976554 52.380924,-2.976446 52.380715,-2.976363 52.380584,-2.976241 52.380298,-2.976087 52.379831,-2.976036 52.379608,-2.976069 52.37928,-2.976091 52.378928,-2.976071 52.378613,-2.976035 52.378424,-2.975992 52.378395,-2.975901 52.378223,-2.975842 52.378095,-2.975834 52.37802,-2.975822 52.3779,-2.975776 52.377677,-2.97571 52.377473,-2.975613 52.377281,-2.975564 52.377153,-2.975519 52.376974,-2.975433 52.376805,-2.975342 52.376658,-2.975273 52.376573,-2.97521 52.376501,-2.975142 52.376448,-2.975027 52.376371,-2.975012 52.376362,-2.974887 52.376293,-2.974849 52.376237,-2.974917 52.37617,-2.97468 52.376055,-2.974513 52.375966,-2.974362 52.375877,-2.97431 52.375843,-2.974406 52.375776,-2.974582 52.37576,-2.974724 52.37574,-2.974958 52.375653,-2.975739 52.375344,-2.976395 52.37508,-2.976664 52.374976,-2.97683 52.374762)", + "LINESTRING(-2.997814 52.40448,-2.997576 52.404378,-2.997296 52.404275,-2.996941 52.404117,-2.99681 52.404059,-2.996536 52.40394,-2.996318 52.403882,-2.996251 52.403881,-2.995987 52.403877,-2.995775 52.403884,-2.995515 52.403893,-2.994131 52.403964,-2.993583 52.403996,-2.992706 52.404048,-2.991636 52.404103,-2.990507 52.404147,-2.990135 52.404129)", + "LINESTRING(-2.982697 52.39662,-2.98267 52.396548,-2.982609 52.396497,-2.982548 52.396461,-2.982336 52.396409,-2.981863 52.396237,-2.981625 52.396145,-2.981339 52.396039,-2.981101 52.395931,-2.980871 52.395818,-2.980433 52.395637,-2.979978 52.395444,-2.979797 52.395343,-2.979337 52.395045,-2.978829 52.394739,-2.978805 52.39471,-2.978742 52.394637,-2.978614 52.39454,-2.978484 52.394484,-2.978426 52.394459,-2.97776 52.394027,-2.977536 52.393867,-2.977492 52.393849,-2.977344 52.393805,-2.975869 52.393539,-2.975558 52.393469,-2.975307 52.393408,-2.975026 52.393312,-2.974937 52.393268,-2.974733 52.393166,-2.974573 52.393071,-2.974432 52.39302,-2.974284 52.392994,-2.97424 52.392995,-2.97399 52.392997,-2.973932 52.393006,-2.973771 52.393035)", + "LINESTRING(-2.953194 52.366719,-2.953507 52.366736,-2.95351 52.366736,-2.953908 52.366768,-2.954334 52.366791,-2.954562 52.366786,-2.954729 52.366779,-2.95522 52.366749,-2.955385 52.366757,-2.955502 52.366795,-2.955579 52.366826,-2.955921 52.366996,-2.956027 52.367056,-2.95617 52.367141,-2.956353 52.367269,-2.956449 52.367341,-2.956469 52.367356,-2.956512 52.367399,-2.956659 52.367549,-2.956776 52.367661,-2.956944 52.367788,-2.957149 52.367924,-2.95735 52.368033,-2.95769 52.368188,-2.957898 52.368266,-2.95797 52.368293,-2.958228 52.368394,-2.958339 52.368458,-2.958398 52.368522,-2.958431 52.368627,-2.958477 52.368714,-2.95853 52.368773,-2.958568 52.368816,-2.958702 52.368923,-2.958908 52.369053,-2.959013 52.369151,-2.959058 52.369195,-2.959133 52.369258)", + "LINESTRING(-2.966068 52.360895,-2.966222 52.360891,-2.966478 52.360892,-2.966667 52.360885,-2.966835 52.360892,-2.967243 52.360923,-2.967495 52.360948,-2.967636 52.360953,-2.968078 52.360941,-2.968299 52.360944,-2.968545 52.360956,-2.968642 52.36095,-2.968822 52.360921,-2.968959 52.360912,-2.96913 52.360911,-2.969356 52.36086,-2.969479 52.360843,-2.969638 52.360834,-2.969796 52.360838,-2.96996 52.360861,-2.970075 52.360884,-2.970228 52.360942,-2.970326 52.360979,-2.970397 52.361011,-2.970521 52.361026,-2.970653 52.361041,-2.97072 52.361051,-2.97083 52.361056,-2.970936 52.36106,-2.97094 52.361061,-2.971028 52.36107,-2.971061 52.361068,-2.971165 52.361061,-2.971173 52.361062,-2.971229 52.361066,-2.971282 52.361087,-2.97138 52.361148,-2.97159 52.361282,-2.971747 52.361379,-2.971835 52.361427,-2.97189 52.361457,-2.971956 52.361493,-2.972094 52.361559,-2.972336 52.361658,-2.972537 52.361748,-2.972635 52.361815,-2.972698 52.361858,-2.972796 52.361938,-2.972891 52.362013,-2.972933 52.362045,-2.973002 52.36209)", + "LINESTRING(-2.9647 52.372689,-2.964835 52.372426,-2.964879 52.372262,-2.964847 52.372112,-2.964788 52.372011,-2.964689 52.371911,-2.964426 52.371713,-2.964038 52.371527,-2.963476 52.371297,-2.962907 52.3711,-2.962814 52.371067,-2.962322 52.3709,-2.961904 52.370745,-2.9619 52.370744,-2.961896 52.370742,-2.961634 52.370672,-2.961628 52.370671,-2.961259 52.370618,-2.961135 52.370605,-2.961085 52.3706,-2.961086 52.370591,-2.961095 52.370497,-2.961096 52.370488,-2.961121 52.370455,-2.96131 52.370209,-2.961519 52.369984,-2.961685 52.369803,-2.96174 52.369743,-2.961792 52.369643,-2.961827 52.369523,-2.961869 52.369469)", + "LINESTRING(-2.991736 52.342846,-2.991747 52.342813,-2.991756 52.342764,-2.991745 52.342628,-2.991739 52.342554,-2.991732 52.342531,-2.991722 52.342499,-2.991718 52.342485,-2.991714 52.342478,-2.9917 52.342451,-2.99169 52.342431,-2.991614 52.342342,-2.991594 52.342322,-2.991511 52.342239,-2.991321 52.34207,-2.991234 52.341994,-2.991138 52.341912,-2.99098 52.34178,-2.990834 52.34166,-2.990727 52.341549,-2.990648 52.341466,-2.990603 52.341414,-2.990584 52.341391,-2.990528 52.341311,-2.990484 52.341226,-2.990471 52.341181)", + "LINESTRING(-2.981095 52.339053,-2.981289 52.3392,-2.981405 52.339277,-2.981642 52.339412,-2.981862 52.339531,-2.98203 52.339615,-2.982129 52.339653,-2.982253 52.339691,-2.982421 52.33973,-2.982601 52.339756,-2.982838 52.339782,-2.982943 52.339791,-2.983192 52.339812,-2.983421 52.339829,-2.983576 52.339841,-2.983713 52.339838,-2.983942 52.339827,-2.984066 52.339821,-2.984197 52.339814,-2.984359 52.339813,-2.984503 52.339822,-2.984523 52.339825,-2.984641 52.339843,-2.984781 52.339878,-2.984989 52.33993,-2.985142 52.339976,-2.98533 52.340048,-2.98545 52.340101,-2.985793 52.340305,-2.986179 52.340517,-2.987262 52.341021,-2.987502 52.341139,-2.987993 52.341405,-2.98828 52.341552,-2.988419 52.341614,-2.988615 52.341683,-2.988796 52.34174,-2.989201 52.34185,-2.98978 52.342006,-2.989938 52.342049,-2.990297 52.342157,-2.990544 52.342244,-2.99059 52.342263,-2.990618 52.342275,-2.990752 52.342331,-2.990972 52.342441,-2.991182 52.342569,-2.991334 52.34268,-2.991462 52.34278,-2.991575 52.342877)", + "LINESTRING(-2.978378 52.326615,-2.97858 52.326744,-2.978935 52.326903,-2.979113 52.326964,-2.98031 52.327377,-2.98094 52.327552,-2.981104 52.3276,-2.981291 52.327676,-2.981642 52.327824,-2.981986 52.327972,-2.982377 52.328139,-2.982546 52.328208,-2.982722 52.328274,-2.982959 52.328344,-2.983549 52.328502,-2.983608 52.328518,-2.983888 52.328588,-2.984434 52.328711,-2.984582 52.328744,-2.985255 52.328894)", + "LINESTRING(-2.943084 52.483843,-2.943363 52.483805,-2.943509 52.483777,-2.943656 52.483749,-2.943861 52.483702,-2.946632 52.483131,-2.946734 52.483095,-2.946799 52.483048,-2.946915 52.482932,-2.946924 52.482923,-2.947675 52.481978,-2.947651 52.481577)", + "LINESTRING(-2.953071 52.469338,-2.953299 52.469326,-2.953594 52.469323,-2.953639 52.469322,-2.953712 52.469319,-2.953768 52.469307,-2.95379 52.469286,-2.953798 52.469217,-2.953806 52.46915,-2.953821 52.469024,-2.953855 52.468907,-2.953909 52.468773,-2.953968 52.468659,-2.954018 52.468562,-2.954068 52.468403,-2.954076 52.46835)", + "LINESTRING(-2.916212 52.483947,-2.91619 52.483345,-2.916182 52.48319,-2.916111 52.48314,-2.915883 52.483029,-2.915722 52.482945,-2.915568 52.482864,-2.915468 52.4828,-2.915327 52.482683,-2.915234 52.482569,-2.915128 52.482414,-2.915013 52.482195,-2.914907 52.48201,-2.914737 52.481759,-2.914614 52.481537,-2.914521 52.481405,-2.914382 52.481233,-2.914305 52.481106,-2.914271 52.481006,-2.914213 52.480799,-2.914163 52.480589,-2.914093 52.480359,-2.914032 52.480197,-2.913985 52.480069,-2.913891 52.479905,-2.913802 52.479758,-2.913734 52.479661,-2.913625 52.479521,-2.913468 52.479309,-2.913381 52.479147,-2.913312 52.478929,-2.913259 52.478706,-2.913218 52.478303,-2.913225 52.478168,-2.913255 52.478098,-2.913311 52.478047,-2.913425 52.477985,-2.913772 52.477823,-2.914284 52.477584,-2.914879 52.477304,-2.915429 52.477045,-2.915857 52.476856,-2.915888 52.476843,-2.916396 52.476614,-2.916883 52.476387,-2.917208 52.476227,-2.917382 52.476128,-2.917702 52.47591,-2.917998 52.475688,-2.918258 52.475444,-2.918358 52.475335,-2.918513 52.475115,-2.918572 52.474971,-2.918603 52.474853,-2.918636 52.474674,-2.918663 52.47453,-2.91872 52.474392,-2.918813 52.474244)", + "LINESTRING(-2.919312 52.439208,-2.919221 52.439125,-2.919125 52.43902,-2.919047 52.438938,-2.918999 52.438881,-2.918932 52.438799,-2.918872 52.438731,-2.918806 52.438649,-2.918698 52.438542,-2.918601 52.438445,-2.918499 52.438349,-2.918451 52.438292,-2.918439 52.438256,-2.918376 52.438088,-2.918314 52.437944,-2.918234 52.437751,-2.918185 52.437647,-2.918111 52.437478,-2.918055 52.437349,-2.918005 52.437213,-2.917956 52.437109,-2.917925 52.437023,-2.9179 52.43698,-2.917864 52.436926,-2.917809 52.436844,-2.917742 52.436751,-2.917724 52.436719,-2.917693 52.436644,-2.917668 52.436583,-2.917572 52.436479,-2.91747 52.436365,-2.917331 52.436215,-2.917139 52.436033,-2.917043 52.435915,-2.916953 52.435851,-2.916768 52.435712,-2.916576 52.435559,-2.916332 52.435417,-2.916082 52.435279,-2.915838 52.435151,-2.915684 52.435073,-2.915559 52.43501,-2.915481 52.434949,-2.915403 52.434892,-2.915349 52.434824,-2.9153 52.434756,-2.915258 52.434688,-2.915228 52.434645,-2.915186 52.434572,-2.915155 52.434498,-2.915139 52.434444,-2.915139 52.43442,-2.915138 52.434417,-2.915139 52.434415,-2.91516 52.434369,-2.915165 52.434358,-2.915181 52.434324,-2.915231 52.43426,-2.915311 52.434181,-2.915369 52.434138,-2.915495 52.434062,-2.91564 52.433982,-2.915832 52.433884,-2.916101 52.433748,-2.916287 52.433654,-2.916591 52.43349,-2.916911 52.433308,-2.917317 52.433053,-2.917607 52.432862,-2.918043 52.432589,-2.918319 52.432407,-2.91859 52.432242,-2.918741 52.43214,-2.918915 52.43202,-2.919031 52.431948,-2.919164 52.431846,-2.91935 52.4317,-2.919518 52.431584,-2.919732 52.43141,-2.919836 52.431326,-2.920015 52.431156,-2.920147 52.431018,-2.920192 52.430928,-2.920225 52.430809,-2.920223 52.43068,-2.92019 52.430536,-2.920104 52.430342,-2.920006 52.430149,-2.919897 52.429995,-2.919775 52.429802,-2.91972 52.429727,-2.919612 52.429616,-2.919503 52.429521,-2.919419 52.429431,-2.918939 52.429004,-2.918704 52.42882,-2.918615 52.428748,-2.918495 52.428652,-2.918399 52.428585,-2.918197 52.428464,-2.91803 52.428365,-2.917685 52.428162,-2.917572 52.428098,-2.917458 52.428024,-2.917214 52.427882,-2.917012 52.427772,-2.916822 52.427687,-2.916679 52.427623,-2.916631 52.427591,-2.916617 52.427566,-2.916582 52.427504,-2.91651 52.427356)", + "LINESTRING(-2.947531 52.452306,-2.947455 52.452225,-2.947258 52.452046,-2.947076 52.45192,-2.946897 52.451781,-2.946825 52.451714,-2.946704 52.451592,-2.946619 52.451467,-2.946503 52.451249,-2.946459 52.451116,-2.946407 52.450915,-2.946378 52.450667,-2.946375 52.45052,-2.946369 52.450229,-2.946394 52.450034,-2.946421 52.449922,-2.946465 52.44976,-2.946549 52.449573,-2.946633 52.449371,-2.946715 52.449246,-2.947034 52.448702,-2.94729 52.448297,-2.947489 52.447958,-2.94775 52.447531,-2.947921 52.447256,-2.948205 52.446801,-2.948314 52.446631,-2.948518 52.446295,-2.948569 52.446201,-2.948642 52.446042,-2.948715 52.445855,-2.948821 52.445591,-2.948888 52.445408,-2.948953 52.445166,-2.948951 52.445083,-2.948944 52.445001,-2.948888 52.444902,-2.948786 52.444799,-2.948738 52.444734,-2.94869 52.444649,-2.948687 52.444493)", + "LINESTRING(-2.984196 52.486523,-2.984457 52.486368,-2.984901 52.486099,-2.985548 52.4857,-2.985908 52.48547,-2.986144 52.485334,-2.986369 52.485187,-2.986479 52.485104,-2.986539 52.485057,-2.986632 52.485021,-2.986663 52.485009,-2.986728 52.485002,-2.986917 52.485008,-2.986978 52.485013,-2.987559 52.485093,-2.987778 52.485123,-2.987914 52.485143,-2.988009 52.485137,-2.988065 52.485122,-2.988137 52.485085,-2.988211 52.485037,-2.988273 52.484995,-2.98831 52.484979)", + "LINESTRING(-2.995145 52.490812,-2.995121 52.49082,-2.995106 52.490825,-2.995003 52.490841)", + "LINESTRING(-2.987242 52.435163,-2.987322 52.435211,-2.987423 52.435307,-2.98768 52.435622,-2.987945 52.435949,-2.988222 52.436339,-2.988312 52.436495,-2.988352 52.436544,-2.988361 52.436555,-2.988405 52.436579,-2.988465 52.436592,-2.988548 52.436586,-2.988625 52.436547,-2.988673 52.436501,-2.988917 52.436278,-2.989057 52.43615,-2.989383 52.435896,-2.989453 52.435863,-2.989572 52.435828,-2.989748 52.435819,-2.990029 52.435835,-2.990331 52.435876,-2.990701 52.435933,-2.990873 52.435968,-2.990993 52.435992,-2.991047 52.436006,-2.991327 52.436078,-2.992217 52.436386,-2.992457 52.436462,-2.992636 52.436531,-2.992846 52.436578,-2.993009 52.436622,-2.993203 52.436691,-2.993324 52.436736,-2.99351 52.436806,-2.993735 52.436909,-2.993967 52.43702,-2.994208 52.437165,-2.994378 52.437262,-2.994486 52.437308,-2.994589 52.437341,-2.994683 52.43736,-2.994729 52.437357,-2.994784 52.437355,-2.994838 52.437352,-2.994951 52.437331,-2.995025 52.437296,-2.995207 52.437212,-2.995258 52.437194,-2.995512 52.43715,-2.995565 52.437141,-2.995813 52.437096,-2.995912 52.437047,-2.996021 52.436998)", + "LINESTRING(-3.029102 52.479538,-3.029049 52.479509,-3.028994 52.479479,-3.028888 52.479419,-3.028646 52.47933,-3.028348 52.479265,-3.028073 52.479214,-3.02755 52.479103,-3.027262 52.47905,-3.027073 52.479053,-3.026789 52.479067,-3.026518 52.47907,-3.026262 52.479053,-3.025955 52.479011,-3.025684 52.47899,-3.025529 52.478978,-3.025097 52.478974,-3.024128 52.47895,-3.023829 52.478945,-3.023721 52.478946,-3.023507 52.478953,-3.023167 52.478975,-3.022985 52.478992,-3.02261 52.479015,-3.021561 52.479059,-3.020843 52.479097,-3.020462 52.47911,-3.020266 52.479114,-3.020121 52.479106,-3.019963 52.47908,-3.019725 52.479036,-3.01932 52.478968,-3.018772 52.478867,-3.018526 52.478829,-3.018251 52.478814,-3.017985 52.478774,-3.017884 52.478751,-3.017605 52.478673,-3.017112 52.478514,-3.016597 52.478347,-3.016245 52.478223,-3.015841 52.478072,-3.015526 52.477969,-3.015358 52.477924,-3.014825 52.477794,-3.014565 52.47771,-3.014336 52.477613,-3.014103 52.4775,-3.013876 52.47739,-3.01364 52.477248,-3.013381 52.4771,-3.013161 52.476988,-3.013064 52.476926)", + "LINESTRING(-3.008701 52.44449,-3.008806 52.444489,-3.008871 52.444477,-3.00893 52.444439,-3.008992 52.444367,-3.009041 52.444272,-3.009049 52.444253,-3.009086 52.444167,-3.009098 52.444151,-3.009134 52.444105,-3.009155 52.444079,-3.009207 52.444041,-3.009221 52.444037,-3.009296 52.444019,-3.009444 52.444016,-3.009517 52.444026,-3.009602 52.444065,-3.009694 52.444138,-3.009901 52.444328,-3.010028 52.444423,-3.010179 52.444535,-3.010234 52.444616,-3.010236 52.4447,-3.01023 52.444761,-3.010174 52.444835,-3.009969 52.445065,-3.009889 52.445178,-3.009855 52.445256,-3.009839 52.445333,-3.009853 52.445429,-3.009877 52.445498,-3.010006 52.445802,-3.010081 52.445987,-3.010137 52.446124,-3.010162 52.446161,-3.010229 52.446251,-3.010268 52.446287,-3.010294 52.446311,-3.010299 52.446313,-3.010328 52.446328,-3.010406 52.446368,-3.010632 52.446455,-3.010819 52.446526,-3.011086 52.446642,-3.011376 52.446774,-3.011647 52.446917,-3.011727 52.446963,-3.011901 52.447061,-3.012048 52.447139,-3.012145 52.447179,-3.012182 52.447194,-3.012277 52.447234,-3.01243 52.447287,-3.012658 52.447348,-3.012779 52.447373,-3.012893 52.447397,-3.012977 52.447417,-3.012991 52.447421,-3.013064 52.447438,-3.013156 52.447476,-3.013197 52.447503,-3.013264 52.447547,-3.013364 52.447637,-3.013408 52.447677,-3.013462 52.447734,-3.013562 52.447839,-3.013753 52.448031,-3.013818 52.44808,-3.013951 52.44818,-3.014102 52.448282,-3.014287 52.448381,-3.014469 52.448466,-3.014688 52.44857,-3.014982 52.448692,-3.015141 52.448747,-3.015189 52.448758,-3.015261 52.448775,-3.015477 52.448805,-3.015627 52.448814,-3.015683 52.448818,-3.015766 52.448816,-3.01584 52.448814,-3.015968 52.44881,-3.016098 52.448795,-3.016222 52.44878,-3.016235 52.448779,-3.016315 52.448758,-3.0164 52.448737,-3.016504 52.44871,-3.016553 52.448693,-3.016907 52.44857,-3.01692 52.448565,-3.017298 52.448432,-3.017657 52.448308,-3.018457 52.448028,-3.018735 52.447925,-3.019186 52.447718,-3.019297 52.447667,-3.019504 52.447573,-3.019691 52.447485,-3.020021 52.447306,-3.02034 52.447097,-3.020412 52.447042,-3.020528 52.446951,-3.020585 52.446897,-3.0207 52.446752,-3.02077 52.446625,-3.020854 52.446427,-3.020881 52.446319,-3.02093 52.446112,-3.020953 52.446002,-3.020959 52.445992,-3.02098 52.445958,-3.021035 52.445909,-3.021088 52.445881,-3.021142 52.445861,-3.021244 52.445841,-3.021316 52.445845,-3.021396 52.445857,-3.021469 52.445882,-3.021555 52.445938,-3.021636 52.446023,-3.02173 52.446141,-3.021988 52.446453,-3.022105 52.44658,-3.022157 52.446676,-3.022161 52.446683,-3.022195 52.446757,-3.022211 52.446841,-3.022242 52.447147,-3.022262 52.447328,-3.022289 52.4474,-3.022322 52.447442,-3.02234 52.447465,-3.022449 52.44753,-3.022566 52.447562,-3.022722 52.447581,-3.022849 52.447588,-3.023013 52.447578,-3.023241 52.447549,-3.02373 52.447493,-3.023942 52.447483)", + "LINESTRING(-2.888846 52.559077,-2.888526 52.559015,-2.8881 52.558936,-2.887961 52.558894,-2.887797 52.55883,-2.887612 52.558738,-2.887359 52.558609,-2.887079 52.558467,-2.886905 52.558368,-2.886651 52.558193,-2.886535 52.55806,-2.886397 52.55782,-2.886355 52.557709,-2.886353 52.557593,-2.886389 52.557524,-2.886442 52.55749,-2.886469 52.557473,-2.886648 52.557357,-2.886851 52.557271,-2.887098 52.557196,-2.887359 52.557129,-2.887542 52.557082,-2.887792 52.557048,-2.88827 52.557015,-2.888439 52.556996,-2.888542 52.55699,-2.889071 52.556911,-2.889527 52.556827,-2.889674 52.556817,-2.889807 52.556843,-2.890283 52.55701,-2.890685 52.557196,-2.890908 52.557302,-2.891384 52.557487)", + "LINESTRING(-3.001325 52.540011,-3.001671 52.540197,-3.002042 52.540409,-3.002262 52.540556,-3.002374 52.540609,-3.002493 52.54064,-3.002832 52.540729,-3.00343 52.540875,-3.00422 52.541066,-3.004733 52.54121,-3.004769 52.541221,-3.004913 52.54127,-3.005031 52.541311,-3.005047 52.541327,-3.005244 52.541459,-3.005596 52.541763,-3.006017 52.542175,-3.006452 52.542614,-3.006565 52.542732,-3.006843 52.542953,-3.006847 52.542957,-3.006998 52.543117,-3.007013 52.54314,-3.007085 52.543249,-3.007161 52.543314,-3.007272 52.54334,-3.007546 52.543391,-3.007698 52.543446,-3.007879 52.543533,-3.007883 52.543536,-3.008032 52.543626,-3.008038 52.54363,-3.008144 52.543722,-3.008188 52.543761,-3.008298 52.543868,-3.008317 52.543886,-3.008438 52.54404,-3.008465 52.544087,-3.008538 52.544214,-3.008612 52.544387,-3.008682 52.544563)", + "LINESTRING(-3.011001 52.573086,-3.012121 52.572393,-3.01401 52.571244,-3.014085 52.571198,-3.014816 52.570754,-3.014951 52.570672,-3.015417 52.570455,-3.015886 52.570226,-3.016029 52.570153,-3.016323 52.569987,-3.016482 52.569904,-3.016585 52.569854,-3.016815 52.569735,-3.016974 52.56964,-3.017033 52.569586,-3.017063 52.569502,-3.017065 52.569402,-3.017007 52.569243,-3.016987 52.569186,-3.016885 52.568864,-3.016852 52.568756)", + "LINESTRING(-3.015129 52.575841,-3.015019 52.575829,-3.014945 52.575821,-3.014885 52.575812,-3.014782 52.575786,-3.014678 52.57576,-3.014574 52.575734,-3.01447 52.575717,-3.014445 52.575713,-3.014381 52.5757,-3.0142 52.575673,-3.013943 52.575639,-3.013602 52.575603)", + "LINESTRING(-3.019494 52.52701,-3.019262 52.527165,-3.01868 52.527548,-3.018282 52.52781,-3.01832 52.527865,-3.018397 52.528008,-3.018519 52.528205,-3.018731 52.528464,-3.018942 52.528642,-3.019077 52.52874,-3.019108 52.528766,-3.019393 52.529033,-3.019454 52.529105,-3.01956 52.529248,-3.019938 52.52977,-3.020112 52.529971,-3.020139 52.530025,-3.020088 52.530084,-3.020002 52.530183,-3.019925 52.530293)", + "LINESTRING(-2.740076 52.23265,-2.740031 52.232641,-2.739944 52.232642,-2.739856 52.232643,-2.739753 52.232652,-2.739637 52.23268,-2.739535 52.232734,-2.739506 52.232762,-2.739406 52.232888,-2.739377 52.232906,-2.739333 52.232934,-2.73929 52.232952,-2.739217 52.232961,-2.739071 52.232971,-2.738968 52.232981)", + "LINESTRING(-2.74881 52.228926,-2.748782 52.228995,-2.748772 52.229095,-2.748813 52.229324,-2.74882 52.229329,-2.7489 52.22938,-2.748952 52.229431,-2.748997 52.229574,-2.749054 52.229656,-2.74907 52.229679,-2.749201 52.229778)", + "LINESTRING(-2.762382 52.225983,-2.7627 52.225925,-2.763153 52.225859,-2.763517 52.225776,-2.763912 52.225686)", + "LINESTRING(-2.798257 52.212656,-2.798231 52.212824,-2.798217 52.212861,-2.798145 52.212924,-2.797348 52.213361,-2.79711 52.21347,-2.796976 52.213514,-2.796803 52.213559,-2.796593 52.213602,-2.796416 52.213631,-2.796137 52.213677,-2.795965 52.213701,-2.795794 52.213715,-2.795591 52.213721,-2.79543 52.21372,-2.795302 52.213724,-2.795172 52.213737,-2.795033 52.213758,-2.794911 52.213788,-2.794771 52.213826,-2.794724 52.213839,-2.794536 52.213891,-2.794189 52.213996,-2.793878 52.214113,-2.793834 52.21414,-2.79356 52.214357,-2.793459 52.214421,-2.793285 52.214494,-2.793038 52.214595,-2.792965 52.214613,-2.792921 52.214622,-2.792863 52.214632,-2.792819 52.214632,-2.792731 52.214615,-2.792443 52.214496)", + "LINESTRING(-2.770867 52.164475,-2.770805 52.164343,-2.770749 52.164267,-2.770768 52.164207,-2.770905 52.164126,-2.771177 52.16399,-2.771345 52.163895,-2.771531 52.163784,-2.771669 52.163688,-2.77181 52.163566,-2.771884 52.163495,-2.771993 52.163371,-2.7721 52.163235,-2.772176 52.163118,-2.772345 52.163,-2.772474 52.162882,-2.772558 52.162848,-2.772658 52.162837,-2.77279 52.162871,-2.772898 52.163016,-2.773065 52.163285,-2.773134 52.163376,-2.773404 52.163732,-2.773459 52.163818,-2.77355 52.16408)", + "LINESTRING(-2.781014 52.154968,-2.780805 52.154691,-2.780461 52.154235,-2.780358 52.154095,-2.780245 52.153973,-2.780063 52.153849,-2.77988 52.153794,-2.779824 52.153785,-2.779736 52.153772,-2.77963 52.153756,-2.779487 52.153738)", + "LINESTRING(-2.870687 52.157811,-2.870528 52.157893,-2.870484 52.157902,-2.870124 52.157943,-2.869676 52.157994)", + "LINESTRING(-2.791074 52.328059,-2.791045 52.32805,-2.791015 52.328041,-2.790911 52.32797,-2.790554 52.327667,-2.79042 52.327582,-2.790316 52.327516,-2.79031 52.327512,-2.790063 52.327293,-2.789899 52.327132,-2.789749 52.32698,-2.789689 52.326881,-2.789596 52.326639,-2.789536 52.326523,-2.78952 52.326482,-2.789505 52.326442,-2.789473 52.32629,-2.789516 52.326217,-2.789573 52.326154,-2.789629 52.326096,-2.789686 52.326042,-2.789909 52.325879,-2.789968 52.325835,-2.790036 52.325764,-2.790079 52.32571,-2.790135 52.325593,-2.790177 52.325449,-2.790223 52.325296)", + "LINESTRING(-2.773759 52.312448,-2.77381 52.312252,-2.773812 52.312017,-2.773804 52.311886,-2.77377 52.311786,-2.773674 52.311637,-2.773624 52.311554,-2.773614 52.311493,-2.773592 52.311322,-2.773565 52.311134,-2.773535 52.311048,-2.773523 52.311013,-2.773473 52.310921,-2.773387 52.310827,-2.773263 52.31071,-2.773185 52.310631,-2.773152 52.310584,-2.773114 52.310494,-2.77309 52.310445,-2.773064 52.310392,-2.773028 52.310346,-2.772976 52.310304,-2.772771 52.310182,-2.77243 52.309952,-2.772317 52.309891,-2.772167 52.309832,-2.771975 52.309775,-2.77168 52.309706,-2.77148 52.309669,-2.77137 52.30967)", + "LINESTRING(-2.785431 52.305367,-2.785715 52.305338,-2.785805 52.305312,-2.785869 52.305267,-2.785918 52.305217,-2.785966 52.305127,-2.786009 52.305053,-2.786069 52.304985,-2.786168 52.30492,-2.786481 52.30477,-2.786754 52.30465,-2.786958 52.304563,-2.787363 52.304407,-2.787459 52.304362,-2.787543 52.304308,-2.787585 52.304261,-2.787586 52.304219,-2.787557 52.304173,-2.787526 52.304166,-2.787396 52.304139,-2.786805 52.304046,-2.786647 52.304034,-2.786116 52.304031,-2.785881 52.304033,-2.785573 52.304044,-2.785383 52.304052,-2.785165 52.304042,-2.78493 52.304011,-2.784582 52.303947,-2.784168 52.303884,-2.784024 52.303864,-2.783814 52.303824,-2.783694 52.303791,-2.783578 52.303753,-2.78352 52.303729,-2.783488 52.303712,-2.783434 52.303684,-2.783335 52.303628,-2.783206 52.303549,-2.783037 52.303439,-2.782861 52.303342,-2.782699 52.303257,-2.782395 52.30311,-2.781973 52.302914,-2.781694 52.302819,-2.781396 52.30272,-2.781217 52.302671,-2.780941 52.302616,-2.780775 52.302591,-2.780146 52.3025,-2.779867 52.302464,-2.779539 52.302432,-2.779246 52.302421,-2.778979 52.302411,-2.778679 52.302375,-2.778164 52.302297,-2.7779 52.302263,-2.777551 52.30225,-2.777494 52.302248,-2.776549 52.302209,-2.776271 52.302202,-2.77608 52.302203,-2.775656 52.30226,-2.775393 52.302315,-2.775297 52.302361)", + "LINESTRING(-2.768162 52.285915,-2.768448 52.285831,-2.768652 52.285764,-2.768716 52.285764,-2.768724 52.285766,-2.76878 52.28578,-2.768815 52.285808,-2.768911 52.285913,-2.769079 52.286078,-2.769143 52.286115,-2.76922 52.286138,-2.769578 52.286155,-2.769661 52.286164,-2.769734 52.286199,-2.769802 52.286251,-2.769847 52.286303)", + "LINESTRING(-2.785332 52.291734,-2.785304 52.291218,-2.785283 52.29103,-2.785269 52.290905)", + "LINESTRING(-2.810067 52.296994,-2.810306 52.296809,-2.810486 52.296658,-2.810606 52.296549,-2.810711 52.296415,-2.810832 52.296234,-2.810912 52.296108,-2.810927 52.296089,-2.81152 52.295364,-2.811823 52.29498,-2.812021 52.294804,-2.812244 52.294671,-2.812416 52.294582,-2.812839 52.294371,-2.813389 52.294105,-2.813715 52.293961,-2.814725 52.29352,-2.815498 52.293161,-2.815944 52.292958,-2.816497 52.292709,-2.816911 52.292523,-2.817309 52.292353,-2.817554 52.292232,-2.817807 52.29212,-2.818191 52.291952,-2.818516 52.291758,-2.818674 52.291653,-2.818796 52.291556,-2.819045 52.291358,-2.819169 52.291236,-2.819287 52.291088,-2.819404 52.290933,-2.819521 52.290805,-2.819616 52.290721,-2.819736 52.29064,-2.819933 52.290532,-2.820069 52.290466,-2.820477 52.290285,-2.820695 52.29019,-2.820963 52.290063,-2.821334 52.289891,-2.821566 52.289792,-2.821976 52.289633,-2.822547 52.2894,-2.822746 52.289344,-2.822912 52.289303,-2.823099 52.289258,-2.823253 52.289233,-2.823578 52.289197,-2.823976 52.289155,-2.824248 52.289124,-2.824589 52.289082,-2.824774 52.289047,-2.825019 52.289004,-2.825263 52.288949,-2.825477 52.288862,-2.825763 52.288707,-2.826032 52.288602,-2.826442 52.288464,-2.826752 52.288385,-2.82704 52.288331,-2.827267 52.288288,-2.827426 52.288252,-2.827609 52.28819,-2.827827 52.288111,-2.827996 52.288043,-2.828204 52.287909,-2.828342 52.287776,-2.828584 52.287612,-2.828936 52.287406,-2.829149 52.287291,-2.829567 52.287102,-2.82977 52.287014,-2.830091 52.286903,-2.830346 52.286808,-2.830576 52.286697,-2.830867 52.286455,-2.831063 52.286299,-2.831265 52.286057,-2.831309 52.285924,-2.831315 52.285778,-2.831316 52.285452,-2.831349 52.285112,-2.83138 52.284946,-2.831477 52.28477,-2.831655 52.284461,-2.831747 52.284338,-2.832017 52.284076,-2.832121 52.283978,-2.83233 52.283767,-2.832466 52.283576,-2.832612 52.283282,-2.83271 52.283022,-2.832765 52.282754,-2.832774 52.282516,-2.83276 52.28226,-2.832722 52.282057,-2.832663 52.28172,-2.832668 52.281617,-2.8327 52.281503,-2.832809 52.281175,-2.832862 52.280979,-2.832885 52.280839,-2.832872 52.280765,-2.832837 52.280582,-2.832766 52.280266,-2.832763 52.280223,-2.832772 52.280085,-2.832798 52.279996,-2.832863 52.279778,-2.832882 52.279713,-2.832876 52.279654,-2.832819 52.279514,-2.832641 52.279207,-2.832576 52.279063,-2.832564 52.279002,-2.832572 52.278926,-2.832579 52.278835)", + "LINESTRING(-2.8096 52.313156,-2.809812 52.312762,-2.809934 52.312592,-2.810033 52.312491,-2.810125 52.312411,-2.81044 52.312106,-2.810489 52.312065,-2.810617 52.311959,-2.810653 52.31193,-2.810848 52.311783,-2.810927 52.311736,-2.811041 52.311684,-2.811097 52.311676,-2.811322 52.311644,-2.811699 52.311638,-2.811945 52.311586,-2.812366 52.311228,-2.812591 52.311079,-2.812836 52.310968,-2.81304 52.310901,-2.813225 52.310872,-2.813313 52.31088,-2.813416 52.310888,-2.813783 52.311141,-2.813911 52.311216,-2.814051 52.311194,-2.814099 52.311176,-2.814195 52.31114,-2.814227 52.311087,-2.814246 52.311025,-2.814254 52.310972,-2.814214 52.310739,-2.814205 52.31068,-2.81411 52.31053,-2.813621 52.310087,-2.813172 52.309559,-2.813157 52.309541,-2.813064 52.309299,-2.813077 52.309132,-2.813233 52.30893,-2.81437 52.308113,-2.814622 52.307931,-2.815506 52.307296,-2.815512 52.307292,-2.81569 52.307207,-2.81587 52.307147,-2.816298 52.307036,-2.816653 52.306942,-2.816811 52.306893,-2.817057 52.3068,-2.817143 52.30675,-2.817279 52.30664,-2.817435 52.306508,-2.817543 52.306409,-2.817628 52.306361,-2.8179 52.306176,-2.818153 52.306013,-2.818347 52.305877,-2.81847 52.305738,-2.818656 52.305494,-2.818772 52.305448)", + "LINESTRING(-2.84966 52.261773,-2.849607 52.261747,-2.849544 52.261684,-2.849539 52.261679,-2.849462 52.26156,-2.849356 52.261536,-2.849261 52.261527,-2.849154 52.261515)", + "LINESTRING(-2.871409 52.253843,-2.87124 52.25344,-2.871087 52.253117,-2.871026 52.252974,-2.870964 52.252804,-2.870824 52.2524,-2.870797 52.252328,-2.870748 52.252157,-2.870679 52.251973,-2.870634 52.251891,-2.870588 52.251822,-2.870409 52.2517,-2.870132 52.251533,-2.869956 52.251435,-2.869871 52.251388,-2.869749 52.251338,-2.869334 52.251179,-2.868741 52.250899,-2.868417 52.250783,-2.868236 52.250729,-2.868045 52.250672,-2.866816 52.250353)", + "LINESTRING(-2.866721 52.282142,-2.866766 52.282095,-2.866835 52.282034,-2.866896 52.281948,-2.866942 52.281807,-2.866984 52.281567,-2.866991 52.281348,-2.867006 52.281279,-2.867061 52.281207,-2.867135 52.281129,-2.867236 52.281049,-2.867331 52.280989,-2.867449 52.280938,-2.867612 52.280873,-2.868169 52.280722,-2.868635 52.280548,-2.868836 52.280505,-2.868971 52.2805,-2.869074 52.280499,-2.869279 52.280507,-2.869416 52.2805,-2.869557 52.280482,-2.869675 52.280445,-2.869778 52.280377,-2.869861 52.280285,-2.869898 52.280191,-2.869895 52.280142,-2.869892 52.280068,-2.869854 52.279936,-2.869807 52.279858,-2.869681 52.279711,-2.869446 52.279519,-2.869358 52.279459,-2.869315 52.279431,-2.869233 52.279397,-2.869029 52.279331,-2.868575 52.279258,-2.8683 52.279184,-2.868182 52.279139,-2.867982 52.279053,-2.867644 52.278872,-2.867516 52.278822,-2.867511 52.27882,-2.867427 52.278795,-2.867315 52.278778,-2.867175 52.278764,-2.867006 52.27877,-2.866844 52.278795,-2.866732 52.278819,-2.866155 52.278948,-2.865845 52.279016,-2.865695 52.279031,-2.865584 52.279027,-2.865529 52.279025,-2.865376 52.279001,-2.865206 52.278966,-2.865049 52.278909,-2.864961 52.278851,-2.864926 52.278799,-2.864926 52.278784,-2.864925 52.278747,-2.864945 52.278685,-2.864986 52.278636,-2.865202 52.278483,-2.865357 52.278359,-2.865431 52.278293,-2.865515 52.278218,-2.865547 52.278181,-2.865644 52.278066,-2.865765 52.277915,-2.865774 52.277902,-2.865846 52.277793,-2.865912 52.277678,-2.86599 52.277542,-2.86609 52.277401,-2.866137 52.277336,-2.86626 52.2772,-2.866323 52.277128,-2.866543 52.276946,-2.866747 52.276785,-2.866852 52.276704,-2.866996 52.276593,-2.867047 52.27655,-2.867079 52.276496,-2.867102 52.27644,-2.86713 52.276372,-2.86713 52.276355,-2.867129 52.276333,-2.867129 52.276317,-2.867122 52.276257,-2.867119 52.276239,-2.867111 52.276195,-2.867043 52.276054,-2.867001 52.275938,-2.866955 52.275829,-2.866893 52.275746,-2.866827 52.275671,-2.866762 52.275632,-2.866691 52.275578,-2.866513 52.275507,-2.866306 52.275444,-2.86601 52.275385,-2.865752 52.275365,-2.865458 52.275371,-2.86523 52.275395,-2.865015 52.275435,-2.864873 52.275467,-2.864636 52.275542,-2.864401 52.275629,-2.864239 52.275701,-2.863556 52.276004,-2.863334 52.276119,-2.863074 52.276293,-2.863031 52.276303,-2.862937 52.276294,-2.862877 52.276262,-2.862847 52.276227,-2.862827 52.276156,-2.862827 52.276075,-2.862831 52.276051,-2.86284 52.275998,-2.862844 52.275975,-2.862864 52.275936,-2.862937 52.275793,-2.86301 52.275653,-2.863091 52.275495,-2.863188 52.275311,-2.863291 52.275136,-2.863322 52.275083,-2.863481 52.274831,-2.863709 52.274511,-2.863937 52.274198,-2.863983 52.274135,-2.864108 52.273941,-2.864208 52.27378,-2.864262 52.273664,-2.864344 52.273524,-2.864377 52.273449,-2.864455 52.273267,-2.864541 52.273114,-2.864604 52.272967,-2.86466 52.272888,-2.864761 52.272799,-2.864874 52.272701,-2.865244 52.272223,-2.865303 52.272127,-2.865359 52.272017,-2.86538 52.271943,-2.865378 52.271853,-2.865358 52.271782,-2.865321 52.271713,-2.865314 52.2717,-2.865286 52.271658,-2.865212 52.271578,-2.865112 52.271488,-2.864864 52.271324,-2.864508 52.271098,-2.864143 52.270876,-2.863871 52.270713,-2.86357 52.270537,-2.863198 52.270336,-2.862901 52.270192,-2.862665 52.270082,-2.862462 52.269977,-2.862355 52.269914,-2.862143 52.269791,-2.861777 52.269578,-2.861671 52.269522,-2.861598 52.269466,-2.861568 52.269412,-2.861557 52.269298,-2.861551 52.269222)", + "LINESTRING(-2.870042 52.273476,-2.870124 52.273451,-2.870412 52.273356,-2.870614 52.273316,-2.870828 52.273282,-2.871244 52.27326,-2.871744 52.273239,-2.872129 52.273221,-2.87277 52.273192,-2.87302 52.273178,-2.873339 52.273154,-2.873444 52.273149,-2.873634 52.27313,-2.873663 52.27312,-2.873692 52.273102,-2.873773 52.273038,-2.873892 52.272891,-2.873901 52.272881,-2.873987 52.272815,-2.87408 52.272782,-2.874156 52.272771,-2.874329 52.272746,-2.874551 52.272709,-2.874662 52.272677,-2.874758 52.272637,-2.874892 52.272595,-2.874999 52.272543,-2.875313 52.27243,-2.875555 52.27235,-2.875835 52.272267,-2.876071 52.272199,-2.876178 52.272148,-2.876381 52.272039,-2.876555 52.271924,-2.876722 52.271792,-2.876875 52.271663,-2.87701 52.271536,-2.877145 52.271414,-2.877244 52.271326,-2.877368 52.271244,-2.877559 52.271134,-2.877754 52.271029,-2.877916 52.27095,-2.878073 52.270895,-2.878135 52.270884,-2.878202 52.270885,-2.878258 52.270903,-2.8783 52.27094,-2.878464 52.271092,-2.878685 52.271279,-2.878926 52.271466,-2.879012 52.271546,-2.879085 52.271657,-2.879158 52.271791,-2.879168 52.271856,-2.879157 52.272034,-2.879174 52.272151,-2.879231 52.272368,-2.879301 52.272639,-2.879357 52.272808,-2.879362 52.272916,-2.879353 52.273034,-2.87934 52.273124,-2.879347 52.273212,-2.879365 52.273387,-2.87935 52.2735,-2.879281 52.273704,-2.879202 52.273859,-2.87915 52.273902,-2.879067 52.274004,-2.879003 52.274159,-2.878877 52.27432,-2.878794 52.274425,-2.87864 52.274567)", + "LINESTRING(-2.866721 52.282142,-2.866546 52.282289,-2.866394 52.282429,-2.866309 52.282508,-2.86607 52.282714,-2.865899 52.282839,-2.865598 52.283033,-2.865402 52.283143,-2.865272 52.283216,-2.864748 52.28343,-2.864323 52.283589,-2.86384 52.283766,-2.863651 52.28385,-2.863464 52.283952,-2.863198 52.284137,-2.86295 52.284316,-2.862834 52.284492)", + "LINESTRING(-2.845194 52.369086,-2.845265 52.369109,-2.845329 52.369154,-2.845454 52.369264,-2.845608 52.369421,-2.845968 52.369803,-2.846306 52.370142,-2.846346 52.370182,-2.846352 52.370188,-2.847293 52.371183,-2.847719 52.371643,-2.847908 52.371843,-2.849636 52.373671)", + "LINESTRING(-2.772262 52.351621,-2.772146 52.351676,-2.772073 52.351712,-2.771812 52.351912,-2.771522 52.35213,-2.771022 52.352546,-2.770992 52.352572,-2.770365 52.353117,-2.770282 52.353181,-2.770046 52.353362,-2.769878 52.353489,-2.769556 52.353646,-2.769406 52.353699,-2.76872 52.353919,-2.768529 52.353947,-2.768192 52.353949,-2.767383 52.353892,-2.76723 52.353883,-2.766907 52.353874,-2.766437 52.353888,-2.766083 52.353923,-2.765772 52.353968,-2.765589 52.354014,-2.765519 52.354032,-2.765474 52.354043,-2.765296 52.354115,-2.765148 52.354231,-2.76491 52.3544,-2.764838 52.354448,-2.764679 52.354533,-2.764424 52.354632,-2.764211 52.354685,-2.763933 52.354741,-2.763889 52.35475,-2.763596 52.354806,-2.763321 52.354844,-2.763259 52.354853,-2.763235 52.354852,-2.763095 52.35485,-2.763014 52.354846,-2.762868 52.354839,-2.762565 52.35481,-2.762292 52.354785,-2.762104 52.354779,-2.761605 52.354788,-2.761516 52.354793,-2.761476 52.354795,-2.761285 52.354806,-2.761247 52.354808,-2.760687 52.354846,-2.760029 52.354864,-2.760015 52.354865,-2.759721 52.354886,-2.759369 52.354926,-2.759053 52.354955,-2.758903 52.354953,-2.758735 52.35493,-2.758489 52.354875,-2.758337 52.354841,-2.758063 52.354778,-2.757839 52.354704,-2.757629 52.354657,-2.757158 52.35459,-2.756717 52.354517,-2.756277 52.354423,-2.755841 52.354312,-2.755313 52.354172,-2.754894 52.354049,-2.754619 52.353955,-2.754135 52.353786,-2.753547 52.353566,-2.753298 52.353465,-2.752793 52.353258,-2.752668 52.353175,-2.752563 52.353066,-2.752496 52.352931,-2.752453 52.352791,-2.752438 52.352626,-2.752416 52.352374,-2.752377 52.352138,-2.752361 52.35204,-2.752337 52.351869)", + "LINESTRING(-2.773655 52.354022,-2.773551 52.353995,-2.773507 52.353978,-2.773209 52.353728,-2.773149 52.353665,-2.773117 52.353504,-2.773065 52.353162,-2.773034 52.352965,-2.772972 52.35274,-2.772923 52.352611,-2.772886 52.352534,-2.772743 52.352239,-2.772652 52.352068,-2.772561 52.351925,-2.772486 52.351836,-2.772411 52.351764,-2.772262 52.351621)", + "LINESTRING(-2.753656 52.360846,-2.753728 52.360934,-2.75384 52.360962,-2.753998 52.360946,-2.754437 52.360861,-2.754844 52.360793,-2.755044 52.36079,-2.755406 52.360811,-2.755894 52.360855,-2.756264 52.360871,-2.756746 52.360857,-2.757133 52.360818,-2.757461 52.360766,-2.757826 52.360684,-2.758227 52.360567,-2.758449 52.360533,-2.758593 52.36053,-2.758726 52.360542,-2.758943 52.360557,-2.759457 52.36057,-2.759816 52.360576,-2.760312 52.360553,-2.761192 52.360483,-2.761344 52.360478,-2.761509 52.360472,-2.761826 52.360457,-2.762371 52.360427,-2.762703 52.360414,-2.762894 52.360411,-2.763043 52.360388,-2.763479 52.360312,-2.763729 52.360296,-2.76429 52.36028,-2.764477 52.36026,-2.764917 52.360214,-2.765116 52.360202,-2.765425 52.360215,-2.765639 52.360213,-2.765865 52.360194,-2.76605 52.360171,-2.766263 52.36013,-2.766457 52.360088,-2.76694 52.359981,-2.76706 52.359964,-2.767268 52.359952,-2.768163 52.359913,-2.768729 52.359888,-2.769041 52.359891,-2.769305 52.359905,-2.769823 52.359945,-2.770114 52.35996,-2.770396 52.35995,-2.770967 52.359901,-2.771202 52.359881,-2.77151 52.359843,-2.771908 52.359735,-2.772174 52.359668,-2.772387 52.35964,-2.77246 52.35963,-2.772868 52.359611,-2.773179 52.359572,-2.773429 52.359575,-2.773575 52.359585,-2.773773 52.359599,-2.773949 52.359605,-2.773984 52.359603,-2.774069 52.359597,-2.774254 52.359562,-2.774815 52.359409,-2.775031 52.359354,-2.775245 52.35932,-2.775579 52.359291,-2.775698 52.35927,-2.775772 52.359256,-2.775799 52.359252,-2.776123 52.359169,-2.776302 52.359162,-2.776435 52.359179,-2.776568 52.359227,-2.776772 52.35931,-2.776943 52.359359,-2.777208 52.359402,-2.777429 52.359408,-2.777672 52.359372,-2.778029 52.359313,-2.778447 52.35922,-2.77871 52.359146,-2.779052 52.359031,-2.77954 52.358873,-2.779776 52.358807,-2.780075 52.358754,-2.780289 52.358728,-2.780606 52.358709,-2.781231 52.358698,-2.781563 52.358681,-2.781774 52.358689,-2.7818 52.358693,-2.782251 52.35876,-2.782572 52.358786,-2.782757 52.358799,-2.782907 52.358797,-2.783039 52.358776,-2.783141 52.358741,-2.783219 52.358672,-2.783336 52.358477,-2.783339 52.358472,-2.783396 52.358373,-2.783511 52.358242,-2.78358 52.35819,-2.78379 52.358072,-2.784078 52.357953,-2.784352 52.357823,-2.784454 52.357751,-2.784543 52.357628,-2.784625 52.357492,-2.784723 52.357393,-2.784828 52.357338,-2.785047 52.357268,-2.785404 52.357212,-2.785891 52.357142,-2.78619 52.357119,-2.786454 52.357117,-2.786613 52.357129,-2.786808 52.357178,-2.787204 52.357335,-2.787725 52.357596,-2.787844 52.357651,-2.787959 52.357686,-2.788219 52.357751,-2.788682 52.357899,-2.789149 52.358066,-2.789808 52.358293,-2.790064 52.358316,-2.790349 52.358303,-2.790691 52.358225,-2.790901 52.358168,-2.791044 52.358104,-2.791144 52.358062,-2.791241 52.357942,-2.791255 52.357924,-2.791346 52.357721,-2.791407 52.357521,-2.791455 52.357414,-2.79158 52.357176,-2.791734 52.356947,-2.791818 52.356849,-2.791869 52.35679,-2.791974 52.356735,-2.792074 52.356716,-2.792153 52.356721,-2.792292 52.356756,-2.79254 52.356832,-2.792669 52.356851,-2.79276 52.356852,-2.792863 52.356848,-2.792998 52.356827,-2.793086 52.356814,-2.793267 52.356791,-2.793417 52.356786,-2.793567 52.356803,-2.793967 52.356842,-2.794114 52.35685,-2.794284 52.356833,-2.794483 52.356768,-2.794772 52.356662,-2.794939 52.356645,-2.795065 52.356662,-2.795174 52.356692,-2.795346 52.356779,-2.795737 52.356976,-2.795915 52.357054,-2.796172 52.357158,-2.79635 52.357236,-2.796486 52.3573,-2.796602 52.357365,-2.796807 52.357481,-2.796919 52.357523,-2.797055 52.357551,-2.797169 52.357565,-2.797284 52.357564,-2.797442 52.357556,-2.797624 52.357529,-2.7978 52.357496,-2.797975 52.357444,-2.798129 52.357373,-2.79824 52.357318,-2.798353 52.357231,-2.798466 52.357144,-2.798585 52.357059,-2.798716 52.356999,-2.79874 52.356991,-2.798815 52.356966,-2.798918 52.35696,-2.799035 52.35697,-2.799433 52.357046,-2.799616 52.357068,-2.799801 52.357071,-2.799918 52.357055,-2.80017 52.357009,-2.800416 52.356975,-2.800521 52.35694,-2.800654 52.356844)", + "LINESTRING(-2.818355 52.347202,-2.818399 52.347293,-2.818443 52.347384,-2.818512 52.347477,-2.818663 52.3476,-2.818888 52.347728,-2.819106 52.347835,-2.819235 52.347893,-2.819377 52.347931,-2.819537 52.347956,-2.819804 52.347997,-2.820024 52.348028,-2.820145 52.348056,-2.820331 52.348128,-2.820539 52.348206,-2.82071 52.348258,-2.820909 52.348302,-2.820981 52.348318,-2.821029 52.348352,-2.821031 52.348388,-2.821011 52.348437,-2.820967 52.34846,-2.820826 52.348507,-2.820756 52.348526,-2.82037 52.348612,-2.820269 52.348639,-2.820204 52.34866,-2.819667 52.348853,-2.819451 52.34892,-2.819269 52.348968,-2.819144 52.349017,-2.818939 52.349106,-2.81881 52.349162,-2.818689 52.349193,-2.818372 52.349238,-2.818072 52.349298,-2.817924 52.34933,-2.817707 52.349379,-2.817626 52.349417,-2.817488 52.34949,-2.817383 52.349555,-2.817306 52.349621,-2.817254 52.349654,-2.817208 52.349686,-2.817105 52.34975,-2.817061 52.349773,-2.816975 52.349802,-2.816725 52.349885,-2.816603 52.349932,-2.816494 52.349974,-2.816223 52.350076,-2.816136 52.350122,-2.815942 52.350213,-2.815839 52.350255,-2.815772 52.350275,-2.815636 52.35032,-2.815461 52.350359,-2.815168 52.350407,-2.815007 52.350429,-2.814702 52.35048,-2.814474 52.350521,-2.814312 52.35054,-2.813958 52.350566,-2.813574 52.350584,-2.813074 52.350598,-2.812936 52.350596)", + "LINESTRING(-2.817427 52.368525,-2.817397 52.368498,-2.817317 52.368426,-2.817133 52.368212,-2.816979 52.368059,-2.816899 52.367997,-2.816833 52.367974,-2.816774 52.367967,-2.816692 52.367984,-2.816435 52.368082,-2.816345 52.368116,-2.816226 52.368194,-2.816155 52.368223,-2.816103 52.368243,-2.816033 52.368271,-2.816012 52.368352,-2.816011 52.368378,-2.816065 52.368732,-2.816082 52.368876,-2.8161 52.369074,-2.816104 52.369262,-2.816104 52.369271)", + "LINESTRING(-2.765419 52.340898,-2.765378 52.342352,-2.765365 52.342451,-2.764943 52.342966,-2.764864 52.343063,-2.764849 52.343129,-2.765031 52.343412,-2.765042 52.343442,-2.765041 52.343497,-2.764983 52.343558,-2.76489 52.343578,-2.764778 52.343581,-2.764724 52.343578,-2.764486 52.343576,-2.764254 52.34357,-2.764096 52.343593,-2.763938 52.343628,-2.763737 52.343721,-2.763547 52.343811,-2.763396 52.343864,-2.763203 52.343899,-2.763004 52.343974,-2.762803 52.344067,-2.762672 52.344127,-2.762663 52.344128,-2.762564 52.344139,-2.762487 52.344123,-2.762484 52.344121,-2.762422 52.344075,-2.762287 52.343936,-2.761979 52.343615,-2.761814 52.343418,-2.761739 52.343311,-2.761583 52.342988,-2.761496 52.342809,-2.761405 52.342665,-2.76136 52.342621,-2.76133 52.342585,-2.761239 52.342546)", + "LINESTRING(-2.737783 52.341558,-2.737981 52.341618,-2.738154 52.341638,-2.738366 52.341621,-2.738571 52.341608,-2.738747 52.341607,-2.738976 52.341633,-2.739153 52.341677,-2.739309 52.341678,-2.739566 52.341635,-2.73983 52.341584,-2.740346 52.341505,-2.740486 52.341483,-2.740723 52.341448,-2.740952 52.341432,-2.741154 52.341443,-2.741561 52.341497,-2.741619 52.341505,-2.741772 52.341515,-2.741874 52.341495,-2.741986 52.341474,-2.742249 52.341397,-2.742395 52.341374,-2.742703 52.341356,-2.742976 52.341335,-2.743242 52.341282,-2.743443 52.341211,-2.743662 52.341118,-2.743995 52.341022,-2.744255 52.340947,-2.744517 52.340827,-2.744621 52.340743,-2.744632 52.340675,-2.744546 52.340604,-2.744345 52.340529,-2.744095 52.340491,-2.743921 52.340447,-2.743828 52.340356,-2.743807 52.340312,-2.743809 52.340236,-2.743912 52.340074,-2.744027 52.339961,-2.744239 52.339814,-2.744414 52.339725,-2.744788 52.339635,-2.745551 52.339441,-2.745769 52.339357,-2.745918 52.339264,-2.746016 52.339167,-2.746142 52.33899,-2.746219 52.338838,-2.746281 52.338717)", + "LINESTRING(-2.791074 52.328059,-2.791045 52.32805,-2.791015 52.328041,-2.790911 52.32797,-2.790554 52.327667,-2.79042 52.327582,-2.790316 52.327516,-2.79031 52.327512,-2.790063 52.327293,-2.789899 52.327132,-2.789749 52.32698,-2.789689 52.326881,-2.789596 52.326639,-2.789536 52.326523,-2.78952 52.326482,-2.789505 52.326442,-2.789473 52.32629,-2.789516 52.326217,-2.789573 52.326154,-2.789629 52.326096,-2.789686 52.326042,-2.789909 52.325879,-2.789968 52.325835,-2.790036 52.325764,-2.790079 52.32571,-2.790135 52.325593,-2.790177 52.325449,-2.790223 52.325296)", + "LINESTRING(-2.876391 52.35697,-2.876449 52.357044,-2.876479 52.357079,-2.876525 52.357196,-2.876726 52.357707,-2.876727 52.357743,-2.876669 52.357797,-2.87664 52.357815,-2.876509 52.357861,-2.876421 52.35788)", + "LINESTRING(-2.85556 52.396517,-2.855534 52.396022,-2.855521 52.395526,-2.855513 52.395292,-2.855499 52.395243,-2.855499 52.395241,-2.855441 52.395187,-2.855286 52.395049,-2.855032 52.394824,-2.85445 52.394312,-2.853884 52.393808,-2.853774 52.393713,-2.853653 52.393622,-2.853425 52.393464,-2.853104 52.393254,-2.852847 52.393086,-2.852393 52.392779,-2.852311 52.392723,-2.8519 52.392452,-2.851752 52.392358,-2.851734 52.392346,-2.851695 52.392304,-2.851677 52.392247,-2.851691 52.392204,-2.851704 52.392193,-2.851712 52.392185,-2.851729 52.39217,-2.851751 52.392161,-2.851795 52.392143,-2.853022 52.391795,-2.853067 52.391781,-2.853157 52.391754,-2.853208 52.391727,-2.853232 52.391698,-2.853238 52.391659,-2.853226 52.391609,-2.853207 52.391558,-2.852786 52.390888,-2.852564 52.390535,-2.852295 52.390097,-2.851979 52.389588,-2.85188 52.389439,-2.851585 52.389,-2.851343 52.388633,-2.851011 52.388114,-2.850987 52.388076,-2.850866 52.38789,-2.850855 52.387881,-2.85083 52.387861,-2.850792 52.387854,-2.850735 52.387864,-2.850576 52.387911,-2.850467 52.387949,-2.85043 52.387961,-2.850363 52.387983,-2.850303 52.388025,-2.850294 52.388032,-2.850198 52.3881,-2.850123 52.388144,-2.850047 52.388176,-2.849561 52.38835,-2.849105 52.388508,-2.84873 52.388639,-2.848151 52.388841,-2.848126 52.38885,-2.848093 52.388861,-2.848036 52.388869,-2.847961 52.388866,-2.847881 52.388852,-2.8478 52.388826,-2.847373 52.388665,-2.846573 52.388365,-2.845732 52.388047,-2.845134 52.387819,-2.844629 52.387632,-2.844577 52.387619,-2.844511 52.387615,-2.844423 52.387617,-2.844304 52.387625,-2.844172 52.387633,-2.844031 52.38765,-2.843693 52.387697,-2.843032 52.387787,-2.842679 52.387842,-2.842089 52.387939,-2.841699 52.388,-2.841066 52.388111,-2.840644 52.388189,-2.840601 52.388197,-2.840249 52.388268,-2.840205 52.388278,-2.839876 52.388349,-2.839457 52.388438,-2.839302 52.388471,-2.839156 52.388507,-2.839064 52.388525,-2.838993 52.388536,-2.838901 52.388548,-2.83878 52.388561,-2.838608 52.388572,-2.838373 52.388602,-2.837898 52.38866,-2.837343 52.388751,-2.83692 52.388814,-2.836688 52.388836,-2.836525 52.388853,-2.836407 52.38886,-2.836264 52.388869,-2.836097 52.388875,-2.835884 52.388887,-2.835807 52.388894,-2.835725 52.388908,-2.835593 52.388929,-2.835501 52.388944,-2.835384 52.388961,-2.835305 52.388972,-2.835256 52.388979,-2.835115 52.388998,-2.834892 52.389042,-2.834639 52.38909,-2.834337 52.389144,-2.834152 52.389174,-2.834038 52.38919,-2.833914 52.389202,-2.833758 52.38921,-2.833503 52.389214,-2.833378 52.389219,-2.833226 52.389232,-2.832982 52.389261,-2.832221 52.389361,-2.831966 52.389395,-2.831785 52.389419,-2.831648 52.389439,-2.831467 52.389466,-2.83136 52.389482,-2.831282 52.389492,-2.831212 52.389498,-2.83115 52.389501,-2.831069 52.389498,-2.831008 52.389485,-2.830965 52.389454,-2.830933 52.389431,-2.830912 52.389387,-2.830918 52.389326,-2.830943 52.389246,-2.83098 52.389159,-2.831 52.389088,-2.83101 52.389013,-2.831014 52.38894,-2.831011 52.388855,-2.831001 52.388759,-2.830979 52.388633,-2.830951 52.388515,-2.830863 52.388224,-2.830836 52.388137,-2.830805 52.387982,-2.830787 52.387894,-2.830775 52.387745,-2.830763 52.387601,-2.830759 52.38756,-2.830742 52.387533,-2.830712 52.387509,-2.830673 52.387493,-2.830608 52.387477,-2.830474 52.387467,-2.829886 52.387431,-2.829247 52.387393,-2.828714 52.387362,-2.828589 52.387356,-2.828479 52.387342,-2.828398 52.387328,-2.828291 52.387296,-2.828268 52.387285,-2.828239 52.387272,-2.828188 52.387234,-2.828129 52.3872,-2.828118 52.387197,-2.828062 52.387177,-2.827989 52.387162,-2.827887 52.387148,-2.827766 52.387134,-2.827541 52.387099,-2.827199 52.387048,-2.826926 52.387011,-2.826678 52.386979,-2.826484 52.386962,-2.826128 52.386937,-2.825835 52.386921,-2.825578 52.386909,-2.825252 52.386883,-2.824822 52.386841,-2.82427 52.386796,-2.823937 52.386775,-2.823542 52.386749,-2.823387 52.386739,-2.823187 52.38673,-2.822928 52.386723,-2.822737 52.386725,-2.822636 52.386727,-2.822504 52.386737,-2.82239 52.386753,-2.822291 52.386764,-2.822187 52.386771,-2.822071 52.38677,-2.821698 52.386754,-2.821006 52.386716,-2.820424 52.386678,-2.820017 52.386642,-2.819853 52.386632,-2.819682 52.386628,-2.819589 52.386628,-2.819231 52.386643,-2.818809 52.386659,-2.818609 52.386667,-2.818181 52.386684,-2.817766 52.386708,-2.817455 52.386728,-2.817396 52.386731,-2.817365 52.386732,-2.817012 52.386745,-2.816911 52.386753,-2.816895 52.386757,-2.816813 52.38678,-2.81671 52.386814)", + "LINESTRING(-2.749888 52.382861,-2.751339 52.382845,-2.751707 52.382817,-2.751819 52.382778,-2.75187 52.38276,-2.75201 52.382642,-2.752104 52.382552,-2.752124 52.382532,-2.752165 52.382507,-2.752235 52.382465,-2.75224 52.382462,-2.752326 52.382443,-2.75249 52.38246,-2.752823 52.382513,-2.753021 52.38252,-2.753173 52.382509,-2.753231 52.382491,-2.75326 52.382473,-2.753274 52.382455,-2.753361 52.382337,-2.753447 52.38222,-2.753542 52.382158)", + "LINESTRING(-2.849636 52.373671,-2.849509 52.373732,-2.849432 52.373769,-2.849363 52.373797,-2.848991 52.373928,-2.848774 52.374004,-2.848314 52.374154,-2.848093 52.374223,-2.847627 52.37434,-2.847196 52.374451,-2.846893 52.374547,-2.846484 52.374688,-2.846072 52.374839,-2.845713 52.374983,-2.845325 52.375139,-2.844837 52.375341,-2.844717 52.375383,-2.844507 52.375452,-2.843824 52.375678,-2.843494 52.375781,-2.8433 52.375826,-2.843033 52.375873,-2.842747 52.37592,-2.842341 52.375982,-2.84211 52.376015,-2.841836 52.376063,-2.841536 52.376121,-2.841258 52.37618,-2.841027 52.376233,-2.840883 52.376266,-2.840791 52.376285,-2.840711 52.376296,-2.840647 52.376305,-2.840597 52.376303,-2.840554 52.376288,-2.840532 52.376278,-2.840492 52.376261,-2.840432 52.376221,-2.840385 52.376186,-2.840337 52.376165,-2.84028 52.376149,-2.840223 52.376136,-2.840149 52.376134,-2.840088 52.376141,-2.840085 52.376141,-2.839997 52.376156,-2.839849 52.376181,-2.839693 52.376196,-2.839501 52.376215,-2.839384 52.376221,-2.839316 52.376223,-2.839233 52.376212,-2.839133 52.376189,-2.838954 52.376148,-2.838297 52.375973,-2.837891 52.375872,-2.837768 52.375854,-2.837658 52.375844,-2.837547 52.375842,-2.83745 52.375842,-2.837346 52.375848,-2.83726 52.37586,-2.837161 52.375877,-2.837075 52.375903,-2.837011 52.375921,-2.836956 52.375931,-2.836916 52.37593,-2.836866 52.375921,-2.83682 52.375905,-2.83677 52.375886,-2.836633 52.375832,-2.836527 52.375789,-2.836448 52.37576,-2.836297 52.37572,-2.835957 52.375646,-2.835684 52.375592,-2.835382 52.375539,-2.835101 52.375498,-2.835051 52.375491,-2.834666 52.375443,-2.834309 52.375408,-2.834102 52.37539,-2.833896 52.375379,-2.833767 52.375379,-2.833655 52.375384,-2.833547 52.3754,-2.833465 52.375423,-2.833372 52.375473,-2.83333 52.375504,-2.833298 52.375527,-2.833246 52.375597,-2.833219 52.375648,-2.833215 52.375691,-2.83321 52.375722,-2.833227 52.375763,-2.833265 52.375818,-2.833342 52.375935,-2.833401 52.376015,-2.833472 52.376113,-2.833505 52.376174,-2.833506 52.376229,-2.8335 52.376258,-2.833497 52.376272,-2.833459 52.376299,-2.833439 52.376303,-2.833401 52.37631,-2.833357 52.376309,-2.833354 52.376308,-2.833312 52.376295,-2.833241 52.376231,-2.833152 52.376155,-2.833073 52.376082,-2.833008 52.376025,-2.832937 52.375973,-2.832878 52.375929,-2.8328 52.375893,-2.832717 52.375865,-2.832619 52.375831,-2.832523 52.3758,-2.832414 52.375772,-2.832111 52.375704,-2.831984 52.37568,-2.831765 52.375635,-2.831397 52.375571,-2.831087 52.375529,-2.830752 52.375481,-2.830563 52.375455,-2.830471 52.375449,-2.830324 52.375441,-2.830123 52.375437,-2.829918 52.375431,-2.829842 52.375423,-2.829737 52.375408,-2.829284 52.37535,-2.828579 52.375259,-2.827637 52.375138,-2.826761 52.375024,-2.826152 52.374942,-2.825627 52.374876,-2.825152 52.374818,-2.824631 52.374752,-2.82419 52.374692,-2.823612 52.374617,-2.822892 52.374522,-2.822234 52.374436,-2.819541 52.374073)", + "LINESTRING(-2.812104 52.378289,-2.812462 52.378218,-2.812687 52.378173,-2.812849 52.37812,-2.812995 52.378065,-2.813084 52.378011,-2.813152 52.377925,-2.813193 52.377827,-2.813234 52.377705,-2.813288 52.377616,-2.813365 52.377529,-2.813436 52.377478,-2.813525 52.377435,-2.813627 52.377399,-2.813696 52.377367,-2.813739 52.377308,-2.813784 52.377238,-2.813816 52.37715,-2.813855 52.376997,-2.813891 52.376849,-2.813926 52.376782,-2.813993 52.37674,-2.814096 52.376715,-2.814202 52.376708,-2.814323 52.3767,-2.814413 52.376688,-2.814475 52.376669,-2.814553 52.376617,-2.814678 52.376511,-2.814971 52.376268,-2.815065 52.376187)", + "LINESTRING(-2.829632 52.505566,-2.82985 52.505388,-2.830133 52.505157,-2.83044 52.504943,-2.831098 52.50454)", + "LINESTRING(-2.857778 52.498206,-2.857762 52.498348,-2.857727 52.498658,-2.857706 52.499173,-2.85764 52.499648,-2.857575 52.5001)", + "LINESTRING(-2.779723 52.462749,-2.779545 52.462676,-2.779526 52.462668,-2.779096 52.462511,-2.778881 52.462447,-2.778792 52.462417,-2.778607 52.462395,-2.778255 52.462332,-2.778078 52.462279,-2.777901 52.462215,-2.777793 52.462162,-2.777596 52.462038,-2.777408 52.461908,-2.777232 52.461832,-2.777084 52.461738,-2.776848 52.461632,-2.776494 52.461485,-2.776347 52.461427,-2.77626 52.461391,-2.776088 52.46132,-2.775911 52.46125,-2.775811 52.461218,-2.775773 52.461202,-2.77556 52.461128,-2.775442 52.461087,-2.775236 52.461023,-2.775099 52.460989,-2.774987 52.460989)", + "LINESTRING(-2.748927 52.460261,-2.748895 52.460247,-2.748855 52.460247,-2.748774 52.460285,-2.748667 52.460342,-2.748423 52.460455,-2.74833 52.460504,-2.74826 52.460539,-2.748165 52.460628,-2.748143 52.460637,-2.747994 52.460698,-2.747658 52.460744,-2.747408 52.460786,-2.747086 52.460816,-2.746861 52.460802,-2.746672 52.46075,-2.746663 52.460748,-2.746633 52.46073,-2.74641 52.460588,-2.746082 52.460374,-2.745724 52.46018,-2.745566 52.4601,-2.745255 52.460006)", + "LINESTRING(-2.831391 52.445745,-2.831339 52.445682,-2.831253 52.445621,-2.831039 52.44551,-2.830941 52.44546,-2.830856 52.445417,-2.830585 52.44522,-2.830148 52.444916,-2.829946 52.444785,-2.829823 52.444658,-2.829669 52.444499,-2.829529 52.444301,-2.829337 52.444027,-2.829228 52.443938)", + "LINESTRING(-2.862644 52.42015,-2.862666 52.420191,-2.862617 52.420468,-2.86324 52.42065,-2.863646 52.420786,-2.863929 52.42088,-2.864098 52.420923,-2.864238 52.420943,-2.864523 52.421001,-2.864593 52.421023,-2.864624 52.421057,-2.864662 52.421116,-2.864726 52.421363,-2.864872 52.421795,-2.864946 52.422014,-2.865 52.422122,-2.865058 52.422183,-2.865126 52.422208,-2.865203 52.422225)", + "LINESTRING(-2.755579 52.587427,-2.755548 52.587419,-2.755514 52.587406,-2.754749 52.587077,-2.754192 52.586858,-2.754158 52.586844,-2.753716 52.586664,-2.753125 52.586419,-2.75309 52.586407,-2.752784 52.586294,-2.751987 52.585975,-2.750903 52.585522,-2.750786 52.585474,-2.750434 52.585337,-2.7502 52.585287,-2.750041 52.585273,-2.749718 52.585276,-2.749452 52.585272,-2.749222 52.585245,-2.749042 52.585194,-2.74897 52.585173,-2.748916 52.585145,-2.748871 52.585093,-2.748724 52.584982,-2.748585 52.584877,-2.748371 52.584716,-2.74821 52.584667,-2.748025 52.584628,-2.747835 52.584588,-2.747546 52.584561)", + "LINESTRING(-2.758824 52.566573,-2.758843 52.566612,-2.758884 52.56673,-2.758879 52.566811,-2.75884 52.566919,-2.758784 52.567022,-2.758735 52.567116,-2.758661 52.567189,-2.758503 52.56727,-2.758483 52.567301,-2.758484 52.567328,-2.758515 52.567351,-2.758562 52.567348,-2.75862 52.567336,-2.758687 52.567284,-2.758831 52.567185,-2.759103 52.566989,-2.759359 52.566874,-2.759639 52.566798,-2.759771 52.566778,-2.759893 52.566784,-2.760066 52.566813,-2.760578 52.56694,-2.760622 52.566931,-2.760666 52.566922,-2.760711 52.566913,-2.760755 52.566894,-2.760798 52.566858,-2.760968 52.566699)", + "LINESTRING(-2.79983 52.554365,-2.79986 52.554392,-2.799905 52.554428,-2.800233 52.554632,-2.800442 52.554793,-2.800517 52.554837,-2.800636 52.554899,-2.800948 52.555032,-2.801053 52.555094,-2.801172 52.555183,-2.801217 52.555201,-2.801335 52.555209,-2.801512 52.555199,-2.80163 52.555198,-2.801748 52.555197,-2.801866 52.555188,-2.801969 52.555169,-2.802115 52.555132,-2.80235 52.555085,-2.802454 52.555076,-2.802793 52.555073,-2.80294 52.555054,-2.80316 52.554999,-2.803538 52.554912,-2.803829 52.554803,-2.804605 52.554622,-2.805872 52.554267,-2.806038 52.554234,-2.80643 52.554195,-2.806568 52.554212,-2.806931 52.554219,-2.807023 52.554211,-2.807075 52.554198,-2.807114 52.55418,-2.807192 52.554172,-2.807355 52.554181,-2.807566 52.554194,-2.808058 52.554246,-2.80856 52.554279,-2.808708 52.554287)", + "LINESTRING(-2.838002 52.589989,-2.838081 52.590031,-2.838235 52.590053,-2.838557 52.590099,-2.838864 52.590158,-2.83901 52.590208,-2.839129 52.590255,-2.839262 52.590309,-2.839384 52.590391,-2.839451 52.590444,-2.839562 52.590509,-2.839657 52.590536,-2.839789 52.590543,-2.839919 52.590545,-2.840044 52.590556,-2.840131 52.59058,-2.840177 52.590626,-2.840219 52.590711,-2.84025 52.590812,-2.840451 52.591463,-2.840611 52.591889,-2.840709 52.592094,-2.840819 52.592311,-2.841156 52.592947,-2.841231 52.593054,-2.841378 52.59321,-2.841452 52.593274)", + "LINESTRING(-2.888846 52.559077,-2.888526 52.559015,-2.8881 52.558936,-2.887961 52.558894,-2.887797 52.55883,-2.887612 52.558738,-2.887359 52.558609,-2.887079 52.558467,-2.886905 52.558368,-2.886651 52.558193,-2.886535 52.55806,-2.886397 52.55782,-2.886355 52.557709,-2.886353 52.557593,-2.886389 52.557524,-2.886442 52.55749,-2.886469 52.557473,-2.886648 52.557357,-2.886851 52.557271,-2.887098 52.557196,-2.887359 52.557129,-2.887542 52.557082,-2.887792 52.557048,-2.88827 52.557015,-2.888439 52.556996,-2.888542 52.55699,-2.889071 52.556911,-2.889527 52.556827,-2.889674 52.556817,-2.889807 52.556843,-2.890283 52.55701,-2.890685 52.557196,-2.890908 52.557302,-2.891384 52.557487)", + "LINESTRING(-2.829632 52.505566,-2.82985 52.505388,-2.830133 52.505157,-2.83044 52.504943,-2.831098 52.50454)", + "LINESTRING(-2.642485 52.161121,-2.642505 52.161137,-2.642515 52.161145,-2.642731 52.16118,-2.642813 52.161197,-2.643002 52.161234,-2.643168 52.161289,-2.643448 52.161364,-2.643565 52.161395)", + "LINESTRING(-2.637575 52.233071,-2.637728 52.233077,-2.637808 52.233079,-2.638076 52.233102,-2.638622 52.233136,-2.638791 52.233154,-2.638988 52.233195,-2.639222 52.233274,-2.639415 52.233362,-2.639539 52.233424,-2.63961 52.23345,-2.639721 52.233468,-2.639879 52.233473,-2.639982 52.233465,-2.640052 52.233456,-2.640186 52.233424,-2.640256 52.233391,-2.640318 52.233354,-2.640357 52.233311,-2.640411 52.233211,-2.640523 52.232946,-2.640638 52.232675,-2.64068 52.232612,-2.640723 52.23256,-2.640835 52.232451,-2.640927 52.232405,-2.641263 52.232261,-2.641743 52.23204,-2.642283 52.23178,-2.642565 52.231658,-2.642817 52.231562,-2.643029 52.231484,-2.643329 52.231368,-2.643708 52.231212,-2.64387 52.231162,-2.644195 52.231077,-2.644562 52.230981,-2.644794 52.230902,-2.644881 52.230856,-2.645009 52.230764,-2.645114 52.23066,-2.645264 52.230502,-2.645455 52.230308,-2.645595 52.230207,-2.64568 52.230165,-2.645736 52.230157,-2.645791 52.230153,-2.646069 52.230191,-2.646136 52.230212,-2.64618 52.230262,-2.646227 52.230349,-2.646285 52.230415,-2.646331 52.230442,-2.646375 52.230449,-2.646438 52.230451,-2.64652 52.230443,-2.646687 52.230402,-2.646814 52.230356,-2.646936 52.230288,-2.64703 52.230232,-2.647068 52.230219,-2.647089 52.230219,-2.647115 52.230227,-2.647136 52.230247,-2.647171 52.230303,-2.647317 52.2306,-2.64753 52.23105,-2.647562 52.231115,-2.647752 52.231493,-2.647963 52.231909,-2.648125 52.232278,-2.648195 52.23237,-2.648499 52.232678,-2.648787 52.233036)", + "LINESTRING(-2.690171 52.230102,-2.689196 52.230251,-2.689023 52.230279,-2.689 52.230275,-2.688958 52.230234,-2.688885 52.230144,-2.688817 52.230056,-2.688737 52.229961,-2.688654 52.229882,-2.688612 52.229842,-2.688251 52.229564,-2.687704 52.229139,-2.687509 52.228987,-2.687417 52.22891)", + "LINESTRING(-2.665954 52.174958,-2.665528 52.175062,-2.664759 52.175273,-2.663968 52.175413,-2.663044 52.175559,-2.662799 52.175583,-2.662155 52.175646,-2.66196 52.175665,-2.661055 52.175805,-2.660705 52.175852,-2.659976 52.175964,-2.659505 52.175989,-2.659009 52.17604,-2.658398 52.176098,-2.657639 52.176165,-2.657347 52.176185,-2.657069 52.176232,-2.656894 52.176251,-2.656646 52.176252,-2.656445 52.176242,-2.655922 52.176208,-2.655463 52.176181)", + "LINESTRING(-2.72594 52.149683,-2.72591 52.149665,-2.725895 52.149656,-2.725866 52.149657,-2.725793 52.149675,-2.725546 52.149748,-2.725343 52.149831,-2.725198 52.149903,-2.725159 52.149924,-2.72514 52.149949,-2.725155 52.149967,-2.725184 52.149984)", + "LINESTRING(-2.632796 52.240441,-2.63376 52.240018,-2.634053 52.239885,-2.634766 52.239675,-2.634794 52.239667,-2.634963 52.239618,-2.635271 52.239519,-2.635415 52.239464,-2.635737 52.239402,-2.636024 52.239367,-2.636327 52.239342,-2.63676 52.239321,-2.636986 52.23931,-2.637142 52.239302,-2.637321 52.239294,-2.63775 52.239315,-2.637888 52.239316,-2.637972 52.239302,-2.638385 52.239243,-2.638485 52.239241,-2.638748 52.239205,-2.639029 52.239164,-2.639202 52.239131,-2.639375 52.239092,-2.639563 52.239052,-2.639751 52.238986,-2.64009 52.238867,-2.640313 52.238778,-2.640843 52.238542,-2.641227 52.238369,-2.641732 52.238155,-2.64186 52.238089)", + "LINESTRING(-2.639628 52.316021,-2.639653 52.315956,-2.639945 52.315567,-2.640282 52.315088,-2.64036 52.314942,-2.640476 52.314813,-2.640679 52.314644,-2.640745 52.314588,-2.640912 52.314469,-2.641118 52.314317,-2.641179 52.314283,-2.641222 52.314259,-2.641342 52.314239,-2.641487 52.314269,-2.642391 52.314469,-2.642953 52.314591,-2.643178 52.314646)", + "LINESTRING(-2.665957 52.29218,-2.666931 52.29203,-2.667244 52.291978,-2.667331 52.29194,-2.667506 52.291819,-2.667615 52.291681,-2.667794 52.29147,-2.668031 52.291296,-2.66824 52.291155,-2.668371 52.291076,-2.668653 52.290936,-2.669207 52.290705,-2.669537 52.290575,-2.669953 52.290379,-2.670247 52.29023,-2.670637 52.290046,-2.670942 52.289843,-2.671075 52.289716,-2.671488 52.289099,-2.671632 52.288956,-2.672236 52.288543,-2.672427 52.288412,-2.672747 52.28806,-2.672811 52.287989,-2.672892 52.287933,-2.672999 52.287857,-2.673944 52.287449,-2.674238 52.287319,-2.674307 52.287288,-2.674378 52.287251,-2.674592 52.28714,-2.674977 52.286959,-2.675056 52.286924,-2.675263 52.28683,-2.675265 52.286828,-2.675294 52.286799,-2.675328 52.286766,-2.675371 52.286705,-2.675399 52.286661,-2.675431 52.286611,-2.675543 52.286414,-2.675699 52.286026,-2.675725 52.285828,-2.675767 52.28572,-2.675881 52.285486,-2.676288 52.284918,-2.67647 52.28468,-2.676749 52.284329,-2.677128 52.283814,-2.6772 52.283739,-2.677232 52.283728,-2.677302 52.283711,-2.677379 52.283733,-2.677402 52.283746)", + "LINESTRING(-2.672184 52.273394,-2.671954 52.273362,-2.671202 52.27319,-2.670777 52.273124,-2.670389 52.27307,-2.669867 52.272991,-2.669658 52.272944,-2.669554 52.272906,-2.669302 52.2728,-2.669102 52.272753,-2.669026 52.272692,-2.668962 52.272593,-2.668927 52.272465,-2.6689 52.272333,-2.668849 52.272254,-2.668552 52.271936,-2.668499 52.271864,-2.668375 52.271699,-2.668374 52.271697,-2.668306 52.271613,-2.668247 52.271578,-2.667917 52.271501,-2.667817 52.271476,-2.667733 52.271425,-2.667666 52.27137,-2.667582 52.271301,-2.667422 52.271071,-2.667232 52.270769,-2.667053 52.270509,-2.666868 52.270205,-2.666625 52.269824,-2.66648 52.269572,-2.666433 52.26948,-2.666419 52.269388,-2.666404 52.26923,-2.666411 52.269141,-2.666439 52.269054,-2.666486 52.26889,-2.666521 52.268726,-2.666542 52.268474,-2.666572 52.268218,-2.66661 52.267985,-2.666625 52.267873,-2.666709 52.267648,-2.6668 52.267359,-2.666856 52.267185,-2.666864 52.266914,-2.666884 52.266832,-2.666937 52.266732,-2.666994 52.266678,-2.667118 52.266601,-2.667395 52.266464,-2.667439 52.266433)", + "LINESTRING(-2.692432 52.276201,-2.692573 52.276122,-2.692668 52.276056,-2.69298 52.275861,-2.693366 52.275692,-2.693791 52.275545,-2.693888 52.27549,-2.693936 52.275445,-2.69398 52.275364,-2.694043 52.275154,-2.694096 52.27492,-2.69415 52.274558,-2.694205 52.274431,-2.694414 52.273995,-2.694706 52.273077,-2.694727 52.273025,-2.694777 52.272924,-2.694852 52.272846,-2.694945 52.272757,-2.695188 52.272611,-2.695378 52.272511,-2.695563 52.272425,-2.695781 52.272325,-2.69595 52.272254,-2.696126 52.272181,-2.696269 52.272109,-2.69645 52.271997,-2.696741 52.271827,-2.696895 52.271751,-2.697155 52.27167,-2.697364 52.271596,-2.697454 52.27156,-2.697493 52.271543,-2.697549 52.271515,-2.697592 52.271487,-2.69765 52.271451,-2.697679 52.271433,-2.697693 52.271388)", + "LINESTRING(-2.71662 52.29899,-2.716103 52.299093,-2.71594 52.299121,-2.715839 52.299122,-2.715711 52.299112,-2.715571 52.299113,-2.715197 52.299153,-2.714666 52.299215,-2.714587 52.299221,-2.714368 52.299293,-2.714006 52.299449,-2.713865 52.299471,-2.713742 52.299458,-2.713671 52.299432,-2.713618 52.299416,-2.713543 52.299414,-2.713271 52.299485,-2.713048 52.299527,-2.712863 52.299542,-2.712736 52.299537,-2.712603 52.299514,-2.712426 52.299461,-2.712134 52.299365,-2.711913 52.299299,-2.711755 52.299265,-2.711653 52.299244,-2.711437 52.299227,-2.711186 52.29922,-2.710958 52.299232,-2.71072 52.299215,-2.710236 52.299199,-2.709901 52.299171,-2.709575 52.299138,-2.709434 52.299134,-2.709285 52.299151,-2.709074 52.299203,-2.708771 52.299229,-2.708419 52.299242,-2.708094 52.299239,-2.707891 52.299202,-2.707749 52.299133,-2.707594 52.299058,-2.707474 52.298978,-2.70734 52.298882,-2.707131 52.298743,-2.706936 52.298636,-2.706577 52.298439,-2.706244 52.298255,-2.706146 52.298212,-2.706107 52.298204)", + "LINESTRING(-2.625241 52.364223,-2.625313 52.364079,-2.625396 52.363755,-2.625417 52.363684,-2.625467 52.36353,-2.625566 52.363323,-2.625637 52.363115,-2.625694 52.362997,-2.625737 52.362908,-2.625837 52.362728,-2.626097 52.362394,-2.626226 52.362213,-2.626255 52.362177,-2.626284 52.362105,-2.626297 52.362024,-2.62631 52.361925,-2.626308 52.361772,-2.626276 52.361658,-2.626215 52.36144,-2.626199 52.361341,-2.626197 52.36118,-2.62623 52.361076,-2.626386 52.360856,-2.626497 52.360664,-2.626545 52.360526,-2.626561 52.360396,-2.626552 52.360324,-2.626536 52.360216,-2.62655 52.360062,-2.626547 52.359991,-2.626569 52.359896,-2.626591 52.359799,-2.626651 52.359693,-2.626763 52.359532,-2.626821 52.35939,-2.626881 52.359282,-2.626983 52.358974,-2.626997 52.358931,-2.62704 52.358888,-2.627095 52.358848,-2.627292 52.358805,-2.627482 52.358788,-2.627652 52.358769,-2.627925 52.358743,-2.628089 52.3587,-2.628234 52.358601,-2.6284 52.358454,-2.628643 52.358199,-2.628776 52.358066,-2.628833 52.357997)", + "LINESTRING(-2.701915 52.415412,-2.70192 52.415411,-2.701938 52.415405,-2.701956 52.4154,-2.701968 52.415395,-2.701982 52.41539,-2.701996 52.415385,-2.70201 52.41538,-2.702027 52.415375,-2.702051 52.415369,-2.702096 52.415363,-2.702615 52.415426,-2.70304 52.415478,-2.703535 52.415544,-2.703915 52.415593,-2.704146 52.415621,-2.704382 52.415651,-2.704569 52.415674,-2.704741 52.415695,-2.704891 52.415713,-2.705012 52.415727,-2.705118 52.41574,-2.705203 52.415751,-2.705272 52.415759,-2.705334 52.415767,-2.705401 52.415775)", + "LINESTRING(-2.707812 52.377531,-2.707872 52.377589,-2.708109 52.377788,-2.708334 52.377977,-2.708556 52.378111,-2.709177 52.378368,-2.70934 52.37842,-2.709472 52.378447,-2.709956 52.378548)", + "LINESTRING(-2.620516 52.379118,-2.620457 52.379211,-2.620431 52.379337,-2.62039 52.37952,-2.62036 52.37975,-2.620341 52.379986,-2.620345 52.380114,-2.6204 52.380269,-2.6204 52.380305,-2.620328 52.380386,-2.620246 52.380461,-2.620105 52.380619,-2.620013 52.38068,-2.619911 52.380753,-2.619865 52.380797,-2.619844 52.380845,-2.619698 52.380995,-2.61959 52.381106,-2.61956 52.381171,-2.619543 52.381275,-2.619538 52.381331)", + "LINESTRING(-2.707602 52.372668,-2.707795 52.372744,-2.70812 52.372872,-2.70846 52.372996)", + "LINESTRING(-2.711811 52.37457,-2.711658 52.374351,-2.711597 52.374317,-2.711513 52.374312,-2.711339 52.374339,-2.710727 52.374445,-2.710437 52.374497,-2.710174 52.374562,-2.709927 52.374623,-2.709397 52.374757)", + "LINESTRING(-2.706761 52.37698,-2.706716 52.376953,-2.706627 52.37689,-2.706537 52.37681,-2.706388 52.376667,-2.706314 52.376596,-2.706192 52.376318,-2.706146 52.376153)", + "LINESTRING(-2.621756 52.445112,-2.621868 52.444997,-2.621989 52.444842,-2.622251 52.444614,-2.622538 52.444381,-2.622715 52.444245,-2.622746 52.444162,-2.622761 52.444092,-2.622739 52.444014,-2.622645 52.443805,-2.622485 52.443494,-2.622426 52.443401,-2.62237 52.443298,-2.622323 52.443194,-2.622298 52.443091,-2.622292 52.442974,-2.622318 52.442867,-2.622363 52.442789,-2.622434 52.442638,-2.622483 52.442528,-2.622536 52.442409,-2.622539 52.442289,-2.622522 52.442225,-2.622475 52.44213,-2.62243 52.442042,-2.622353 52.441909,-2.622241 52.441739,-2.622058 52.441463,-2.621748 52.441037,-2.621524 52.440713,-2.621368 52.440483,-2.621248 52.440291,-2.621166 52.440152,-2.621086 52.439994,-2.621018 52.439834,-2.62092 52.439574,-2.620759 52.439153,-2.620586 52.438729,-2.620425 52.438338,-2.620138 52.437647)", + "LINESTRING(-2.654057 52.461737,-2.654156 52.461723,-2.654248 52.461682,-2.654354 52.461623,-2.654612 52.461392,-2.654764 52.461257,-2.654893 52.461097,-2.655048 52.460894,-2.655062 52.460875,-2.655109 52.460821,-2.655134 52.460792,-2.655226 52.46069,-2.655231 52.460685,-2.655344 52.460581,-2.655418 52.460523,-2.65552 52.460452,-2.655555 52.460434,-2.655627 52.460397,-2.655695 52.460367,-2.655719 52.460356,-2.655819 52.460324,-2.655992 52.460266,-2.656134 52.460217,-2.656205 52.460188,-2.656229 52.460176,-2.656276 52.460152,-2.6564 52.460089,-2.656492 52.46003,-2.656579 52.45996,-2.656722 52.459843,-2.656837 52.459745,-2.657007 52.459598,-2.657009 52.459596,-2.657095 52.459498,-2.657107 52.459484,-2.657153 52.459424,-2.657211 52.459359,-2.657332 52.459224,-2.657388 52.459182,-2.657462 52.459126,-2.65762 52.459015,-2.65783 52.458869,-2.657942 52.458791,-2.658069 52.458703,-2.658316 52.458521,-2.658471 52.45842,-2.658762 52.458249,-2.65919 52.458021,-2.659703 52.457759,-2.659955 52.457606)", + "LINESTRING(-2.735941 52.47267,-2.735934 52.472667,-2.735924 52.472661,-2.735852 52.47262,-2.735599 52.47246,-2.73548 52.47237,-2.735464 52.472357,-2.735361 52.472276,-2.735294 52.472218,-2.735262 52.472172,-2.735206 52.472079,-2.735165 52.472022,-2.734934 52.471758,-2.734895 52.471727,-2.734885 52.471718,-2.734835 52.471673,-2.734825 52.471663,-2.734729 52.471589,-2.734697 52.47157,-2.73464 52.471541,-2.734612 52.471531)", + "LINESTRING(-2.600202 52.588818,-2.599984 52.588964,-2.599881 52.58905,-2.599775 52.589104,-2.599548 52.589215,-2.599542 52.589219,-2.599052 52.589451,-2.59847 52.589744,-2.598061 52.589933,-2.597517 52.59018,-2.597069 52.590412,-2.596399 52.590737,-2.596005 52.590942,-2.595702 52.591172,-2.595278 52.591479,-2.594971 52.591716,-2.594324 52.592189,-2.594038 52.592401,-2.593483 52.592668,-2.592961 52.592903,-2.592742 52.593009,-2.59245 52.593148,-2.592205 52.593362,-2.591903 52.593647,-2.591599 52.593929,-2.591221 52.594265,-2.590853 52.594544,-2.590349 52.594841,-2.589792 52.595132,-2.589358 52.595346,-2.588695 52.595666,-2.58789 52.596063,-2.587503 52.596248,-2.587206 52.59639,-2.586929 52.596499,-2.58639 52.596768,-2.585825 52.597044,-2.585507 52.597212,-2.585136 52.597431,-2.584636 52.597744,-2.584113 52.598065,-2.583643 52.598353,-2.583338 52.598545,-2.58302 52.598717,-2.582686 52.5989,-2.582504 52.598987,-2.582322 52.599055,-2.582214 52.599083,-2.581887 52.599137,-2.581618 52.599174,-2.581605 52.599185,-2.5816 52.59919,-2.581574 52.599213,-2.581574 52.599231)", + "LINESTRING(-2.643908 52.583275,-2.643708 52.583233,-2.643223 52.58317,-2.642576 52.583105,-2.641417 52.582982,-2.64131 52.582971,-2.641297 52.582969,-2.641206 52.582963,-2.641102 52.582947,-2.640998 52.582903,-2.640938 52.582866,-2.640862 52.582804,-2.640729 52.582636,-2.640672 52.582555,-2.640647 52.582507,-2.640625 52.582469,-2.640621 52.58244,-2.640622 52.582385,-2.640636 52.582358,-2.640709 52.582304,-2.640817 52.58222,-2.6409 52.582151,-2.640989 52.582077,-2.641102 52.58199,-2.641183 52.581935,-2.641303 52.581863,-2.641425 52.581798,-2.64147 52.581768,-2.641513 52.581728,-2.641632 52.58163,-2.64178 52.5815,-2.641912 52.581426,-2.642237 52.581273,-2.642484 52.58117,-2.642678 52.581101,-2.642836 52.581071)", + "LINESTRING(-2.694135 52.569982,-2.6944 52.570116,-2.694927 52.57055,-2.695022 52.570633,-2.695077 52.570645,-2.695132 52.57064,-2.695204 52.570588,-2.695539 52.570325,-2.695671 52.570243,-2.6957 52.570225,-2.695773 52.570198,-2.695832 52.570188,-2.695906 52.570188,-2.696069 52.570214,-2.696187 52.570213,-2.696305 52.570213,-2.696393 52.570194,-2.696452 52.570185,-2.69654 52.570139,-2.696642 52.570067,-2.696685 52.570013,-2.696742 52.569886,-2.696786 52.569832,-2.696829 52.569796,-2.696932 52.569733,-2.697108 52.569669,-2.697695 52.569485,-2.69793 52.569412,-2.698376 52.569276,-2.698473 52.569256,-2.698576 52.569219,-2.699147 52.568955,-2.699557 52.568755,-2.70001 52.568492,-2.700259 52.568355,-2.700596 52.568219,-2.70091 52.568118,-2.701081 52.568063,-2.701433 52.567971,-2.701933 52.56786,-2.702052 52.567827)", + "LINESTRING(-2.735197 52.581367,-2.734933 52.581501,-2.734664 52.581612,-2.734412 52.581716,-2.734155 52.581793,-2.73393 52.581831,-2.733637 52.581899,-2.733549 52.581899)", + "LINESTRING(-2.471251 52.186382,-2.471183 52.186377,-2.471137 52.186366,-2.471089 52.18633,-2.471061 52.186262,-2.471046 52.186148,-2.471038 52.186098,-2.470963 52.186025,-2.470884 52.185977,-2.470715 52.185932,-2.470661 52.185913,-2.470461 52.185895,-2.470222 52.185855,-2.470068 52.185818,-2.46998 52.185797,-2.469735 52.185775,-2.469362 52.185764,-2.469308 52.185757,-2.468923 52.185734,-2.468668 52.185713,-2.468601 52.185695,-2.468482 52.185663,-2.468349 52.185615,-2.468213 52.185558,-2.468109 52.185501,-2.467894 52.185386,-2.467456 52.185107,-2.467185 52.184921,-2.467114 52.184875,-2.466823 52.184617,-2.466688 52.184521,-2.466615 52.184469,-2.466488 52.184209,-2.466276 52.183883)", + "LINESTRING(-2.471194 52.161747,-2.471208 52.161746,-2.471329 52.161734,-2.471447 52.16172,-2.471514 52.161706,-2.471686 52.16167,-2.471771 52.161669,-2.47189 52.161687)", + "LINESTRING(-2.486775 52.192233,-2.486664 52.192166,-2.486034 52.191851,-2.485589 52.191668,-2.485207 52.191477,-2.485187 52.191467,-2.484394 52.191077,-2.484261 52.190967,-2.484201 52.190922,-2.484156 52.190876,-2.484035 52.19073,-2.483971 52.190665,-2.483911 52.190625,-2.48372 52.1905,-2.483666 52.190465,-2.483521 52.19038,-2.483259 52.190129,-2.483087 52.189954,-2.482767 52.189456)", + "LINESTRING(-2.506368 52.187521,-2.506339 52.187566,-2.50631 52.187593,-2.506252 52.187611,-2.506223 52.18762,-2.506091 52.187603)", + "LINESTRING(-2.505218 52.189211,-2.505069 52.189019,-2.504941 52.188854)", + "LINESTRING(-2.50762 52.201419,-2.507724 52.201279,-2.50784 52.201135,-2.507882 52.201,-2.507915 52.200773,-2.50795 52.200666,-2.507951 52.200662,-2.508038 52.200532,-2.508095 52.200451,-2.508153 52.200388,-2.508225 52.200315,-2.508327 52.200234,-2.508414 52.200171,-2.508574 52.20008,-2.509286 52.199681,-2.509563 52.199545,-2.509636 52.199518,-2.509841 52.199449,-2.510023 52.199411,-2.51022 52.199386,-2.51036 52.199374,-2.510693 52.19938,-2.511144 52.199398,-2.511418 52.199391,-2.511575 52.199373,-2.51177 52.199338,-2.512456 52.199218,-2.51266 52.19919,-2.513226 52.199136,-2.513306 52.199118,-2.513362 52.199106,-2.513367 52.199105,-2.5135 52.199064,-2.51351 52.199059,-2.51353 52.199049,-2.513624 52.199006,-2.513725 52.198907)", + "LINESTRING(-2.511843 52.190473,-2.511727 52.190563,-2.511672 52.190594,-2.511625 52.1906,-2.511465 52.190619,-2.511392 52.190628,-2.511333 52.190628,-2.5113 52.19062,-2.511274 52.190601,-2.511259 52.190574,-2.511153 52.190269,-2.511032 52.189865,-2.511017 52.189818,-2.511001 52.189775,-2.510972 52.189749,-2.510928 52.189731,-2.510884 52.189713,-2.510825 52.189713,-2.510723 52.189723,-2.510636 52.189744)", + "LINESTRING(-2.540195 52.199951,-2.540115 52.199992,-2.539923 52.200124,-2.539792 52.200195,-2.539712 52.200274,-2.539129 52.200421,-2.538881 52.200476,-2.538735 52.200495,-2.538427 52.200514,-2.538121 52.20056,-2.53796 52.200597,-2.537669 52.200706,-2.537523 52.200761,-2.537131 52.201005,-2.53671 52.201286,-2.536448 52.201413,-2.536288 52.201477,-2.536113 52.201522,-2.535953 52.201568,-2.535734 52.201605,-2.535573 52.201633,-2.535295 52.201652,-2.53512 52.201644,-2.535061 52.201635,-2.534944 52.2016,-2.53487 52.201564,-2.534723 52.201475,-2.534162 52.201073,-2.534088 52.201019,-2.533631 52.200707,-2.533528 52.200662,-2.533454 52.200644,-2.533393 52.200645,-2.533258 52.200637,-2.532589 52.200671,-2.532514 52.200672,-2.532447 52.200673,-2.532357 52.200667,-2.532181 52.20065,-2.531512 52.200542,-2.531233 52.200507,-2.531033 52.200494,-2.530901 52.200478,-2.530773 52.200462,-2.529977 52.200263,-2.529738 52.200201,-2.529564 52.200141,-2.529338 52.200039,-2.529245 52.199997,-2.528879 52.199775,-2.528693 52.199663,-2.528521 52.199549,-2.528378 52.199481,-2.528156 52.199402,-2.52758 52.19925,-2.527218 52.199153,-2.526851 52.199047,-2.526484 52.198959,-2.526279 52.198897,-2.525676 52.198692,-2.525427 52.198595,-2.524883 52.198372,-2.524721 52.198328,-2.524545 52.198293)", + "LINESTRING(-2.544544 52.17669,-2.544596 52.176676,-2.544688 52.176668,-2.544773 52.176675,-2.54492 52.176689,-2.545117 52.176722,-2.545294 52.176748,-2.545435 52.176759,-2.545625 52.176784,-2.545699 52.176791,-2.545889 52.176809,-2.546085 52.176831,-2.546323 52.176845,-2.546654 52.176873,-2.546825 52.176888,-2.547009 52.17689,-2.54726 52.176893,-2.547529 52.176899,-2.547848 52.176917,-2.548111 52.176923,-2.548264 52.176934,-2.548447 52.176948,-2.548566 52.176945)", + "LINESTRING(-2.572267 52.237221,-2.572354 52.23703,-2.572462 52.236915,-2.572642 52.236834,-2.572777 52.236822,-2.573147 52.236798,-2.573256 52.23677,-2.573293 52.236761,-2.573381 52.236734,-2.573672 52.236597,-2.57437 52.23618,-2.574776 52.235936,-2.575348 52.235529,-2.575583 52.235373,-2.575987 52.235117,-2.576503 52.234756,-2.576544 52.234726,-2.576745 52.234593,-2.576895 52.234517,-2.577057 52.234461,-2.577394 52.234363,-2.577633 52.234284,-2.577839 52.234198,-2.577967 52.234153,-2.578536 52.233986,-2.579064 52.233819,-2.579075 52.233815,-2.579399 52.23368,-2.579744 52.233564,-2.580219 52.233415,-2.580847 52.233218)", + "LINESTRING(-2.441663 52.321315,-2.441916 52.321358,-2.442019 52.321366,-2.442294 52.321388,-2.44248 52.321436,-2.442685 52.321469,-2.44299 52.321514,-2.443297 52.32154,-2.443602 52.321574,-2.443702 52.321607,-2.443745 52.321669,-2.443789 52.32201,-2.443829 52.322171,-2.443914 52.322332,-2.443995 52.322392,-2.444002 52.322398,-2.444023 52.322413,-2.444032 52.322417,-2.444041 52.322421,-2.4441 52.322447,-2.444476 52.322556,-2.444493 52.32256,-2.444694 52.322611,-2.444935 52.322681,-2.445149 52.322755,-2.445355 52.322852,-2.445631 52.323012,-2.445893 52.323175,-2.446104 52.323281,-2.44629 52.323343,-2.446489 52.323402,-2.446927 52.323534,-2.447081 52.323584,-2.447145 52.323602,-2.447282 52.323637,-2.447384 52.323654,-2.447486 52.323657,-2.447589 52.323648,-2.448131 52.323592,-2.448249 52.323592,-2.44849 52.323599,-2.448762 52.323617)", + "LINESTRING(-2.472028 52.316325,-2.472073 52.316386,-2.472207 52.316558,-2.472267 52.316683,-2.472312 52.316764,-2.472327 52.316809,-2.472343 52.316962,-2.472345 52.317132,-2.472304 52.317456,-2.47229 52.317501,-2.472203 52.317683,-2.472045 52.317966,-2.472003 52.318045,-2.47196 52.318159,-2.471917 52.318267,-2.471903 52.318312,-2.471859 52.318375,-2.47183 52.318402,-2.471801 52.318429,-2.471758 52.318447,-2.471654 52.318472)", + "LINESTRING(-2.513312 52.310431,-2.513306 52.310371,-2.5133 52.310355,-2.513222 52.310076,-2.513172 52.30988,-2.513115 52.309663,-2.513099 52.309626,-2.513048 52.309509,-2.513032 52.309431,-2.513078 52.309344,-2.513109 52.309326,-2.513184 52.309281,-2.513257 52.309237,-2.513461 52.309147,-2.513605 52.309075,-2.513739 52.309009,-2.513795 52.308971,-2.513839 52.308901,-2.513843 52.308833,-2.513782 52.30868,-2.513738 52.308606,-2.513621 52.308397,-2.513579 52.308322,-2.513493 52.308058,-2.513457 52.307962,-2.513405 52.307867,-2.513197 52.307596,-2.51312 52.30749,-2.512969 52.307256,-2.512865 52.307106,-2.512804 52.307012,-2.512779 52.306933,-2.512773 52.306863,-2.512784 52.306794,-2.5128 52.306747)", + "LINESTRING(-2.447545 52.312033,-2.447574 52.312015,-2.447603 52.311997,-2.447748 52.311762,-2.447893 52.311609,-2.447984 52.31151,-2.448009 52.311483,-2.448242 52.311302,-2.448344 52.311221,-2.448708 52.310967,-2.448795 52.310904,-2.449013 52.310652,-2.449042 52.310616,-2.449071 52.310597,-2.449114 52.31057,-2.44929 52.310507,-2.449859 52.310217,-2.449961 52.310154,-2.449975 52.3101,-2.450001 52.309803,-2.450015 52.309686,-2.450058 52.309587,-2.45013 52.309434,-2.450235 52.309256,-2.450453 52.309011,-2.450681 52.308838,-2.450827 52.30873,-2.451118 52.308531,-2.451569 52.308206,-2.451685 52.308114,-2.451712 52.308092,-2.451754 52.308061,-2.4518 52.308009,-2.451846 52.307936,-2.451896 52.307834,-2.451924 52.307764,-2.451926 52.307708,-2.451935 52.307634,-2.451944 52.307557,-2.451928 52.307467,-2.451928 52.307465,-2.451913 52.307395,-2.451838 52.307198,-2.45185 52.307128,-2.451852 52.307116,-2.451856 52.307093,-2.451884 52.307035,-2.451961 52.306947,-2.452048 52.306867,-2.452174 52.306789,-2.452283 52.306727,-2.452473 52.306631,-2.452524 52.306604,-2.452668 52.30651,-2.45271 52.306475,-2.45303 52.306222,-2.453176 52.306123,-2.453239 52.306091)", + "LINESTRING(-2.504205 52.303927,-2.504313 52.303921,-2.504708 52.303739,-2.504743 52.303727,-2.504947 52.303657,-2.505136 52.30361,-2.505179 52.303607,-2.505327 52.303594,-2.505721 52.303539,-2.505735 52.303537,-2.506063 52.303488,-2.506494 52.303412,-2.506697 52.303379,-2.506829 52.303359,-2.507095 52.303328,-2.507372 52.303307,-2.507605 52.303302,-2.507775 52.303307,-2.508311 52.303289,-2.508416 52.303304,-2.508705 52.303355,-2.509098 52.303421,-2.509553 52.30349,-2.509639 52.303492,-2.509761 52.303471,-2.509877 52.303422,-2.509979 52.303349,-2.510145 52.303238,-2.510265 52.303178,-2.51049 52.303111,-2.510669 52.303047,-2.510794 52.302988,-2.510973 52.302883,-2.511093 52.302795,-2.511267 52.302679,-2.511436 52.302578,-2.511679 52.302427,-2.511826 52.302358,-2.511969 52.30229,-2.512169 52.302212,-2.512498 52.302075,-2.51274 52.301972,-2.512942 52.3019,-2.513044 52.301864,-2.513083 52.301833,-2.513105 52.301787,-2.513094 52.301723,-2.513033 52.30132,-2.512999 52.301071,-2.512998 52.301062)", + "LINESTRING(-2.471692 52.306163,-2.471601 52.306131,-2.471559 52.30611,-2.471471 52.306066,-2.471372 52.306008,-2.471235 52.305918,-2.471124 52.305828,-2.470985 52.3057,-2.470942 52.305644,-2.470888 52.305565,-2.470828 52.305459,-2.470768 52.305348,-2.470707 52.305268,-2.470672 52.30523,-2.470672 52.30523,-2.470671 52.305229,-2.47066 52.305224)", + "LINESTRING(-2.460975 52.291103,-2.460895 52.291139,-2.460541 52.291265,-2.46029 52.29135,-2.460273 52.29136,-2.460239 52.29138,-2.460162 52.291444,-2.460092 52.291508,-2.460018 52.291578,-2.459951 52.291614,-2.459858 52.291635,-2.459754 52.291643,-2.459648 52.29164,-2.45952 52.291627,-2.459354 52.291608,-2.459248 52.291608,-2.459195 52.291613,-2.459113 52.291632,-2.458917 52.291709,-2.458094 52.292053,-2.457536 52.29228,-2.45715 52.292444,-2.456959 52.292532,-2.456719 52.292656,-2.455967 52.293047,-2.45559 52.293237,-2.455529 52.293266,-2.455447 52.293284,-2.454891 52.293361,-2.454729 52.293387,-2.454654 52.293412,-2.454636 52.293418,-2.45458 52.293447)", + "LINESTRING(-2.527254 52.284957,-2.527217 52.284992,-2.527166 52.285086,-2.527039 52.285303,-2.527002 52.285402,-2.52696 52.285441,-2.526887 52.28558,-2.526854 52.28564,-2.526846 52.285665,-2.526847 52.285695,-2.526855 52.285734,-2.52687 52.285764,-2.526912 52.285807,-2.526946 52.285842,-2.526988 52.285887,-2.527049 52.285949,-2.527079 52.285988,-2.527129 52.286055,-2.527159 52.286105,-2.527186 52.286149,-2.527216 52.286195,-2.52724 52.286247,-2.527259 52.286296,-2.527294 52.286383,-2.527327 52.286465,-2.527392 52.286665,-2.527405 52.286865,-2.527394 52.287169,-2.527378 52.287376,-2.527368 52.287493,-2.527344 52.287666,-2.527326 52.287704,-2.527292 52.287753,-2.527281 52.287816,-2.527302 52.287863,-2.527411 52.287887,-2.527687 52.287883,-2.52791 52.287894,-2.528124 52.287909,-2.528404 52.287941,-2.528654 52.287974,-2.528888 52.288003,-2.529118 52.288033,-2.52948 52.288081,-2.5296 52.288088,-2.5299 52.288117,-2.530232 52.288148,-2.530578 52.288161,-2.530763 52.288171,-2.530984 52.288192,-2.531201 52.2882,-2.531392 52.288201,-2.531518 52.288207,-2.531633 52.288219,-2.531806 52.288224,-2.531985 52.288245,-2.532221 52.288262,-2.532435 52.288288,-2.532926 52.288341,-2.533105 52.288362,-2.533188 52.288389,-2.533259 52.288423,-2.533339 52.288487,-2.533333 52.288518,-2.533328 52.288566,-2.53334 52.288619,-2.533332 52.288664,-2.533289 52.288739,-2.533199 52.288857,-2.533167 52.2889,-2.533148 52.288969,-2.533137 52.289042,-2.533123 52.28912,-2.53308 52.28919,-2.533037 52.289243,-2.532926 52.289358,-2.532822 52.289458,-2.532779 52.289508,-2.532703 52.289579,-2.532616 52.289655,-2.532564 52.28971)", + "LINESTRING(-2.448937 52.282899,-2.448852 52.28286,-2.448805 52.282836,-2.447935 52.28238,-2.447175 52.281963,-2.446732 52.28172,-2.446589 52.281628,-2.44658 52.281619,-2.446447 52.281495,-2.446396 52.281389,-2.446387 52.281328,-2.446405 52.281235,-2.446457 52.281182,-2.446507 52.281131,-2.446744 52.281)", + "LINESTRING(-2.563133 52.253041,-2.563455 52.252986,-2.563777 52.252876,-2.564579 52.252572,-2.56506 52.25239,-2.565162 52.252371,-2.565269 52.252375,-2.566355 52.252547,-2.566456 52.252563,-2.567209 52.252685,-2.567378 52.252711,-2.567596 52.252732,-2.568538 52.252798,-2.569435 52.252855,-2.569635 52.252857,-2.569726 52.252852,-2.57001 52.252813,-2.570499 52.252757,-2.570648 52.25274,-2.570966 52.25271,-2.57109 52.252714,-2.571365 52.252768,-2.571592 52.252817,-2.57164 52.252824,-2.571675 52.252829,-2.571753 52.25283,-2.571852 52.252811,-2.571865 52.252804,-2.571958 52.252754,-2.572143 52.252652,-2.572291 52.252577,-2.57244 52.252535,-2.572446 52.252534,-2.572473 52.25253,-2.572666 52.252499,-2.57274 52.252496,-2.572809 52.252494,-2.572882 52.252499)", + "LINESTRING(-2.548434 52.318773,-2.54837 52.31869,-2.548342 52.318571,-2.54829 52.318243,-2.548328 52.318091,-2.548343 52.317724,-2.548345 52.317578,-2.548348 52.317463,-2.548352 52.317393,-2.548359 52.31729,-2.548367 52.317172,-2.548362 52.317132,-2.548348 52.317089,-2.548335 52.317051,-2.548303 52.317005,-2.548268 52.316968,-2.548228 52.316939,-2.548197 52.316914)", + "LINESTRING(-2.5647 52.280694,-2.564611 52.280667,-2.564554 52.280647,-2.564553 52.280646,-2.564466 52.280583,-2.564464 52.280581,-2.564462 52.280579,-2.564382 52.280491,-2.5643 52.280394,-2.5642 52.280285,-2.564089 52.280184,-2.564012 52.280141,-2.563911 52.280103,-2.563849 52.28009,-2.56382 52.280083,-2.563771 52.280073,-2.56375 52.280071,-2.563685 52.280064,-2.56362 52.280057)", + "LINESTRING(-2.572267 52.237221,-2.572354 52.23703,-2.572462 52.236915,-2.572642 52.236834,-2.572777 52.236822,-2.573147 52.236798,-2.573256 52.23677,-2.573293 52.236761,-2.573381 52.236734,-2.573672 52.236597,-2.57437 52.23618,-2.574776 52.235936,-2.575348 52.235529,-2.575583 52.235373,-2.575987 52.235117,-2.576503 52.234756,-2.576544 52.234726,-2.576745 52.234593,-2.576895 52.234517,-2.577057 52.234461,-2.577394 52.234363,-2.577633 52.234284,-2.577839 52.234198,-2.577967 52.234153,-2.578536 52.233986,-2.579064 52.233819,-2.579075 52.233815,-2.579399 52.23368,-2.579744 52.233564,-2.580219 52.233415,-2.580847 52.233218)", + "LINESTRING(-2.471886 52.410372,-2.472048 52.410396,-2.472451 52.410365,-2.473273 52.4103,-2.473549 52.410281,-2.473782 52.410266,-2.474242 52.410265,-2.474647 52.410255,-2.474666 52.410255,-2.474948 52.410239,-2.475095 52.410224,-2.475192 52.410209,-2.475535 52.410156,-2.476032 52.410086,-2.476313 52.41005,-2.476674 52.410016,-2.476947 52.409988,-2.47713 52.409984,-2.477333 52.409991,-2.477465 52.410011,-2.477505 52.410023,-2.477604 52.410054,-2.477621 52.410059,-2.47776 52.410118,-2.477938 52.410225,-2.47796 52.410242,-2.478004 52.410276,-2.478065 52.410324,-2.478077 52.410336,-2.478164 52.410437,-2.478193 52.410445,-2.478311 52.410454,-2.478707 52.410425,-2.478741 52.410429)", + "LINESTRING(-2.466721 52.410894,-2.466809 52.41093,-2.466969 52.411017,-2.467398 52.411283,-2.46767 52.411458,-2.467738 52.411487,-2.467844 52.411521,-2.468032 52.411543,-2.468194 52.411562,-2.468255 52.411569,-2.470843 52.41184,-2.471402 52.411902)", + "LINESTRING(-2.554667 52.389753,-2.554543 52.38971,-2.554214 52.389653,-2.55373 52.389577,-2.553436 52.389514,-2.553155 52.389412,-2.552772 52.38929,-2.552624 52.389246,-2.552374 52.389193,-2.552153 52.389131,-2.552101 52.389104,-2.552049 52.389077,-2.552 52.389048)", + "LINESTRING(-2.474069 52.386413,-2.474094 52.386471,-2.474115 52.386496,-2.474138 52.386512,-2.474147 52.386518,-2.474168 52.386532,-2.474186 52.386543,-2.474206 52.38655,-2.474224 52.386555,-2.474247 52.386557,-2.474265 52.386558,-2.474356 52.386555)", + "LINESTRING(-2.577546 52.379129,-2.577584 52.379095,-2.577739 52.379002,-2.57807 52.378821,-2.579069 52.378298,-2.580057 52.377738,-2.580511 52.377505,-2.580879 52.3773,-2.58191 52.376725,-2.5821 52.376616,-2.582245 52.37653,-2.582368 52.376457,-2.582477 52.376409,-2.582588 52.376376,-2.582702 52.376349,-2.582832 52.37633,-2.583016 52.376318,-2.583245 52.376315,-2.583266 52.376315,-2.583497 52.376348,-2.583633 52.376389,-2.583712 52.376413,-2.583878 52.376449,-2.584109 52.376495,-2.584299 52.376554,-2.584416 52.376593,-2.58449 52.376599,-2.584599 52.376567,-2.584676 52.376514,-2.584728 52.376458,-2.584749 52.376421)", + "LINESTRING(-2.459996 52.457962,-2.459215 52.4578,-2.45878 52.457693,-2.458686 52.457664,-2.458619 52.457636,-2.458585 52.457607,-2.458548 52.457468,-2.458519 52.457359,-2.458485 52.457302,-2.458481 52.457242,-2.458492 52.457168,-2.458519 52.457079,-2.458548 52.456995,-2.458598 52.456919,-2.458673 52.456838,-2.458893 52.456647,-2.459155 52.456424,-2.459233 52.456346,-2.459266 52.456298,-2.459277 52.456238,-2.459288 52.456113,-2.459284 52.455913,-2.459288 52.45563,-2.459307 52.45544,-2.459305 52.455367,-2.459301 52.455309,-2.459283 52.455264,-2.459234 52.455202,-2.459169 52.455154,-2.459056 52.455092,-2.458995 52.455039,-2.458933 52.454965,-2.458907 52.454912,-2.458852 52.454721,-2.458775 52.454426,-2.458715 52.454227,-2.458665 52.454112,-2.458609 52.454007,-2.458514 52.453871,-2.458433 52.453774,-2.458356 52.453697,-2.458293 52.45363,-2.458277 52.453587)", + "LINESTRING(-2.578602 52.498031,-2.579251 52.498096,-2.579281 52.498114,-2.579311 52.498132,-2.579329 52.498169,-2.579309 52.498265)", + "LINESTRING(-2.571655 52.452134,-2.571922 52.452084,-2.572008 52.452068,-2.572449 52.452065,-2.573334 52.452059,-2.573409 52.452073)", + "LINESTRING(-2.545333 52.455671,-2.545365 52.455672,-2.545391 52.455671,-2.545479 52.455653,-2.545553 52.455635,-2.545919 52.455507,-2.545995 52.455476,-2.54605 52.455469,-2.546051 52.455469,-2.546107 52.455486,-2.54617 52.455533,-2.546229 52.455605,-2.546334 52.455703,-2.546482 52.455828,-2.54675 52.456016,-2.546824 52.456087,-2.546869 52.456177,-2.546884 52.456377,-2.546897 52.456551,-2.546919 52.456924,-2.546914 52.456973,-2.546866 52.456996,-2.546808 52.456985,-2.546774 52.456978,-2.546585 52.456905,-2.546199 52.456729,-2.546066 52.456697,-2.546052 52.456693,-2.545934 52.456672,-2.545904 52.456667,-2.545727 52.45665,-2.54547 52.456622,-2.544925 52.456606,-2.544903 52.456606,-2.544375 52.456603,-2.544226 52.456608,-2.543741 52.456612,-2.543313 52.456598)", + "LINESTRING(-2.47225 52.463886,-2.472365 52.463904,-2.472832 52.463991,-2.472848 52.463994,-2.473175 52.464072,-2.473328 52.464126,-2.473333 52.464128,-2.473338 52.46413,-2.473463 52.464195,-2.473616 52.464322,-2.473678 52.464369,-2.473732 52.464407)", + "LINESTRING(-2.457175 52.510534,-2.456312 52.51087,-2.45619 52.510917,-2.456011 52.510988,-2.455861 52.511048,-2.455756 52.51109,-2.455731 52.511109)", + "LINESTRING(-2.518319 52.577444,-2.518208 52.577535,-2.518032 52.577597,-2.517232 52.577863,-2.51674 52.578024,-2.516571 52.578088,-2.516489 52.578164,-2.516356 52.578267,-2.5163 52.578304,-2.516133 52.578414,-2.515911 52.578595,-2.515846 52.578648)", + "LINESTRING(-2.497517 52.560907,-2.497589 52.560937,-2.497794 52.561027,-2.498074 52.561161,-2.498513 52.561426,-2.49877 52.561577,-2.498981 52.561683,-2.499414 52.561923,-2.499551 52.562023,-2.499692 52.562176,-2.499774 52.562338,-2.499914 52.56263,-2.50008 52.562958,-2.500308 52.563461,-2.500415 52.563697)", + "LINESTRING(-2.600202 52.588818,-2.599984 52.588964,-2.599881 52.58905,-2.599775 52.589104,-2.599548 52.589215,-2.599542 52.589219,-2.599052 52.589451,-2.59847 52.589744,-2.598061 52.589933,-2.597517 52.59018,-2.597069 52.590412,-2.596399 52.590737,-2.596005 52.590942,-2.595702 52.591172,-2.595278 52.591479,-2.594971 52.591716,-2.594324 52.592189,-2.594038 52.592401,-2.593483 52.592668,-2.592961 52.592903,-2.592742 52.593009,-2.59245 52.593148,-2.592205 52.593362,-2.591903 52.593647,-2.591599 52.593929,-2.591221 52.594265,-2.590853 52.594544,-2.590349 52.594841,-2.589792 52.595132,-2.589358 52.595346,-2.588695 52.595666,-2.58789 52.596063,-2.587503 52.596248,-2.587206 52.59639,-2.586929 52.596499,-2.58639 52.596768,-2.585825 52.597044,-2.585507 52.597212,-2.585136 52.597431,-2.584636 52.597744,-2.584113 52.598065,-2.583643 52.598353,-2.583338 52.598545,-2.58302 52.598717,-2.582686 52.5989,-2.582504 52.598987,-2.582322 52.599055,-2.582214 52.599083,-2.581887 52.599137,-2.581618 52.599174,-2.581605 52.599185,-2.5816 52.59919,-2.581574 52.599213,-2.581574 52.599231)", + "LINESTRING(-2.478365 52.517265,-2.478477 52.517347,-2.478512 52.517372,-2.478895 52.517586,-2.4791 52.517735,-2.479305 52.517896,-2.479507 52.518064,-2.479846 52.518332,-2.480108 52.518545,-2.480699 52.51908,-2.480877 52.519241,-2.480944 52.519297,-2.480997 52.519358,-2.481038 52.519415,-2.48116 52.519651,-2.481163 52.519657,-2.481165 52.519662,-2.4812 52.519808,-2.481269 52.520139,-2.481295 52.520381,-2.481283 52.520579,-2.481261 52.520732,-2.481316 52.520904,-2.481459 52.521127,-2.481552 52.521267,-2.481731 52.521449,-2.481895 52.521618,-2.482215 52.521987,-2.482547 52.522309,-2.483038 52.522747,-2.483544 52.523186,-2.483841 52.523382,-2.484123 52.523534,-2.484448 52.523677,-2.484641 52.523748,-2.485042 52.52389,-2.485233 52.523952,-2.485345 52.523986,-2.485602 52.524068,-2.485927 52.524147,-2.486091 52.524175,-2.486336 52.524205,-2.486547 52.524225,-2.486651 52.524234,-2.486702 52.524243,-2.4868 52.52426,-2.486931 52.524296,-2.487035 52.52434,-2.487168 52.524412,-2.487242 52.524453,-2.487376 52.524546,-2.487449 52.524597,-2.48753 52.524681,-2.4876 52.524761,-2.487704 52.524868,-2.487764 52.524922,-2.487824 52.524976,-2.487943 52.525119,-2.488078 52.525352,-2.488187 52.525735,-2.488216 52.525855,-2.488278 52.526115,-2.488305 52.526239,-2.488385 52.526429,-2.488431 52.5266,-2.488462 52.526735,-2.488512 52.527283,-2.488513 52.527346,-2.488528 52.527418,-2.488559 52.527481,-2.488614 52.527547,-2.488721 52.52762,-2.488857 52.52769,-2.489649 52.528116,-2.490231 52.528454,-2.490491 52.528575,-2.490601 52.528632,-2.490729 52.528709,-2.490812 52.528777,-2.490994 52.528932,-2.491131 52.529129,-2.491132 52.529212,-2.49112 52.529238,-2.491085 52.529304)", + "LINESTRING(-2.399788 52.170841,-2.39976 52.170875,-2.399673 52.170957,-2.399615 52.170993,-2.399542 52.171029,-2.399324 52.171111,-2.399207 52.171147,-2.39909 52.171183,-2.398828 52.171238,-2.398687 52.171248,-2.398571 52.171249,-2.398435 52.17124,-2.398415 52.171239,-2.39838 52.171242,-2.398299 52.17125,-2.398201 52.171264,-2.398103 52.171311)", + "LINESTRING(-2.39886 52.194121,-2.398902 52.194016,-2.39878 52.19367,-2.398754 52.193547,-2.398799 52.193432,-2.398894 52.193346,-2.398981 52.193289,-2.399046 52.193265,-2.399249 52.193196,-2.399485 52.193106,-2.399774 52.192991,-2.400075 52.192865,-2.400318 52.192747,-2.40067 52.192582,-2.400878 52.192503,-2.401028 52.192446,-2.40112 52.192388,-2.4012 52.192317,-2.401209 52.192289,-2.40121 52.19225,-2.401165 52.192124,-2.40115 52.192061,-2.401261 52.191423,-2.401298 52.191298,-2.4014 52.19114,-2.401526 52.190955,-2.401612 52.190805,-2.401674 52.190626,-2.401736 52.190451,-2.401787 52.190325,-2.401832 52.190182,-2.401888 52.189919)", + "LINESTRING(-2.420562 52.189747,-2.420649 52.189755,-2.420904 52.189748,-2.421703 52.189726,-2.421869 52.189701,-2.422065 52.189651,-2.422175 52.18964,-2.422326 52.189643,-2.422433 52.18966,-2.422603 52.189707,-2.422789 52.189736,-2.423127 52.189773,-2.423211 52.189771,-2.423304 52.189737,-2.423401 52.189718,-2.423611 52.189748,-2.423773 52.189749,-2.424169 52.189666,-2.424832 52.189523,-2.424895 52.189492,-2.425031 52.189393,-2.42513 52.189322,-2.425258 52.189185)", + "LINESTRING(-2.431553 52.211334,-2.431826 52.211228,-2.432062 52.211176,-2.432725 52.21103,-2.432992 52.210966,-2.433262 52.21089,-2.433621 52.210751,-2.433836 52.210616,-2.434025 52.210455,-2.434143 52.210242,-2.434182 52.210042,-2.434238 52.209873,-2.434312 52.209601,-2.43435 52.209277,-2.434391 52.209007,-2.434394 52.208868)", + "LINESTRING(-2.411074 52.184883,-2.410958 52.184882,-2.410934 52.18488,-2.41067 52.184841,-2.410351 52.184785,-2.410136 52.184761,-2.409997 52.18475,-2.409754 52.184755,-2.409291 52.184788,-2.409123 52.1848,-2.40881 52.184786,-2.408474 52.184759,-2.408347 52.184763,-2.407924 52.184807,-2.407374 52.184865,-2.407051 52.184899,-2.406995 52.184894,-2.406965 52.184885,-2.406892 52.184858,-2.406686 52.184751,-2.406636 52.18473,-2.406583 52.184715,-2.406525 52.184707,-2.405576 52.184658,-2.405101 52.184641,-2.404782 52.184628,-2.404481 52.184626,-2.404104 52.184627,-2.403745 52.184639,-2.403416 52.184676,-2.402704 52.184781)", + "LINESTRING(-2.411444 52.156441,-2.411417 52.156354,-2.411373 52.156202,-2.411266 52.155878,-2.41114 52.155478,-2.411087 52.155324,-2.41101 52.1551,-2.410884 52.154704,-2.410759 52.154315,-2.41071 52.154107,-2.410674 52.154034,-2.41064 52.153965,-2.410614 52.153891,-2.410553 52.153752,-2.410141 52.153263,-2.40989 52.152986,-2.409609 52.152708,-2.40916 52.152261,-2.409114 52.152257,-2.408964 52.152286,-2.408323 52.152406,-2.408029 52.152462,-2.40781 52.15248,-2.407722 52.152481,-2.40743 52.152473,-2.407093 52.152429,-2.406984 52.152418,-2.406773 52.152362,-2.406536 52.152334,-2.406269 52.152317,-2.406083 52.152324)", + "LINESTRING(-2.309246 52.321985,-2.30921 52.322046,-2.309069 52.322272,-2.309024 52.322327,-2.30898 52.322338,-2.30896 52.322343,-2.30885 52.322344,-2.308767 52.322364,-2.308753 52.322369)", + "LINESTRING(-2.317414 52.305071,-2.317354 52.305041,-2.317212 52.30497,-2.317056 52.304907,-2.316933 52.304856,-2.316823 52.304778)", + "LINESTRING(-2.31162 52.298537,-2.31168 52.298317,-2.311681 52.298306,-2.311717 52.298032,-2.311803 52.297506,-2.311828 52.297403,-2.311885 52.29728,-2.311899 52.297265,-2.311943 52.297213,-2.312097 52.297157,-2.312239 52.297129,-2.312491 52.297101,-2.3128 52.29706,-2.312944 52.297037,-2.313045 52.29702,-2.313186 52.29698,-2.313245 52.296964,-2.313407 52.296912,-2.313418 52.296908,-2.313451 52.296896,-2.313624 52.296829,-2.313666 52.296809,-2.313875 52.296709,-2.314267 52.296499,-2.314505 52.296391,-2.314865 52.29626,-2.315593 52.295989,-2.316099 52.295795,-2.317154 52.295436,-2.317332 52.295378,-2.318137 52.295173,-2.318314 52.29513,-2.319226 52.294921,-2.319938 52.294753,-2.320333 52.29466,-2.320446 52.294633,-2.320696 52.294577,-2.32076 52.294519,-2.32084 52.29447,-2.320946 52.294376,-2.321001 52.294344,-2.321105 52.294315,-2.321169 52.294298,-2.321239 52.294287,-2.321331 52.294279,-2.321476 52.29428,-2.322073 52.294296,-2.322789 52.294317,-2.322742 52.294467,-2.322676 52.294735,-2.322625 52.294996,-2.322596 52.295041,-2.322529 52.295078,-2.322365 52.295129,-2.322313 52.295156,-2.322284 52.295221,-2.322259 52.29536,-2.322265 52.295417)", + "LINESTRING(-2.303381 52.282977,-2.303361 52.28292,-2.303334 52.282843,-2.303301 52.282764,-2.303278 52.282705,-2.303027 52.282448,-2.302958 52.282307,-2.302958 52.282251,-2.302958 52.282236)", + "LINESTRING(-2.330317 52.266892,-2.330322 52.266946,-2.330326 52.266989,-2.330319 52.267158,-2.330317 52.267329,-2.330291 52.267437,-2.330195 52.267845)", + "LINESTRING(-2.325552 52.324293,-2.325676 52.32429,-2.325721 52.324308,-2.325775 52.32433,-2.325834 52.324354,-2.326184 52.324634,-2.326472 52.324866,-2.32673 52.325073,-2.326893 52.325203,-2.327011 52.325296,-2.327231 52.325463)", + "LINESTRING(-2.394535 52.321592,-2.394659 52.321506,-2.394904 52.321359,-2.395022 52.321287,-2.395179 52.321211,-2.39532 52.321134,-2.395429 52.321062,-2.39552 52.320986,-2.395648 52.32088,-2.395753 52.320779,-2.395813 52.320708,-2.395856 52.320643,-2.395939 52.3205,-2.396028 52.320348,-2.396095 52.320239,-2.396155 52.320159,-2.396269 52.320018,-2.39646 52.319815,-2.396568 52.319689,-2.396723 52.319489,-2.396904 52.319268,-2.397038 52.31913,-2.397126 52.319043,-2.397219 52.318972,-2.397266 52.318946,-2.397317 52.318896,-2.397368 52.318846,-2.397393 52.318803,-2.397433 52.318728,-2.397467 52.318668,-2.397516 52.318602,-2.39758 52.318536,-2.397689 52.318435,-2.397794 52.318348,-2.397905 52.318255,-2.398077 52.318125,-2.398168 52.31805,-2.398217 52.317987,-2.39824 52.317925,-2.398252 52.317882,-2.398254 52.317838)", + "LINESTRING(-2.378569 52.312133,-2.37857 52.312127,-2.378321 52.311753,-2.3781 52.311421)", + "LINESTRING(-2.367521 52.286345,-2.367594 52.286291,-2.367984 52.286161,-2.368477 52.286025,-2.368881 52.285927,-2.36908 52.285878,-2.369367 52.285843,-2.369432 52.285834,-2.369552 52.285818,-2.369669 52.285802,-2.369818 52.285757,-2.369894 52.285715,-2.370197 52.285531,-2.370559 52.285294,-2.37092 52.285059,-2.372029 52.284362,-2.372119 52.284306,-2.372218 52.284251,-2.37247 52.284157,-2.372648 52.284069,-2.372718 52.284018,-2.372749 52.283955,-2.372772 52.283858,-2.372733 52.283773,-2.372691 52.283642,-2.372643 52.283484,-2.372621 52.283362,-2.372615 52.283303,-2.372626 52.283207,-2.372652 52.283134,-2.372753 52.282962,-2.372846 52.282879,-2.37293 52.282811,-2.373244 52.282583,-2.37328 52.282551,-2.373543 52.282366,-2.373753 52.282222,-2.374052 52.282024,-2.374299 52.281847,-2.374437 52.281744,-2.374638 52.281589,-2.374835 52.281434,-2.37505 52.281274,-2.37517 52.281179,-2.375292 52.281104,-2.375429 52.281011,-2.375717 52.280825,-2.37583 52.280752,-2.375883 52.280713,-2.375901 52.280687,-2.375908 52.280641,-2.375943 52.280465,-2.375969 52.280312,-2.375983 52.28013,-2.375997 52.280043,-2.376011 52.279916,-2.376028 52.279736,-2.376029 52.279554,-2.376028 52.279374,-2.376055 52.27919,-2.376091 52.279008,-2.37611 52.278827,-2.376143 52.278646,-2.376142 52.278524,-2.376117 52.278402,-2.376085 52.278261,-2.376002 52.278084,-2.375937 52.277952,-2.375879 52.277791,-2.375869 52.277657)", + "LINESTRING(-2.356828 52.29325,-2.35674 52.292996,-2.356687 52.292818,-2.356655 52.292763,-2.356609 52.292711,-2.356551 52.292684,-2.35648 52.29268,-2.356456 52.292684,-2.356274 52.292712,-2.356212 52.292719,-2.356141 52.292727,-2.356016 52.292741,-2.355927 52.292741,-2.355848 52.292741,-2.355743 52.292732,-2.355719 52.29273,-2.355703 52.292726,-2.355544 52.292691,-2.355469 52.292682,-2.355305 52.292664,-2.355283 52.292661,-2.355196 52.292648,-2.355177 52.29265,-2.355073 52.292657,-2.354956 52.292666,-2.35483 52.292723,-2.354682 52.292809,-2.354512 52.29291,-2.354314 52.292985,-2.35412 52.293026,-2.354027 52.293038)", + "LINESTRING(-2.439742 52.273662,-2.439487 52.27359,-2.439344 52.273597,-2.439059 52.273611,-2.43898 52.273595,-2.43881 52.273451)", + "LINESTRING(-2.386295 52.272591,-2.386277 52.272551,-2.386273 52.272507,-2.386273 52.272447,-2.386275 52.272432,-2.386278 52.272384,-2.386279 52.272367,-2.386284 52.272356,-2.386302 52.272316,-2.386322 52.272286,-2.38633 52.272274,-2.386347 52.272262,-2.386366 52.27225,-2.386368 52.272248,-2.386451 52.272216,-2.386781 52.272128,-2.386868 52.272101,-2.386905 52.272065,-2.386904 52.272017,-2.386883 52.271978,-2.386829 52.271926,-2.386761 52.271888,-2.386644 52.271853,-2.386502 52.27183,-2.386391 52.271819,-2.386275 52.271812,-2.386211 52.271794,-2.386207 52.27179,-2.386187 52.271768,-2.386193 52.271714,-2.386224 52.271702,-2.386245 52.271693,-2.386256 52.271689,-2.386336 52.271687,-2.386393 52.271685,-2.386579 52.27167,-2.386619 52.271665,-2.386721 52.271652,-2.386799 52.271643,-2.386816 52.271638,-2.386953 52.271599,-2.387064 52.271552,-2.38708 52.271546,-2.387114 52.271521,-2.387193 52.271465,-2.387434 52.271266,-2.387709 52.271054,-2.387859 52.270946,-2.388003 52.270832,-2.388051 52.270783,-2.388095 52.270737,-2.388136 52.270666,-2.388156 52.27053,-2.388171 52.27044,-2.388222 52.270343,-2.38829 52.270248,-2.388348 52.270213,-2.388433 52.270189,-2.388543 52.270166,-2.388775 52.270123,-2.388964 52.270083,-2.389059 52.270051,-2.38919 52.270002,-2.389295 52.269948,-2.389399 52.269881,-2.389458 52.269828,-2.389488 52.269756,-2.389557 52.269482,-2.389596 52.269274,-2.389609 52.269022,-2.389622 52.268896,-2.389692 52.268518,-2.389749 52.268374,-2.389778 52.268329,-2.389863 52.268272,-2.390046 52.268158,-2.390356 52.267968,-2.390702 52.26776,-2.390886 52.267669,-2.390974 52.267633,-2.391061 52.267605,-2.39112 52.267596,-2.391247 52.267581,-2.39153 52.267568,-2.391603 52.267559,-2.391706 52.267517,-2.391771 52.267474,-2.391774 52.267472,-2.391775 52.267471,-2.391863 52.267381,-2.391962 52.267263,-2.392009 52.267172,-2.39204 52.267074,-2.39206 52.266964,-2.392102 52.266757,-2.392115 52.266694,-2.392193 52.266545,-2.392282 52.266434,-2.39236 52.266357,-2.39245 52.266303,-2.392565 52.266261,-2.392723 52.266231,-2.392901 52.266206,-2.393029 52.266188,-2.393073 52.266175,-2.39316 52.266149,-2.393313 52.26609,-2.393392 52.266044,-2.393453 52.266005,-2.393627 52.265865,-2.393811 52.265725,-2.393847 52.265679,-2.393852 52.265637,-2.393825 52.265578,-2.393745 52.265507,-2.393448 52.265288,-2.393385 52.265244,-2.393161 52.265087,-2.393002 52.264965,-2.392901 52.264891)", + "LINESTRING(-2.413413 52.258694,-2.413538 52.259264,-2.41355 52.259313,-2.413676 52.259883,-2.413779 52.260331,-2.413839 52.260595,-2.413895 52.260804,-2.413933 52.261004,-2.413968 52.261134,-2.414015 52.261357,-2.41411 52.26167,-2.414162 52.261798,-2.414221 52.261889,-2.414317 52.261954,-2.414454 52.261996,-2.414872 52.262069,-2.415052 52.26213,-2.415116 52.262207,-2.415148 52.262318,-2.415124 52.262503,-2.415013 52.262875,-2.414913 52.263165,-2.414805 52.263391,-2.414465 52.263742,-2.414041 52.264168,-2.413843 52.264367,-2.413608 52.264517,-2.413418 52.264593,-2.41315 52.264649,-2.412802 52.264738,-2.412492 52.264842,-2.412056 52.265013,-2.411777 52.265105,-2.41154 52.265151,-2.411298 52.265155,-2.411154 52.265137,-2.410854 52.2651,-2.410463 52.265056)", + "LINESTRING(-2.422179 52.250591,-2.422229 52.25056,-2.422258 52.250542,-2.422404 52.250506,-2.422448 52.250479,-2.422506 52.250406,-2.422598 52.25024)", + "LINESTRING(-2.304096 52.38383,-2.304311 52.383709,-2.304375 52.383673,-2.304741 52.383474)", + "LINESTRING(-2.311777 52.355598,-2.311908 52.355533,-2.312027 52.355479,-2.311996 52.355417,-2.311862 52.355242,-2.311751 52.355094,-2.311715 52.35494,-2.311647 52.354695,-2.311602 52.354528,-2.311601 52.354461,-2.3116 52.354326,-2.311555 52.35417,-2.311489 52.354145,-2.311335 52.354178,-2.311181 52.354211,-2.31102 52.354269,-2.310948 52.354295,-2.310895 52.354314,-2.310667 52.354401)", + "LINESTRING(-2.310861 52.374127,-2.310797 52.374063,-2.310739 52.374022,-2.310657 52.373964,-2.310579 52.373921)", + "LINESTRING(-2.331681 52.351268,-2.331968 52.351174,-2.332394 52.351032,-2.332727 52.350926,-2.333121 52.3508,-2.333336 52.350697,-2.333535 52.350572,-2.333728 52.350421,-2.33399 52.350216,-2.334129 52.350094,-2.334252 52.349977,-2.334333 52.349867,-2.334419 52.349752,-2.334485 52.349592,-2.334495 52.349413,-2.334456 52.349228,-2.334372 52.348983,-2.334323 52.348821,-2.334316 52.348799)", + "LINESTRING(-2.328113 52.34744,-2.328381 52.347429,-2.328637 52.347401,-2.328936 52.347357,-2.329147 52.347329,-2.32934 52.347286,-2.32945 52.347264,-2.329714 52.347204,-2.329903 52.347157,-2.330088 52.347111,-2.330303 52.347075,-2.330413 52.347035,-2.330616 52.346951)", + "LINESTRING(-2.377692 52.403371,-2.377783 52.403294,-2.377821 52.403256,-2.377923 52.40318,-2.378179 52.402998,-2.378403 52.402832,-2.37892 52.402432,-2.379181 52.40224,-2.379405 52.402124,-2.379934 52.40181,-2.38016 52.401672,-2.380332 52.401507,-2.380498 52.401279,-2.380777 52.400857,-2.380868 52.400761,-2.38108 52.400531,-2.381152 52.400413,-2.381184 52.400297,-2.381217 52.400057,-2.381256 52.399866,-2.381298 52.399733,-2.381373 52.39961,-2.381469 52.399356,-2.381489 52.399177,-2.381495 52.398913,-2.381469 52.398764,-2.381359 52.398634,-2.381155 52.398507,-2.381016 52.398461,-2.380878 52.398423,-2.38062 52.398386,-2.380386 52.398338,-2.380169 52.398274,-2.380085 52.398228,-2.379902 52.398126,-2.379793 52.398048,-2.379716 52.397953,-2.379691 52.397856,-2.379723 52.397749,-2.379781 52.397586,-2.379801 52.39745,-2.379787 52.397334,-2.379669 52.397187,-2.379388 52.396965,-2.37896 52.39669,-2.378453 52.396307,-2.378046 52.395955,-2.377357 52.395277,-2.377302 52.395176,-2.3772 52.394948,-2.377105 52.394613,-2.376996 52.394229,-2.376749 52.393658,-2.376667 52.393464,-2.37645 52.392901,-2.37639 52.392785,-2.375713 52.391955,-2.375234 52.391356,-2.375004 52.391043,-2.374907 52.390855,-2.374914 52.390767,-2.374988 52.390534,-2.375028 52.390408,-2.375047 52.390376,-2.375212 52.390101,-2.375258 52.389951,-2.375276 52.389892,-2.375314 52.389655,-2.375315 52.389636,-2.375321 52.389509,-2.375321 52.389505,-2.375438 52.389241,-2.375754 52.388654,-2.375912 52.388359,-2.375976 52.388178,-2.37602 52.388052,-2.375996 52.387924,-2.375716 52.387478,-2.375151 52.386671,-2.374893 52.386348,-2.374724 52.386148,-2.374601 52.38596,-2.374589 52.385941,-2.374556 52.385827,-2.374571 52.385719,-2.374616 52.385639,-2.374694 52.385554,-2.374796 52.385442,-2.374826 52.38541,-2.375082 52.385237,-2.375492 52.385069,-2.375811 52.384952,-2.376154 52.384779,-2.376547 52.384534,-2.376794 52.384354,-2.377111 52.384089,-2.377263 52.38397,-2.377377 52.38388,-2.377532 52.383758,-2.377707 52.383613)", + "LINESTRING(-2.41285 52.381728,-2.41263 52.381673,-2.412534 52.38165,-2.412416 52.381631,-2.412314 52.381609,-2.412146 52.381574,-2.41204 52.381558,-2.411958 52.381553,-2.411908 52.381559,-2.411769 52.381592,-2.411629 52.38164,-2.411416 52.381728,-2.41137 52.381751,-2.411362 52.381755)", + "LINESTRING(-2.32153 52.435879,-2.321434 52.435843,-2.321169 52.435748,-2.321029 52.435692,-2.320891 52.435624,-2.320814 52.435544,-2.320789 52.435454,-2.320686 52.43505,-2.320678 52.435016,-2.320697 52.434978,-2.3207 52.434977,-2.320741 52.434964,-2.320807 52.434964,-2.320847 52.434986,-2.320903 52.435022,-2.32098 52.435044,-2.32112 52.435084,-2.321164 52.435095,-2.321305 52.435128,-2.321308 52.435129,-2.321397 52.435165,-2.321537 52.435254,-2.321663 52.435362,-2.321808 52.435503,-2.321811 52.435518,-2.321824 52.43558,-2.321813 52.435716,-2.321777 52.435796,-2.321718 52.435883,-2.321666 52.43593)", + "LINESTRING(-2.307716 52.425456,-2.307818 52.425431,-2.307876 52.425407,-2.307913 52.425393,-2.307955 52.425381,-2.307993 52.425377,-2.308035 52.42538,-2.308086 52.425401,-2.308219 52.425445,-2.308331 52.425485,-2.308463 52.425511,-2.308596 52.425534,-2.308714 52.425547,-2.308825 52.425552,-2.309022 52.425546,-2.309125 52.425533,-2.309161 52.425522,-2.309213 52.425506,-2.309219 52.425501,-2.309245 52.425482,-2.309286 52.425452,-2.309447 52.425307,-2.309696 52.425131,-2.309799 52.425067,-2.310109 52.424883,-2.310276 52.424771,-2.310451 52.424658,-2.310519 52.424607,-2.310586 52.424531,-2.310665 52.42442,-2.310708 52.424391)", + "LINESTRING(-2.368821 52.479672,-2.368718 52.479668,-2.368563 52.479662,-2.368422 52.479647,-2.368321 52.479625,-2.368055 52.479535,-2.367906 52.479453,-2.367768 52.479353,-2.367678 52.479272)", + "LINESTRING(-2.356756 52.456904,-2.3567 52.456817,-2.356403 52.456452,-2.356335 52.456374,-2.356182 52.456224,-2.356001 52.456019,-2.355913 52.455933,-2.355897 52.455925,-2.355889 52.455921,-2.35586 52.455907,-2.355792 52.455906)", + "LINESTRING(-2.351301 52.457594,-2.351243 52.457599,-2.351081 52.457613,-2.350831 52.457667,-2.350523 52.457776,-2.350141 52.457939,-2.350024 52.458003)", + "LINESTRING(-2.351553 52.453669,-2.351661 52.453639,-2.351911 52.453547,-2.352488 52.453293,-2.352981 52.453076,-2.353348 52.452904,-2.353436 52.452854)", + "LINESTRING(-2.358583 52.43464,-2.358485 52.434675,-2.358283 52.434761,-2.358063 52.434905,-2.357924 52.434996,-2.357888 52.435043,-2.357871 52.435063,-2.357815 52.435066,-2.357731 52.435058,-2.357557 52.435069,-2.357033 52.435113,-2.356814 52.43513,-2.356696 52.435121,-2.356544 52.435094,-2.356379 52.435059,-2.356325 52.435055,-2.356269 52.435064,-2.355794 52.435249)", + "LINESTRING(-2.36948 52.442856,-2.369591 52.442905,-2.369678 52.442964,-2.369829 52.443057,-2.36992 52.443113,-2.370008 52.443155,-2.370101 52.443184,-2.37022 52.443212)", + "LINESTRING(-2.378203 52.420339,-2.377907 52.420588,-2.377812 52.420689,-2.377747 52.420784,-2.377636 52.420949,-2.377438 52.421253,-2.37723 52.421596,-2.377145 52.421741,-2.377032 52.421894,-2.37695 52.421998,-2.37685 52.422099,-2.376733 52.42218,-2.376585 52.422267,-2.376382 52.422369,-2.376173 52.422464,-2.376015 52.422525,-2.375777 52.422613,-2.375539 52.422702,-2.375192 52.422816,-2.374837 52.422933,-2.374674 52.422981,-2.374571 52.423022,-2.374448 52.423075,-2.374379 52.423108,-2.374324 52.423142,-2.374227 52.423211,-2.374132 52.42328,-2.37405 52.423355,-2.373964 52.423444,-2.373799 52.423653,-2.373586 52.423942,-2.373383 52.424274,-2.373231 52.424506,-2.373167 52.424614,-2.373126 52.424671,-2.373096 52.424694,-2.373001 52.424733,-2.372757 52.424811,-2.372453 52.42491,-2.372215 52.424983,-2.371593 52.425148,-2.371186 52.425256,-2.371087 52.425292,-2.370841 52.425377,-2.370665 52.425442,-2.370489 52.425505,-2.370155 52.425593,-2.369952 52.425637,-2.369691 52.425684,-2.369177 52.425766,-2.368982 52.425788,-2.368642 52.425837,-2.368614 52.425842,-2.368611 52.425842,-2.368609 52.425843,-2.368465 52.42587,-2.368347 52.425896,-2.368256 52.425948,-2.368198 52.425992,-2.368112 52.426089,-2.367959 52.42626,-2.367834 52.426413,-2.3677 52.426546,-2.367614 52.426657,-2.36759 52.426744,-2.367598 52.426837,-2.367632 52.426944,-2.367705 52.427086)", + "LINESTRING(-2.430145 52.497136,-2.429921 52.496968,-2.42984 52.49691,-2.429772 52.496859,-2.429759 52.496849,-2.429681 52.496802,-2.429674 52.496798,-2.429601 52.49676,-2.429592 52.496755,-2.429577 52.49675,-2.429452 52.496705,-2.429156 52.496622,-2.428936 52.496571,-2.428713 52.496519,-2.428662 52.496509,-2.42838 52.496451,-2.428278 52.49643,-2.427906 52.496362,-2.427796 52.496359,-2.427692 52.496374,-2.427614 52.496413,-2.427594 52.496423,-2.427497 52.496563,-2.427473 52.496604,-2.427424 52.496683,-2.427409 52.496697,-2.427333 52.496767,-2.427313 52.496788,-2.427262 52.496844,-2.427253 52.496852,-2.427253 52.496854,-2.42723 52.496909,-2.427251 52.496965,-2.42727 52.497014,-2.427279 52.497085,-2.427279 52.497097,-2.427274 52.497153,-2.427272 52.497192,-2.427256 52.497239,-2.427248 52.497264,-2.427249 52.497297,-2.427262 52.497316,-2.427274 52.497333,-2.427276 52.497335,-2.427375 52.497409,-2.427536 52.497534,-2.427549 52.497543,-2.427734 52.497685,-2.427863 52.497795,-2.427899 52.49783,-2.427971 52.497897,-2.428166 52.498061,-2.428402 52.498242,-2.428577 52.498372,-2.428759 52.498507,-2.428938 52.498655,-2.429307 52.498971,-2.42952 52.49917,-2.429637 52.499279,-2.429907 52.499533,-2.430107 52.499708,-2.43019 52.499779,-2.430309 52.499887,-2.430347 52.499938,-2.430354 52.499947,-2.430396 52.500005,-2.430403 52.500067,-2.430403 52.50013,-2.430396 52.500164,-2.430395 52.500168,-2.430384 52.500186,-2.430342 52.500254,-2.430222 52.500419,-2.430129 52.500571,-2.430049 52.500741)", + "LINESTRING(-2.384219 52.482371,-2.384296 52.482448,-2.384358 52.482546,-2.38439 52.482628,-2.384477 52.482964,-2.38456 52.48325,-2.384633 52.48332,-2.384683 52.483336,-2.385527 52.483375,-2.386516 52.483431,-2.386754 52.483455,-2.386904 52.483491,-2.386908 52.483492,-2.38696 52.48351,-2.387116 52.483564,-2.387205 52.483599,-2.387258 52.48362,-2.387266 52.483624,-2.387373 52.483676,-2.3874 52.483699,-2.387405 52.483732,-2.387404 52.483741,-2.387401 52.483772,-2.387188 52.484013,-2.387151 52.484063,-2.387135 52.484117,-2.387132 52.484128,-2.387132 52.484135,-2.387133 52.484219,-2.387128 52.484283,-2.387116 52.484454,-2.387105 52.484566,-2.387079 52.484639,-2.387041 52.484709,-2.386988 52.484814,-2.386922 52.484945,-2.386917 52.484955,-2.386797 52.485264,-2.386765 52.485391,-2.386753 52.485438,-2.386725 52.485502,-2.386614 52.485766,-2.386546 52.485953,-2.38654 52.485983)", + "LINESTRING(-2.409893 52.500854,-2.409695 52.500838,-2.409501 52.500821,-2.409485 52.500817,-2.40946 52.500811,-2.40945 52.500808,-2.409439 52.500768,-2.409456 52.500683,-2.409462 52.500587,-2.409477 52.500532,-2.409451 52.500492,-2.409392 52.500465,-2.409194 52.500421,-2.409173 52.500406,-2.409139 52.500381,-2.409116 52.500337,-2.409098 52.500304,-2.409093 52.500125,-2.40903 52.499999,-2.408956 52.49991,-2.408952 52.499905,-2.408935 52.499891,-2.408772 52.499757,-2.408677 52.499692,-2.408658 52.499679,-2.408632 52.499667,-2.408306 52.499518,-2.408293 52.499507,-2.408247 52.499467,-2.408236 52.499458,-2.408234 52.49945,-2.408202 52.499331,-2.408205 52.499195,-2.408133 52.498988,-2.408037 52.498857,-2.407772 52.49855,-2.407591 52.498335,-2.407348 52.498142,-2.407131 52.497985,-2.407067 52.497943,-2.406992 52.497894,-2.406829 52.497786,-2.406808 52.497772,-2.406522 52.497612,-2.406495 52.497602,-2.406233 52.497495,-2.406027 52.497414,-2.405534 52.497297,-2.405457 52.497278,-2.404824 52.497124,-2.403814 52.496815,-2.40333 52.496679,-2.403133 52.496635,-2.40265 52.496552,-2.401894 52.496427,-2.401568 52.496373,-2.400958 52.496297,-2.40045 52.496245,-2.400184 52.496219,-2.400092 52.496211,-2.400034 52.496193,-2.399953 52.496147,-2.39985 52.496033,-2.399776 52.495956)", + "LINESTRING(-2.358014 52.492146,-2.358028 52.492193,-2.358029 52.492234,-2.35786 52.492818,-2.357794 52.493046,-2.357747 52.493245,-2.357732 52.493321)", + "LINESTRING(-2.345449 52.467635,-2.345714 52.467635,-2.345802 52.467634,-2.345964 52.467634,-2.346156 52.467651,-2.346421 52.467677,-2.34648 52.467686,-2.346554 52.467713,-2.346687 52.467758,-2.34688 52.467846,-2.347019 52.467912,-2.347165 52.467976,-2.347251 52.468013,-2.347374 52.468089,-2.347533 52.468179,-2.347609 52.468222,-2.347754 52.468317,-2.347802 52.468356,-2.34787 52.468446,-2.347959 52.468599,-2.348004 52.468716,-2.348034 52.468787,-2.348168 52.46894,-2.348276 52.469186,-2.348332 52.469236)", + "LINESTRING(-2.304184 52.534293,-2.304229 52.534219,-2.304246 52.53395,-2.304293 52.533323,-2.304343 52.532656,-2.304409 52.531983,-2.304495 52.531339,-2.304623 52.53067,-2.304758 52.530145,-2.304946 52.529717,-2.304941 52.529607)", + "LINESTRING(-2.404084 52.529404,-2.404094 52.529399,-2.404103 52.529392,-2.40411 52.529384,-2.404115 52.529376,-2.404118 52.529367,-2.404119 52.529358,-2.404118 52.529349,-2.404115 52.529341,-2.40411 52.529332,-2.404102 52.529325,-2.404093 52.529318,-2.404082 52.529312,-2.40407 52.529307,-2.404057 52.529303,-2.404043 52.529301,-2.404029 52.529299,-2.404014 52.529299,-2.404 52.529301,-2.403986 52.529303,-2.403973 52.529307,-2.403961 52.529312,-2.40395 52.529318,-2.403941 52.529325,-2.403934 52.529333,-2.403929 52.529341,-2.403926 52.52935,-2.403925 52.529359,-2.403926 52.529368,-2.403929 52.529376,-2.403935 52.529385,-2.403942 52.529392,-2.403951 52.529399,-2.403962 52.529405,-2.403974 52.52941,-2.403987 52.529414,-2.404001 52.529416,-2.404015 52.529418,-2.40403 52.529418,-2.404044 52.529416,-2.404058 52.529414,-2.404071 52.52941,-2.404083 52.529405,-2.404084 52.529404)" + }; + + static double expectations[][4] = + { + { 3.41515232094025E-07, 3.42522426421965E-07, 6.83030293657794E-07, 6.87058957282716E-07}, + { 1.02802331980456E-07, 1.03813675877973E-07, 2.05604735015186E-07, 2.09650025340125E-07}, + { 3.56112451527224E-07, 3.57098969061553E-07, 7.12224860421884E-07, 7.16171342673988E-07}, + { 4.25305444196056E-08, 4.35412488286602E-08, 8.50612309477583E-08, 8.91039491079937E-08}, + { 3.69520876120077E-08, 3.79614419898644E-08, 7.39041894348702E-08, 7.79416069462968E-08}, + { 3.12580681338659E-08, 3.22376649819489E-08, 6.23702476332255E-08, 6.62886350255576E-08}, + { 2.64535032101776E-07, 2.65503302898651E-07, 5.29010577565714E-07, 5.32883049686461E-07}, + { 1.26452604831684E-07, 1.27462314480908E-07, 2.52905124398239E-07, 2.56944261423087E-07}, + { 5.62396706982327E-08, 5.7239461170866E-08, 1.12479426661594E-07, 1.16478773293238E-07}, + { 7.03945403301987E-07, 7.04847309407342E-07, 1.40789144609244E-06, 1.41149810417573E-06}, + { 2.05895901217446E-07, 2.06897283305807E-07, 4.11792029808566E-07, 4.15797074992952E-07}, + { 1.01571146160495E-07, 1.02582319527755E-07, 2.031423207427E-07, 2.07186729994646E-07}, + { 2.42559636376427E-07, 2.43568607061206E-07, 4.85119102222598E-07, 4.89155340233083E-07}, + { 3.41515232094025E-07, 3.42522426421965E-07, 6.83030293657794E-07, 6.87058957282716E-07}, + { 9.08697614931953E-08, 9.1881105390712E-08, 1.81739480353826E-07, 1.85784855943893E-07}, + { 6.0466163631645E-08, 6.14741111348849E-08, 1.20932355684999E-07, 1.24964373071634E-07}, + { 4.04659118657946E-07, 4.05667066161186E-07, 8.09318166261619E-07, 8.13350311545946E-07}, + { 4.80904560618001E-07, 4.81905772176106E-07, 9.61808808597198E-07, 9.65813697462181E-07}, + { 3.57066625156222E-08, 3.67177221960446E-08, 7.14132681878255E-08, 7.54576063854984E-08}, + { 2.44433664420285E-08, 2.54509160413363E-08, 4.88867044623476E-08, 5.29170023355618E-08}, + { 3.61392153536144E-07, 3.62384142249539E-07, 7.22784136542032E-07, 7.26752162449884E-07}, + { 7.03945403301987E-07, 7.04847309407342E-07, 1.40789144609244E-06, 1.41149810417573E-06}, + { 7.91276917766481E-07, 7.91866199278957E-07, 1.58255338078561E-06, 1.58491059210064E-06}, + { 2.80934472129957E-07, 2.81945006008755E-07, 5.61869072157606E-07, 5.65911307148781E-07}, + { 3.5339049020422E-07, 3.54394444457284E-07, 7.06780582504507E-07, 7.10797138481212E-07}, + { 2.44327040377357E-07, 2.4533331099974E-07, 4.88653867591893E-07, 4.9267929114194E-07}, + { 2.6145809783884E-07, 2.62465945866097E-07, 5.22915939882296E-07, 5.26947090406793E-07}, + { 2.21305654690696E-07, 2.22233921931547E-07, 4.42615530005241E-07, 4.46329210035401E-07}, + { 7.88202072499189E-08, 7.98287089764926E-08, 1.5764054239753E-07, 1.61674222454167E-07}, + { 4.08582224054044E-07, 4.09593170047629E-07, 8.17164746536037E-07, 8.21208203660717E-07}, + { 2.61692591152496E-07, 2.62703764519756E-07, 5.23385125461573E-07, 5.27429577346084E-07}, + { 2.01361032736713E-07, 2.0236487330294E-07, 4.02722207581974E-07, 4.06737527214318E-07}, + { 6.18118889406105E-08, 6.28143510539303E-08, 1.23623692616093E-07, 1.27633413171679E-07}, + { 5.01939382502314E-07, 5.02932437029813E-07, 1.00387870816121E-06, 1.00785118206659E-06}, + { 6.52623768360172E-07, 6.53615401802199E-07, 1.30525545216642E-06, 1.30922269647726E-06}, + { 3.24414514807359E-07, 3.25418923807774E-07, 6.48829413307794E-07, 6.52846509296978E-07}, + { 1.65468009072356E-07, 1.66476610274913E-07, 3.30936202885823E-07, 3.34970451376648E-07}, + { 5.23240828442795E-09, 6.24356744083343E-09, 1.04648165688559E-08, 1.45333485717657E-08}, + { 3.62318644420156E-07, 3.63320253882193E-07, 7.24637303051168E-07, 7.28643442471366E-07}, + { 5.94340193060816E-07, 5.95350627463631E-07, 1.18868054244103E-06, 1.19272210952204E-06}, + { 7.32884174681203E-07, 7.33866755808776E-07, 1.46576839199497E-06, 1.46969848913159E-06}, + { 3.02247087802243E-07, 3.0325044519941E-07, 6.04493862965683E-07, 6.08507960464522E-07}, + { 3.23513106081919E-07, 3.24517259286949E-07, 6.47026212163837E-07, 6.51042981303362E-07}, + { 2.82636392512359E-07, 2.83643203147221E-07, 5.65272713970444E-07, 5.6930015546186E-07}, + { 5.57109984811177E-08, 5.67222713243609E-08, 1.11422096438218E-07, 1.15467202022046E-07}, + { 1.69497056390355E-07, 1.70405499488879E-07, 3.38994169624129E-07, 3.42627942018225E-07}, + { 4.37937046626757E-08, 4.4801083731727E-08, 8.75873382710779E-08, 9.16166129627527E-08}, + { 3.69329029581422E-08, 3.79310165499192E-08, 7.38645837827789E-08, 7.78570665715961E-08}, + { 5.61418005418091E-08, 5.71532154935994E-08, 1.12283629505328E-07, 1.16328905619412E-07}, + { 2.30063292860905E-07, 2.31069662959271E-07, 4.60126457824117E-07, 4.64152151380404E-07}, + { 1.53257730062251E-07, 1.54239160110592E-07, 3.06515318015954E-07, 3.10441222950431E-07}, + { 7.43983150641725E-08, 7.54085220933121E-08, 1.4879661591749E-07, 1.52837202449518E-07}, + { 3.73331090486317E-08, 3.83436145057203E-08, 7.46662180972635E-08, 7.87081404496348E-08}, + { 1.35055771011139E-07, 1.36057437316595E-07, 2.70111300437748E-07, 2.74118391985212E-07}, + { 1.49921490333327E-07, 1.50926723563316E-07, 2.99842824347252E-07, 3.03863657791226E-07}, + { 5.4672608484907E-07, 5.47715472976051E-07, 1.09345225496327E-06, 1.09740931009128E-06}, + { 6.82862975054377E-08, 6.92914738920081E-08, 1.3657287922797E-07, 1.40593087394336E-07}, + { 2.99415603421949E-08, 3.09528473962928E-08, 5.9883106473535E-08, 6.39284820636021E-08}, + { 1.15991221605327E-06, 1.16091044333189E-06, 2.31982436105227E-06, 2.32381808018545E-06}, + { 5.37620522322868E-07, 5.38598712296334E-07, 1.07524111570001E-06, 1.07915387559387E-06}, + { 2.19138769352867E-08, 2.29165522114272E-08, 4.38277680814281E-08, 4.78386539271014E-08}, + { 2.25320761160219E-07, 2.26330556074572E-07, 4.50641536531293E-07, 4.54680815664688E-07}, + { 1.01003628572016E-06, 1.01100829397183E-06, 2.02007224459066E-06, 2.02395995074767E-06}, + { 4.75155772505786E-07, 4.76152848705169E-07, 9.50311530800718E-07, 9.5429980717654E-07}, + { 1.65787653827465E-07, 1.66797761380622E-07, 3.31575222389802E-07, 3.35615951030377E-07}, + { 2.30222070740638E-07, 2.31232661462855E-07, 4.60444127270421E-07, 4.64487072804332E-07}, + { 7.98883817765272E-07, 7.99890472080733E-07, 1.59776760710884E-06, 1.60179418173811E-06}, + { 1.04933420175257E-07, 1.05940515027214E-07, 2.0986679771795E-07, 2.13895532397146E-07}, + { 1.77967848458138E-06, 1.78066323996973E-06, 3.55935688389764E-06, 3.56329583439674E-06}, + { 4.1623603408425E-07, 4.17224313764564E-07, 8.3247203974679E-07, 8.36425286365738E-07}, + { 9.68960307545785E-08, 9.78908332172068E-08, 1.93792118352576E-07, 1.97771228727106E-07}, + { 2.7254995416115E-07, 2.73529721539489E-07, 5.45099553050932E-07, 5.49018324136341E-07}, + { 4.01288005491551E-07, 4.02259715315267E-07, 8.02576039404812E-07, 8.06462495006599E-07}, + { 1.35055771011139E-07, 1.36057437316595E-07, 2.70111300437748E-07, 2.74118391985212E-07}, + { 4.29554916081543E-08, 4.39544862729235E-08, 8.59111395357104E-08, 8.99071466164969E-08}, + { 1.76189836054164E-06, 1.76286511077706E-06, 3.52380727974833E-06, 3.52767503386531E-06}, + { 1.41602981784672E-07, 1.42607618158763E-07, 2.83206148310455E-07, 2.87224651174256E-07}, + { 1.15380575493873E-06, 1.15479357987169E-06, 0.000002307610870389, 2.31156330698923E-06}, + { 1.41356807148441E-07, 1.42356668675347E-07, 2.82713486399189E-07, 2.86713202513056E-07}, + { 6.45327844495114E-08, 6.55440999253187E-08, 1.29065526266459E-07, 1.33110816591397E-07}, + { 6.86342787048488E-08, 6.96456083915109E-08, 1.37268628463971E-07, 1.41313861945491E-07}, + { 1.83265086661777E-07, 1.84274682624164E-07, 3.66530358064665E-07, 3.70568429275409E-07}, + { 1.43990902756741E-07, 1.44994970696644E-07, 2.87981706037499E-07, 2.91998276225058E-07}, + { 1.02871865692578E-07, 1.03880751112229E-07, 2.05743802439429E-07, 2.09779301485469E-07}, + { 1.36728246502571E-07, 1.37673012545747E-07, 2.7345657827027E-07, 2.77235542966991E-07}, + { 3.10800132297118E-07, 3.11808250330614E-07, 6.21600349859364E-07, 6.25632381456853E-07}, + { 1.32283005882528E-07, 1.33261437440524E-07, 2.64565414909157E-07, 2.68479169562852E-07}, + { 3.33188367562798E-07, 3.34195561890738E-07, 6.66376735125596E-07, 6.70405427172227E-07}, + { 1.90134230138028E-07, 1.91139307048616E-07, 3.80268787125715E-07, 3.8428883897268E-07}, + { 3.02247087802243E-07, 3.0325044519941E-07, 6.04493862965683E-07, 6.08507960464522E-07}, + { 6.45327844495114E-08, 6.55440999253187E-08, 1.29065526266459E-07, 1.33110816591397E-07}, + { 4.02965838475211E-08, 4.13054976888816E-08, 8.05931534841875E-08, 8.46289225364671E-08}, + { 5.11229515609557E-07, 5.12224545445861E-07, 1.02245836330894E-06, 1.02643905108835E-06}, + { 1.18189390718726E-07, 1.19196172931879E-07, 2.36378838280871E-07, 2.40405839235791E-07}, + { 3.81603527443986E-07, 3.82614828708938E-07, 7.63207339105065E-07, 7.67251918887268E-07}, + { 3.34147500780091E-08, 3.43787576184695E-08, 6.67881465687969E-08, 7.06435514530313E-08}, + { 3.4107115709503E-07, 3.42081634130409E-07, 6.82142385244333E-07, 6.86184307596704E-07}, + { 1.58899425173331E-07, 1.59907060037767E-07, 3.17798821924953E-07, 3.21829773497484E-07}, + { 5.36395234007614E-07, 5.37394143407255E-07, 1.07279079486489E-06, 1.07678548033618E-06}, + { 3.9406657492691E-07, 3.95064475355866E-07, 7.88133220908094E-07, 7.92124779991354E-07}, + { 2.77072558674263E-07, 2.78073869708351E-07, 5.54145316300492E-07, 5.58150745177954E-07}, + { 3.93172285839682E-07, 3.94176680629243E-07, 7.8634455746851E-07, 7.90362207681028E-07}, + { 2.85718613213248E-07, 2.86716215214256E-07, 5.71436899576838E-07, 5.75428146021295E-07}, + { 1.26677917933193E-07, 1.27688309703444E-07, 2.5335566533613E-07, 2.57397502423373E-07}, + { 8.70625598281549E-08, 8.80735200325944E-08, 1.74125048602036E-07, 1.7816884678723E-07}, + { 9.37471753559294E-08, 9.47451752608686E-08, 1.87494393344423E-07, 1.91486549283582E-07}, + { 3.30706200202258E-08, 3.40820349720161E-08, 6.61412968838704E-08, 7.01866440522281E-08}, + { 9.30588299752344E-08, 9.40660100923196E-08, 1.86117645739614E-07, 1.90146408840519E-07}, + { 3.83720646368602E-08, 3.9382058503179E-08, 7.67441576954297E-08, 8.07838489436108E-08}, + { 3.12277990133225E-07, 3.13278405883466E-07, 6.2455600868816E-07, 6.28557373261174E-07}, + { 2.62851173715717E-07, 2.63860243876479E-07, 5.25702404274853E-07, 5.29738812815594E-07}, + { 6.38404742403509E-08, 6.48505391609433E-08, 1.27680962691556E-07, 1.3172102342196E-07}, + { 7.73673903609051E-07, 7.74670056102877E-07, 1.54734770774212E-06, 1.55133201928948E-06}, + { 2.23658261688797E-07, 2.24661988568187E-07, 4.47316281793064E-07, 4.51331573003699E-07}, + { 3.18664490350784E-07, 3.19664522407948E-07, 6.37329037544987E-07, 6.41328341544067E-07}, + { 6.28178327133355E-08, 6.38285229115354E-08, 1.25635679637526E-07, 1.29678596749727E-07}, + { 2.14196546721723E-07, 2.15193523445123E-07, 4.28392880280626E-07, 4.32381142445593E-07}, + { 2.53436667208007E-08, 2.63544563949836E-08, 5.06872623873278E-08, 5.47306626685895E-08}, + { 1.79067058070359E-07, 1.80076483502489E-07, 3.58134101929863E-07, 3.62171505230435E-07}, + { 1.14243619009358E-08, 1.24315846505851E-08, 2.28486385367432E-08, 2.69068462005454E-08}, + { 1.62669806513804E-08, 1.72783103380425E-08, 3.25339186701967E-08, 3.65793084711186E-08}, + { 2.55726050113481E-07, 2.56733443393387E-07, 5.11451958118414E-07, 5.15481701768294E-07}, + { 6.74249776011493E-08, 6.84268144368616E-08, 1.34849770461187E-07, 1.38856961484635E-07}, + { 6.02680273686929E-07, 6.03684966904439E-07, 1.20536046210873E-06, 1.20937964709356E-06}, + { 1.45373832083351E-07, 1.46384664390098E-07, 2.90747806275249E-07, 2.94791007604545E-07}, + { 3.46929951433594E-07, 3.4793785630427E-07, 6.93859675493513E-07, 6.9789133760878E-07}, + { 2.86301002461187E-07, 2.87301332946299E-07, 5.72601834392117E-07, 5.76603540025644E-07}, + { 8.92922287221154E-08, 9.02999346408251E-08, 1.78584627974487E-07, 1.82615082167104E-07}, + { 1.61394524411662E-07, 1.62388303692751E-07, 3.22789020401615E-07, 3.26764009628278E-07}, + { 3.15667904260408E-07, 3.16657960297562E-07, 6.31335680623124E-07, 6.35296956374987E-07}, + { 3.65886961617434E-07, 3.66888201597249E-07, 7.31774122186835E-07, 7.35779138949511E-07}, + { 5.1565010039667E-08, 5.25749044300028E-08, 1.03130020079334E-07, 1.07168872887087E-07}, + { 2.49045257305625E-07, 2.50053105332881E-07, 4.98090642508942E-07, 5.02122333045918E-07}, + { 3.89293546732006E-07, 3.90250974646733E-07, 7.78586866090336E-07, 7.82417473033092E-07}, + { 1.28008643685007E-07, 1.29012775573756E-07, 2.56017258948305E-07, 2.60033857557573E-07}, + { 3.59406385541661E-07, 3.60415128852765E-07, 7.18812870559304E-07, 7.2284757379748E-07}, + { 7.04774407722653E-08, 7.14837113946487E-08, 1.40955009442223E-07, 1.44979907190645E-07}, + { 4.69074876718878E-08, 4.79159325550427E-08, 9.38164674835207E-08, 9.78508154503288E-08}, + { 3.46929951433594E-07, 3.4793785630427E-07, 6.93859675493513E-07, 6.9789133760878E-07}, + { 2.52614157147946E-07, 2.5362039934862E-07, 5.05228484826148E-07, 5.09253013092348E-07}, + { 1.752849669856E-07, 1.76295728238074E-07, 3.50569891338637E-07, 3.54612936348531E-07}, + { 9.97295472870974E-08, 1.00740251696152E-07, 1.99459023519921E-07, 2.03501656415028E-07}, + { 1.27083694678731E-08, 1.37173685743619E-08, 2.54168952551481E-08, 2.94820375698493E-08}, + { 2.88675792603499E-07, 2.89683143250841E-07, 5.77351315200758E-07, 5.81380774633544E-07}, + { 2.2199529325917E-07, 2.22990578890858E-07, 4.43990884946288E-07, 4.47971643779965E-07}, + { 3.101136769601E-08, 3.20127782060808E-08, 6.20226217051822E-08, 6.60284200648675E-08}, + { 6.34119317055593E-08, 6.44227355905969E-08, 1.26823891832828E-07, 1.30867206848961E-07}, + { 2.27363642579803E-07, 2.28347417419172E-07, 4.54726489351742E-07, 4.5866131870298E-07}, + { 5.761698673723E-08, 5.86278900982506E-08, 1.15233817155058E-07, 1.19277274279739E-07}, + { 5.59963240220895E-08, 5.70068436900328E-08, 1.11992690676743E-07, 1.16034897246209E-07}, + { 1.00404065506154E-07, 1.01413306197173E-07, 2.00808131012309E-07, 2.04845150619803E-07}, + { 1.51791383018463E-07, 1.52801391095636E-07, 3.03582666560942E-07, 3.07622912032457E-07}, + { 7.73673903609051E-07, 7.74670056102877E-07, 1.54734770774212E-06, 1.55133201928948E-06}, + { 6.7849948948151E-07, 6.79496110933542E-07, 1.35699917791499E-06, 1.36098604741619E-06}, + { 6.46773514745291E-08, 6.56873169191385E-08, 1.29354639000212E-07, 1.33394671308906E-07}, + { 2.14274791687785E-07, 2.15266346970111E-07, 4.28549661535271E-07, 4.32515697923463E-07}, + { 1.75431694060535E-07, 1.76439094445868E-07, 3.50863423648207E-07, 3.54893018084113E-07}, + { 1.54840201105344E-07, 1.55849093630422E-07, 3.09680387999833E-07, 3.13715879940446E-07}, + { 3.03876547036452E-07, 3.04886683011318E-07, 6.07753179338033E-07, 6.11793765870061E-07}, + { 2.87581904956369E-07, 2.88585042085288E-07, 5.7516393781043E-07, 5.79176422377259E-07}, + { 2.4641536811032E-08, 2.56472958426457E-08, 4.92830878329187E-08, 5.33060031671084E-08}, + { 2.38351063330811E-08, 2.48459812723922E-08, 4.76701984553074E-08, 5.17136911071248E-08}, + { 5.06429515212403E-07, 5.07291815665667E-07, 1.01285916542793E-06, 1.0163081114456E-06}, + { 3.16136237188402E-08, 3.26210596313103E-08, 6.32272758593899E-08, 6.72569697712788E-08}, + { 3.48408235595343E-08, 3.58516203391446E-08, 6.96816471190687E-08, 7.37248200266549E-08}, + { 7.48174926457068E-08, 7.58264846467682E-08, 1.49634963975132E-07, 1.5367105987707E-07}, + { 1.93732120123968E-07, 1.94739627090712E-07, 3.87464289985928E-07, 3.9149432495833E-07}, + { 3.07901757423679E-08, 3.17564925467195E-08, 6.17883486597748E-08, 6.55261729320955E-08}, + { 4.99771878992306E-07, 5.00766930144891E-07, 9.99543672719483E-07, 1.00352374943213E-06}, + { 1.17716950853719E-07, 1.18722240927127E-07, 2.35433859074874E-07, 2.39455012263079E-07}, + { 3.58876590667023E-08, 3.6895563937378E-08, 7.17753749768235E-08, 7.58068807726886E-08}, + { 4.9829156978376E-07, 4.99225798478165E-07, 9.96582841139571E-07, 1.0003212125298E-06}, + { 3.75331644875132E-07, 3.76332543794433E-07, 7.50663197379708E-07, 7.54666956481742E-07}, + { 2.08074482088705E-08, 2.18164970533508E-08, 4.16148893123136E-08, 4.56511770607904E-08}, + { 2.65227200202389E-08, 2.75340639177557E-08, 5.30454471459052E-08, 5.70908014196903E-08}, + { 9.48590397342741E-08, 9.57736716600266E-08, 1.89718221577095E-07, 1.93376600066131E-07}, + { 1.26375994113914E-08, 1.36486946189507E-08, 2.52751917173555E-08, 2.93195441258831E-08}, + { 1.50946419807951E-07, 1.51955084959354E-07, 3.01892768561629E-07, 3.05927514432369E-07}, + { 9.22171139450256E-08, 9.32281949417302E-08, 1.84434327366034E-07, 1.88478459506314E-07}, + { 9.69194388744654E-07, 9.70171512904017E-07, 1.93838912565525E-06, 1.94229757255471E-06}, + { 5.55253905076825E-08, 5.65363365012672E-08, 1.11050773909938E-07, 1.15094508146285E-07}, + { 1.13003537194345E-07, 1.13988456007519E-07, 2.26006307002535E-07, 2.29945861462966E-07}, + { 1.2296865747885E-07, 1.23975510746277E-07, 2.45937201270863E-07, 2.49964827503391E-07}, + { 4.48469990033118E-08, 4.58578668371956E-08, 8.96939909011962E-08, 9.37375403964325E-08}, + { 5.0952010610672E-08, 5.19609670845966E-08, 1.01904042537626E-07, 1.05939804484478E-07}, + { 4.86714952785405E-08, 4.96825975915272E-08, 9.73430047679358E-08, 1.01387534812147E-07}, + { 7.39467296284602E-08, 7.49580095771307E-08, 1.47893480573202E-07, 1.51938643000449E-07}, + { 1.0657652893542E-07, 1.07576717311986E-07, 2.13153157346824E-07, 2.17153882431376E-07}, + { 2.98015478961133E-08, 3.08124867842707E-08, 5.96030602650899E-08, 6.36467447634459E-08}, + { 4.8263878227317E-07, 4.83640725690293E-07, 9.65278132980529E-07, 9.69288855401373E-07}, + { 3.14623996189312E-07, 3.15605028333721E-07, 6.29259531592652E-07, 6.33185010201487E-07}, + { 2.29475041635396E-07, 2.30466028483534E-07, 4.5895009037622E-07, 4.62914151455607E-07}, + { 4.36916394619402E-07, 4.37877190506697E-07, 8.7382976232675E-07, 8.77673194565887E-07}, + { 4.38233769273211E-08, 4.4833392109922E-08, 8.76467751709242E-08, 9.16867648470543E-08}, + { 1.28198685445113E-07, 1.29205858456771E-07, 2.56397569842193E-07, 2.60425942144593E-07}, + { 1.72098651773922E-07, 1.73105441092503E-07, 3.44197339074981E-07, 3.48224730828406E-07}, + { 1.79612058559542E-08, 1.79676149514307E-08, 3.59441060869162E-08, 3.59159741947224E-08} + }; + + typedef bg::model::linestring

linestring; + typedef bg::model::polygon

polygon; + + int const n = sizeof(testcases) / sizeof(testcases[0]); + int const ne = sizeof(expectations) / sizeof(expectations[0]); + BOOST_ASSERT(n == ne); + + boost::ignore_unused(n, ne); + + bg::strategy::buffer::join_miter join_miter; + bg::strategy::buffer::join_round join_round(100); + bg::strategy::buffer::end_flat end_flat; + bg::strategy::buffer::end_round end_round(100); + + // Aimes tested originally with 0.000018 degrees (around 2 m) + ut_settings settings; + settings.use_ln_area = true; + settings.tolerance = 0.001; + + int expectation_index = 0; + for (int width = 18; width <= 36; width += 18, expectation_index += 2) + { + double aimes_width = static_cast(width) / 1000000.0; + for (int i = 0; i < n; i++) + { +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) && ! defined(BOOST_GEOMETRY_TEST_FAILURES) + if (i > 10) + { + // Several cases (11,20,40 etc) are still reported as invalid + settings.test_validity = false; + } +#endif + std::ostringstream name; + try + { + name << "aimes_" << i << "_" << width; + test_one + ( + name.str(), testcases[i], join_miter, end_flat, + expectations[i][expectation_index], + aimes_width, settings + ); + test_one + ( + name.str(), testcases[i], join_round, end_round, + expectations[i][expectation_index + 1], + aimes_width, settings + ); + } + catch(std::exception const& e) + { + std::cout << "Exception: " << e.what() << " in " << name.str() << std::endl; + } + } + } +} + + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + + test_aimes >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/buffer/buffer_multi_linestring.cpp b/src/boost/libs/geometry/test/algorithms/buffer/buffer_multi_linestring.cpp new file mode 100644 index 000000000..45f4cbea8 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/buffer_multi_linestring.cpp @@ -0,0 +1,226 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2012-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2016. +// Modifications copyright (c) 2016, 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) + +#include "test_buffer.hpp" + +static std::string const simplex = "MULTILINESTRING((0 0,4 5),(5 4,10 0))"; +static std::string const two_bends = "MULTILINESTRING((0 0,4 5,7 4,10 6),(1 5,5 9,8 6))"; +static std::string const turn_inside = "MULTILINESTRING((0 0,4 5,7 4,10 6),(1 5,5 9,8 6),(0 4,-2 6))"; + +static std::string const bend_near_start1 = "MULTILINESTRING((10 0,11 0,15 2),(9 0,8 0,4 2))"; +static std::string const bend_near_start2 = "MULTILINESTRING((10 0,11 0,12 1.5,15 3),(9 0,8 0,7 1.5,4 3))"; + +static std::string const degenerate0 = "MULTILINESTRING()"; +static std::string const degenerate1 = "MULTILINESTRING((5 5))"; +static std::string const degenerate2 = "MULTILINESTRING((5 5),(9 9))"; +static std::string const degenerate3 = "MULTILINESTRING((5 5),(9 9),(4 10))"; +static std::string const degenerate4 = "MULTILINESTRING((5 5,5 5),(9 9,9 9,10 10,9 9,9 9,9 9),(4 10,4 10,3 11,4 12,3 11,4 10,4 10))"; + +static std::string const crossing = "MULTILINESTRING((0 0,10 10),(10 0,0 10))"; + +static std::string const mikado1 = "MULTILINESTRING((-2 0,-17 -11,3.7142857142857144125969171000179 -2.4285714285714283811046243499732),(11.406143344709896325639419956133 0.75426621160409546007485914742574,12 1,11.403846153846153299582510953769 0.75),(4.25 -2.25,-19 -12,-1 0))"; +static std::string const mikado2 = "MULTILINESTRING((-6.1176470588235289937983907293528 -12.696078431372548322997317882255,-6.116279069767442067018237139564 -12.697674418604652402109422837384),(-1.8000000000000007105427357601002 -1.6000000000000000888178419700125,-9.7619047619047627506461140001193 -1.238095238095238137532305700006),(-10.537366548042705005627794889733 -1.2028469750889678735461529868189,-10.567164179104477028658948256634 -1.201492537313432862333684170153),(1.9041095890410959512450972397346 3.4931506849315070439843111671507,-7 1,-7 -4),(-5.540540540540540348501963308081 -5.459459459459459651498036691919,-1.521739130434782261147574899951 -1.2173913043478261641894278000109),(1.2040816326530612290213184678578 2.530612244897959328682190971449,-6.288135593220339103481819620356 -4.711864406779660896518180379644),(-8.4018691588785046064913331065327 -6.755140186915888023122533923015,-8.4131455399061039202024403493851 -6.7660406885758996864410619309638),(-2 5,-12 12,-11.088000000000000966338120633736 0.14400000000000012789769243681803),(-10.720812182741116913575751823373 -0.80456852791878175068518430634867,-10.696969696969697238841945363674 -0.78787878787878784514475682954071),(-10.411764705882353254651206952985 -0.58823529411764707841570043456159,0.11913357400722013323957071406767 6.7833935018050537379963316197973),(-1.5283018867924527128820955113042 -1.2264150943396234794136034906842,1.1922525107604009519945975625888 6.1190817790530829256567812990397),(0.33490011750881265584212087560445 6.6498237367802577324482626863755,-11.548480463096961301516785169952 1.3335745296671497328588884556666))"; +static std::string const mikado3 = "MULTILINESTRING((1 18,4.0559006211180124168436122999992 7.8136645962732922399140989000443),(6.7243816254416959310447055031545 -1.0812720848056533995418249105569,7 -2,7 -8,14 3.6666666666666669627261399000417),(15.297872340425531234586742357351 5.8297872340425538340014099958353,16 7,15.214285714285713524418497399893 5.8445378151260509724806979647838),(13.685863874345550073030608473346 3.5968586387434555717845796607435,-1 -18,-3.7900797165633304253162805252941 -11.117803365810452476125647081062),(-11.540540540540540348501963308081 8,-16 19,8 14),(1 -10,6.5999999999999996447286321199499 -1.200000000000000177635683940025),(11.5 6.5,15 12),(19 10,11.564231738035264385189293534495 6.4886649874055422060337150469422),(-13.438785504407443127661281323526 -5.3183153770812925387190261972137,-17 -7,-12.970074812967581578959652688354 -7.7556109725685784539450651209336),(-2.3532338308457703135445626685396 -9.7462686567164187323442092747428,-1 -10,12.285714285714286475581502600107 3.2857142857142864755815026001073),(14.90000000000000035527136788005 5.9000000000000003552713678800501,15 6,14.893004115226338157640384451952 5.9012345679012341292946075554937),(11.987804878048780921062643756159 3.2195121951219514144781896902714,-11 -18),(-12.210826210826210669324609625619 -11.703703703703702387883822666481,-15 -15,-11.463576158940396609864365018439 -15.589403973509934786534358863719),(-8.9189189189189193029960733838379 -16.013513513513512265262761502527,-3 -17,-7.0297239915074314353660156484693 -14.210191082802548834251865628175),(-12.450511945392491952588898129761 -10.457337883959045399251408525743,-16 -8,-12.923076923076923350208744523115 -8),(-0.52380952380952372493538859998807 -8,18 -8),(2 -19,-2.2961165048543685784920853620861 -9.6917475728155331182733789319173),(6.0463576158940393057150686217938 -1.7284768211920527036795647291001,7 -3,6.4482758620689653028534848999698 -1.3448275862068967967388744000345),(-1.3333333333333339254522798000835 8,4 16,2.9090909090909091716525836091023 8),(0.64705882352941168633719826175366 -6.8823529411764710062016092706472,-3 -16))"; +static std::string const mikado4 = "MULTILINESTRING((-15 2,-15 -17,-6 11,-1.9358288770053475591481628725887 10.572192513368984023713892383967),(2.1545064377682408007785852532834 10.14163090128755406738036981551,6.87603305785123986026974307606 9.6446280991735537924114396446384),(8.4810810810810810522752944962122 9.475675675675674369813350494951,13 9),(-15 0,-8 9,-2.9850746268656713766631582984701 4.4865671641791049495395782287233),(-1.8235294117647056211239942058455 3.4411764705882355031008046353236,-1.1428571428571423496123315999284 2.8285714285714291804652020800859),(1.2307692307692308375521861307789 0.69230769230769229061195346730528,1.2857142857142858094476878250134 0.64285714285714290472384391250671,2 0,1.9459459459459460539676456392044 0.51351351351351348650808859019889),(1.908127208480565384363103476062 0.87279151943462895957281943992712,1.9078014184397162900097555393586 0.87588652482269502286271745106205),(1.4685990338164249813246442499803 5.0483091787439615671928550000302,0.63551401869158885560295857430901 12.962616822429906093816498469096,0 19,2.9565217391304345895264304999728 8.6521739130434784925682834000327),(0 19,3.4942528735632185643567027000245 6.770114942528735468840750399977),(4.75 2.375,5.2427184466019420838733822165523 0.65048543689320226235395239200443),(5.5384615384615383248956277384423 -0.38461538461538458122390693461057,5.7358490566037731994697423942853 -1.0754716981132084185901476303115),(5.9777777777777778567269706400111 -1.9222222222222207221875578397885,6.867052023121386739035187929403 -5.0346820809248553629799971531611,10 -16,-14 -19,-12 -12),(0 10,1.9476439790575916788384347455576 5.4554973821989527493769855936989),(-4 1,-4.2790697674418600726653494348284 0.16279069767441856075862460784265))"; + +static std::string const mysql_2015_04_10a = "MULTILINESTRING((-58 19, 61 88),(1.922421e+307 1.520384e+308, 15 42, 89 -93,-89 -22),(-63 -5, -262141 -536870908, -3 87, 77 -69))"; +static std::string const mysql_2015_04_10b = "MULTILINESTRING((-58 19, 61 88), (-63 -5, -262141 -536870908, -3 87, 77 -69))"; + +static std::string const mysql_2015_09_08a = "MULTILINESTRING((7 -4, -3 -5), (72057594037927936 15, 72057594037927940 70368744177660, 32771 36028797018963964, 8589934589 2305843009213693953, 7 2, 9.300367e+307 9.649737e+307, -4092 -274877906946, 5 10, -3 4))"; +static std::string const mysql_2015_09_08b = "MULTILINESTRING((-9 -10, 0 -1, 5 -10, -6 7, -7 7, 5.041061e+307 9.926906e+307, 6.870356e+307 1.064454e+307, 35184372088830 288230376151711743, 183673728842483250000000000000000000000.000000 244323751784861950000000000000000000000.000000), (-23530 -7131, -6 1, 1 1, 2 -6, 32766 -4194302, -4 -6), (134217725 0, 50336782742294697000000000000000000000.000000 36696596077212901000000000000000000000.000000, 7434 16486, 3.025467e+307 8.926790e+307), (2147483646 67108868, 71328904281592545000000000000000000000.000000 225041650340452780000000000000000000000.000000, -7 4, 1.667154e+307 3.990414e+307))"; + +static std::string const mysql_23023665_1 = "MULTILINESTRING((-5 15, 7 15, 19 -10, -11 -2),(2 13, 2 -9))"; + +static std::string const touching1 = "MULTILINESTRING((-5 15, 9 15),(2 13, 2 0),(-4 14.75,-4 13),(8 15.25,8 13),(1.5 1,-1 1),(2.25 4,5 4))"; +static std::string const touching2 = "MULTILINESTRING((-5 15, 9 15),(2 13, 2 0),(-11 -2,9 14))"; + +static std::string const ticket_13444 = "MULTILINESTRING((-14900.3540680666540 6736752.97813679560,-14903.4321076464080 6736753.66526194570,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.2786583450830 6736754.3021534560,-14906.2786583450830 6736754.3021534560,-14922.5830341660040 6736758.55049021640,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.4931871261580 6736765.77697354280,-14943.4931871261580 6736765.77697354280,-14977.8347379614440 6736783.40904572790,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-15011.938643947820 6736805.44739563390,-15011.4855624884060 6736805.15855005480,-15044.495275804080 6736826.22277528610,-15044.636350994740 6736826.3142731870,-15044.636350994740 6736826.3142731870,-15044.636350994740 6736826.3142731870,-15044.636350994740 6736826.3142731870,-15044.636350994740 6736826.3142731870,-15044.636350994740 6736826.3142731870,-15044.636350994740 6736826.3142731870,-15059.3568953647720 6736834.30329997840,-15068.0541424639030 6736839.02352138140,-15069.4928800905110 6736839.75371170980,-15070.9534140734160 6736840.41931523480,-15087.9426162696510 6736846.96412046530,-15089.5494797231820 6736847.51131521720,-15091.1563320447620 6736848.05671593270,-15094.2349059580680 6736848.97707971370,-15335.9054238793630 6736921.18738844430000000000)," + "(-14900.3540680666540 6736752.97813679560,-14903.4321076464080 6736753.66526194570,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.2786583450830 6736754.3021534560,-14906.2786583450830 6736754.3021534560,-14922.5830341660040 6736758.55049021640,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.4931871261580 6736765.77697354280,-14943.4931871261580 6736765.77697354280,-14977.8347379614440 6736783.40904572790,-14978.1533343440550 6736783.59921684120,-14983.6129319775540 6736787.37752308510,-14985.1947819415070 6736788.51675631760,-14986.7766319054570 6736789.65598971210,-14987.9123578781710 6736790.53687736760,-14992.4552617690170 6736794.05684083610,-14998.267508417350 6736798.72501083650,-15010.441029442540 6736809.15394911820,-15011.6583859978380 6736810.19630545840,-15022.6145949955260 6736819.58290076720,-15059.7358046474820 6736849.75929930060,-15061.0431630110740 6736850.7029863410,-15062.3505213746680 6736851.644879410,-15070.4409770615170 6736856.86027784460,-15087.1738995260860 6736866.37430707270,-15088.6108003810950 6736867.09552943430,-15095.9473782124990 6736870.45405826350,-15104.0074102825180 6736873.63317977920,-15116.207314027020 6736878.44671658990,-15123.8358828827350 6736880.87232399170,-15134.5288992083770 6736884.24879940230,-15180.7309406607860 6736898.17991495970000000000)," + "(-14900.3540680666540 6736752.97813679560,-14903.4321076464080 6736753.66526194570,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.2786583450830 6736754.3021534560,-14906.2786583450830 6736754.3021534560,-14922.5830341660040 6736758.55049021640,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.4931871261580 6736765.77697354280,-14943.4931871261580 6736765.77697354280,-14977.8347379614440 6736783.40904572790,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-15011.938643947820 6736805.44739563390,-15011.4855624884060 6736805.15855005480,-15044.495275804080 6736826.22277528610,-15044.636350994740 6736826.3142731870,-15045.8532288762310 6736827.08752021570,-15074.3737944831540 6736845.21847973950,-15077.090034585930 6736846.94438557510,-15078.4820514222590 6736847.81092678480,-15078.071961550180 6736847.56872581780,-15087.3648458486150 6736853.06579258570,-15090.2635942565180 6736854.6786728650,-15097.9514630049710 6736858.31707360780,-15103.8265161100060 6736861.09610959050,-15130.264249516680 6736873.60626847480,-15134.7519500720480 6736875.32141580710,-15146.8630765226570 6736879.66849063620,-15194.4412940478560 6736894.61146595520,-15195.9796069589630 6736895.07075342350000000000)," + "(-14900.3540680666540 6736752.97813679560,-14903.4321076464080 6736753.66526194570,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.2786583450830 6736754.3021534560,-14906.2786583450830 6736754.3021534560,-14922.5830341660040 6736758.55049021640,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.4931871261580 6736765.77697354280,-14943.4931871261580 6736765.77697354280,-14977.8347379614440 6736783.40904572790,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-15011.938643947820 6736805.44739563390,-15011.4855624884060 6736805.15855005480,-15044.495275804080 6736826.22277528610,-15044.636350994740 6736826.3142731870,-15045.8532288762310 6736827.08752021570,-15074.3737944831540 6736845.21847973950,-15077.090034585930 6736846.94438557510,-15078.4820514222590 6736847.81092678480,-15078.071961550180 6736847.56872581780,-15078.071961550180 6736847.56872581780,-15078.071961550180 6736847.56872581780,-15078.071961550180 6736847.56872581780,-15078.071961550180 6736847.56872581780,-15078.071961550180 6736847.56872581780,-15078.071961550180 6736847.56872581780,-15082.7943681199050 6736849.88488502430,-15097.5442785716020 6736857.11683175990,-15106.6291957973660 6736860.3533587540,-15108.2275099140060 6736860.85390822030,-15125.8089540650780 6736866.36354256610,-15127.375820425570 6736866.840769290,-15215.2540981133260 6736893.00754821770,-15218.3352769027190 6736893.92791708470,-15437.0992937759950 6736959.30128452830,-15461.7487574869660 6736966.66788661480,-15515.650723588680 6736982.80231144560,-15574.1728604397850 6737000.31823665460,-15594.0923367237140 6737006.20472987550,-15710.5446690337120 6737040.61236372680,-15712.0936018242430 6737041.03398283110,-15734.2281022037190 6737046.24412034730,-15742.1332777301140 6737048.10462824910,-15743.8434568030350 6737048.30018792950,-15748.6193127583390 6737048.65262600970000000000)," + "(-14900.3540680666540 6736752.97813679560,-14903.4321076464080 6736753.66526194570,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.2786583450830 6736754.3021534560,-14906.2786583450830 6736754.3021534560,-14922.5830341660040 6736758.55049021640,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14943.4931871261580 6736765.77697354280,-14943.4931871261580 6736765.77697354280,-14977.8347379614440 6736783.40904572790,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-14978.1533343440550 6736783.59921684120,-15011.938643947820 6736805.44739563390,-15011.4855624884060 6736805.15855005480,-15011.4855624884060 6736805.15855005480,-15011.4855624884060 6736805.15855005480,-15011.4855624884060 6736805.15855005480,-15011.4855624884060 6736805.15855005480,-15011.4855624884060 6736805.15855005480,-15011.4855624884060 6736805.15855005480,-15024.686885240 6736812.53218883280,-15026.1816388343670 6736813.3144049160,-15030.6658773535710 6736815.65925955030,-15036.7550423671660 6736818.56027804410,-15041.3219133443780 6736820.73649111390,-15048.9609128363750 6736824.08244226970,-15050.4611878774870 6736824.67628146990,-15084.9584078886780 6736837.58108171260,-15086.4811249391280 6736838.09598240720000000000)," + "(-14900.3540680666540 6736752.97813679560,-14903.4321076464080 6736753.66526194570,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.2786583450830 6736754.3021534560,-14906.2786583450830 6736754.3021534560,-14922.5830341660040 6736758.55049021640,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-14980.0377729478370 6736780.26763486860,-14980.0377729478370 6736780.26763486860,-14991.6555536792150 6736785.84897732640,-15011.9866671761430 6736795.61588732150,-15012.4519381197970 6736795.86346895620,-15020.770743478080 6736800.37376175450,-15022.2480644401890 6736801.17391738670,-15026.6800384584770 6736803.57797288240,-15038.4986506831680 6736809.98460484760,-15041.4533037393390 6736811.58671214340,-15058.2989705841660 6736819.98118544460,-15081.4365374991940 6736828.96412467860,-15082.9566942013570 6736829.48440706080,-15099.6784290571030 6736835.20392734280,-15104.2978317020080 6736836.58357383120,-15111.9968435314880 6736838.88358319360,-15113.5366592557220 6736839.34286751130,-15175.1290655861190 6736857.7411727840,-15252.1195734991230 6736880.73776734710,-15421.5006278668590 6736931.32583960150,-15423.0404547230450 6736931.78512913550,-15470.7754991468520 6736946.04105874990,-15498.4926942527330 6736954.32084811290,-15500.0325433728140 6736954.78013895270,-15575.3855081806230 6736977.37871549190,-15636.8689327295510 6736995.84730348080,-15638.406032258210 6736996.30839077380,-15730.631692283210 6737024.00955883970,-15733.7340329077980 6737024.91558956820,-15735.3732012775510 6737025.31388429920,-15737.0123696473070 6737025.7121790480,-15740.0858017133340 6737026.31913025120000000000)," + "(-14900.3540680666540 6736752.97813679560,-14903.4321076464080 6736753.66526194570,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.2786583450830 6736754.3021534560,-14906.2786583450830 6736754.3021534560,-14922.5830341660040 6736758.55049021640,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-14980.0377729478370 6736780.26763486860,-14980.0377729478370 6736780.26763486860,-14991.6555536792150 6736785.84897732640,-15011.9866671761430 6736795.61588732150,-15012.4519381197970 6736795.86346895620,-15012.4519381197970 6736795.86346895620,-15012.4519381197970 6736795.86346895620,-15012.4519381197970 6736795.86346895620,-15012.4519381197970 6736795.86346895620,-15012.4519381197970 6736795.86346895620,-15012.4519381197970 6736795.86346895620,-15021.625933202080 6736800.2499708710,-15023.1507875867560 6736800.96759922520,-15027.7253396088290 6736803.12227872670,-15042.7733302609810 6736809.10550915170,-15074.0109486029650 6736819.38555251160,-15075.5483598261980 6736819.84483573210,-15089.3850385714010 6736823.99094439390,-15135.5072973447730 6736837.81251791210,-15197.0045366425070 6736856.23952505740,-15275.413533166740 6736879.73487190530000000000)," + "(-14900.3540680666540 6736752.97813679560,-14903.4321076464080 6736753.66526194570,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.2786583450830 6736754.3021534560,-14906.2786583450830 6736754.3021534560,-14922.5830341660040 6736758.55049021640,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-15030.7446692891440 6736797.61627536640,-15031.1498499716740 6736797.74544842350,-15038.6298407030480 6736800.08671043440,-15040.2125700909780 6736800.58187397570,-15044.9607693867150 6736802.06915886140,-15048.1262281625750 6736803.05948622340,-15059.2053672739280 6736806.52922108490,-15060.808434732820 6736807.02797317230,-15070.4268283542390 6736810.02228038110,-15090.7124010474890 6736816.33562555160,-15093.7912866553690 6736817.2649561130,-15109.1857035628240 6736821.91519868650,-15121.5012459943460 6736825.63611227830,-15139.9829308673380 6736831.19236878680,-15292.4567809757460 6736877.02759306690,-15297.0794564136850 6736878.40904073880,-15352.5515616689190 6736894.99530161920000000000)," + "(-14900.3540680666540 6736752.97813679560,-14903.4321076464080 6736753.66526194570,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.2786583450830 6736754.3021534560,-14906.2786583450830 6736754.3021534560,-14922.5830341660040 6736758.55049021640,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-15030.7446692891440 6736797.61627536640,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15063.4394263695590 6736806.12734892960,-15077.96973686180 6736809.90028341770,-15079.4709581185830 6736810.20886396620,-15112.4978702955780 6736817.01378568450,-15112.4978702955780 6736817.01378568450,-15112.4978702955780 6736817.01378568450,-15112.4978702955780 6736817.01378568450,-15112.4978702955780 6736817.01378568450,-15112.4978702955780 6736817.01378568450,-15111.7280180932050 6736816.8612893540,-15111.7280180932050 6736816.8612893540,-15136.404287537560 6736822.99882040450,-15160.8745380003330 6736830.05133549120,-15177.1880420194980 6736834.75361365080,-15266.4520692562510 6736861.47645545290,-15269.4815178782760 6736862.38605624720,-15320.982200112470 6736877.84569711610,-15416.0519172795560 6736906.38250955010,-15422.1735541886120 6736908.2142799450,-15480.3290491648930 6736925.62239861490,-15523.3135120558580 6736938.44483037390,-15529.4541957297860 6736940.27660798650,-15676.8305371123480 6736984.23760042710,-15684.5052033691940 6736986.53406332340,-15705.9942844730870 6736992.96236877050,-15715.0598543713510 6736996.18818513960,-15722.6144959532430 6736998.8775624940,-15729.8982749501720 6737002.20385167190000000000)," + "(-14900.3540680666540 6736752.97813679560,-14903.4321076464080 6736753.66526194570,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.2786583450830 6736754.3021534560,-14906.2786583450830 6736754.3021534560,-14922.5830341660040 6736758.55049021640,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-15030.7446692891440 6736797.61627536640,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15063.4394263695590 6736806.12734892960,-15077.96973686180 6736809.90028341770,-15079.4709581185830 6736810.20886396620,-15112.4978702955780 6736817.01378568450,-15112.4978702955780 6736817.01378568450,-15123.5406969890390 6736819.20973316490,-15126.6957919203090 6736819.83765943070,-15137.7386408776670 6736822.03360766730,-15142.4712888405410 6736822.97549742090,-15186.6427180658250 6736831.75929733830,-15188.2202710974380 6736832.07326094250,-15189.7978241290440 6736832.38722456990,-15190.0044887636720 6736832.42848835510,-15222.1556839025690 6736840.72251470480,-15234.5402332864270 6736844.34835063950,-15269.996782405240 6736854.92625629810,-15379.4496123019090 6736887.58221805560,-15387.1575630864950 6736889.88224184050,-15474.9321578005460 6736916.19621079690,-15481.0917769198550 6736918.0423361780,-15541.148430687430 6736936.04611730850,-15680.1650234030040 6736978.02997740640,-15694.0778224160020 6736982.24254881030,-15695.6236827885860 6736982.71081178360,-15697.0432178030370 6736983.18086888920,-15719.1585489661970 6736991.21490258910,-15720.7032404841320 6736991.83387157130,-15723.554088115150 6736993.14357420990,-15726.4049394568230 6736994.45417464520000000000)," + "(-14900.3540680666540 6736752.97813679560,-14903.4321076464080 6736753.66526194570,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.5703376748190 6736754.36135745610,-14906.2786583450830 6736754.3021534560,-14906.2786583450830 6736754.3021534560,-14922.5830341660040 6736758.55049021640,-14943.1461152178110 6736765.65497725270,-14943.1461152178110 6736765.65497725270,-14980.5459018954430 6736780.45959997360,-14980.5459018954430 6736780.45959997360,-15030.7446692891440 6736797.61627536640,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15031.1498499716740 6736797.74544842350,-15063.4394263695590 6736806.12734892960,-15077.96973686180 6736809.90028341770,-15079.4709581185830 6736810.20886396620,-15112.4978702955780 6736817.01378568450,-15112.4978702955780 6736817.01378568450,-15123.5406969890390 6736819.20973316490,-15126.6957919203090 6736819.83765943070,-15137.7386408776670 6736822.03360766730,-15142.4712888405410 6736822.97549742090,-15186.6427180658250 6736831.75929733830,-15188.2202710974380 6736832.07326094250,-15189.7978241290440 6736832.38722456990,-15190.0044887636720 6736832.42848835510,-15190.0044887636720 6736832.42848835510,-15190.0044887636720 6736832.42848835510,-15190.0044887636720 6736832.42848835510,-15190.0044887636720 6736832.42848835510,-15190.0044887636720 6736832.42848835510,-15190.0044887636720 6736832.42848835510,-15221.983183219660 6736838.87281871770,-15268.3061621668480 6736848.24688855470,-15269.855061561530 6736848.63441014480,-15300.8331273788140 6736856.38484578950,-15302.3963647239070 6736856.82798435070,-15308.5770232269750 6736858.67050808390,-15393.5610720781510 6736884.00839143530,-15395.0947874942920 6736884.46947239150,-15454.9098758556520 6736902.42873865920000000000)," + "(-15035.8556810692230 6736780.3429856580,-15067.3888192633710 6736786.679630680,-15089.4620493951220 6736791.11456749960,-15098.9220131172680 6736793.01628063250,-15102.0753269366810 6736793.64958708270,-15102.0753269366810 6736793.64958708270,-15105.2380806489130 6736794.28289358780,-15106.8190066610910 6736794.59864982220,-15166.8942062558330 6736806.61713062690,-15195.3829901481420 6736812.31510593650,-15290.2728818098240 6736831.29463120830,-15329.8103366688590 6736839.2029293180,-15347.0557184092210 6736843.2109036660,-15351.6484711680370 6736844.44164282270,-15368.3596751999520 6736850.43566813880,-15371.3980739090370 6736851.52467590480,-15377.4497910459360 6736854.09380189050,-15380.4756551803580 6736855.37657110580,-15413.5284714028580 6736872.262497440,-15414.9655503690590 6736872.99627892490,-15443.2170790306680 6736887.49968991610,-15454.8128073709250 6736892.57876041620,-15456.2628661897430 6736893.2013100730,-15459.1629949593350 6736894.44461543950,-15471.4299019053380 6736898.62305579240,-15486.7635383708280 6736903.84745482360,-15524.6976920000360 6736915.32428000490,-15532.5896984306750 6736917.71222237870,-15543.2866888621390 6736920.94877348280,-15543.2866888621390 6736920.94877348280,-15543.2866888621390 6736920.94877348280,-15543.2866888621390 6736920.94877348280,-15543.2866888621390 6736920.94877348280,-15543.2866888621390 6736920.94877348280,-15543.1144664779570 6736920.89674465540,-15543.1144664779570 6736920.89674465540,-15569.2930703739980 6736931.11772403310000000000)," + "(-14999.0450639284860 6736757.94409741740,-14999.0450639284860 6736757.94409741740,-14999.0450639284860 6736757.94409741740,-14999.0450639284860 6736757.94409741740,-14998.3237136282440 6736757.80416062470,-14998.3237136282440 6736757.80416062470,-15074.4307232707360 6736785.59960193090,-15101.5656395162080 6736793.51682595350,-15101.5656395162080 6736793.51682595350,-15102.0753269366810 6736793.64958708270,-15102.0753269366810 6736793.64958708270,-15102.0753269366810 6736793.64958708270,-15102.0753269366810 6736793.64958708270,-15102.0753269366810 6736793.64958708270,-15105.2380806489130 6736794.28289358780,-15106.8190066610910 6736794.59864982220,-15166.8942062558330 6736806.61713062690,-15195.3829901481420 6736812.31510593650,-15290.2728818098240 6736831.29463120830,-15329.8103366688590 6736839.2029293180,-15347.0557184092210 6736843.2109036660,-15351.6484711680370 6736844.44164282270,-15368.3596751999520 6736850.43566813880,-15371.3980739090370 6736851.52467590480,-15377.4497910459360 6736854.09380189050,-15380.4756551803580 6736855.37657110580,-15413.5284714028580 6736872.262497440,-15414.9655503690590 6736872.99627892490,-15443.2170790306680 6736887.49968991610,-15454.8128073709250 6736892.57876041620,-15456.2628661897430 6736893.2013100730,-15459.1629949593350 6736894.44461543950,-15471.4299019053380 6736898.62305579240,-15486.7635383708280 6736903.84745482360,-15524.6976920000360 6736915.32428000490,-15532.5896984306750 6736917.71222237870,-15543.2866888621390 6736920.94877348280,-15543.2866888621390 6736920.94877348280,-15670.4529210342480 6736958.21046822050,-15675.0913147842820 6736959.22952028270,-15689.4798710369670 6736961.8112390470,-15695.8747861639310 6736962.95767313520,-15697.484822222950 6736963.16040719490,-15703.9249664590210 6736963.96775526740000000000)," + "(-15024.331987571450 6736740.12011628040,-15043.3966526176450 6736741.54639214930,-15098.6064446248090 6736747.23176345690,-15109.6695982572860 6736748.86256334840,-15114.2194484843550 6736749.66271390670,-15209.0076497912120 6736768.50036193520,-15329.0727003271190 6736792.35965132710,-15330.651878623290 6736792.66464307440,-15351.2999521063080 6736795.90293848980,-15398.9493695778070 6736803.37524280050,-15419.5974430608280 6736806.61354248320,-15424.1870343461050 6736807.59490003720,-15445.5403613309970 6736812.9842953617))"; + +template +void test_all() +{ + typedef bg::model::linestring

linestring; + typedef bg::model::multi_linestring multi_linestring_type; + typedef bg::model::polygon polygon; + + bg::strategy::buffer::join_miter join_miter; + bg::strategy::buffer::join_round join_round(100); + bg::strategy::buffer::join_round_by_divide join_round_by_divide(4); + bg::strategy::buffer::end_flat end_flat; + bg::strategy::buffer::end_round end_round(100); + + bg::strategy::buffer::end_round end_round32(32); + bg::strategy::buffer::join_round join_round32(32); + + // Round joins / round ends + test_one("simplex", simplex, join_round, end_round, 49.0217, 1.5); + test_one("two_bends", two_bends, join_round, end_round, 74.73, 1.5); + test_one("turn_inside", turn_inside, join_round, end_round, 86.3313, 1.5); + test_one("two_bends_asym", two_bends, join_round, end_round, 58.3395, 1.5, ut_settings(), 0.75); + + // Round joins / flat ends: + test_one("simplex", simplex, join_round, end_flat, 38.2623, 1.5); + test_one("two_bends", two_bends, join_round, end_flat, 64.6217, 1.5); + + test_one("bend_near_start1", bend_near_start1, join_round, end_flat, 202.5910, 9.0); + test_one("bend_near_start2", bend_near_start2, join_round, end_flat, 231.4988, 9.0); + + // TODO this should be fixed test_one("turn_inside", turn_inside, join_round, end_flat, 99, 1.5); + test_one("two_bends_asym", two_bends, join_round, end_flat, 52.3793, 1.5, ut_settings(), 0.75); + + // This one is far from done: + // test_one("turn_inside_asym_neg", turn_inside, join_round, end_flat, 99, +1.5, ut_settings(), -1.0); + + // Miter / divide joins, various ends + test_one("two_bends", two_bends, join_round_by_divide, end_flat, 64.6217, 1.5); + test_one("two_bends", two_bends, join_miter, end_flat, 65.1834, 1.5); + test_one("two_bends", two_bends, join_miter, end_round, 75.2917, 1.5); + + test_one("degenerate0", degenerate0, join_round, end_round, 0.0, 3.0); + test_one("degenerate1", degenerate1, join_round, end_round, 28.2503, 3.0); + test_one("degenerate2", degenerate2, join_round, end_round, 56.0457, 3.0); + test_one("degenerate3", degenerate3, join_round, end_round, 80.4531, 3.0); + test_one("degenerate4", degenerate4, join_round, end_round, 104.3142, 3.0); + + test_one("crossing", crossing, join_round32, end_flat, 2628.4272, 50.0); + test_one("crossing", crossing, join_round32, end_round32, 9893.764, 50.0); + + // Cases formly causing a segmentation fault because a generated side was skipped + // (The expected area for large distances is about R*R*PI where R is distance) + // Note that for large distances the flat ends (not tested here) still give weird effects + { + // The results can differ between compilers and platforms + + ut_settings settings(40.0); + + ut_settings settings10 = settings; + settings10.tolerance *= 10.0; + + test_one("mikado1_large", mikado1, join_round32, end_round32, 5455052125.0, 41751.0, settings); + test_one("mikado1_small", mikado1, join_round32, end_round32, 1057.37, 10.0); + test_one("mikado1_small", mikado1, join_round32, end_flat, 874.590, 10.0); + + test_one("mikado2_large", mikado2, join_round32, end_round32, 19878812253.0, 79610.0, settings10); + test_one("mikado2_small", mikado2, join_round32, end_round32, 1082.470, 10.0); + test_one("mikado2_small", mikado2, join_round32, end_flat, 711.678, 10.0); + + // BSD 29151950588 + // msvc 29151950611 + // clang/linux 29151950612 + // mingw 29151950711 + test_one("mikado3_large", mikado3, join_round32, end_round32, 29151950650.0, 96375.0, settings10); + test_one("mikado3_small", mikado3, join_round32, end_round32, 2533.285, 10.0); + test_one("mikado3_small", mikado3, join_round32, end_flat, 2136.236, 10.0); + + test_one("mikado4_large", mikado4, join_round32, end_round32, 11212832169.0, 59772.0, settings); + test_one("mikado4_small", mikado4, join_round32, end_round32, 2103.686, 10.0); + test_one("mikado4_small", mikado4, join_round32, end_flat, 1930.785, 10.0); + } + + { + // Coordinates in one linestring vary so much that + // length = geometry::math::sqrt(dx * dx + dy * dy); returns a value of inf for length + // That geometry is skipped for the buffer + // SQL Server reports area 2117753600 (for b) + // PostGIS reports 2087335072 (for b) + // BG (2017) reports 1063005187 (for a/b) which apparently misses parts + // BG (2015) reported 794569660 (for a/b) + // BG (earlier) reported 927681870 (for a/b) + test_one("mysql_2015_04_10a", + mysql_2015_04_10a, join_round32, end_round32, + ut_settings::ignore_area(), 0.98, ut_settings::assertions_only()); + test_one("mysql_2015_04_10b", + mysql_2015_04_10b, join_round32, end_round32, + ut_settings::ignore_area(), 0.98, ut_settings::assertions_only()); + + // Two other cases with for length calculation + test_one("mysql_2015_09_08a", + mysql_2015_09_08a, join_round32, end_round32, + ut_settings::ignore_area(), 4051744443.0, ut_settings::assertions_only()); + test_one("mysql_2015_09_08b", + mysql_2015_09_08b, join_round32, end_round32, + ut_settings::ignore_area(), 2061380362.0, ut_settings::assertions_only()); + } + + // Generates first no interior, then one touching point (no interior), + // then one real interior ring, then one complete polygon + test_one("mysql_23023665_1", + mysql_23023665_1, join_round32, end_round32, 1, 1, 186.5504, 1.0); + test_one("touching1_1", + touching1, join_round32, end_round32, 2, 0, 78.70773, 1.0 +#if defined(BOOST_GEOMETRY_USE_RESCALING) + , ut_settings::ignore_validity() // false positive, due to rescaling. As we remove it, it is gone +#endif + ); + test_one("touching2_1", + touching2, join_round32, end_round32, 1, 1, 107.8991, 1.0); + test_one("mysql_23023665_1_09", + mysql_23023665_1, join_round32, end_round32, 1, 0, 167.8062, 0.9); + test_one("mysql_23023665_1_11", + mysql_23023665_1, join_round32, end_round32, 1, 1, 205.1473, 1.1); + test_one("mysql_23023665_1_20", + mysql_23023665_1, join_round32, end_round32, 1, 1, 368.8422, 2.0); + test_one("mysql_23023665_1_59", + mysql_23023665_1, join_round32, end_round32, 1, 1, 1020.7214, 5.9821); // very small triangle + test_one("mysql_23023665_1_60", + mysql_23023665_1, join_round32, end_round32, 1, 0, 1023.3061, 6.0); // no interior anymore + + test_one("mysql_23023665_1", + mysql_23023665_1, join_round32, end_flat, 1, 0, 180.3075, 1.0); + test_one("mysql_23023665_1_09", + mysql_23023665_1, join_round32, end_flat, 1, 0, 162.7494, 0.9); + test_one("mysql_23023665_1_11", + mysql_23023665_1, join_round32, end_flat, 1, 0, 197.7607, 1.1); + test_one("mysql_23023665_1_20", + mysql_23023665_1, join_round32, end_flat, 1, 1, 350.1135, 2.0); + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) + { + ut_settings settings(10.0); + test_one("ticket_13444_1", + ticket_13444, join_round32, end_round32, 3, 0, 11801.7832, 1.0, settings); + test_one("ticket_13444_3", + ticket_13444, join_round32, end_round32, 3, 1, 34132.0882, 3.0, settings); + test_one("ticket_13444_5", + ticket_13444, join_round32, end_round32, 2, 1, 50525.1110, 5.0, settings); + } +#endif + +} + + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + + test_all >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/buffer/buffer_multi_point.cpp b/src/boost/libs/geometry/test/algorithms/buffer/buffer_multi_point.cpp new file mode 100644 index 000000000..1539223bb --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/buffer_multi_point.cpp @@ -0,0 +1,224 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2012-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include "test_buffer.hpp" + +static std::string const simplex = "MULTIPOINT((5 5),(7 7))"; +static std::string const three = "MULTIPOINT((5 8),(9 8),(7 11))"; + +// Generated error (extra polygon on top of rest) at distance 14.0: +static std::string const multipoint_a = "MULTIPOINT((39 44),(38 37),(41 29),(15 33),(58 39))"; + +// Just one with holes at distance ~ 15 +static std::string const multipoint_b = "MULTIPOINT((5 56),(98 67),(20 7),(58 60),(10 4),(75 68),(61 68),(75 62),(92 26),(74 6),(67 54),(20 43),(63 30),(45 7))"; + +// Grid, U-form, generates error for square point at 0.54 (top cells to control rescale) +static std::string const grid_a = "MULTIPOINT(5 0,6 0,7 0, 5 1,7 1, 0 13,8 13)"; + +static std::string const mysql_report_2015_02_25_1 = "MULTIPOINT(-9 19,9 -6,-4 4,16 -14,-3 16,14 9)"; +static std::string const mysql_report_2015_02_25_2 = "MULTIPOINT(-2 11,-15 3,6 4,-14 0,20 -7,-17 -1)"; + +static std::string const mysql_report_3 = "MULTIPOINT(0 0,0 0,0 0,0 0,0 0)"; + +template +void test_all() +{ + typedef bg::model::polygon polygon; + typedef bg::model::multi_point

multi_point_type; + + bg::strategy::buffer::join_round join; + bg::strategy::buffer::end_flat end_flat; + typedef bg::strategy::buffer::distance_symmetric + < + typename bg::coordinate_type

::type + > distance_strategy; + bg::strategy::buffer::side_straight side_strategy; + + double const pi = boost::geometry::math::pi(); + + test_one("simplex1", simplex, join, end_flat, 2.0 * pi, 1.0); + test_one("simplex2", simplex, join, end_flat, 22.8372, 2.0); + test_one("simplex3", simplex, join, end_flat, 44.5692, 3.0); + + test_one("three1", three, join, end_flat, 3.0 * pi, 1.0); +#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // For no-rescaling, fails in CCW mode + test_one("three2", three, join, end_flat, 36.7592, 2.0); +#endif + test_one("three19", three, join, end_flat, 33.6914, 1.9); + test_one("three21", three, join, end_flat, 39.6394, 2.1); + test_one("three3", three, join, end_flat, 65.533, 3.0); + + test_one("multipoint_a", multipoint_a, join, end_flat, 2049.98, 14.0); + test_one("multipoint_b", multipoint_b, join, end_flat, 7109.88, 15.0); + test_one("multipoint_b1", multipoint_b, join, end_flat, 6911.89, 14.7); + test_one("multipoint_b2", multipoint_b, join, end_flat, 7174.79, 15.1); + + // Grid tests + { + bg::strategy::buffer::point_square point_strategy; + + test_with_custom_strategies("grid_a50", + grid_a, join, end_flat, + distance_strategy(0.5), side_strategy, point_strategy, 7.0); + + test_with_custom_strategies("grid_a54", + grid_a, join, end_flat, + distance_strategy(0.54), side_strategy, point_strategy, 7.819); + } + + test_with_custom_strategies("mysql_report_2015_02_25_1_800", + mysql_report_2015_02_25_1, join, end_flat, + distance_strategy(6051788), side_strategy, + bg::strategy::buffer::point_circle(800), + 115057490003226.125, ut_settings(1.0)); + + { + typename bg::strategy::area::services::default_strategy + < + typename bg::cs_tag

::type + >::type area_strategy; + + multi_point_type g; + bg::read_wkt(mysql_report_3, g); + bg::model::multi_polygon buffered; + test_buffer("mysql_report_3", buffered, g, + bg::strategy::buffer::join_round(36), + bg::strategy::buffer::end_round(36), + distance_strategy(1), + side_strategy, + bg::strategy::buffer::point_circle(36), + area_strategy, + 1, 0, 3.12566719800474635, ut_settings(1.0)); + } +} + +template +void test_many_points_per_circle() +{ + // Tests for large distances / many points in circles. + // Before Boost 1.58, this would (seem to) hang. It is solved by using monotonic sections in get_turns for buffer + // This is more time consuming, only calculate this for counter clockwise + // Reported by MySQL 2015-02-25 + // SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT(''), 6051788, ST_BUFFER_STRATEGY('point_circle', 83585))); + // SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT(''), 5666962, ST_BUFFER_STRATEGY('point_circle', 46641))) ; + + typedef bg::model::polygon polygon; + typedef bg::model::multi_point

multi_point_type; + + bg::strategy::buffer::join_round join; + bg::strategy::buffer::end_flat end_flat; + typedef bg::strategy::buffer::distance_symmetric + < + typename bg::coordinate_type

::type + > distance_strategy; + bg::strategy::buffer::side_straight side_strategy; + + using bg::strategy::buffer::point_circle; + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) + double const tolerance = 1000.0; +#else + double const tolerance = 1.0; +#endif + + // Area should be somewhat larger (~>) than pi*distance^2 + // 6051788: area ~> 115058122875258 + + // Strategies with many points, which are (very) slow in debug mode + test_with_custom_strategies( + "mysql_report_2015_02_25_1_8000", + mysql_report_2015_02_25_1, join, end_flat, + distance_strategy(6051788), side_strategy, point_circle(8000), + 115058661065242.812, ut_settings(10.0 * tolerance)); + + // Expectations: + // 115058672785641.031 + // 115058672785680.281 + // 115058672785679.922 + test_with_custom_strategies( + "mysql_report_2015_02_25_1", + mysql_report_2015_02_25_1, join, end_flat, + distance_strategy(6051788), side_strategy, point_circle(83585), + 115058672785660.0, ut_settings(25.0 * tolerance)); + + // Takes about 7 seconds in release mode + // Expectations: + // 115058672880035.391 + // 115058672879944.547 + // 115058672879920.484 + test_with_custom_strategies( + "mysql_report_2015_02_25_1_250k", + mysql_report_2015_02_25_1, join, end_flat, + distance_strategy(6051788), side_strategy, point_circle(250000), + 115058672879977.0, ut_settings(150.0 * tolerance)); + +#if defined(BOOST_GEOMETRY_BUFFER_INCLUDE_SLOW_TESTS) + // Takes about 110 seconds in release mode + test_with_custom_strategies( + "mysql_report_2015_02_25_1_800k", + mysql_report_2015_02_25_1, join, end_flat, + distance_strategy(6051788), side_strategy, point_circle(800000), + 115058672871849.219, ut_settings(tolerance)); +#endif + + // 5666962: area ~> 100890546298964 + // Expectations: + // 100891031341796.875 + // 100891031341794.766 + // 100891031341794.078 + test_with_custom_strategies( + "mysql_report_2015_02_25_2", + mysql_report_2015_02_25_2, join, end_flat, + distance_strategy(5666962), side_strategy, point_circle(46641), + 100891031341795.0, ut_settings(200.0 * tolerance)); + + // Multipoint b with large distances/many points + // Area ~> pi * 10x + + // Expectations: + // 3141871558222.398 + // 3141871558231.5166 + // 3141871558231.48926 + + test_with_custom_strategies( + "multipoint_b_50k", + multipoint_b, join, end_flat, + distance_strategy(1000000), side_strategy, point_circle(50000), + 3141871558227.0, ut_settings(40.0 * tolerance)); + +#if defined(BOOST_GEOMETRY_BUFFER_INCLUDE_SLOW_TESTS) + // Tests optimization min/max radius + // Takes about 55 seconds in release mode + test_with_custom_strategies( + "multipoint_b_500k", + multipoint_b, join, end_flat, + distance_strategy(10000000), side_strategy, point_circle(500000), + 314162054419515.562, ut_settings((tolerance)); +#endif +} + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + + test_all >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER) + test_all >(); +#endif + +#if defined(BOOST_GEOMETRY_COMPILER_MODE_RELEASE) && ! defined(BOOST_GEOMETRY_COMPILER_MODE_DEBUG) + test_many_points_per_circle >(); +#else + std::cout << "Skipping some tests in debug or unknown mode" << std::endl; +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/buffer/buffer_multi_polygon.cpp b/src/boost/libs/geometry/test/algorithms/buffer/buffer_multi_polygon.cpp new file mode 100644 index 000000000..b3548e355 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/buffer_multi_polygon.cpp @@ -0,0 +1,529 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2012-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2016. +// Modifications copyright (c) 2016, 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) + +#include "test_buffer.hpp" + + +static std::string const simplex + = "MULTIPOLYGON(((0 1,2 5,5 3,0 1)),((1 1,5 2,5 0,1 1)))"; + +static std::string const zonethru + = "MULTIPOLYGON(((0 0,0 6,5 6,5 4,3 4,3 0,0 0)),((5 0,5 2,7 2,7 6,10 6,10 0,5 0)))"; + +static std::string const wrapped + = "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(2 2,8 2,8 8,2 8,2 2)),((4 4,4 6,6 6,6 4,4 4)))"; + +static std::string const nested + = "MULTIPOLYGON(((0 0,0 14,14 14,14 0,0 0),(2 2,12 2,12 12,2 12,2 2)),((4 4,4 10,10 10,10 4,4 4),(6 6,8 6,8 8,6 8,6 6)))"; + +static std::string const triangles + = "MULTIPOLYGON(((0 4,3 0,-2.5 -1,0 4)),((3 8,5.5 13,8 8,3 8)),((11 4,13.5 -1,8 0,11 4)))"; + +static std::string const degenerate0 + = "MULTIPOLYGON()"; +static std::string const degenerate1 + = "MULTIPOLYGON(((5 5,5 5,5 5,5 5)),((6 6,6 6,6 6,6 6)))"; +static std::string const degenerate2 + = "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(5 5,5 5,5 5,5 5)),((11 5,11 5,11 5,11 5)))"; + +// From robustness tests (rt) + +// Case with duplicate points (due to chained boxes) (round) +static std::string const rt_a + = "MULTIPOLYGON(((2 7,2 8,3 8,3 7,2 7)),((5 4,5 5,6 5,6 4,5 4)),((5 8,6 8,6 7,6 6,5 6,5 7,4 7,4 8,5 8)),((3 5,4 5,4 4,3 4,2 4,2 5,3 5)))"; + +// Case with u-u (miter) +static std::string const rt_b + = "MULTIPOLYGON(((8 4,8 5,9 5,9 4,8 4)),((6 2,6 3,7 3,7 2,6 2)),((8 0,8 1,9 1,9 0,8 0)),((9 7,9 8,10 8,10 7,9 7)))"; + +// Case with geometry::equals( turn.point(7.0000000000000000, 4.3368086899420177e-019), helper_segment(7.0000000000000000, 0.00000000000000000))) (round) +static std::string const rt_c + = "MULTIPOLYGON(((6 1,6 2,7 2,7 1,6 1)),((8 0,8 1,9 1,9 0,8 0)))"; + +// Case with round corner on same perpendicular points (round) +static std::string const rt_d + = "MULTIPOLYGON(((2 2,2 3,3 2,2 2)),((2 5,2 6,3 5,2 5)),((2 4,2 5,3 4,2 4)),((3 2,3 3,4 2,3 2)),((4 4,4 5,5 4,4 4)),((5 6,5 5,4 5,4 6,5 7,5 6)),((2 2,3 1,3 0,2 0,2 1,1 1,1 2,2 2)),((1 3,1 2,0 2,1 3)),((1 4,2 4,2 3,1 3,1 4)))"; + +// Case with missing turning point (miter) and many intersections (round, OK) +static std::string const rt_e + = "MULTIPOLYGON(((0 6,0 7,1 6,0 6)),((3 7,3 8,4 8,4 7,3 7)),((4 6,4 7,5 7,4 6)),((3 6,3 7,4 6,3 6)),((1 9,2 10,2 9,1 9)),((1 9,1 8,0 8,0 9,1 9)),((3 5,3 4,2 4,2 5,2 6,3 5)))"; + +// Extract of e (miter) +static std::string const rt_f + = "MULTIPOLYGON(((0 6,0 7,1 6,0 6)),((1 9,1 8,0 8,0 9,1 9)))"; + +// Robustness / turn problem (collinearity with turn after), solved in get_turn-info +static std::string const rt_g1 + = "MULTIPOLYGON(((3 8,3 9,4 9,3 8)),((7 5,7 6,8 5,7 5)),((1 8,1 9,2 9,1 8)),((1 6,1 7,2 7,1 6)))"; + +static std::string const rt_g2 + = "MULTIPOLYGON(((6 5,7 5,6 4,5 4,5 5,6 5)),((4 2,4 3,5 3,4 2)))"; + +static std::string const rt_g3 + = "MULTIPOLYGON(((4 2,5 3,5 2,4 2)),((2 0,3 1,3 0,2 0)))"; + + +// IP on match of 3 lines +static std::string const rt_h + = "MULTIPOLYGON(((4 7,4 8,5 7,4 7)),((4 8,5 9,5 8,4 8)),((9 1,10 2,10 1,9 1)),((4 1,4 2,5 2,4 1)),((2 9,2 10,3 10,2 9)),((7 7,8 8,8 7,7 7)),((3 4,4 4,3 3,2 3,2 4,3 4)))"; + +// r=1.16 (touching) +static std::string const rt_i + = "MULTIPOLYGON(((2 1,2 2,3 2,2 1)),((3 2,3 3,4 3,3 2)))"; + +// r=1.16 (touching in the middle) +static std::string const rt_j + = "MULTIPOLYGON(((2 4,2 5,3 5,2 4)),((5 3,5 4,6 4,5 3)),((9 4,9 5,10 5,10 4,9 4)),((0 2,0 3,1 3,0 2)))"; + +// Occupied (but not completely - due to duplicate point there) +static std::string const rt_k + = "MULTIPOLYGON(((3 7,3 8,4 8,3 7)),((0 4,0 5,1 5,0 4)),((3 5,3 6,4 6,4 5,3 5)),((2 6,3 7,3 6,2 6)),((3 2,3 1,2 1,2 2,3 3,3 2)),((0 9,1 10,1 9,1 8,0 8,0 9)))"; + +// Segment-intersection problem (nearly collinear not reported as collinear), fixed +static std::string const rt_l + = "MULTIPOLYGON(((2 5,2 6,3 5,2 5)),((6 1,6 2,7 1,6 1)))"; + +// Segment-intersection problem (missed touch because of robustness) (with 4), fixed +static std::string const rt_m1 + = "MULTIPOLYGON(((4 2,4 3,5 2,4 2)),((1 2,2 3,2 2,1 2)))"; + +// Same, with 2 +static std::string const rt_m2 + = "MULTIPOLYGON(((0 3,1 4,1 3,0 3)),((3 6,4 7,4 6,4 5,3 5,3 6)))"; + +// Segment-intersection problem (disjoint nearly collinear segments were reported as intersecting), fixed. +static std::string const rt_n + = "MULTIPOLYGON(((0 0,1 1,1 0,0 0)),((3 3,4 4,4 3,3 3)))"; + +// Segment intersection of 3 pieces in one point, plus all intersection points are within the other piece (due to precision) +static std::string const rt_o1 + = "MULTIPOLYGON(((8 4,8 5,9 5,8 4)),((9 4,10 5,10 4,9 4)),((6 2,6 3,7 3,6 2)))"; + +static std::string const rt_o2 + = "MULTIPOLYGON(((8 4,8 5,9 5,8 4)),((6 5,7 4,6 4,6 5)),((9 4,10 5,10 4,9 4)),((6 2,6 3,7 3,6 2)))"; + +static std::string const rt_o3 + = "MULTIPOLYGON(((8 4,8 5,9 5,8 4)),((6.5 5,7.5 4,6.5 4,6.5 5)),((8.5 4,9.5 5,9.5 4,8.5 4)),((6 2,6 3,7 3,6 2)),((10 4,11 5,11 4,10 4)))"; + +static std::string const rt_o4 + = "MULTIPOLYGON(((8 4,8 5,9 5,8 4)),((6.5 5,7.5 4,6.5 4,6.5 5)),((8.5 4,9.5 5,9.5 4,8.5 4)),((6 2,6 3,7 3,6 2)),((10 4,11 5,11 4,10 4)),((10 3,11 3,11 2,10 3)))"; + +// Occupied - intersection +static std::string const rt_p1 + = "MULTIPOLYGON(((5 2,5 3,6 3,6 2,5 2)),((8 0,8 1,9 0,8 0)),((8 2,9 3,9 2,8 2)))"; + +static std::string const rt_p2 + = "MULTIPOLYGON(((9 3,9 4,10 3,9 3)),((9 4,9 5,10 5,9 4)),((8 6,9 7,9 6,8 6)))"; + +static std::string const rt_p3 + = "MULTIPOLYGON(((3 8,3 9,4 9,3 8)),((3 7,3 8,4 8,3 7)),((0 8,0 9,1 8,0 8)))"; + +// Occupation map: robustness, nearly collinear, both incoming +static std::string const rt_p4 + = "MULTIPOLYGON(((8 8,9 9,9 8,8 8)),((5 8,5 9,6 9,5 8)),((6 5,6 6,7 6,6 5)),((4 7,4 8,5 8,4 7)))"; + +// Occupation map: Two collinear segments intersecting one segment +static std::string const rt_p5 + = "MULTIPOLYGON(((3 2,4 3,4 2,3 2)),((2 2,2 3,3 3,3 2,2 2)),((4 3,5 4,5 3,4 3)))"; + +// Occupied map: only two pieces involved so leave early +static std::string const rt_p6 + = "MULTIPOLYGON(((7 3,7 4,8 3,7 3)),((7 6,8 7,8 6,7 6)))"; + +// Occupation map: needing relaxed_less for map +static std::string const rt_p7 + = "MULTIPOLYGON(((6 6,7 7,7 6,6 6)),((3 4,3 5,4 4,3 4)),((2 6,3 7,3 6,2 6)))"; + +// Occupation map: needing relaxed_less PLUS relaxed_equals for map +static std::string const rt_p8 + = "MULTIPOLYGON(((4 7,4 8,5 7,4 7)),((5 3,6 4,6 3,5 3)),((8 5,8 6,9 6,8 5)))"; + +// Occupation map: needing go back for extra outgoing vectors too +static std::string const rt_p9 + = "MULTIPOLYGON(((1 6,1 7,2 6,1 6)),((4 3,4 4,5 3,4 3)),((3 4,2 3,2 4,3 5,3 4)))"; + +static std::string const rt_p10 + = "MULTIPOLYGON(((6 6,7 7,7 6,6 6)),((4 6,5 7,5 6,4 6)),((8 8,9 9,9 8,8 8)))"; + +// Occupation map, multiple back/forward cases and combinations +static std::string const rt_p11 + = "MULTIPOLYGON(((0 8,0 9,1 9,1 8,0 8)),((2 8,2 9,3 9,3 8,2 8)),((3 8,4 9,4 8,3 8)),((4 1,4 2,5 2,4 1)))"; + +// Occupation map - incoming angle, non-zero +static std::string const rt_p12 + = "MULTIPOLYGON(((8 4,9 5,9 4,8 4)),((5 5,5 6,6 6,6 5,5 5)),((8 4,8 3,7 3,8 4)))"; + +// Occupation map - outgoing angle, 1 +static std::string const rt_p13 + = "MULTIPOLYGON(((5 2,6 3,6 2,5 2)),((3 0,4 1,4 0,3 0)),((3 1,3 2,4 2,4 1,3 1)))"; + +// Occupation map - touch which was originally in other segment-id +static std::string const rt_p14 + = "MULTIPOLYGON(((9 9,10 10,10 9,9 9)),((7 7,8 8,8 7,7 7)),((6 6,6 7,7 7,7 6,6 6)))"; + +// Occupation map - needing measuring sides from original point and not center point +static std::string const rt_p15 + = "MULTIPOLYGON(((5 2,5 3,6 3,6 2,5 2)),((4 1,5 2,5 1,4 1)),((8 5,9 6,9 5,8 5)))"; + +// Occupation map - needing other approach w.r.t. discarding (collinear) segments +static std::string const rt_p16 + = "MULTIPOLYGON(((5 7,5 8,6 7,5 7)),((9 3,9 4,10 3,9 3)),((6 7,7 8,7 7,6 7)))"; + +// Occupation map - outputting two valid turns (resulting in the wrong choice in the end) +static std::string const rt_p17 + = "MULTIPOLYGON(((4 8,5 9,5 8,4 8)),((1 8,2 9,2 8,1 8)),((2 6,3 7,3 6,2 6)))"; + +// Occupation map - outputting no valid turns (needing to take other turns into account) +static std::string const rt_p18 + = "MULTIPOLYGON(((7 6,8 7,8 6,7 6)),((7 3,7 4,8 3,7 3)),((5 4,6 5,6 4,5 4)))"; + +// Occupation map - showing wrong approach in p17/p18, now new approach with keep_indices +static std::string const rt_p19 + = "MULTIPOLYGON(((0 5,1 6,1 5,0 5)),((0 7,0 8,1 7,0 7)),((3 4,3 5,4 4,3 4)))"; + +// Occupation map: two non-collinear segments non-intersecting, needing relaxed_equal +static std::string const rt_p20 + = "MULTIPOLYGON(((2 3,2 4,3 4,3 3,2 3)),((0 5,0 6,1 6,0 5)),((2 7,2 8,3 8,2 7)))"; + +// Occupation map: turn more right should still be included +static std::string const rt_p21 + = "MULTIPOLYGON(((4 2,4 3,5 3,4 2)),((4 1,5 2,5 1,4 1)),((5 2,6 3,6 2,5 2)))"; + +static std::string const rt_p22 + = "MULTIPOLYGON(((4 8,5 9,5 8,4 8)),((5 9,6 10,6 9,5 9)),((1 7,1 8,2 8,2 7,1 7)),((2 6,3 7,3 6,2 6)))"; + +// Occupation map with a uu-turn +static std::string const rt_q1 + = "MULTIPOLYGON(((4 6,4 7,5 7,5 6,4 6)),((1 6,1 7,2 7,2 6,1 6)),((1 9,1 10,2 10,2 9,1 9)))"; + +// Occupation map with twice a uu-turn +static std::string const rt_q2 + = "MULTIPOLYGON(((0 6,0 7,1 6,0 6)),((2 6,2 7,3 6,2 6)),((4 5,3 5,3 6,4 6,5 6,5 5,4 4,4 5)))"; + +// Robustness issue related to collinear correction (meeting) and selecting the right axis (x/y) +static std::string const rt_r + = "MULTIPOLYGON(((3 1,2 0,1 1,2 2,3 1)),((5 3,4 2,3 2,4 4,5 3)))"; + +// Robustness - flagged by "meeting" +static std::string const rt_s1 + = "MULTIPOLYGON(((4 1,5 2,5 1,4 1)),((5 2,6 3,6 2,5 2)),((7 1,7 2,8 1,7 1)))"; + +// Robustness - flagged by "disjoint" +static std::string const rt_s2 + = "MULTIPOLYGON(((0 0,1 1,1 0,0 0)),((2 4,2 5,3 4,2 4)),((3.5 3.5,4 4,4 3,3 3,3 4,3.5 3.5)))"; + +// Robustness issue in get_turn_info (touch, collinear, blocking q) +static std::string const rt_t + = "MULTIPOLYGON(((1 3,1 4,2 3,1 3)),((1 4,0 3,0 4,0 5,1 4)))"; + +// Created traversed ring +static std::string const rt_u1 + = "MULTIPOLYGON(((7 6,8 7,8 6,7 6)),((8 9,9 10,9 9,8 9)),((2 8,3 9,3 8,2 8)),((6 5,6 6,7 6,6 5)),((6 7,7 7,6 6,5 6,6 7)),((7 7,7 8,8 7,7 7)),((6 7,6 8,7 8,6 7)),((8 7,8 8,9 8,9 7,8 7)))"; + +static std::string const rt_u2 + = "MULTIPOLYGON(((4 2,5 3,5 2,4 2)),((6 4,6 5,7 5,6 4)),((7 4,7 5,8 5,7 4)),((7 3,7 4,8 3,7 3)),((7 10,8 10,7 9,6 9,7 10)),((0 7,0 8,1 7,0 7)),((6 1,6 2,7 2,7 1,6 1)),((5 7,5 8,6 9,6 8,7 9,7 8,7 7,6 6,6 7,5 7)),((5 4,6 4,6 3,5 3,4 3,4 4,5 4)),((5 2,6 2,5 1,4 0,3 0,4 1,3 1,3 2,3 3,4 3,4 2,4.5 1.5,5 2)),((5 6,5 5,4 5,4 6,4 7,5 7,5 6)),((5 0,5 1,5.5 0.5,6 1,6 0,5 0)),((5 9,5 8,4 8,3 8,2 8,1 8,0 8,1 9,1 10,2 9,2 10,3 10,4 10,5 10,5 9)),((4 5,4 4,3 4,3 3,2 3,1 3,0 3,0 4,0 5,0 6,1 6,2 5,1 5,1 4,2 4,3 5,2 5,2 6,2.5 5.5,3 6,4 5)),((3 2,2 2,2 3,3 2)),((2 0,1 0,2 1,3 0,2 0)),((1 1,0 1,0 2,0 3,1 2,1.5 1.5,2 2,3 1,2 1,1 1)),((2 6,1 6,1 7,2 7,3 7,2 6)),((4 8,4 7,3 7,4 8)),((9 6,8 6,7 6,7 7,8 7,8.5 6.5,9 7,8 7,8 8,8.5 7.5,9 8,8 8,8 9,9 9,9 10,10 10,10 9,10 8,10 7,10 6,10 5,9 4,9 5,8 5,9 6)),((7 0,6 0,7 1,8 1,7 0)),((8 3,9 2,8 2,7 2,8 3)),((10 2,10 1,10 0,9 0,9 1,8 1,8 2,8.5 1.5,9 2,9 3,10 4,10 3,10 2)),((9 4,9 3,8 3,8 4,9 4)))"; + +static std::string const rt_u3 + = "MULTIPOLYGON(((3 0,4 1,4 0,3 0)),((2 0,2 1,3 1,2 0)),((6 7,7 8,7 7,6 7)),((1 2,2 3,2 2,1 2)),((9 1,10 2,10 1,9 1)),((0 2,0 3,1 3,1 2,0 2)),((5 0,5 1,6 1,6 0,5 0)),((1 1,2 2,2 1,1 1)),((0 7,0 8,1 7,0 7)),((9 0,10 1,10 0,9 0)),((0 5,0 6,1 6,1 5,0 5)),((1 6,2 7,2 6,1 6)),((7 0,8 1,8 0,7 0)),((8 6,9 7,9 6,8 6)),((9 6,10 7,10 6,9 6)),((1 4,1 5,2 5,1 4)),((5 6,4 5,4 6,5 7,5 6)),((5 4,4.5 3.5,5 3,4 3,4 2,3 1,3 2,3 3,2 3,2 4,3 4,4 4,5 5,5 4)),((4 7,3 7,3 8,4 9,5 10,6 10,6 9,5 9,4 8,5 8,4 7)),((6 3,5 3,5 4,5.5 3.5,6 4,7 4,7 3,8 3,8 2,8 1,7 1,6 1,6 2,6 3)),((3 5,2 4,2 5,2 6,3 5)),((1 1,1 0,0 0,0 1,1 2,1 1)),((2 9,2 8,1 8,0 8,1 9,1 10,1.5 9.5,2 10,2.5 9.5,3 10,3 9,2 9)),((6 5,6 6,7 7,8 7,8 6,7 6,7 5,6 4,6 5)),((7 8,6 8,6 9,7 9,8 8,7 8)),((9 10,10 10,10 9,10 8,9 7,9 8,8 8,9 9,8 9,8 10,9 10)))"; + +static std::string const rt_u4 + = "MULTIPOLYGON(((5 0,6 1,6 0,5 0)),((6 1,6 2,7 2,7 1,6 1)),((6 6,7 7,7 6,6 6)),((4 7,4 8,5 8,4 7)),((1 6,1 7,2 7,1 6)),((3 4,3 5,4 5,3 4)),((2 0,2 1,3 0,2 0)),((7 2,7 3,8 3,7 2)),((3 3,4 4,4 3,3 3)),((5 9,5 10,6 10,7 10,6 9,5 8,5 9)),((5 4,5 5,6 4,5 4)),((3 1,4 2,4 1,3 1)),((3 0,3 1,4 0,3 0)),((2 7,2 8,3 8,3 7,2 7)),((9 2,9 3,10 2,9 2)),((6 2,6 3,7 3,6 2)),((8 8,9 9,9 8,8 8)),((2 1,2 2,3 2,3 1,2 1)),((4 3,5 4,5 3,4 3)),((4 6,5 7,5 6,4 6)),((1 8,1 9,2 8,1 7,1 8)),((8 8,9 7,8 7,7 7,7 8,8 8)),((8 1,8 2,9 2,9 1,10 1,9 0,8 0,8 1)),((5 2,4 2,4 3,5 2)),((2 5,1 5,1 6,2 6,3 5,2 5)),((1 3,2 4,2 3,2 2,1 1,0 1,1 2,1 3)),((1 0,0 0,1 1,2 1,1.5 0.5,2 0,1 0)),((2 10,3 10,4 10,4 9,3 9,2 8,2 9,1 9,0 9,1 10,2 10)),((9 5,9 6,10 6,10 5,10 4,9 4,8.5 3.5,9 3,8 3,8 4,7 4,7 5,8 5,9 5)),((7 0,6 0,7 1,8 1,7 0)),((7 9,7 8,6 8,6 9,7 9)))"; + +static std::string const rt_u5 + = "MULTIPOLYGON(((4 3,4 4,5 4,5 3,4 3)),((6 5,6 6,7 6,6 5)),((5 4,6 5,6 4,5 4)),((4 0,4 1,5 1,5 0,4 0)),((7 8,8 9,8 8,7 8)),((8 2,8 3,9 3,8 2)),((2 1,2 2,3 1,2 1)),((5 7,5 8,6 8,5 7)),((4 5,4 6,5 5,4 5)),((7 0,8 1,8 0,7 0)),((7 2,8 1,7 1,6 1,7 2)),((3 3,4 3,4 2,3 2,3 3)),((3 9,3 10,4 9,3 9)),((1 2,2 3,2 2,1 2)),((2 4,2 5,3 4,2 3,2 4)),((3 7,4 7,3 6,2 6,3 7)))"; + +static std::string const rt_u6 + = "MULTIPOLYGON(((2 2,3 3,3 2,2 2)),((9 8,9 9,10 9,10 8,9 8)),((5 3,6 4,6 3,5 3)),((5 5,5 6,6 6,5 5)),((5 1,6 2,6 1,5 1)),((6 5,7 6,7 5,6 5)),((3 0,4 1,4 0,3 0)),((6 6,6 7,7 6,6 6)),((9 2,10 2,10 1,9 1,9 2)),((6 8,6 9,7 9,7 8,6 8)),((7 0,7 1,8 0,7 0)),((4 4,4 5,5 5,4 4)),((0 7,0 8,1 8,0 7)),((5 9,6 10,6 9,5 9)),((4 9,4 10,5 10,5 9,4 9)),((3 7,4 7,3 6,2 6,3 7)),((9 7,10 6,9 6,8 6,9 7)),((5 3,5 2,4 2,4 3,4 4,5 4,5 3)),((1 1,2 0,1 0,0 0,1 1)),((2 10,3 10,3 9,2 9,1 9,1 10,2 10)),((8.5 4.5,9 4,8 4,7 4,8 5,9 5,8.5 4.5)),((8 3,9 3,9 2,8 2,8 3)))"; + +// This case has colocated intersection points and is fixed by specific sorting in enrich_intersection_points +static std::string const rt_u7 + = "MULTIPOLYGON(((4 5,4 6,5 5,4 5)),((9 2,9 3,10 3,10 2,9 2)),((7 3,7 4,8 4,8 3,7 3)),((5 5,6 6,6 5,5 5)),((3 6,4 7,4 6,3 6)),((0 5,0 6,1 5,0 5)))"; + +// This case is also fixed by sorting order in enrich_intersection_points. It also has IP's between piece and original (due to rounding/rescaling pieces but not original) but that is not problematic +// anymore by the fix in sorting +static std::string const rt_u8 + = "MULTIPOLYGON(((4 3,4 4,5 4,5 3,4 3)),((6 3,6 4,7 4,7 3,6 3)),((9 0,9 1,10 0,9 0)),((9 3,9 4,10 4,10 3,9 3)),((8 2,9 2,9 1,8 1,8 2)),((8 4,8 5,9 4,8 4)),((9 1,10 2,10 1,9 1)),((6 7,7 8,7 7,6 7)),((4 6,4 7,5 7,4 6)),((8 8,8 9,9 9,8 8)),((3 2,3 3,4 3,4 2,3 2)),((7 1,8 1,8 0,7 0,6 0,6 1,7 1)))"; + +// Fixed by checking IP's between piece and original (using robust represention of original) +static std::string const rt_u9 + = "MULTIPOLYGON(((2 3,2 4,3 4,2 3)),((9 8,9 9,10 9,10 8,9 8)),((6 3,6 4,7 4,6 3)),((5 8,5 9,6 9,5 8)),((9 5,9 6,10 6,9 5)),((4 4,4 5,5 5,5 4,4 4)),((7 7,7 8,8 8,7 7)),((8 6,8 7,9 6,8 6)),((6 7,7 7,6 6,5 6,5 7,6 7)))"; + +// Fixed by fixing border check for IP's +static std::string const rt_u10 + = "MULTIPOLYGON(((7 5,8 6,8 5,7 5)),((4 5,5 6,5 5,5 4,4 4,4 5)),((9 5,10 5,10 4,9 4,8 4,9 5)),((1 2,1 1,0 1,1 2)),((6 6,6 7,7 7,7 6,6 6)),((3 6,3 7,4 6,3 6)),((8 6,8 7,9 6,8 6)),((1 3,1 4,2 3,1 3)),((9 9,10 8,9 8,9 7,8 7,8 8,9 9)),((9 2,10 3,10 2,9 2)),((2 5,2 6,3 6,2 5)),((1 9,1 10,2 10,2 9,1 9)),((4 6,4 7,5 7,5 6,4 6)),((6 0,6 1,7 1,7 0,6 0)),((0 9,0 10,1 10,0 9)),((3.5 5.5,4 6,4 5,3 5,3 6,3.5 5.5)),((9 3,9 4,10 3,9 3)),((9 9,10 10,10 9,9 9)),((1 6,2 7,2 6,1 6)),((4 2,4 3,5 2,4 2)),((5 10,4 9,4 10,5 10)),((0 3,1 2,0 2,0 3)),((5 8,4 8,5 9,6 10,6 9,7 9,7 8,6 8,5 7,5 8)),((6 2,5 2,5 3,5.5 2.5,6 3,6 4,7 4,8 4,8 3,7 3,7 2,6 2)),((4 0,3 0,3 1,2.5 0.5,3 0,2 0,2 1,2 2,3 3,3 2,4 2,4 1,5 0,4 0)),((3 5,4 4,3 4,2 4,3 5)),((0 6,0 7,1 7,1 6,1 5,0 5,0 6)),((2 8,3 8,3 7,2 7,1 7,1 8,2 8)),((9 1,9 0,8 0,8 1,8 2,9 1)),((7 10,8 10,8 9,7 9,7 10)))"; + +// Fixed by blocking IP's instead of discarding them +static std::string const rt_u11 + = "MULTIPOLYGON(((7 3,8 4,8 3,7 3)),((4 8,5 9,5 8,4 8)),((7 1,8 2,8 1,7 1)),((7 2,8 3,8 2,7 2)),((0 1,0 2,1 2,0 1)),((8 1,9 2,9 1,8 1)),((6 9,6 8,5 8,6 9)),((7 9,7 10,8 10,7 9)),((0 7,1 8,1 7,0 7)),((6 4,6 5,7 5,7 4,6 4)),((7 4,8 5,8 4,7 4)),((4 2,4 3,5 3,5 2,4 2)),((5 5,5 6,6 6,6 5,5 5)),((5 9,6 10,6 9,5 9)),((4 8,4 7,3 7,3 8,4 8)),((5 5,6 4,5 4,4 4,4 5,5 5)),((4.5 0.5,5 0,4 0,4 1,5 2,6 2,6 3,7 4,7 3,7 2,7 1,6 1,6 0,5 0,5 1,4.5 0.5)),((4 6,3 5,3 6,4 7,5 7,5 6,4 6)),((2 3,1 3,0 3,1 4,1 5,1 6,2 6,2 5,2 4,2 3)),((3 4,4 4,3 3,2 3,3 4)),((3 9,4 9,3 8,2 8,2 9,3 9)),((1 9,1 8,0 8,0 9,1 10,2 9,1 9)),((3 7,3 6,2 6,2 7,3 7)),((8 6,8 7,9 7,9 6,9 5,8 5,8 6)),((9 1,10 2,10 1,10 0,9 0,9 1)),((8 8,8 7,7 7,7 8,8 8)),((6 8,7 9,7 8,6 7,6 8)),((10 9,10 8,10 7,9 7,9 8,9 9,9 10,10 10,10 9)))"; + +static std::string const rt_u12 + = "MULTIPOLYGON(((9 0,9 1,10 0,9 0)),((1 0,1 1,2 1,2 0,1 0)),((4 0,4 1,5 0,4 0)),((1 2,1 3,2 2,1 2)),((3 7,4 8,4 7,3 7)),((3 6,4 7,4 6,3 6)),((6 9,7 10,7 9,6 9)),((5 6,5 7,6 7,5 6)),((7 6,7 7,8 7,7 6)),((7 3,7 4,8 3,7 3)),((8 7,8 8,9 7,8 6,8 7)),((8 5,8 6,9 6,8 5)),((6 4,6 5,7 5,6 4)),((2 9,2 10,3 10,2 9)),((1 4,2 5,2 4,1 4)),((2 2,2 3,3 3,2 2)),((3 2,3 3,4 3,3 2)),((9 5,10 6,10 5,9 5)),((4 4,5 5,5 4,4 4)),((5 10,6 10,6 9,5 9,4 9,4 10,5 10)),((5 3,5 4,6 4,6 3,6 2,6 1,5 1,5 2,4 2,4 3,5 3)),((0 6,1 6,1 5,0 5,0 6)),((3 5,4 6,4 5,4 4,3 4,3 5)),((2 2,3 2,4 2,4 1,3 1,2 1,2 2)),((2 8,1 8,2 9,3 9,2 8)),((2 6,1 6,2 7,3 6,2 6)),((0 9,1 10,1 9,0 8,0 9)),((1 8,1 7,0 7,1 8)),((9 5,10 4,9 4,8 4,8 5,9 5)),((6 1,7 1,6.5 0.5,7 0,6 0,6 1)),((8 1,9 1,8.5 0.5,9 0,8 0,8 1)),((6 7,7 7,6.5 6.5,7 6,6 6,6 7)),((6.5 8.5,7 9,7 8,6 8,6 9,6.5 8.5)),((9 9,10 10,10 9,9 8,9 9)))"; + +static std::string const rt_u13 + = "MULTIPOLYGON(((6 4,6 5,7 5,6 4)),((3 2,3 3,4 3,3 2)),((7 8,7 9,8 9,8 8,7 8)),((4 9,4 10,5 10,4 9)),((7 7,7 8,8 7,7 7)),((2 6,2 7,3 7,2 6)),((0 1,1 2,1 1,0 1)),((3 1,4 2,4 1,3 1)),((2 5,2 6,3 6,2 5)),((3 5,4 4,3 4,2 4,3 5)),((4 1,5 2,5 1,4 1)),((2 0,2 1,3 1,2 0)),((5 7,5 8,6 7,5 7)),((0 2,0 3,1 3,0 2)),((9 8,9 9,10 9,10 8,9 8)),((7 5,7 6,8 5,7 5)),((5 6,5 7,6 6,5 6)),((0 6,0 7,1 7,1 6,0 6)),((5 0,5 1,6 1,5 0)),((8 7,8 8,9 8,8 7)),((4.5 4.5,5 4,4 4,4 5,5 5,4.5 4.5)),((6 2,5 2,5 3,6 3,7 3,8 2,7 2,6 2)),((8 6,8 7,9 7,9 6,9 5,8 5,8 6)),((8 1,9 0,8 0,7 0,8 1)))"; + +static std::string const neighbouring + = "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((10 10,10 20,20 20,20 10,10 10)))"; + +static std::string const neighbouring_with_holes + = "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((10 10,10 20,20 20,20 10,10 10),(14 14,14 16,16 16,16 14,14 14)))"; + + +// MultiPolygons causing assertion failure +static std::string const mysql_report_2015_07_05_1 + = "MULTIPOLYGON(((44 25,2.68435e+08 1.75922e+13,-6.87195e+10 -6.87195e+10,44 25),(-9704 8028,1.01776e+308 4.42027e+307,1.34218e+08 7.20576e+16,-9704 8028),(27945 15972,13 24,18 34,27945 15972),(3.3444e+307 1.47467e+308,1.22536e+38 1.42547e+38,10 -88,-28578 24802,3.3444e+307 1.47467e+308)))"; +static std::string const mysql_report_2015_07_05_2 + = "MULTIPOLYGON(((19777 -21893,3.22595e+307 6.86823e+307,-40 -13,19777 -21893)),((-1322 4851,8.49998e+307 3.94481e+307,75 -69,8.64636e+307 3.94909e+307,-1.15292e+18 7.20576e+16,-1322 4851)))"; + +template +void test_all() +{ + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multi_polygon_type; + + bg::strategy::buffer::join_miter join_miter; + bg::strategy::buffer::join_round join_round(100); + bg::strategy::buffer::join_round join_round_rough(12); + bg::strategy::buffer::end_flat end_flat; + + bg::strategy::buffer::join_round join_round32(32); + bg::strategy::buffer::end_round end_round32(32); + + test_one("triangles424", triangles, join_miter, end_flat, 417.910, 4.24); + test_one("triangles425", triangles, join_miter, end_flat, 418.918, 4.25); + test_one("triangles426", triangles, join_miter, end_flat, 419.927, 4.26); + test_one("zonethru_10", zonethru, join_miter, end_flat, 96.0000, 1.0); + + test_one("multi_simplex_05", simplex, join_round, end_flat, 23.7030, 0.5); + test_one("multi_simplex_05", simplex, join_miter, end_flat, 24.5965, 0.5); + test_one("multi_simplex_10", simplex, join_round, end_flat, 34.2532, 1.0); + test_one("multi_simplex_10", simplex, join_miter, end_flat, 38.1379, 1.0); + test_one("multi_simplex_20", simplex, join_round, end_flat, 59.9159, 2.0); + test_one("multi_simplex_20", simplex, join_miter, end_flat, 77.7060, 2.0); + test_one("multi_simplex_50", simplex, join_round, end_flat, 174.46, 5.0); + test_one("multi_simplex_50", simplex, join_miter, end_flat, 298.797, 5.0); + + test_one("multi_simplex_01", simplex, join_round, end_flat, 9.7514, -0.1); + test_one("multi_simplex_05", simplex, join_round, end_flat, 3.2019, -0.5); + test_one("multi_simplex_10", simplex, join_round, end_flat, 0.2012, -1.0); + test_one("multi_simplex_12", simplex, join_round, end_flat, 0.0, -1.2); + + test_one("zonethru_05", zonethru, join_round, end_flat, 67.4627, 0.5); + test_one("zonethru_05", zonethru, join_miter, end_flat, 68.0000, 0.5); + test_one("zonethru_10", zonethru, join_round, end_flat, 93.8508, 1.0); + test_one("zonethru_10", zonethru, join_miter, end_flat, 96.0000, 1.0); + test_one("zonethru_15", zonethru, join_round, end_flat, 114.584, 1.5); + test_one("zonethru_15", zonethru, join_miter, end_flat, 117.000, 1.5); + + test_one("wrapped_05", wrapped, join_round, end_flat, 104.570, 0.5); + test_one("wrapped_05", wrapped, join_miter, end_flat, 105.000, 0.5); + test_one("wrapped_10", wrapped, join_round, end_flat, 142.281, 1.0); + test_one("wrapped_10", wrapped, join_miter, end_flat, 144.000, 1.0); + test_one("wrapped_15", wrapped, join_round, end_flat, 167.066, 1.5); + test_one("wrapped_15", wrapped, join_miter, end_flat, 169.000, 1.5); + + test_one("wrapped_05", wrapped, join_round, end_flat, 33.215, -0.5); + test_one("wrapped_05", wrapped, join_miter, end_flat, 33.000, -0.5); + test_one("wrapped_15", wrapped, join_round, end_flat, 0.0, -1.5); + test_one("wrapped_15", wrapped, join_miter, end_flat, 0.0, -1.5); + test_one("wrapped_25", wrapped, join_round, end_flat, 0.0, -2.5); + test_one("wrapped_25", wrapped, join_miter, end_flat, 0.0, -2.5); + test_one("wrapped_50", wrapped, join_round, end_flat, 0.0, -5.0); + test_one("wrapped_50", wrapped, join_miter, end_flat, 0.0, -5.0); + + test_one("nested_05", nested, join_round, end_flat, 191.570, 0.5); + test_one("nested_05", nested, join_round, end_flat, 64.430, -0.5); + test_one("nested_10", nested, join_round, end_flat, 254.279, 1.0); + test_one("nested_10", nested, join_round, end_flat, 1.721, -1.0); + test_one("nested_25", nested, join_round, end_flat, 355.622, 2.5); + test_one("nested_25", nested, join_round, end_flat, 0.0, -2.5); + // 3.0 is exactly touching (for the deflate case) + test_one("nested_30", nested, join_round, end_flat, 392.256, 3.0); + test_one("nested_30", nested, join_round, end_flat, 0.0, -3.0); + test_one("nested_29", nested, join_round, end_flat, 384.803, 2.9); + test_one("nested_29", nested, join_round, end_flat, 0.0, -2.9); + test_one("nested_31", nested, join_round, end_flat, 399.771, 3.1); + test_one("nested_31", nested, join_round, end_flat, 0.0, -3.1); + + test_one("degenerate0", degenerate0, join_round, end_flat, 0.0, 1.0); + test_one("degenerate1", degenerate1, join_round, end_flat, 5.708, 1.0); + test_one("degenerate2", degenerate2, join_round, end_flat, 133.0166, 0.75); + + test_one("rt_a", rt_a, join_round, end_flat, 34.5381, 1.0); + test_one("rt_a", rt_a, join_miter, end_flat, 36.0, 1.0); + test_one("rt_b", rt_b, join_round, end_flat, 31.4186, 1.0); + test_one("rt_b", rt_b, join_miter, end_flat, 34.0, 1.0); + test_one("rt_c", rt_c, join_round, end_flat, 14.7093, 1.0); + test_one("rt_c", rt_c, join_miter, end_flat, 16.0, 1.0); + test_one("rt_d", rt_d, join_round, end_flat, 18.8726, 0.3); + test_one("rt_e", rt_e, join_round, end_flat, 14.1866, 0.3); + + test_one("rt_g1", rt_g1, join_round, end_flat, 24.719, 1.0); + test_one("rt_g3", rt_g3, join_miter, end_flat, 16.5711, 1.0); + + test_one("rt_d", rt_d, join_miter, end_flat, 19.8823, 0.3); + test_one("rt_e", rt_e, join_miter, end_flat, 15.1198, 0.3); + test_one("rt_f", rt_f, join_miter, end_flat, 4.60853, 0.3); +#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + test_one("rt_g1", rt_g1, join_miter, end_flat, 30.3137, 1.0); + test_one("rt_g2", rt_g2, join_miter, end_flat, 18.5711, 1.0); +#endif + + test_one("rt_h", rt_h, join_round, end_flat, 47.6012, 1.0); + test_one("rt_h", rt_h, join_miter, end_flat, 61.7058, 1.0); + test_one("rt_i", rt_i, join_round, end_flat, 10.7528, 1.0); +#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + test_one("rt_i", rt_i, join_miter, end_flat, 13.6569, 1.0); +#endif + test_one("rt_j", rt_j, join_round, end_flat, 28.7309, 1.0); + test_one("rt_j", rt_j, join_miter, end_flat, 35.1421, 1.0); + test_one("rt_k", rt_k, join_round, end_flat, 42.0092, 1.0); + test_one("rt_k", rt_k, join_miter, end_flat, 48.0563, 1.0); + + test_one("rt_l", rt_l, join_miter, end_flat, 19.3995, 1.0); + + test_one("rt_m1", rt_m1, join_round, end_flat, 14.1074, 1.0); + test_one("rt_m1", rt_m1, join_miter, end_flat, 19.4853, 1.0); + test_one("rt_m2", rt_m2, join_miter, end_flat, 21.4853, 1.0); + + test_one("rt_n", rt_n, join_miter, end_flat, 18.4853, 1.0); + + test_one("rt_o1", rt_o1, join_round, end_flat, 17.536, 1.0); + test_one("rt_o1", rt_o1, join_miter, end_flat, 20.9142, 1.0); + test_one("rt_o2", rt_o2, join_miter, end_flat, 25.7426, 1.0); + test_one("rt_o3", rt_o3, join_miter, end_flat, 28.8247, 1.0); + test_one("rt_o4", rt_o4, join_miter, end_flat, 34.6532, 1.0); + + test_one("rt_p1", rt_p1, join_miter, end_flat, 24.8211, 1.0); + test_one("rt_p2", rt_p2, join_miter, end_flat, 21.4853, 1.0); + test_one("rt_p3", rt_p3, join_miter, end_flat, 22.3995, 1.0); + test_one("rt_p4", rt_p4, join_miter, end_flat, 33.0563, 1.0); + test_one("rt_p5", rt_p5, join_miter, end_flat, 17.0, 1.0); + + test_one("rt_p6", rt_p6, join_miter, end_flat, 18.4853, 1.0); +#if defined(BOOST_GEOMETRY_USE_KRAMER) || defined(BOOST_GEOMETRY_TEST_FAILURES) + test_one("rt_p7", rt_p7, join_miter, end_flat, 26.2279, 1.0); +#endif + +#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + test_one("rt_p8", rt_p8, join_miter, end_flat, 29.0563, 1.0); +#endif + test_one("rt_p9", rt_p9, join_miter, end_flat, 26.1421, 1.0); + test_one("rt_p10", rt_p10, join_miter, end_flat, 23.3995, 1.0); + + test_one("rt_p11", rt_p11, join_miter, end_flat, 28.7426, 1.0); + test_one("rt_p12", rt_p12, join_miter, end_flat, 22.5711, 1.0); + test_one("rt_p13", rt_p13, join_miter, end_flat, 19.9142, 1.0); + test_one("rt_p14", rt_p14, join_miter, end_flat, 20.8284, 1.0); + test_one("rt_p15", rt_p15, join_miter, end_flat, 23.6569, 1.0); +#if defined(BOOST_GEOMETRY_USE_KRAMER) || defined(BOOST_GEOMETRY_TEST_FAILURES) + test_one("rt_p16", rt_p16, join_miter, end_flat, 23.4853, 1.0); +#endif + + test_one("rt_p17", rt_p17, join_miter, end_flat, 25.3137, 1.0); + +#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + test_one("rt_p18", rt_p18, join_miter, end_flat, 23.3137, 1.0); +#endif + test_one("rt_p19", rt_p19, join_miter, end_flat, 25.5637, 1.0); +#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + test_one("rt_p20", rt_p20, join_miter, end_flat, 25.4853, 1.0); +#endif + test_one("rt_p21", rt_p21, join_miter, end_flat, 17.1716, 1.0); +#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + test_one("rt_p22", rt_p22, join_miter, end_flat, 26.5711, 1.0); +#endif + + test_one("rt_q1", rt_q1, join_miter, end_flat, 27, 1.0); + test_one("rt_q2", rt_q2, join_miter, end_flat, 26.4853, 1.0); + test_one("rt_q2", rt_q2, join_miter, end_flat, 0.9697, -0.25); + + test_one("rt_r", rt_r, join_miter, end_flat, 21.0761, 1.0); +#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + test_one("rt_s1", rt_s1, join_miter, end_flat, 20.4853, 1.0); +#endif + +#if defined(BOOST_GEOMETRY_USE_KRAMER) || defined(BOOST_GEOMETRY_TEST_FAILURES) + test_one("rt_s2", rt_s2, join_miter, end_flat, 24.6495, 1.0); +#endif + + test_one("rt_t1", rt_t, join_miter, end_flat, 15.6569, 1.0); + test_one("rt_t2", rt_t, join_miter, end_flat, 0.1679, -0.25); + + test_one("rt_u1", rt_u1, join_round, end_flat, 33.2032, 1.0); + test_one("rt_u2", rt_u2, join_round, end_flat, 138.8001, 1.0); + test_one("rt_u3", rt_u3, join_round, end_flat, 133.4526, 1.0); + test_one("rt_u4", rt_u4, join_round, end_flat, 126.9268, 1.0); + test_one("rt_u5", rt_u5, join_round, end_flat, 78.4906, 1.0); + test_one("rt_u6", rt_u6, join_round, end_flat, 115.4461, 1.0); + + test_one("rt_u7", rt_u7, join_miter, end_flat, 42.6421, 1.0); + test_one("rt_u7", rt_u7, join_round, end_flat, 35.6233, 1.0); + test_one("rt_u7_rough", rt_u7, join_round_rough, end_flat, 35.1675, 1.0); + + test_one("rt_u8", rt_u8, join_miter, end_flat, 70.9142, 1.0); + test_one("rt_u9", rt_u9, join_miter, end_flat, 59.3063, 1.0); +#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + test_one("rt_u10", rt_u10, join_miter, end_flat, 144.0858, 1.0); // PG: 144.085786772487 +#endif + test_one("rt_u10_51", rt_u10, join_miter, end_flat, 0.1674, -0.51); // PG: 0.167380307629637 + + // TODO: now one small triangle missing due to clusters/uu turns + test_one("rt_u10_50", rt_u10, join_miter, end_flat, 0.2145, -0.50, ut_settings::ignore_validity()); // PG: 0.214466094067263 + test_one("rt_u10_45", rt_u10, join_miter, end_flat, 1.3000, -0.45); // PG: 1.30004221251301 + test_one("rt_u10_25", rt_u10, join_miter, end_flat, 9.6682, -0.25); // PG: 9.66820888343117 + + test_one("rt_u11", rt_u11, join_miter, end_flat, 131.3995, 1.0); + test_one("rt_u11_50", rt_u11, join_miter, end_flat, 0.04289, -0.50); + test_one("rt_u11_25", rt_u11, join_miter, end_flat, 10.1449, -0.25); + + test_one("rt_u12", rt_u12, join_miter, end_flat, 142.1348, 1.0); + test_one("rt_u13", rt_u13, join_miter, end_flat, 115.4853, 1.0); + + test_one("neighbouring_small", + neighbouring, + join_round32, end_round32, 128.0, -1.0); + test_one("neighbouring_with_holes_small", + neighbouring_with_holes, + join_round32, end_round32, 97.757, -1.0); + test_one("neighbouring_large", + neighbouring, + join_round32, end_round32, 0.0, -10.0); + test_one("neighbouring_with_holes_large", + neighbouring_with_holes, + join_round32, end_round32, 0.0, -10.0); + + // Check cases with extreme coordinates on assertions + test_one("mysql_report_2015_07_05_1", + mysql_report_2015_07_05_1, + join_round32, end_round32, ut_settings::ignore_area(), 5526.0, + ut_settings::assertions_only()); + + test_one("mysql_report_2015_07_05_2", + mysql_report_2015_07_05_2, + join_round32, end_round32, ut_settings::ignore_area(), 948189399.0, + ut_settings::assertions_only()); +} + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + + test_all >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/buffer/buffer_point.cpp b/src/boost/libs/geometry/test/algorithms/buffer/buffer_point.cpp new file mode 100644 index 000000000..f1f3d5eb2 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/buffer_point.cpp @@ -0,0 +1,41 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2012-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include "test_buffer.hpp" + + +static std::string const simplex = "POINT(5 5)"; + +template +void test_all() +{ + typedef bg::model::polygon polygon; + + bg::strategy::buffer::join_miter join_miter; + bg::strategy::buffer::end_flat end_flat; + + double const pi = boost::geometry::math::pi(); + + test_one("simplex1", simplex, join_miter, end_flat, pi, 1.0); + test_one("simplex2", simplex, join_miter, end_flat, pi * 4.0, 2.0, ut_settings(0.1)); + test_one("simplex3", simplex, join_miter, end_flat, pi * 9.0, 3.0, ut_settings(0.1)); +} + + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + + test_all >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER) + test_all >(); +#endif + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/buffer/buffer_point_geo.cpp b/src/boost/libs/geometry/test/algorithms/buffer/buffer_point_geo.cpp new file mode 100644 index 000000000..63222705f --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/buffer_point_geo.cpp @@ -0,0 +1,47 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2018-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include "test_buffer_geo.hpp" + +static std::string const simplex = "POINT(4.9 52.0)"; + +template +void test_point() +{ + typedef bg::model::polygon polygon; + + bg::strategy::buffer::join_miter join_miter; + bg::strategy::buffer::end_flat end_flat; + + // NOTE: for now do not test with a radius less than 2 meter, because is not precise yet (in double) + test_one_geo("simplex1", simplex, join_miter, end_flat, 70.7107, 5.0, ut_settings(0.1, false, 8)); + test_one_geo("simplex1", simplex, join_miter, end_flat, 76.5437, 5.0, ut_settings(0.1, false, 16)); + // * Result is different for clang/VCC. Specified expectation is in between, and tolerance higher + test_one_geo("simplex1", simplex, join_miter, end_flat, 77.9640, 5.0, ut_settings(0.2, false, 32)); + + // The more points used for the buffer, the more the area approaches 10*PI square meters + test_one_geo("simplex1", simplex, join_miter, end_flat, 282.8430, 10.0, ut_settings(0.1, false, 8)); + test_one_geo("simplex1", simplex, join_miter, end_flat, 306.1471, 10.0, ut_settings(0.1, false, 16)); + test_one_geo("simplex1", simplex, join_miter, end_flat, 312.1450, 10.0, ut_settings(0.1, false, 32)); + // * Same here + test_one_geo("simplex1", simplex, join_miter, end_flat, 313.9051, 10.0, ut_settings(0.2, false, 180)); +} + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + + test_point > >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_point > >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/buffer/buffer_polygon.cpp b/src/boost/libs/geometry/test/algorithms/buffer/buffer_polygon.cpp new file mode 100644 index 000000000..c217307b7 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/buffer_polygon.cpp @@ -0,0 +1,865 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2012-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2016, 2019. +// Modifications copyright (c) 2016, 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) + +#include "test_buffer.hpp" + + +static std::string const simplex + = "POLYGON ((0 0,1 5,6 1,0 0))"; +static std::string const concave_simplex + = "POLYGON ((0 0,3 5,3 3,5 3,0 0))"; +static std::string const concave_b + = "POLYGON((0 10,5 15,6 13,8 11,0 10))"; +static std::string const square_simplex + = "POLYGON ((0 0,0 1,1 1,1 0,0 0))"; +static std::string const spike_simplex + = "POLYGON ((0 0,1 5,3 3,5 5,3 3,5 1,0 0))"; +static std::string const chained_box + = "POLYGON((0 0,0 4,4 4,8 4,12 4,12 0,8 0,4 0,0 0))"; + +static std::string const join_types + = "POLYGON ((0 0,0 4,4 4,2 6,0 8,2 6,4 8,8 4,4 0,0 0))"; // first 4 join types are all different: convex, concave, continue, spike + +static std::string const donut_simplex + = "POLYGON ((0 0,1 9,8 1,0 0),(1 1,4 1,1 4,1 1))"; +static std::string const donut_diamond + = "POLYGON((15 0,15 15,30 15,30 0,15 0),(26 11,22 14,19 10,23 07,26 11))"; +static std::string const letter_L + = "POLYGON ((0 0,0 4,1 4,1 1,3 1,3 0,0 0))"; +static std::string const indentation + = "POLYGON ((0 0,0 5,4 5,4 4,3 3,2 4,2 1,3 2,4 1,4 0,0 0))"; +static std::string const funnelgate + = "POLYGON((0 0,0 7,7 7,7 0,5 0,5 1,6 6,1 6,2 1,2 0,0 0))"; +static std::string const gammagate + = "POLYGON((0 0,0 6,9 6,9 0,4 0,4 2,7 2,7 4,2 4,2 0,0 0))"; +static std::string const fork_a + = "POLYGON((0 0,0 6,9 6,9 0,4 0,4 2,7 2,7 4,6 4,6 5,5 5,5 4,4 4,4 5,3 5,3 4,2 4,2 0,0 0))"; +static std::string const fork_b + = "POLYGON((0 0,0 8,14 8,14 0,4 0,4 2,13 2,13 4,12 4,12 7,9 7,9 4,7 4,7 7,4 7,4 4,2 4,2 0,0 0))"; +static std::string const fork_c + = "POLYGON((0 0,0 9,12 9,12 0,4 0,4 4,6 4,6 2,8 2,8 4,10 4,10 7,6 7,6 6,2 6,2 0,0 0))"; + +static std::string const arrow + = "POLYGON ((1 0,1 5,0.5 4.5,2 10,3.5 4.5,3 5,3 0,1 0))"; +static std::string const tipped_aitch + = "POLYGON ((0 0,0 3,3 3,3 4,0 4,0 7,7 7,7 4,4 4,4 3,7 3,7 0,0 0))"; +static std::string const snake + = "POLYGON ((0 0,0 3,3 3,3 4,0 4,0 7,8 7,8 4,6 4,6 3,8 3,8 0,7 0,7 2,5 2" + ",5 5,7 5,7 6,1 6,1 5,4 5,4 2,1 2,1 1,6 1,6 0,0 0))"; +static std::string const church + = "POLYGON ((0 0,0 3,2.999 3,3 8,3 0,0 0))"; +static std::string const flower + = "POLYGON ((1 0,1 10,9 10,9 0,4.99 0,4.99 5.5,4.5 6,5 6.5,5.5 6,5.01 5.5,5.01 0.01,5.25 0.01,5.25 5,6 3,8 5,6 6,8 7,6 9,5 7,4 9,2 7,4 6,2 5,4 3,4.75 5,4.75 0,1 0))"; + +static std::string const saw + = "POLYGON((1 3,1 8,1.5 6,5 8,5.5 6,9 8,9.5 6,13 8,13 3,1 3))"; + +static std::string const bowl + = "POLYGON((1 2,1 7,2 7,3 5,5 4,7 5,8 7,9 7,9 2,1 2))"; + +// Triangle with segmented sides, closing point at longest side +static std::string const triangle + = "POLYGON((4 5,5 4,4 4,3 4,3 5,3 6,4 5))"; + +// Triangle which caused acos in join_round to fail with larger side strategy +static std::string const sharp_triangle + = "POLYGON((2 0,3 8,4 0,2 0))"; + +static std::string const right_triangle + = "POLYGON((0 1,20 0,0 0,0 1))"; + + +static std::string const degenerate0 + = "POLYGON(())"; +static std::string const degenerate1 + = "POLYGON((5 5))"; +static std::string const degenerate2 + = "POLYGON((5 5,5 5,5 5,5 5))"; +static std::string const degenerate3 + = "POLYGON((0 0,0 10,10 10,10 0,0 0),(5 5,5 5,5 5,5 5))"; + + +// Real-life examples +static std::string const county1 + = "POLYGON((-111.700 41.200 ,-111.681388 41.181739 ,-111.682453 41.181506 ,-111.684052 41.180804 ,-111.685295 41.180538 ,-111.686318 41.180776 ,-111.687517 41.181416 ,-111.688982 41.181520 ,-111.690670 41.181523 ,-111.692135 41.181460 ,-111.693646 41.182034 ,-111.695156 41.182204 ,-111.696489 41.182274 ,-111.697775 41.182075 ,-111.698974 41.181539 ,-111.700485 41.182348 ,-111.701374 41.182955 ,-111.700 41.200))"; + +//static std::string const invalid_parcel +// = "POLYGON((116042.20 464335.07,116056.35 464294.59,116066.41 464264.16,116066.44 464264.09,116060.35 464280.93,116028.89 464268.43,116028.89 464268.44,116024.74 464280.7,116018.91 464296.71,116042.2 464335.07))"; + +static std::string const parcel1 + = "POLYGON((225343.489 585110.376,225319.123 585165.731,225323.497 585167.287,225323.134 585167.157,225313.975 585169.208,225321.828 585172,225332.677 585175.83,225367.032 585186.977,225401.64 585196.671,225422.799 585201.029,225429.784 585202.454,225418.859 585195.112,225423.803 585196.13,225425.389 585196.454,225397.027 585165.48,225363.802 585130.372,225354.086 585120.261,225343.489 585110.376))"; +static std::string const parcel2 + = "POLYGON((173356.986490154 605912.122380707,173358.457939143 605902.891897507,173358.458257372 605902.889901239,173214.162964795 605901.13020255,173214.162746654 605901.132200038,173213.665 605905.69,173212.712441616 605913.799985923,173356.986490154 605912.122380707))"; +static std::string const parcel3 + = "POLYGON((120528.56 462115.62,120533.4 462072.1,120533.4 462072.01,120533.39 462071.93,120533.36 462071.86,120533.33 462071.78,120533.28 462071.72,120533.22 462071.66,120533.15 462071.61,120533.08 462071.58,120533 462071.55,120532.92 462071.54,120467.68 462068.66,120468.55 462059.04,120517.39 462062.87,120517.47 462062.87,120517.55 462062.86,120517.62 462062.83,120517.69 462062.79,120517.76 462062.74,120517.81 462062.68,120517.86 462062.62,120517.89 462062.55,120517.92 462062.47,120530.49 461998.63,120530.5 461998.55,120530.49 461998.47,120530.47 461998.39,120530.44 461998.31,120530.4 461998.24,120530.35 461998.18,120530.28 461998.13,120530.21 461998.09,120530.13 461998.06,120482.19 461984.63,120485 461963.14,120528.2 461950.66,120528.28 461950.63,120528.35 461950.59,120528.42 461950.53,120528.47 461950.47,120528.51 461950.4,120528.54 461950.32,120528.56 461950.24,120528.56 461950.15,120528.55 461950.07,120528.53 461949.99,120528.49 461949.92,120528.44 461949.85,120497.49 461915.03,120497.43 461914.98,120497.37 461914.93,120497.3 461914.9,120497.23 461914.88,120497.15 461914.86,120424.61 461910.03,120424.53 461910.03,120424.45 461910.05,120424.37 461910.07,120424.3 461910.11,120424.24 461910.16,120424.18 461910.22,120424.14 461910.29,120424.11 461910.37,120424.09 461910.45,120424.08 461910.53,120424.08 461967.59,120424.08 461967.67,120424.1 461967.75,120424.14 461967.82,120424.18 461967.89,120424.23 461967.95,120424.3 461968,120424.37 461968.04,120424.44 461968.07,120424.52 461968.09,120473.31 461973.83,120469.63 461993.16,120399.48 461986.43,120399.4 461986.43,120399.32 461986.44,120399.25 461986.47,120399.17 461986.5,120399.11 461986.55,120399.05 461986.61,120399.01 461986.67,120398.97 461986.74,120398.95 461986.82,120398.93 461986.9,120394.1 462057.5,120394.1 462057.58,120394.11 462057.66,120394.14 462057.74,120394.18 462057.81,120394.23 462057.87,120394.29 462057.93,120394.35 462057.97,120394.43 462058,120394.5 462058.03,120394.58 462058.03,120458.74 462059.95,120455.16 462072.48,120396.57 462067.68,120396.49 462067.68,120396.4 462067.69,120396.32 462067.72,120396.25 462067.76,120396.18 462067.82,120396.13 462067.88,120396.08 462067.96,120396.05 462068.04,120396.03 462068.12,120392.17 462103.9,120392.16 462103.99,120392.18 462104.07,120392.2 462104.15,120392.24 462104.22,120392.29 462104.29,120392.35 462104.35,120392.42 462104.4,120392.5 462104.43,120392.58 462104.45,120392.66 462104.46,120393.63 462104.46,120393.63 462103.46,120393.22 462103.46,120396.98 462068.71,120455.49 462073.51,120455.57 462073.51,120455.66 462073.49,120455.74 462073.46,120455.81 462073.42,120455.88 462073.37,120455.93 462073.3,120455.98 462073.23,120456.01 462073.15,120459.88 462059.61,120459.89 462059.52,120459.9 462059.44,120459.88 462059.36,120459.86 462059.28,120459.82 462059.21,120459.77 462059.14,120459.72 462059.08,120459.65 462059.04,120459.57 462059,120459.49 462058.98,120459.41 462058.97,120395.13 462057.05,120399.9 461987.48,120469.99 461994.2,120470.07 461994.2,120470.15 461994.19,120470.23 461994.16,120470.3 461994.13,120470.37 461994.08,120470.42 461994.02,120470.47 461993.95,120470.5 461993.88,120470.53 461993.8,120474.4 461973.48,120474.4 461973.4,120474.4 461973.32,120474.38 461973.24,120474.35 461973.16,120474.31 461973.09,120474.25 461973.03,120474.19 461972.98,120474.12 461972.94,120474.04 461972.91,120473.96 461972.9,120425.08 461967.14,120425.08 461911.06,120496.88 461915.85,120527.16 461949.92,120484.4 461962.27,120484.33 461962.3,120484.25 461962.35,120484.19 461962.4,120484.14 461962.46,120484.09 461962.53,120484.06 461962.61,120484.05 461962.69,120481.14 461984.93,120481.14 461985.01,120481.15 461985.09,120481.17 461985.17,120481.2 461985.24,120481.25 461985.31,120481.3 461985.36,120481.36 461985.41,120481.43 461985.45,120481.51 461985.48,120529.42 461998.9,120517.02 462061.84,120468.14 462058,120468.05 462058,120467.97 462058.02,120467.89 462058.05,120467.81 462058.09,120467.75 462058.15,120467.69 462058.22,120467.65 462058.29,120467.62 462058.37,120467.6 462058.46,120466.64 462069.1,120466.63 462069.18,120466.65 462069.26,120466.67 462069.33,120466.71 462069.4,120466.76 462069.47,120466.81 462069.53,120466.88 462069.57,120466.95 462069.61,120467.03 462069.63,120467.11 462069.64,120532.34 462072.52,120527.62 462115.03,120391.73 462106.36,120391.66 462107.36,120528.03 462116.06,120528.12 462116.06,120528.2 462116.04,120528.28 462116.02,120528.35 462115.97,120528.42 462115.92,120528.47 462115.85,120528.51 462115.78,120528.54 462115.7,120528.56 462115.62))"; + +static std::string const parcel3_bend // of parcel_3 - clipped + = "POLYGON((120399.40000152588 461986.43000030518, 120399.47999954224 461986.43000030518, 120403 461986.76769953477, 120403 461987.777217312, 120399.90000152588 461987.47999954224, 120399.72722010587 461990, 120398.71791817161 461990, 120398.93000030518 461986.90000152588, 120398.95000076294 461986.81999969482, 120398.9700012207 461986.74000167847, 120399.00999832153 461986.66999816895, 120399.04999923706 461986.61000061035, 120399.11000061035 461986.54999923706, 120399.16999816895 461986.5, 120399.25 461986.4700012207, 120399.31999969482 461986.43999862671, 120399.40000152588 461986.43000030518))"; + +// Has concavety +static std::string const italy_part1 + = "POLYGON ((1660000 5190000 , 1651702.9375 5167014.5, 1650311.34375 5167763.53125, 1643318.59375 5172188.15625, 1642488.03125 5172636.75, 1640818.25 5173802.75, 1640107.03125 5174511.21875, 1638931.9375 5176054.03125, 1638684.5625 5177095.75, 1660000 5190000))"; + +// Did have a self-intersection for first flat/convex solution +static std::string const nl_part1 + = "POLYGON ((471871.966884626832325 6683515.683521211147308,470695.876464393688366 6681756.129975977353752,469211.542374156008009 6679924.978601523675025,464542.357652322971262 6674631.078279769048095,463243.59315323777264 6673494.345109832473099,459502.033748187706806 6670774.304660517722368,452204.484529234410729 6666030.372161027044058,439990.287360413349234 6659313.515823394991457,434547.988775020290632 6657783.034025833010674,433867.715366783668287 6657685.311832630075514,433063.65468478546245 6657783.034025833010674,423725.285241116478574 6659758.338574352674186,422581.143514745577704 6660350.880751021206379,422333.791606202081311 6660844.461689073592424,421993.599242338153999 6662622.453031159006059,421993.599242338153999 6663363.130126810632646,422612.090333183819894 6667314.244697011075914,422241.062470370030496 6667759.324870104901493,421096.80942450783914 6668303.522556710988283,408449.802075482031796 6673245.655735924839973,401646.845354124438018 6675273.665065255947411,400842.895991614612285 6675372.844085373915732,400255.351719210040756 6675224.699206517077982,392370.258227849320974 6672455.311684883199632,391968.283546594379004 6672009.975794731639326,391875.554410762328189 6671219.573235900141299,391937.336728153284639 6670527.121663697995245,392122.906319305824582 6669933.841785561293364,392339.311409408226609 6667957.501854715868831,392308.475910458364524 6665733.178529324010015,391937.336728153284639 6665289.631341196596622,387793.802641845482867 6664449.731981083750725,385814.7647345236619 6664202.740090588107705,384268.648326894966885 6664300.5401631873101,382846.319193030707538 6664646.406163938343525,382289.610419573145919 6664943.560305980034173,377186.502322628628463 6668957.888622742146254,376352.608017096004914 6669834.728738470934331,376197.985244384559337 6670428.001423852518201,375548.658654586179182 6676313.056885857135057,375243.086652359867003 6687692.866469252854586,379228.324422756850254 6689778.692146780900657,391782.713955441897269 6694388.125634397380054,393885.427817036863416 6694487.537080916576087,395215.139134563156404 6694091.147844122722745,405171.999669074953999 6689084.665672835893929,414263.128523688821588 6684478.40333267301321,415778.298112876422238 6683439.398042757064104,416396.677884233708028 6683192.009851422160864,419025.042381353967357 6682597.809754087589681,429909.63955213711597 6681508.792763692326844,430497.183824544539675 6681656.873437026515603,440979.806314075656701 6686955.330480101518333,467325.344922157470137 6687797.546342735178769,468129.294284664443694 6687698.216345063410699,468747.785375512961764 6687450.699095219373703,469211.542374156008009 6687054.651439971290529,469489.952420631831046 6686707.835750493220985,471871.966884626832325 6683515.683521211147308))"; + +static std::string const erode_triangle ="POLYGON((-262.6446228027343700 -261.9999389648437500, -261.0000000000000000 -262.0000000000000000, -261.0000915527343700 -262.5285644531250000, -262.6446228027343700 -261.9999389648437500))"; + +static std::string const forming_uu_a ="POLYGON((0 0,0 10,5 6,10 10,10 0,5 4,0 0))"; +static std::string const forming_uu_b ="POLYGON((0 0,0 10,5 6,10 10,10 0,5 4,0 0),(1.25 2.5, 4.25 5,1.25 7.5,1.25 5.5,2.25 5.0,1.25 4.5,1.25 2.5))"; + +// Ticket 10398, fails at next distances ( /10.0 ): +// #1: 5,25,84 +// #2: 5,13,45,49,60,62,66,73 +// #3: 4,8,12,35,45,54 +// #4: 6,19,21,23,30,43,45,66,78,91 + +static std::string const ticket_10398_1 + = "POLYGON((897866.5 6272518.7,897882.5 6272519.2,897882.6 6272519,897883.3 6272508.7,897883.5 6272505.5,897855 6272503.5,897852.4 6272505.6,897850.1 6272517.6,897860.8 6272518.5,897866.5 6272518.7))"; +static std::string const ticket_10398_2 + = "POLYGON((898882.3 6271337.3,898895.7 6271339.9,898898 6271328.3,898881.6 6271325.1,898879.3 6271336.7,898882.3 6271337.3))"; +static std::string const ticket_10398_3 + = "POLYGON((897558.7 6272055,897552.5 6272054.2,897552.5 6272053.7,897546.1 6272052.7,897545.6 6272057.7,897560.7 6272059.6,897560.9 6272055.3,897558.7 6272055))"; +static std::string const ticket_10398_4 + = "POLYGON((898563.3 6272366.9,898554.7 6272379.2,898559.7 6272382.3,898561.6 6272379.4,898568.7 6272369.1,898563.8 6272366.2,898563.3 6272366.9))"; + +static std::string const ticket_10412 + = "POLYGON((897747.8 6270564.3,897764.3 6270569.7,897776.5 6270529.5,897768.1 6270527.1,897767.6 6270529.4,897756.3 6270525.8,897745.8 6270522.3,897752 6270502.9,897749.7 6270502,897750.7 6270499.1,897751.8 6270498.6,897752.3 6270499.3,897754.6 6270497.9,897755.8 6270500.2,897766.8 6270494.1,897765.6 6270491.5,897768.3 6270490.5,897770.9 6270491.5,897770.2 6270494.6,897780.1 6270497.5,897781 6270494.6,897786.8 6270496.6,897790.8 6270482.5,897785.3 6270480.7,897785.9 6270478.2,897768.9 6270473.2,897768.1 6270475.8,897766.1 6270475.2,897758.7 6270479.2,897753.2 6270481.8,897751.9 6270479,897746.5 6270481.9,897748 6270484.6,897745.2 6270486.1,897743.9 6270483.3,897741.4 6270484.7,897742.6 6270487.3,897739.4 6270488.9,897738.3 6270486.3,897735.6 6270487.8,897733.1 6270496.8,897731.2 6270502.7,897732.4 6270503.2,897731.5 6270506.1,897730.3 6270505.7,897725.8 6270520.2,897726.8 6270520.7,897726 6270523,897728 6270523.7,897726.3 6270529.6,897742.8 6270534.5,897741.2 6270539.9,897751.4 6270543.4,897750.7 6270546.4,897753.2 6270547.2,897747.8 6270564.3))"; + +static std::string const ticket_11580 + = "POLYGON((14.02 474.96,14.02 494.96,14.022 494.96,14.022 486.24,14.02 474.96))"; + +static std::string const issue_369 + = "POLYGON((-0.0149622653 -0.0269554816,-0.0149539290 -0.0271028206,-0.0149470828 -0.0271355230,-0.0149622653 -0.0269554816))"; + +static std::string const issue_555 + = "POLYGON((100.0637755102041 100.0770239202989,100.0360264929713 100.1,100 100.1,0 100.1,-0.0999999999999943 100.1,-0.09999999999999432 100,-0.1000000000000014 0,-0.1000000000000014 -0.1000000000000014,-1.836970198721056e-17 -0.1000000000000014,100 -0.1000000000000014,100.0360264929713 -0.1000000000000012,100.0637755102041 -0.07702392029888726,101.1041649480706 0.7844145387331185,103.4026139046043 2.203948968996805,105.8748306243106 3.293026604107826,108.4735936784235 4.030845140790255,111.1492644962378 4.403311621418428,113.8507355037622 4.403311621418428,116.5264063215765 4.030845140790252,119.1251693756894 3.293026604107823,121.5973860953957 2.203948968996801,123.8958350519294 0.7844145387331167,124.9362244897959 -0.07702392029888117,124.9639735070287 -0.09999999999999432,125 -0.09999999999999432,135 -0.1000000000000014,135.1 -0.0999999999999943,135.1 0,135.1 100,135.1 100.1,135 100.1,125 100.1,124.9639735070287 100.1,124.9362244897959 100.0770239202989,123.8958350519294 99.21558546126688,121.5973860953958 97.7960510310032,119.1251693756894 96.70697339589218,116.5264063215765 95.96915485920975,113.8507355037622 95.59668837858158,111.1492644962378 95.59668837858158,108.4735936784235 95.96915485920975,105.8748306243106 96.70697339589218,103.4026139046043 97.7960510310032,101.1041649480706 99.21558546126688,100.0637755102041 100.0770239202989),(124.9 71.15855631858324,124.9 28.84144368141676,124.9 27.45166011926875,124.5057975806765 24.70018817664119,123.7253617444602 22.03243382063001,122.574469398775 19.50232706258395,121.0763864178284 17.16101529763987,119.2613973111302 15.0558293341122,117.1661930067267 13.22932657712651,114.8331291254269 11.71843070902665,112.3093697403817 10.55368525835367,109.6459339313539 9.758636146879443,106.8966644080684 9.349355696820595,104.1171390524456 9.33411772066918,101.3635473834475 9.7132302618644,100.0275510204082 10.0961298147011,100.014047339233 10.09999999999999,100 10.09999999999999,29.6 10.1,28.20533247460344 10.1,25.44438883273841 10.49696376664363,22.76804145044581 11.28281026239098,20.2307730424806 12.44154191878281,17.88423507675108 13.94957030080114,15.77619629938279 15.77619629938281,13.94957030080113 17.88423507675109,12.44154191878281 20.23077304248061,11.28281026239098 22.76804145044582,10.49696376664362 25.44438883273843,10.1 28.20533247460346,10.1 29.6,10.1 70.40000000000001,10.1 71.79466752539656,10.49696376664363 74.5556111672616,11.28281026239098 77.23195854955421,12.44154191878281 79.76922695751941,13.94957030080114 82.11576492324893,15.77619629938281 84.22380370061721,17.88423507675109 86.05042969919887,20.23077304248062 87.5584580812172,22.76804145044583 88.71718973760903,25.44438883273843 89.50303623335638,28.20533247460346 89.90000000000001,29.6 89.90000000000001,100 89.90000000000001,100.014047339233 89.90000000000001,100.0275510204082 89.9038701852989,101.3635473834475 90.2867697381356,104.1171390524456 90.66588227933082,106.8966644080684 90.6506443031794,109.6459339313539 90.24136385312056,112.3093697403817 89.44631474164633,114.8331291254269 88.28156929097335,117.1661930067267 86.77067342287347,119.2613973111302 84.94417066588778,121.0763864178284 82.83898470236012,122.574469398775 80.49767293741604,123.7253617444602 77.96756617936998,124.5057975806765 75.29981182335879,124.9 72.54833988073125,124.9 71.15855631858324))"; + +// CCW Polygons not working in 1.56 +static std::string const mysql_report_2014_10_24 + = "POLYGON((0 0, 0 8, 8 8, 8 10, -10 10, -10 0, 0 0))"; +static std::string const mysql_report_2014_10_28_1 + = "POLYGON((0 0,10 10,0 8,0 0))"; +static std::string const mysql_report_2014_10_28_2 + = "POLYGON((1 1,10 10,0 8,1 1))"; +static std::string const mysql_report_2014_10_28_3 + = "POLYGON((2 2,8 2,8 8,2 8,2 2))"; + +// Polygons having problems with negative distances in 1.57 +static std::string const mysql_report_2015_02_17_1 + = "POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))"; +static std::string const mysql_report_2015_02_17_2 + = "POLYGON((0 0,0 10,10 10,10 0,0 0))"; +static std::string const mysql_report_2015_02_17_3 + = "POLYGON((10 10,10 20,20 20,20 10,10 10))"; + +// Polygons causing assertion failure +static std::string const mysql_report_2015_07_05_0 + = "POLYGON((0 0,0 30000,30000 20000,25000 0,0 0),(-11 3,4.99294e+306 1.78433e+307,15 -14,-11 3))"; +static std::string const mysql_report_2015_07_05_1 + = "POLYGON((9192 27876,128 4.5036e+15,-1 5,3 9,9192 27876),(-11 3,4.99294e+306 1.78433e+307,15 -14,-11 3))"; +static std::string const mysql_report_2015_07_05_2 + = "POLYGON((-15 -15,1.31128e+308 2.47964e+307,-20 -9,-15 -15),(11 -4,1.04858e+06 5.36871e+08,7.03687e+13 -1.15292e+18,-12 17,10284 -21812,11 -4),(-28066 -10001,2.19902e+12 3.35544e+07,8.80784e+306 1.04773e+308,1.42177e+308 1.6141e+308,-28066 -10001))"; +static std::string const mysql_report_2015_07_05_3 + = "POLYGON((-2.68435e+08 -12,27090 -14130,5.76461e+17 5.49756e+11,-2.68435e+08 -12),(2.68435e+08 65539,1.42845e+308 1.63164e+308,-1 -8,-4 10,2.68435e+08 65539),(13 17,8.79609e+12 -2.2518e+15,1.02101e+308 3.13248e+306,17868 780,5 -4,13 17),(-1 14,1.35905e+308 2.09331e+307,1.37439e+11 -2047,-1 14))"; +static std::string const mysql_report_2015_07_05_4 + = "POLYGON((2.19902e+12 524287,1.13649e+308 1.36464e+308,-10 -19,2.19902e+12 524287),(1.44115e+17 -1.09951e+12,-14 0,-4347 16243,1.44115e+17 -1.09951e+12))"; +static std::string const mysql_report_2015_07_05_5 + = "POLYGON((9 3,-8193 8.38861e+06,-2 -4,9 3),(-10 -2,32268 -2557,1.72036e+308 5.67867e+307,4.91634e+307 1.41031e+308,-2.68435e+08 -19,-10 -2),(-5 4,9.50167e+307 1.05883e+308,-422 -25737,-5 4))"; + +// Versions without interiors +static std::string const mysql_report_2015_07_05_0_wi + = "POLYGON((0 0,0 30000,30000 20000,25000 0,0 0))"; +static std::string const mysql_report_2015_07_05_1_wi + = "POLYGON((9192 27876,128 4.5036e+15,-1 5,3 9,9192 27876))"; +static std::string const mysql_report_2015_07_05_2_wi + = "POLYGON((-15 -15,1.31128e+308 2.47964e+307,-20 -9,-15 -15))"; +static std::string const mysql_report_2015_07_05_3_wi + = "POLYGON((-2.68435e+08 -12,27090 -14130,5.76461e+17 5.49756e+11,-2.68435e+08 -12))"; +static std::string const mysql_report_2015_07_05_4_wi + = "POLYGON((2.19902e+12 524287,1.13649e+308 1.36464e+308,-10 -19,2.19902e+12 524287))"; +static std::string const mysql_report_2015_07_05_5_wi + = "POLYGON((9 3,-8193 8.38861e+06,-2 -4,9 3))"; + +class buffer_custom_side_strategy +{ +public : + template + < + typename Point, + typename OutputRange, + typename DistanceStrategy + > + static inline bg::strategy::buffer::result_code apply( + Point const& input_p1, Point const& input_p2, + bg::strategy::buffer::buffer_side_selector side, + DistanceStrategy const& distance, + OutputRange& output_range) + { + // Generate a block along (left or right of) the segment + + double const dx = bg::get<0>(input_p2) - bg::get<0>(input_p1); + double const dy = bg::get<1>(input_p2) - bg::get<1>(input_p1); + + // For normalization [0,1] (=dot product d.d, sqrt) + double const length = bg::math::sqrt(dx * dx + dy * dy); + + if (bg::math::equals(length, 0)) + { + return bg::strategy::buffer::result_no_output; + } + + // Generate the perpendicular p, to the left (ccw), and use an adapted distance + double const d = 1.1 * distance.apply(input_p1, input_p2, side); + double const px = d * -dy / length; + double const py = d * dx / length; + + output_range.resize(2); + + bg::set<0>(output_range.front(), bg::get<0>(input_p1) + px); + bg::set<1>(output_range.front(), bg::get<1>(input_p1) + py); + bg::set<0>(output_range.back(), bg::get<0>(input_p2) + px); + bg::set<1>(output_range.back(), bg::get<1>(input_p2) + py); + + return bg::strategy::buffer::result_normal; + } +}; + + +template +void test_all() +{ + typedef bg::model::polygon polygon_type; + + bg::strategy::buffer::join_miter join_miter(10.0); + bg::strategy::buffer::join_round join_round(100); + bg::strategy::buffer::join_round join_round_rough(12); + bg::strategy::buffer::end_flat end_flat; + bg::strategy::buffer::end_round end_round(100); + + test_one("simplex", simplex, join_round, end_flat, 47.9408, 1.5); + test_one("simplex", simplex, join_miter, end_flat, 52.8733, 1.5); + + test_one("simplex", simplex, join_round, end_flat, 7.04043, -0.5); + test_one("simplex", simplex, join_miter, end_flat, 7.04043, -0.5); + + test_one("square_simplex", square_simplex, join_round, end_flat, 14.0639, 1.5); + test_one("square_simplex", square_simplex, join_miter, end_flat, 16.0000, 1.5); + + test_one("square_simplex01", square_simplex, join_miter, end_flat, 0.6400, -0.1); + test_one("square_simplex04", square_simplex, join_miter, end_flat, 0.0400, -0.4); + test_one("square_simplex05", square_simplex, join_miter, end_flat, 0.0, -0.5); + test_one("square_simplex06", square_simplex, join_miter, end_flat, 0.0, -0.6); + + test_one("concave_simplex", concave_simplex, join_round, end_flat, 14.5616, 0.5); + test_one("concave_simplex", concave_simplex, join_miter, end_flat, 16.3861, 0.5); + + test_one("concave_simplex", concave_simplex, join_round, end_flat, 0.777987, -0.5); + test_one("concave_simplex", concave_simplex, join_miter, end_flat, 0.724208, -0.5); + + test_one("concave_b10", concave_b, join_miter, end_flat, 836.9106, 10.0); + test_one("concave_b25", concave_b, join_miter, end_flat, 4386.6479, 25.0); + test_one("concave_b50", concave_b, join_miter, end_flat, 16487.2000, 50.0); + test_one("concave_b75", concave_b, join_miter, end_flat, 36318.1506, 75.0); + test_one("concave_b100", concave_b, join_miter, end_flat, 63879.5186, 100.0); + + test_one("concave_b10", concave_b, join_round, end_flat, 532.2875, 10.0); + test_one("concave_b25", concave_b, join_round, end_flat, 2482.8329, 25.0); + test_one("concave_b50", concave_b, join_round, end_flat, 8872.9719, 50.0); + test_one("concave_b75", concave_b, join_round, end_flat, 19187.5490, 75.0); + test_one("concave_b100", concave_b, join_round, end_flat, 33426.6139, 100.0); + + test_one("concave_b_rough_10", concave_b, join_round_rough, end_flat, 520.312, 10.0); + test_one("concave_b_rough_25", concave_b, join_round_rough, end_flat, 2409.384, 25.0); + test_one("concave_b_rough_50", concave_b, join_round_rough, end_flat, 8586.812, 50.0); + test_one("concave_b_rough_75", concave_b, join_round_rough, end_flat, 18549.018, 75.0); + test_one("concave_b_rough_100", concave_b, join_round_rough, end_flat, 32295.917, 100.0); + + test_one("spike_simplex15", spike_simplex, join_round, end_round, 50.3633, 1.5); + test_one("spike_simplex15", spike_simplex, join_miter, end_flat, 51.5509, 1.5); + test_one("spike_simplex30", spike_simplex, join_round, end_round, 100.9199, 3.0); + test_one("spike_simplex30", spike_simplex, join_miter, end_flat, 106.6979, 3.0); + test_one("spike_simplex150", spike_simplex, join_round, end_round, 998.9821, 15.0); + test_one("spike_simplex150", spike_simplex, join_miter, end_flat, 1428.1560, 15.0); + + test_one("join_types", join_types, join_round, end_flat, 88.2060, 1.5); + + test_one("chained_box", chained_box, join_round, end_flat, 83.1403, 1.0); + test_one("chained_box", chained_box, join_miter, end_flat, 84, 1.0); + test_one("L", letter_L, join_round, end_flat, 13.7314, 0.5); + test_one("L", letter_L, join_miter, end_flat, 14.0, 0.5); + + test_one("chained_box", chained_box, join_miter, end_flat, 84, 1.0); + test_one("chained_box", chained_box, join_round, end_flat, 83.1403, 1.0); + + test_one("indentation4", indentation, join_miter, end_flat, 25.7741, 0.4); + test_one("indentation4", indentation, join_round, end_flat, 25.5695, 0.4); + test_one("indentation5", indentation, join_miter, end_flat, 28.2426, 0.5); + test_one("indentation5", indentation, join_round, end_flat, 27.9953, 0.5); + test_one("indentation6", indentation, join_miter, end_flat, 30.6712, 0.6); + + // SQL Server gives 30.34479159164 + test_one("indentation6", indentation, join_round, end_flat, 30.3445, 0.6); + + test_one("indentation7", indentation, join_miter, end_flat, 33.0958, 0.7); + test_one("indentation7", indentation, join_round, end_flat, 32.6533, 0.7); + + test_one("indentation8", indentation, join_miter, end_flat, 35.5943, 0.8); + test_one("indentation8", indentation, join_round, end_flat, 35.0164, 0.8); + test_one("indentation12", indentation, join_miter, end_flat, 46.3541, 1.2); + test_one("indentation12", indentation, join_round, end_flat, 45.0537, 1.2); + + // Indentation - deflated + test_one("indentation4", indentation, join_miter, end_flat, 6.991, -0.4); + test_one("indentation4", indentation, join_round, end_flat, 7.255, -0.4); + test_one("indentation8", indentation, join_miter, end_flat, 1.369, -0.8); + test_one("indentation8", indentation, join_round, end_flat, 1.374, -0.8); + test_one("indentation12", indentation, join_miter, end_flat, 0, -1.2); + test_one("indentation12", indentation, join_round, end_flat, 0, -1.2); + + test_one("donut_simplex6", donut_simplex, join_miter, end_flat, 53.648, 0.6); + test_one("donut_simplex6", donut_simplex, join_round, end_flat, 52.820, 0.6); + test_one("donut_simplex8", donut_simplex, join_miter, end_flat, 61.132, 0.8); + test_one("donut_simplex8", donut_simplex, join_round, end_flat, 59.6713, 0.8); + test_one("donut_simplex10", donut_simplex, join_miter, end_flat, 68.670, 1.0); + test_one("donut_simplex10", donut_simplex, join_round, end_flat, 66.387, 1.0); + test_one("donut_simplex12", donut_simplex, join_miter, end_flat, 76.605, 1.2); + test_one("donut_simplex12", donut_simplex, join_round, end_flat, 73.3179, 1.2); + test_one("donut_simplex14", donut_simplex, join_miter, end_flat, 84.974, 1.4); + test_one("donut_simplex14", donut_simplex, join_round, end_flat, 80.500, 1.4); + test_one("donut_simplex16", donut_simplex, join_miter, end_flat, 93.777, 1.6); + test_one("donut_simplex16", donut_simplex, join_round, end_flat, 87.933, 1.6); + + test_one("donut_simplex3", donut_simplex, join_miter, end_flat, 19.7636, -0.3); + test_one("donut_simplex3", donut_simplex, join_round, end_flat, 19.8861, -0.3); + test_one("donut_simplex6", donut_simplex, join_miter, end_flat, 12.8920, -0.6); + test_one("donut_simplex6", donut_simplex, join_round, end_flat, 12.9157, -0.6); + + test_one("donut_diamond1", donut_diamond, join_miter, end_flat, 280.0, 1.0); + test_one("donut_diamond4", donut_diamond, join_miter, end_flat, 529.0, 4.0); + test_one("donut_diamond5", donut_diamond, join_miter, end_flat, 625.0, 5.0); + test_one("donut_diamond6", donut_diamond, join_miter, end_flat, 729.0, 6.0); + + test_one("donut_diamond1", donut_diamond, join_miter, end_flat, 122.0417, -1.0); + test_one("donut_diamond2", donut_diamond, join_miter, end_flat, 56.3750, -2.0); + test_one("donut_diamond3", donut_diamond, join_miter, end_flat, 17.7084, -3.0); + + test_one("arrow4", arrow, join_miter, end_flat, 28.265, 0.4); + test_one("arrow4", arrow, join_round, end_flat, 27.039, 0.4); + test_one("arrow5", arrow, join_miter, end_flat, 31.500, 0.5); + test_one("arrow5", arrow, join_round, end_flat, 29.621, 0.5); + test_one("arrow6", arrow, join_miter, end_flat, 34.903, 0.6); + test_one("arrow6", arrow, join_round, end_flat, 32.268, 0.6); + + test_one("tipped_aitch3", tipped_aitch, join_miter, end_flat, 55.36, 0.3); + test_one("tipped_aitch9", tipped_aitch, join_miter, end_flat, 77.44, 0.9); + test_one("tipped_aitch13", tipped_aitch, join_miter, end_flat, 92.16, 1.3); + + // SQL Server: 55.205415532967 76.6468846383224 90.642916957136 + test_one("tipped_aitch3", tipped_aitch, join_round, end_flat, 55.2053, 0.3); + test_one("tipped_aitch9", tipped_aitch, join_round, end_flat, 76.6457, 0.9); + test_one("tipped_aitch13", tipped_aitch, join_round, end_flat, 90.641, 1.3); + + test_one("snake4", snake, join_miter, end_flat, 64.44, 0.4); + test_one("snake5", snake, join_miter, end_flat, 72, 0.5); + test_one("snake6", snake, join_miter, end_flat, 75.44, 0.6); + test_one("snake16", snake, join_miter, end_flat, 114.24, 1.6); + + test_one("funnelgate2", funnelgate, join_miter, end_flat, 120.982, 2.0); + test_one("funnelgate3", funnelgate, join_miter, end_flat, 13.0*13.0, 3.0); + test_one("funnelgate4", funnelgate, join_miter, end_flat, 15.0*15.0, 4.0); + test_one("gammagate1", gammagate, join_miter, end_flat, 88.0, 1.0); + test_one("fork_a1", fork_a, join_miter, end_flat, 88.0, 1.0); + test_one("fork_b1", fork_b, join_miter, end_flat, 154.0, 1.0); + test_one("fork_c1", fork_c, join_miter, end_flat, 152.0, 1.0); + test_one("triangle", triangle, join_miter, end_flat, 14.6569, 1.0); + + test_one("degenerate0", degenerate0, join_round, end_round, 0.0, 1.0); + test_one("degenerate1", degenerate1, join_round, end_round, 3.1389, 1.0); + test_one("degenerate2", degenerate2, join_round, end_round, 3.1389, 1.0); + test_one("degenerate3", degenerate3, join_round, end_round, 143.1395, 1.0); + + test_one("gammagate2", gammagate, join_miter, end_flat, 130.0, 2.0); + + test_one("flower1", flower, join_miter, end_flat, 67.614, 0.1); + test_one("flower20", flower, join_miter, end_flat, 74.894, 0.20); + test_one("flower25", flower, join_miter, end_flat, 78.226, 0.25); + test_one("flower30", flower, join_miter, end_flat, 81.492, 0.30); + test_one("flower35", flower, join_miter, end_flat, 84.694, 0.35); + test_one("flower40", flower, join_miter, end_flat, 87.831, 0.40); + test_one("flower45", flower, join_miter, end_flat, 90.902, 0.45); + test_one("flower50", flower, join_miter, end_flat, 93.908, 0.50); + test_one("flower55", flower, join_miter, end_flat, 96.849, 0.55); + test_one("flower60", flower, join_miter, end_flat, 99.724, 0.60); + + test_one("flower10", flower, join_round, end_flat, 67.486, 0.10); + test_one("flower20", flower, join_round, end_flat, 74.702, 0.20); + test_one("flower25", flower, join_round, end_flat, 78.071, 0.25); + test_one("flower30", flower, join_round, end_flat, 81.352, 0.30); + test_one("flower35", flower, join_round, end_flat, 84.547, 0.35); + test_one("flower40", flower, join_round, end_flat, 87.665, 0.40); + test_one("flower45", flower, join_round, end_flat, 90.709, 0.45); + test_one("flower50", flower, join_round, end_flat, 93.680, 0.50); + test_one("flower55", flower, join_round, end_flat, 96.580, 0.55); + test_one("flower60", flower, join_round, end_flat, 99.408, 0.60); + + // Flower - deflated + test_one("flower60", flower, join_round, end_flat, 19.3210, -0.60); + + // Saw + { + // SQL Server: + // 68.6258859984014 90.2254986930165 112.799509089077 136.392823913949 161.224547934625 187.427508982734 + //215.063576036522 244.167935815974 274.764905445676 306.878264367143 340.530496138041 375.720107548269 + int const n = 12; + double expected_round[n] = + { + 68.6252, 90.222, 112.792, 136.397, 161.230, 187.435, + 215.073, 244.179, 274.779, 306.894, 340.543, 375.734 + }; + double expected_miter[n] = + { + 70.7706, 98.804, 132.101, 170.661, 214.484, 263.57, + 317.92, 377.532, 442.408, 512.546, 587.948, 668.613 + }; + + for (int i = 1; i <= n; i++) + { + std::ostringstream out; + out << "saw_" << i; + test_one(out.str(), saw, join_round, end_flat, expected_round[i - 1], double(i) / 2.0, ut_settings(0.1)); + test_one(out.str(), saw, join_miter, end_flat, expected_miter[i - 1], double(i) / 2.0); + } + } + + // Bowl + { + // SQL Server values - see query below. + //1 43.2425133175081 60.0257800296593 78.3497997564532 98.2145746255142 119.620102487345 142.482792724034 + //2 166.499856911107 191.763334982583 218.446279387336 246.615018368511 276.300134755606 307.518458532186 + + int const n = 12; + double expected_round[n] = + { + 43.2423, 60.025, 78.3477, 98.2109, 119.614, 142.487, + 166.505, 191.77, 218.455, 246.625, 276.312, 307.532 + }; + double expected_miter[n] = + { + 43.4895, 61.014, 80.5726, 102.166, 125.794, 151.374, + 178.599, 207.443, 237.904, 270.000, 304.0, 340.000 + }; + + for (int i = 1; i <= n; i++) + { + std::ostringstream out; + out << "bowl_" << i; + test_one(out.str(), bowl, join_round, end_flat, expected_round[i - 1], double(i) / 2.0, ut_settings(0.1)); + test_one(out.str(), bowl, join_miter, end_flat, expected_miter[i - 1], double(i) / 2.0); + } + } + + { + ut_settings settings; + settings.use_ln_area = true; + test_one("county1", county1, join_round, end_flat, 0.00114, 0.01, settings); + test_one("county1", county1, join_miter, end_flat, 0.00133, 0.01, settings); + test_one("county1", county1, join_round, end_flat, 3.94411e-05, -0.003, settings); + test_one("county1", county1, join_miter, end_flat, 3.94301e-05, -0.003, settings); + } + + test_one("parcel1_10", parcel1, join_round, end_flat, 7571.405, 10.0); + test_one("parcel1_10", parcel1, join_miter, end_flat, 8207.453, 10.0); + test_one("parcel1_20", parcel1, join_round, end_flat, 11648.111, 20.0); + test_one("parcel1_20", parcel1, join_miter, end_flat, 14184.022, 20.0); + test_one("parcel1_30", parcel1, join_round, end_flat, 16350.488, 30.0); + test_one("parcel1_30", parcel1, join_miter, end_flat, 22417.799, 30.0); + + test_one("parcel2_10", parcel2, join_round, end_flat, 5000.867, 10.0); + test_one("parcel2_10", parcel2, join_miter, end_flat, 5091.122, 10.0); + test_one("parcel2_20", parcel2, join_round, end_flat, 9049.673, 20.0); + test_one("parcel2_20", parcel2, join_miter, end_flat, 9410.691, 20.0); + test_one("parcel2_30", parcel2, join_round, end_flat, 13726.528, 30.0); + test_one("parcel2_30", parcel2, join_miter, end_flat, 14535.232, 30.0); + + test_one("parcel3_10", parcel3, join_round, end_flat, 19993.007, 10.0); + test_one("parcel3_10", parcel3, join_miter, end_flat, 20024.558, 10.0, ut_settings(0.05)); // MSVC 14 reports 20024.51456, so we increase the tolerance + test_one("parcel3_20", parcel3, join_round, end_flat, 34505.837, 20.0); + test_one("parcel3_20", parcel3, join_miter, end_flat, 34633.261, 20.0); + test_one("parcel3_30", parcel3, join_round, end_flat, 45262.452, 30.0); + test_one("parcel3_30", parcel3, join_miter, end_flat, 45567.388, 30.0); + + test_one("parcel3_bend_5", parcel3_bend, join_round, end_flat, 155.634, 5.0); + test_one("parcel3_bend_10", parcel3_bend, join_round, end_flat, 458.454, 10.0); + + // These cases differ a bit based on point order, because piece generation is different in one corner. Tolerance is increased + test_one("parcel3_bend_15", parcel3_bend, join_round, end_flat, 918.06, 15.0, ut_settings(0.25)); + test_one("parcel3_bend_20", parcel3_bend, join_round, end_flat, 1534.64, 20.0, ut_settings(0.25)); + + // Parcel - deflated + test_one("parcel1_10", parcel1, join_round, end_flat, 1571.9024, -10.0); + test_one("parcel1_10", parcel1, join_miter, end_flat, 1473.7325, -10.0); + test_one("parcel1_20", parcel1, join_round, end_flat, 209.3579, -20.0); + test_one("parcel1_20", parcel1, join_miter, end_flat, 188.4224, -20.0); + + test_one("nl_part1_2", nl_part1, + join_round, end_flat, BG_IF_RESCALED(1848737356.991, 1848737292.653), -0.2 * 1000.0); + test_one("nl_part1_5", nl_part1, + join_round, end_flat, BG_IF_RESCALED(1775953811.679, 1775953824.799), -0.5 * 1000.0); + + test_one("italy_part1_30", italy_part1, + join_round, end_flat, BG_IF_RESCALED(5015638814.956, 5015638827.704), 30.0 * 1000.0); + test_one("italy_part1_50", italy_part1, + join_round, end_flat, BG_IF_RESCALED(11363180044.822, 11363180033.564), 50.0 * 1000.0); + test_one("italy_part1_60", italy_part1, join_round, end_flat, 15479097108.720, 60.0 * 1000.0); + + { + ut_settings settings; + settings.test_validity = false; + + // Tickets + test_one("ticket_10398_1_5", ticket_10398_1, join_miter, end_flat, 494.7192, 0.5, settings); + test_one("ticket_10398_1_25", ticket_10398_1, join_miter, end_flat, 697.7798, 2.5, settings); + { + // qcc-arm reports 1470.79863681712281 + ut_settings specific = settings; + specific.tolerance = 0.02; + test_one("ticket_10398_1_84", ticket_10398_1, join_miter, end_flat, 1470.8096, 8.4, specific); + } + + test_one("ticket_10398_2_45", ticket_10398_2, join_miter, end_flat, 535.4780, 4.5, settings); + test_one("ticket_10398_2_62", ticket_10398_2, join_miter, end_flat, 705.2046, 6.2, settings); + test_one("ticket_10398_2_73", ticket_10398_2, join_miter, end_flat, 827.3394, 7.3, settings); + + test_one("ticket_10398_3_12", ticket_10398_3, join_miter, end_flat, 122.9443, 1.2, settings); + test_one("ticket_10398_3_35", ticket_10398_3, join_miter, end_flat, 258.2729, 3.5, settings); + test_one("ticket_10398_3_54", ticket_10398_3, join_miter, end_flat, 402.0571, 5.4, settings); + + test_one("ticket_10398_4_30", ticket_10398_4, join_miter, end_flat, 257.9482, 3.0, settings); + test_one("ticket_10398_4_66", ticket_10398_4, join_miter, end_flat, 553.0112, 6.6, settings); + test_one("ticket_10398_4_91", ticket_10398_4, join_miter, end_flat, 819.1406, 9.1, settings); + + test_one("ticket_10412", ticket_10412, join_miter, end_flat, 3109.6616, 1.5, settings); + test_one("ticket_11580_100", ticket_11580, join_miter, end_flat, 52.0221000, 1.00, settings); + #if defined(BOOST_GEOMETRY_TEST_FAILURES) + // Larger distance, resulting in only one circle. Not solved yet in non-rescaled mode. + test_one("ticket_11580_237", ticket_11580, join_miter, end_flat, 999.999, 2.37, settings); + #endif + } + + // Tickets - deflated + test_one("ticket_10398_1_5", ticket_10398_1, join_miter, end_flat, 404.3936, -0.5); + test_one("ticket_10398_1_25", ticket_10398_1, join_miter, end_flat, 246.7329, -2.5); + + { + // Test issue 369 as reported (1.15e-3) and some variants + // Use high tolerance because output areas are very small + const double distance = 1.15e-3; + const double join_distance = 0.1e-3; + const int points_per_circle = 2 * 3.1415 * distance / join_distance; + + ut_settings specific; + specific.use_ln_area = true; + specific.tolerance = 0.01; + bg::strategy::buffer::join_round jr(points_per_circle); + bg::strategy::buffer::end_round er(points_per_circle); + test_one("issue_369", issue_369, jr, er, 4.566e-06, distance, specific); + test_one("issue_369_10", issue_369, jr, er, 8.346e-08, distance / 10.0, specific); + test_one("issue_369_100", issue_369, jr, er, 4.942e-09, distance / 100.0, specific); + test_one("issue_369_1000", issue_369, jr, er, 7.881e-10, distance / 1000.0, specific); + } + + { + // Test issue 555 as reported (-0.000001) and some variants + bg::strategy::buffer::join_round jr(180); + bg::strategy::buffer::end_round er(180); +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) + // With rescaling the interior ring is missing + test_one("issue_555", issue_555, jr, er, 4520.7942, -0.000001); +#endif + test_one("issue_555", issue_555, jr, er, 4520.7957, +0.000001); + test_one("issue_555_1000", issue_555, jr, er, 4521.6280, +0.001); + test_one("issue_555_1000", issue_555, jr, er, 4519.9627, -0.001); + } + + { + bg::strategy::buffer::join_round join_round32(32); + bg::strategy::buffer::end_round end_round32(32); + test_one("mysql_report_2014_10_24", mysql_report_2014_10_24, + join_round32, end_round32, 174.902, 1.0); + test_one("mysql_report_2014_10_28_1", mysql_report_2014_10_28_1, + join_round32, end_round32, 75.46, 1.0); + test_one("mysql_report_2014_10_28_2", mysql_report_2014_10_28_2, + join_round32, end_round32, 69.117, 1.0); + test_one("mysql_report_2014_10_28_3", mysql_report_2014_10_28_3, + join_round32, end_round32, 63.121, 1.0); + + test_one("mysql_report_2015_02_17_1_d1", + mysql_report_2015_02_17_1, + join_round32, end_round32, 48.879, -1); + test_one("mysql_report_2015_02_17_1_d5", + mysql_report_2015_02_17_1, + join_round32, end_round32, 0.0, -5.0); + test_one("mysql_report_2015_02_17_1_d6", + mysql_report_2015_02_17_1, + join_round32, end_round32, 0.0, -6.0); + test_one("mysql_report_2015_02_17_1_d10", + mysql_report_2015_02_17_1, + join_round32, end_round32, 0.0, -10.0); + + test_one("mysql_report_2015_02_17_2_d1", + mysql_report_2015_02_17_2, + join_round32, end_round32, 64.0, -1.0); + test_one("mysql_report_2015_02_17_2_d10", + mysql_report_2015_02_17_2, + join_round32, end_round32, 0.0, -10.0); + test_one("mysql_report_2015_02_17_3_d1", + mysql_report_2015_02_17_3, + join_round32, end_round32, 64.0, -1.0); + + { + // These extreme testcases, containing huge coordinate differences + // and huge buffer distances, are to verify assertions. + // No assertions should be raised. + + // The buffers themselves are most often wrong. Versions + // without interior rings might be smaller (or have no output) + // then their versions with interior rings. + + // Therefore all checks on area, validity, self-intersections + // or having output at all are omitted. + + // Details (for versions with interior rings) + // Case 3 is reported as invalid + // On MinGW, also case 2 and 4 are reported as invalid + // On PowerPC, also case 1 is reported as invalid + + ut_settings settings = ut_settings::assertions_only(); + const double no_area = ut_settings::ignore_area(); + + test_one("mysql_report_2015_07_05_0", mysql_report_2015_07_05_0, + join_round32, end_round32, no_area, 6.0, settings); + test_one("mysql_report_2015_07_05_1", mysql_report_2015_07_05_1, + join_round32, end_round32, no_area, 6.0, settings); + test_one("mysql_report_2015_07_05_2", mysql_report_2015_07_05_2, + join_round32, end_round32, no_area, 549755813889.0, settings); + test_one("mysql_report_2015_07_05_3", mysql_report_2015_07_05_3, + join_round32, end_round32, no_area, 49316.0, settings); + test_one("mysql_report_2015_07_05_4", mysql_report_2015_07_05_4, + join_round32, end_round32, no_area, 1479986.0, settings); + test_one("mysql_report_2015_07_05_5", mysql_report_2015_07_05_5, + join_round32, end_round32, no_area, 38141.0, settings); + + // Versions without interior rings (area should be smaller but still no checks) + test_one("mysql_report_2015_07_05_0_wi", mysql_report_2015_07_05_0_wi, + join_round32, end_round32, no_area, 6.0, settings); + test_one("mysql_report_2015_07_05_1_wi", mysql_report_2015_07_05_1_wi, + join_round32, end_round32, no_area, 6.0, settings); + test_one("mysql_report_2015_07_05_2_wi", mysql_report_2015_07_05_2_wi, + join_round32, end_round32, no_area, 549755813889.0, settings); + test_one("mysql_report_2015_07_05_3_wi", mysql_report_2015_07_05_3_wi, + join_round32, end_round32, no_area, 49316.0, settings); + test_one("mysql_report_2015_07_05_4_wi", mysql_report_2015_07_05_4_wi, + join_round32, end_round32, no_area, 1479986.0, settings); + test_one("mysql_report_2015_07_05_5_wi", mysql_report_2015_07_05_5_wi, + join_round32, end_round32, no_area, 38141.0, settings); + } + } + + + { + using bg::strategy::buffer::join_round; + using bg::strategy::buffer::join_miter; + bg::strategy::buffer::side_straight side_strategy; + bg::strategy::buffer::point_circle point_strategy; + typedef bg::strategy::buffer::distance_symmetric + < + typename bg::coordinate_type

::type + > distance; + + test_with_custom_strategies("sharp_triangle_j12", + sharp_triangle, + join_round(12), end_flat, distance(1.0), side_strategy, point_strategy, + 29.1604); + // Test very various number of points (min is 3) + test_with_custom_strategies("sharp_triangle_j2", + sharp_triangle, + join_round(2), end_flat, distance(1.0), side_strategy, point_strategy, + 27.2399); + test_with_custom_strategies("sharp_triangle_j5", + sharp_triangle, + join_round(5), end_flat, distance(1.0), side_strategy, point_strategy, + 28.8563); + + test_with_custom_strategies("sharp_triangle_j36", + sharp_triangle, + join_round(36), end_flat, distance(1.0), side_strategy, point_strategy, + 29.2482); + test_with_custom_strategies("sharp_triangle_j360", + sharp_triangle, + join_round(360), end_flat, distance(1.0), side_strategy, point_strategy, + 29.2659); + + // Test with various miter limits + test_with_custom_strategies("sharp_triangle_m2", + sharp_triangle, + join_miter(2), end_flat, distance(4.0), side_strategy, point_strategy, + 148.500); + test_with_custom_strategies("sharp_triangle_m3", + sharp_triangle, + join_miter(3), end_flat, distance(4.0), side_strategy, point_strategy, + 164.376); + test_with_custom_strategies("sharp_triangle_m4", + sharp_triangle, + join_miter(4), end_flat, distance(4.0), side_strategy, point_strategy, + 180.2529); + test_with_custom_strategies("sharp_triangle_m5", + sharp_triangle, + join_miter(5), end_flat, distance(4.0), side_strategy, point_strategy, + 196.1293); + test_with_custom_strategies("sharp_triangle_m25", + sharp_triangle, + join_miter(25), end_flat, distance(4.0), side_strategy, point_strategy, + 244.7471); + + // Right triangles, testing both points around sharp corner as well as points + // around right corners in join_round strategy + test_with_custom_strategies("right_triangle_j3", + right_triangle, + join_round(3), end_flat, distance(1.0), side_strategy, point_strategy, + 53.0240); + test_with_custom_strategies("right_triangle_j4", + right_triangle, + join_round(4), end_flat, distance(1.0), side_strategy, point_strategy, + 53.2492); + test_with_custom_strategies("right_triangle_j5", + right_triangle, + join_round(5), end_flat, distance(1.0), side_strategy, point_strategy, + 53.7430); + test_with_custom_strategies("right_triangle_j6", + right_triangle, + join_round(6), end_flat, distance(1.0), side_strategy, point_strategy, + 53.7430); + + buffer_custom_side_strategy custom_side_strategy; + test_with_custom_strategies("sharp_triangle_custom_side", + sharp_triangle, + join_round(49), end_flat, distance(1.0), custom_side_strategy, point_strategy, + 31.1087); + } +} + +template +void test_deflate_special_cases() +{ + typedef bg::model::polygon polygon_type; + + bg::strategy::buffer::join_miter join_miter(5); + bg::strategy::buffer::join_round join_round(8); + bg::strategy::buffer::end_flat end_flat; + + // This case fails for because there is an IP formed at the border of the original + test_one("erode_50", erode_triangle, join_miter, end_flat, 0, 0, 0.0, -0.50); + test_one("erode_40", erode_triangle, join_miter, end_flat, 0, 0, 0.0, -0.40); + test_one("erode_60", erode_triangle, join_miter, end_flat, 0, 0, 0.0, -0.60); + + // This case generates a uu-turn in deflate, at 1.0 + test_one("forming_uu_a_95", forming_uu_a, join_round, end_flat, 1, 0, 23.0516, -0.95); + test_one("forming_uu_a_10", forming_uu_a, join_round, end_flat, 2, 0, 21.4606, -1.0); + test_one("forming_uu_a_15", forming_uu_a, join_round, end_flat, 2, 0, 8.8272, -1.5); + test_one("forming_uu_a_20", forming_uu_a, join_round, end_flat, 2, 0, 1.7588, -2.0); + test_one("forming_uu_a_21", forming_uu_a, join_round, end_flat, 2, 0, 0.9944, -2.1); + + test_one("forming_uu_b_25", forming_uu_b, join_round, end_flat, 1, 1, 38.4064, -0.25); + test_one("forming_uu_b_50", forming_uu_b, join_round, end_flat, 1, 1, 24.4551, -0.50); + test_one("forming_uu_b_95", forming_uu_b, join_round, end_flat, 1, 0, 11.5009, -0.95); + test_one("forming_uu_b_10", forming_uu_b, join_round, end_flat, 1, 0, 10.7152, -1.0); + test_one("forming_uu_b_15", forming_uu_b, join_round, end_flat, 1, 0, 4.4136, -1.5); + + test_one("forming_uu_b_25", forming_uu_b, join_round, end_flat, 1, 1, 67.7139, 0.25); + test_one("forming_uu_b_50", forming_uu_b, join_round, end_flat, 1, 1, 82.0260, 0.50); + test_one("forming_uu_b_70", forming_uu_b, join_round, end_flat, 1, 3, 93.0760, 0.70); + + // From here on a/b have the same result + test_one("forming_uu_a_10", forming_uu_a, join_round, end_flat, 1, 0, 108.0959, 1.0); + test_one("forming_uu_b_10", forming_uu_b, join_round, end_flat, 1, 0, 108.0959, 1.0); +} + +template +< + typename InputPoint, + typename OutputPoint, + bool InputClockwise, + bool OutputClockwise, + bool InputClosed, + bool OutputClosed +> +void test_mixed() +{ + typedef bg::model::polygon input_polygon_type; + typedef bg::model::polygon output_polygon_type; + + bg::strategy::buffer::join_round join_round(12); + bg::strategy::buffer::end_flat end_flat; + + std::ostringstream name; + name << "mixed_" << std::boolalpha + << InputClockwise << "_" << OutputClockwise + << "_" << InputClosed << "_" << OutputClosed; + + test_one(name.str(), + simplex, join_round, end_flat, 47.4831, 1.5); +} + +#ifdef HAVE_TTMATH +#include +#endif + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + + typedef bg::model::point dpoint; + + test_all(); + test_deflate_special_cases(); + + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER) + test_all(); + test_deflate_special_cases(); +#endif + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + typedef bg::model::point fpoint; + test_deflate_special_cases(); + + test_mixed(); + test_mixed(); + test_mixed(); + test_mixed(); + + test_mixed(); + test_mixed(); + test_mixed(); + test_mixed(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/buffer/buffer_ring.cpp b/src/boost/libs/geometry/test/algorithms/buffer/buffer_ring.cpp new file mode 100644 index 000000000..d195e6047 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/buffer_ring.cpp @@ -0,0 +1,50 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2017-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include "test_buffer.hpp" + +// Short test verifying behavior of explicit ring_type (polygon without holes) +// The test buffer_polygon.cpp contains all other tests, also for rings. + +static std::string const concave_simplex = "POLYGON ((0 0,3 5,3 3,5 3,0 0))"; + +template +void test_all() +{ + typedef bg::model::ring ring_type; + typedef bg::model::polygon polygon_type; + + bg::strategy::buffer::join_miter join_miter(10.0); + bg::strategy::buffer::join_round join_round(100); + bg::strategy::buffer::end_flat end_flat; + + test_one("concave_simplex", concave_simplex, join_round, end_flat, 14.5616, 0.5); + test_one("concave_simplex", concave_simplex, join_miter, end_flat, 16.3861, 0.5); + + test_one("concave_simplex", concave_simplex, join_round, end_flat, 0.777987, -0.5); + test_one("concave_simplex", concave_simplex, join_miter, end_flat, 0.724208, -0.5); +} + + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + + test_all >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER) + test_all >(); +#endif + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_all >(); + test_all >(); +#endif + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/buffer/buffer_with_strategies.cpp b/src/boost/libs/geometry/test/algorithms/buffer/buffer_with_strategies.cpp new file mode 100644 index 000000000..2fd10dad1 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/buffer_with_strategies.cpp @@ -0,0 +1,141 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2015-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include "geometry_test_common.hpp" + +#include + +#include + +#include + +// For test +#include +#include +#include + + +// This unit test tests boost::geometry::buffer (overload with strategies) +// More detailed tests are, per geometry type, available in buffer_.cpp +// (testing boost::geometry::buffer_inserter) + +// SVG's are not created (they are in detailed tests) + +static std::string const polygon_simplex = "POLYGON ((0 0,1 5,6 1,0 0))"; +static std::string const polygon_empty = "POLYGON()"; +static std::string const multi_polygon_empty = "MULTIPOLYGON()"; +static std::string const multi_polygon_simplex + = "MULTIPOLYGON(((0 1,2 5,5 3,0 1)),((1 1,5 2,5 0,1 1)))"; + + +template +< + typename Geometry, + typename GeometryOut, + typename JoinStrategy, + typename EndStrategy, + typename SideStrategy, + typename PointStrategy, + typename DistanceStrategy +> +void test_with_strategies(std::string const& caseid, + std::string const& wkt, + JoinStrategy const& join_strategy, + EndStrategy const& end_strategy, + SideStrategy const& side_strategy, + PointStrategy const& point_strategy, + DistanceStrategy const& distance_strategy, + double expected_area, + std::size_t expected_numpoints, + double tolerance = 0.01) +{ + namespace bg = boost::geometry; + Geometry g; + bg::read_wkt(wkt, g); + bg::correct(g); + + GeometryOut result; + + bg::buffer(g, result, + distance_strategy, side_strategy, + join_strategy, end_strategy, point_strategy); + + BOOST_CHECK_MESSAGE + ( + bg::num_points(result) == expected_numpoints, + "Buffer " << caseid + << " numpoints expected: " << expected_numpoints + << " detected: " << bg::num_points(result) + ); + + double const area = bg::area(result); + double const difference = area - expected_area; + + BOOST_CHECK_MESSAGE + ( + bg::math::abs(difference) < tolerance, + "Buffer " << caseid + << std::setprecision(12) + << " area expected: " << expected_area + << " detected: " << area + ); +} + + +template +void test_all() +{ + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + + bg::strategy::buffer::join_round join(160); + bg::strategy::buffer::end_round end(160); + bg::strategy::buffer::point_circle circle(160); + bg::strategy::buffer::side_straight side; + + typedef bg::strategy::buffer::distance_symmetric + < + typename bg::coordinate_type::type + > distance; + + test_with_strategies( + "multi_polygon_empty", multi_polygon_empty, + join, end, side, circle, distance(1.0), + 0.0, 0); + + + // PostGIS: 34.2550669294223 216 (40 / qcircle) + // SQL Server: 34.2550419903829 220 (default options) + test_with_strategies( + "multi_polygon_simplex", multi_polygon_simplex, + join, end, side, circle, distance(1.0), + 34.2551, 219); + + test_with_strategies( + "polygon_empty", polygon_empty, + join, end, side, circle, distance(1.0), + 0.0, 0); + + // + // PostGIS: 35.2256914798762 164 (40 / qcircle) + // SQL Server: 35.2252355201605 153 (default options) + test_with_strategies( + "polygon_simplex", polygon_simplex, + join, end, side, circle, distance(1.0), + 35.2257, 166); +} + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/buffer/data/gr.wkt b/src/boost/libs/geometry/test/algorithms/buffer/data/gr.wkt new file mode 100644 index 000000000..036c88a86 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/data/gr.wkt @@ -0,0 +1,69 @@ +POLYGON ((2591610.140844767447561 4286029.643435961566865,2594115.163346088025719 4285152.154383632354438,2595320.753431379329413 4284579.74977499153465,2595722.950751616619527 4284312.518855294212699,2596619.740569446701556 4283052.568823982961476,2596990.879751751665026 4282213.095253625884652,2597300.125297174789011 4280305.940899614244699,2597331.072115615941584 4276605.626913164742291,2597083.4975680927746 4276224.365647087804973,2596588.793751005548984 4276338.45431409496814,2593527.50775419222191 4280152.943493959493935,2593279.933206666260958 4280534.342283136211336,2591394.069713138509542 4284656.279324283823371,2590775.35598330758512 4286373.458162739872932,2590744.297845378052443 4286869.41149783320725,2591053.877349274698645 4286755.075002126395702,2591610.140844767447561 4286029.643435961566865)) +POLYGON ((2555555.316249697003514 4352689.19908235501498,2557008.369563022628427 4349463.861683191731572,2558987.741428818088025 4345433.099935893900692,2559234.870698379352689 4345049.408414580859244,2560966.556697157677263 4343015.118392486125231,2561430.313695803284645 4342785.395555835217237,2562605.290921126957983 4342516.585997329093516,2569871.893321639392525 4336378.612767102196813,2571634.637458350043744 4334883.0389523813501,2572283.964048148132861 4334232.22402105294168,2572407.528682927601039 4333272.843957723118365,2566717.989508484955877 4320591.121212368831038,2565852.146509092766792 4319480.50177791994065,2565450.060508346650749 4319326.951108642853796,2564862.73887492204085 4319365.82100017927587,2560038.708741397596896 4320169.301217127591372,2559018.242969294078648 4320744.689832178875804,2552555.478611800819635 4325149.20531311724335,2551751.640568782109767 4326221.374757977202535,2550576.66334345843643 4328098.824049399234354,2550453.098708679433912 4328558.753026241436601,2549927.336753659881651 4331739.889987670816481,2548752.359528339467943 4344511.821145920082927,2548690.354571968782693 4345548.058069777674973,2552122.779751087073237 4352689.19908235501498,2552493.918933392036706 4352958.124562109820545,2554967.549338309559971 4353880.126825681887567,2555678.880884478799999 4353304.211824299767613,2555802.445519257802516 4352843.225500854663551,2555555.316249697003514 4352689.19908235501498)) +POLYGON ((2423981.689384551718831 4397064.104942323639989,2423115.846385159529746 4397565.041253533214331,2421260.484432108234614 4399107.56739207636565,2421074.914840955752879 4399532.360126257874072,2421043.968022517394274 4400033.551205471158028,2421136.919797329232097 4400534.765832838602364,2422033.820934650488198 4404663.704022608697414,2422373.901979023125023 4405011.327909963205457,2422806.600839736871421 4405011.327909963205457,2424909.537340311333537 4403390.708195376209915,2425156.666609875392169 4403042.998234177939594,2425187.613428313750774 4402502.49359661154449,2423981.689384551718831 4397064.104942323639989)) +POLYGON ((2414952.342847325839102 4402772.811946315690875,2415199.917394851800054 4407443.344988466240466,2415539.998439224436879 4409295.868931110948324,2416127.32007264951244 4410801.725029764696956,2416436.899576546158642 4411149.688281376846135,2418786.965346681885421 4410260.826705728657544,2418817.912165123037994 4409759.293516525067389,2417921.011027801316231 4407133.719019911251962,2417704.494618207681924 4406670.408635009080172,2415756.626168309245259 4403197.75068792887032,2415477.993482854217291 4402811.985060860402882,2414952.342847325839102 4402772.811946315690875)) +POLYGON ((2575376.196863402612507 4472224.118898721411824,2574788.54127150401473 4472262.430893377400935,2574077.655003299936652 4472844.958158013410866,2571232.551457603927702 4476924.250396336428821,2571046.870546959806234 4477352.313107781112194,2571139.933641265612096 4477857.05776893068105,2571418.121048756409436 4478051.379721556790173,2573180.753865978680551 4478673.681781725026667,2573644.510864621493965 4478789.947777447290719,2574293.837454420048743 4478673.681781725026667,2575345.250044961925596 4478207.231596697121859,2577107.994181675370783 4477196.473884411156178,2578190.01963218441233 4476303.170729604549706,2578839.680180453695357 4475642.544422381557524,2579086.809450014494359 4475254.132838231511414,2578932.297996794339269 4474826.295240636914968,2578406.536041778046638 4473389.061551753431559,2578190.01963218441233 4472922.845304501242936,2577788.267589911818504 4472650.872045905329287,2575376.196863402612507 4472224.118898721411824)) +POLYGON ((2992329.583521094173193 4210636.757361931726336,2989670.494844515342265 4211622.804856428876519,2989299.355662210378796 4211887.312598169781268,2988990.11011678725481 4212570.448900697752833,2988897.15834197262302 4214579.428908327594399,2994277.451970995403826 4221104.691221220418811,2994679.649291229899973 4221331.860711568035185,3005286.059054522309452 4223077.793598398566246,3007419.49709557602182 4222774.352976323105395,3007852.307275780942291 4222584.723914881236851,3005440.681827233638614 4218941.420209947042167,3001668.064284248743206 4217386.771951836533844,2994556.084656450431794 4212760.042085616849363,2992329.583521094173193 4210636.757361931726336)) +POLYGON ((3021458.109399007633328 4218334.91193628590554,3019170.048585242591798 4222280.340583647601306,3013139.983088459353894 4244731.27551181614399,3013016.418453680351377 4245225.340754669159651,3012985.471635239198804 4246404.671038310043514,3013171.041226391680539 4246861.158235197886825,3019015.425812528003007 4254888.940125274471939,3023251.800354156643152 4262009.280857927165926,3023715.446033311076462 4262808.53217298258096,3023777.45098968455568 4263379.794801467098296,3023282.301894635427743 4265856.480225098319352,3023282.301894635427743 4268942.871743682771921,3023437.369945311918855 4272564.139858214184642,3029374.372347788885236 4276644.344143596477807,3029807.071208502631634 4276834.911807493306696,3031013.106571755837649 4276758.437207715585828,3031384.245754060801119 4276491.398155529983342,3031322.240797690115869 4274660.606354106217623,3029621.5016173501499 4262808.53217298258096,3029281.420572974253446 4261894.245038099586964,3025385.238395213149488 4245871.944135325029492,3028137.390166091732681 4229037.501189870759845,3023684.499214872717857 4225355.573288939893246,3023158.737259853631258 4224634.065929244272411,3021458.109399007633328 4218334.91193628590554)) +POLYGON ((3140013.58973282482475 4361679.380983226001263,3140415.341775096952915 4363063.537204368971288,3140631.412906725890934 4363485.932750260457397,3140972.050548554863781 4363793.190280830487609,3141343.18973085982725 4363679.144116920419037,3142084.577539542689919 4363140.624535604380071,3142981.923954826314002 4361525.227856651879847,3143445.235675507225096 4360104.328066130168736,3139982.642914383672178 4348003.370526700280607,3137755.696501065045595 4341978.158247251063585,3132684.982375938910991 4329630.295225298032165,3130612.65873533161357 4326220.409288696944714,3124026.329743056092411 4316033.855261153541505,3117965.762705800123513 4310104.12395291030407,3112121.266800169833004 4306813.83149869274348,3110915.23143691662699 4305399.016821959987283,3109338.613488811533898 4303181.005272405222058,3106493.843901589047164 4298977.470186469145119,3105690.005858570337296 4297258.298849802464247,3105009.621130842715502 4295233.115651254542172,3101979.393271958455443 4291298.952079682610929,3099443.757910670246929 4288740.055800472386181,3099072.618728365283459 4288472.585214412771165,3094650.785915075801313 4285953.10422613658011,3093197.176004296634346 4285571.515517945401371,3092609.854370868764818 4285533.728383533656597,3091187.302598022390157 4285991.854710307903588,3087229.560741849243641 4288397.128361198119819,3086919.981237955857068 4288702.257656610570848,3086734.856924765277654 4289160.517468039877713,3086023.525378596037626 4290954.981583534739912,3085683.444334223400801 4292482.172733942978084,3085930.573603781871498 4293666.622321301139891,3086981.986194326076657 4297715.956746149808168,3088094.958463276270777 4315001.549609431065619,3085745.004012632183731 4323500.611016820184886,3093444.30527385789901 4335304.329701188020408,3095021.925097377970815 4337605.706930064596236,3095331.059323312714696 4337913.330734616145492,3103153.925219320226461 4344702.619414729066193,3105349.368216744158417 4346431.425165256485343,3106833.59098749095574 4347467.846874327398837,3124552.536976037546992 4356492.665546560660005,3128911.919554991647601 4358375.398172507993877,3140013.58973282482475 4361679.380983226001263)) +POLYGON ((2869661.293280427809805 4348273.422753568738699,2868455.369236662983894 4348464.149494192562997,2865239.905745100229979 4349578.862875730730593,2864436.06770208152011 4350654.570571920834482,2864280.554373443126678 4351113.25120413582772,2864280.554373443126678 4351613.287907429039478,2864651.693555748090148 4352689.19908235501498,2868393.809558254666626 4355915.504127815365791,2868826.953696933109313 4356068.470322852954268,2871856.736277852207422 4354301.19344930164516,2878381.060313754249364 4350116.703279375098646,2878381.060313754249364 4349578.862875730730593,2878103.429503716994077 4349195.023546325974166,2877793.849999820347875 4348887.077368510887027,2877361.151139107067138 4348734.213284035213292,2876371.186907482333481 4348619.221118183806539,2869661.293280427809805 4348273.422753568738699)) +POLYGON ((2832771.572504406329244 4346008.731944741681218,2829771.178269057068974 4347369.175229661166668,2825828.130585667211562 4348142.127324001863599,2829678.783091698773205 4350614.481874004937708,2830860.66212545055896 4355358.841731435619295,2829304.304324670694768 4360000.83623484056443,2826554.490263093262911 4363676.929640293121338,2824236.484506305772811 4364602.067025523632765,2824082.418331047520041 4365024.523125616833568,2824051.805471079889685 4365525.069310077466071,2824391.552556981798261 4365831.277767788618803,2825566.975060267839581 4366486.222207658924162,2827545.345050645060837 4366101.77840356528759,2829864.35268285125494 4365486.032512652687728,2830576.129506982397288 4364870.32195342425257,2833173.32454667892307 4362294.908526715822518,2833482.45877261320129 4361949.638619001023471,2836420.625412609893829 4358028.17926303576678,2837131.066402854397893 4356914.802749514579773,2837410.03304678061977 4355493.406172873452306,2836976.888908104971051 4350153.610815620049834,2835214.590049356687814 4347965.502946531400084,2833946.104451768100262 4346623.362936964258552,2832771.572504406329244 4346008.731944741681218)) +POLYGON ((2827421.780415862798691 4355032.325973690487444,2826927.521876740735024 4355032.325973690487444,2826586.995554406195879 4355339.341782544739544,2826494.377738065086305 4356338.586831928230822,2826556.382694435771555 4356914.802749514579773,2826834.570101929362863 4357298.917752743698657,2827267.71424060780555 4357453.010237406939268,2827700.41310131829232 4357453.010237406939268,2828257.121874776203185 4357260.879104228690267,2828628.261057081166655 4356953.808400047942996,2828658.87391704833135 4356452.555076035670936,2828472.859047933947295 4355915.504127815365791,2828195.116918405517936 4355530.332167193293571,2827421.780415862798691 4355032.325973690487444)) +POLYGON ((3049659.121279629413038 4351883.292507800273597,3041000.913924711290747 4357298.917752743698657,3038743.465970913879573 4358873.559323026798666,3038434.331744979135692 4359180.684900897555053,3038557.896379761397839 4364254.6467181192711,3038773.967511389870197 4364716.122996930032969,3039362.179700742010027 4365370.860944991,3045082.665693628136069 4366409.11084074433893,3045577.369510712567717 4366254.889769581146538,3045948.508693017531186 4365986.600226512178779,3054946.351814345922321 4357337.924797600135207,3055255.486040280200541 4356990.739412423223257,3055441.166950923856348 4356567.492721032351255,3055410.554090953897685 4356031.542479675263166,3054483.151413156185299 4354610.26269743964076,3052102.138824579305947 4352573.196799884550273,3051637.491270006634295 4352419.174248870462179,3050184.326637192163616 4351998.319567987695336,3049659.121279629413038 4351883.292507800273597)) +POLYGON ((2946255.114198702387512 4380222.691562238149345,2939483.215615274384618 4378682.888404951430857,2933731.671484458725899 4372332.933580402284861,2933917.241075611207634 4371255.05224512051791,2933917.241075611207634 4370754.100087784230709,2932402.0714864237234 4370524.891465342603624,2929711.924671915359795 4370293.471900186501443,2929093.210942084435374 4370331.556763516739011,2928196.866402216255665 4370716.152219046838582,2927392.917039709165692 4371177.906580962240696,2926434.567543470300734 4372139.566267141140997,2926248.997952317818999 4372564.397179501131177,2924424.694137195590883 4377413.12285110540688,2923496.400903470814228 4380299.902395087294281,2923249.271633910015225 4381301.475791771896183,2923342.223408721853048 4381879.034633260220289,2923527.792999874334782 4382341.270527723245323,2923836.481947846710682 4382649.069151515141129,2936638.891306016594172 4389082.423625545576215,2937226.10161995049566 4389121.685267948545516,2939514.607711677905172 4388196.647164435125887,2939885.746893982868642 4387964.845271034166217,2945327.600201413501054 4383611.620911222882569,2945574.729470974765718 4383227.671343368478119,2946873.827928530517966 4380722.977743802592158,2946749.81801578681916 4380493.417091364972293,2946255.114198702387512 4380222.691562238149345)) +POLYGON ((3099165.236544703599066 4373102.28192847315222,3094310.148273246828467 4376835.804897713474929,3093629.874865010380745 4377413.12285110540688,3090785.216597279068083 4380031.261001949198544,3091218.360735954716802 4381533.133311292156577,3096072.447131995577365 4387388.067401162348688,3097680.679815486073494 4389238.083705622702837,3098515.464676942676306 4389661.512792814522982,3100371.271907959133387 4390315.696544957347214,3100834.472309148870409 4390470.264578749425709,3101329.621404197998345 4390470.264578749425709,3101979.393271958455443 4389238.083705622702837,3102102.95790674071759 4388736.427967187017202,3102782.786037015262991 4385538.37119132000953,3103153.925219320226461 4383304.903861795552075,3103185.428635211661458 4382726.297493098303676,3103061.41872247075662 4375564.04138542059809,3102906.350671794265509 4375025.894491924904287,3101144.05181304551661 4373641.301943959668279,3100772.912630740553141 4373410.923327951692045,3099165.236544703599066 4373102.28192847315222)) +POLYGON ((2777451.908152145799249 4382187.790468361228704,2776926.257516617886722 4382187.790468361228704,2774576.191746482159942 4382572.81191058177501,2773555.837293869815767 4382957.847208662889898,2767062.014798443764448 4388543.73516106698662,2766443.746346578001976 4389198.960370588116348,2765454.338712409604341 4390701.982067508623004,2765299.715939695481211 4391126.579249332658947,2765268.769121257122606 4391665.397940886206925,2765608.850165629759431 4391781.824092406779528,2766907.503345223609358 4392090.033415410667658,2767371.59430234041065 4392167.191215805709362,2768392.060074443928897 4392012.737400809302926,2776122.419473599176854 4388043.083050085231662,2777792.100516006816179 4386463.179297599941492,2777946.723288720939308 4386039.876878512091935,2778812.566288110334426 4383381.027661667205393,2778689.001653331331909 4382765.397153282538056,2778348.809289464261383 4382457.595182967372239,2777451.908152145799249 4382187.790468361228704)) +POLYGON ((2791552.080133982934058 4387927.807373217307031,2790438.996545541565865 4388196.647164435125887,2790067.857363236602396 4388465.35499195381999,2790099.360779130831361 4389044.410724042914808,2794366.236861238256097 4396446.5750179477036,2798726.509996119420975 4399570.549252319149673,2799220.768535241484642 4399686.089549814350903,2803890.287215545307845 4399686.089549814350903,2803952.292171918787062 4399416.960361426696181,2803488.535173272714019 4398142.507823202759027,2800427.249176459386945 4393977.922856635414064,2798046.236587879713625 4391897.280122672207654,2796314.105311136227101 4390470.264578749425709,2794087.604175782762468 4388928.014395661652088,2792975.0771847916767 4388196.647164435125887,2791552.080133982934058 4387927.807373217307031)) +POLYGON ((2708495.606177705805749 4390432.107989124953747,2708062.795997500885278 4390586.677706940099597,2707815.221449974924326 4390817.426428416743875,2707599.150318346451968 4391781.824092406779528,2707630.097136787604541 4392860.803806035779417,2709577.965586688369513 4401963.127562602981925,2709949.104768991004676 4403042.998234177939594,2710536.426402418408543 4403776.494762715883553,2710938.623722652904689 4404007.528835942037404,2728811.635886458214372 4406747.810917943716049,2730326.805475645698607 4406747.810917943716049,2731316.21310981689021 4406361.916791649535298,2732676.871245781425387 4405628.381286242976785,2732831.382699004374444 4405204.318247580900788,2732954.947333783376962 4397449.662762952037156,2732707.818064222112298 4396215.70463749859482,2732274.673925546463579 4395212.73283763974905,2731841.975064833182842 4394287.167169045656919,2731563.787657339591533 4393901.5847502136603,2731192.648475037422031 4393631.629823670722544,2724760.942255473230034 4392205.354002934880555,2717710.522306081373245 4391858.147049539722502,2708495.606177705805749 4390432.107989124953747)) +POLYGON ((2822814.823289383202791 4389738.79179900418967,2821144.585649522021413 4390663.963404381647706,2820804.949883111286908 4391010.160238422453403,2811775.603345888201147 4401383.509644056670368,2812146.742528193630278 4406091.646367501467466,2812393.871797754429281 4406594.118604704737663,2813692.413657857105136 4408677.630211332812905,2814063.218881691340357 4408949.078180028125644,2816723.198114194441587 4409759.293516525067389,2817279.016331724822521 4409642.53197271656245,2819289.780293926596642 4407905.716136941686273,2828318.681553184520453 4399839.682315330021083,2828442.69146592868492 4399493.199055306613445,2826649.000510776881129 4391974.575301819480956,2826339.421006880234927 4390817.426428416743875,2825906.610826675314456 4390663.963404381647706,2822814.823289383202791 4389738.79179900418967)) +POLYGON ((2744983.574911451898515 4403853.87603235989809,2743870.602642501704395 4403892.080636514350772,2741613.15468870382756 4404239.679361053742468,2741242.01550639886409 4404510.041760813444853,2740747.311689314898103 4405281.709882943890989,2739541.721604023594409 4408253.445802656002343,2739788.850873582065105 4408716.82503604516387,2740685.752010903321207 4409605.418750107288361,2741118.450871617067605 4409798.492321811616421,2743159.382415821310133 4409721.067870171740651,2743530.521598126273602 4409527.995702023617923,2745725.964595550205559 4407982.988415124826133,2746282.673369008116424 4406747.810917943716049,2746344.233047416433692 4405705.7760009765625,2746282.673369008116424 4405126.927174153737724,2745787.969551923684776 4404277.885347863659263,2745447.777188059873879 4403969.462745145894587,2744983.574911451898515 4403853.87603235989809)) +POLYGON ((3002440.95550882909447 4393515.183507037349045,3001914.859595338813961 4393554.322651777416468,3000400.135284116026014 4393940.864107725210488,2999657.745600014925003 4394478.714367645792663,2997060.661879806313664 4398219.709376811981201,2996813.087332283146679 4398605.447808753699064,2996565.958062722347677 4399608.738515092991292,2996472.449690454639494 4405049.536662658676505,2996937.097245027311146 4405859.455502709373832,3012398.150001814588904 4416440.464416719041765,3012768.398628192488104 4416671.773395116440952,3022601.694527924992144 4422586.396166446618736,3024333.825804668478668 4423397.650780817493796,3025385.238395213149488 4423629.111171501688659,3037290.301338096614927 4425253.929675227962434,3043535.992688546422869 4423127.921581463888288,3044216.377416274044663 4422547.150215717963874,3044897.096102475654334 4421309.167946700938046,3045206.230328407138586 4420344.181726089678705,3045174.726912512909621 4419455.664805953390896,3043938.635286745615304 4418141.669627649709582,3042299.010506852064282 4417212.997638188302517,3039300.174744371324778 4416479.687834044918418,3036733.592564641963691 4416015.97058436460793,3032713.845752095803618 4415011.133778312243521,3029930.301884810905904 4414006.391851871274412,3009645.998230932746083 4406554.9315883545205,3008748.651815646328032 4406208.230043982155621,3004760.408418997190893 4404510.041760813444853,3003461.421280929353088 4403892.080636514350772,3002749.64445679821074 4403313.330287384800613,3002502.960465199314058 4402965.761763590388,3002348.003734017256647 4402425.261041063815355,3001884.692013333551586 4397873.417565458454192,3001822.687056962866336 4394827.255802458152175,3002440.95550882909447 4393515.183507037349045)) +POLYGON ((2732862.440836933907121 4407751.86814397200942,2732274.673925546463579 4407829.278283690102398,2731563.787657339591533 4408446.355883928947151,2730852.567430661991239 4409566.220655422657728,2729801.154840120114386 4411960.071072018705308,2729677.590205338317901 4412964.619837751612067,2729677.590205338317901 4414586.696965764276683,2729863.159796490799636 4415127.815147946588695,2733913.85342747811228 4417986.699851487763226,2734284.547331818379462 4418025.928970955312252,2737562.461057716514915 4415977.722463401965797,2738366.299100735224783 4414586.696965764276683,2737902.542102092411369 4412347.141336007975042,2737624.466014089994133 4411110.484502057544887,2735985.286512158345431 4408716.82503604516387,2735645.094148294534534 4408408.273934078402817,2733851.848471104633063 4407867.497141764499247,2732862.440836933907121 4407751.86814397200942)) +POLYGON ((2871423.592139176558703 4406283.544610826298594,2868641.384105780627578 4406322.730629188008606,2867744.482968458905816 4406709.735038844868541,2865394.08323984965682 4408176.032580778934062,2865022.832738053519279 4409101.692518272437155,2865208.402329206001014 4409527.022704998962581,2876433.191863853018731 4416904.200170629657805,2890070.052125012036413 4423706.636915417388082,2891708.786348978523165 4421580.938346943818033,2885462.53840107889846 4416285.519423273392022,2875011.085368971340358 4408445.382985705509782,2871423.592139176558703 4406283.544610826298594)) +POLYGON ((2836574.691587867680937 4418101.32718844152987,2836791.319316952489316 4417792.364822591654956,2836791.319316952489316 4417290.476607773452997,2836358.620456239208579 4415939.613563259132206,2836080.43304874561727 4415552.273545492440462,2834193.678999291267246 4414355.433311192318797,2833296.889181460719556 4414083.847474261187017,2831163.451140407007188 4414121.949728757143021,2829772.29146396368742 4415126.702566269785166,2829833.851142372004688 4415707.207860444672406,2830019.420733524486423 4416248.383032094687223,2835770.408266887068748 4420885.592912990599871,2836574.691587867680937 4418101.32718844152987)) +POLYGON ((2857879.794972320087254 4421890.984954208135605,2851201.404761160258204 4422508.878594832494855,2850891.825257263612002 4422856.11162082478404,2850798.762162960600108 4423320.127291233278811,2851417.141934318002313 4424053.909083651378751,2854107.288748829159886 4425640.509660203009844,2855560.787340113893151 4426025.989992116577923,2857447.096111606806517 4425098.856170088984072,2857756.230337541084737 4424750.575453975237906,2859023.825379202608019 4422933.631725312210619,2859116.888473505619913 4422431.361588627099991,2858777.141387606505305 4422122.412531306035817,2857879.794972320087254 4421890.984954208135605)) +POLYGON ((2750920.688633420038968 4425602.226895059458911,2750487.989772706758231 4425602.226895059458911,2749034.825139892753214 4427342.074314353987575,2747704.779863892588764 4429392.472481383010745,2745169.255822095554322 4436280.532989690080285,2742912.141826771665365 4443172.094972506165504,2743035.706461550667882 4444993.485261105932295,2743994.167277280706912 4445187.203341979533434,2745354.825413248036057 4444876.475120771676302,2749931.280999249313027 4443249.624229383654892,2750333.366999995429069 4442978.413751287385821,2754136.931361418683082 4437944.501922651194036,2754631.635178505908698 4437208.783617055974901,2756857.691035897471011 4433299.838508390821517,2757012.647767082322389 4432874.670501386746764,2757043.260627049952745 4432332.647792200557888,2756919.695992270950228 4431713.207272284664214,2756393.934037251397967 4430861.901202405802906,2753363.706178370397538 4427806.28598749730736,2752281.235449896194041 4426800.33404,2750920.688633420038968 4425602.226895059458911)) +POLYGON ((2790964.758500557858497 4431286.013572776690125,2790655.624274626374245 4431595.229334438219666,2786017.609010213986039 4436588.918906288221478,2785770.034462690819055 4436975.9120261836797,2785614.966412014793605 4438987.751332331448793,2785676.971368385013193 4439569.42315,2785862.540959537494928 4440111.815924239344895,2786790.054956829641014 4441156.254623740911484,2789047.50291062425822 4443481.657626637257636,2789388.029232962056994 4443791.22932964283973,2789759.168415267020464 4444022.01952782087028,2791799.65468150889501 4445029.606650262139738,2792324.860039072111249 4445029.606650262139738,2792665.497680898290128 4444759.466273522004485,2791521.467274015769362 4432409.262017754837871,2790964.758500557858497 4431286.013572776690125)) +POLYGON ((3002904.712507471907884 4428578.671140423975885,3002255.385917676147074 4428578.671140423975885,2999657.745600014925003 4429083.320886803790927,2998452.266834214795381 4429662.36082876753062,2996627.963019093032926 4431674.902603208087385,2992484.206293805502355 4448712.961802339181304,2993009.522970859892666 4449331.304155612364411,2993473.613927976693958 4449758.249342942610383,3001234.474867610726506 4446930.267641404643655,3004048.631594866048545 4445264.886822195723653,3011006.099769443739206 4438215.722953799180686,3011191.66936059622094 4437790.357810690067708,3011191.66936059622094 4432022.435482876375318,3011129.664404225535691 4431597.318660767748952,3010728.02368144178763 4431325.291832115501165,3002904.712507471907884 4428578.671140423975885)) +POLYGON ((2804291.927938329055905 4435467.317885399796069,2801447.714948560111225 4436241.23637755215168,2799962.712941377889365 4436861.080760887823999,2796716.636589847505093 4438293.355328067205846,2796376.110267509706318 4438642.080834309570491,2794705.872627645730972 4440731.886706870980561,2794025.599219409283251 4442436.989644778892398,2793933.09272255981341 4442939.092294411733747,2793995.097678933292627 4443481.657626637257636,2795232.079860627185553 4447084.544819872826338,2797767.269943953491747 4452122.80516323260963,2799839.036987107247114 4454720.030186050571501,2801168.636985142249614 4456079.054110595025122,2807879.42116812383756 4458755.034223730675876,2812888.130336876492947 4458445.024254319258034,2814651.319751549512148 4457007.925696013495326,2812857.628796400502324 4446465.217853839509189,2812393.871797754429281 4444566.871689950115979,2810847.755390125792474 4440267.109022814780474,2804291.927938329055905 4435467.317885399796069)) +POLYGON ((2833389.395678310189396 4427727.755652001127601,2831627.096819561906159 4427960.424345386214554,2831225.456096780486405 4428269.543242838233709,2821144.585649522021413 4449138.765884415246546,2820959.016058369539678 4449565.563777130097151,2821577.395829726476222 4451155.010687317699194,2821917.476874099578708 4451464.806924395263195,2838213.425811837427318 4465117.415024137124419,2838986.762314376886934 4465622.831824013963342,2839419.906453055329621 4465778.500044224783778,2842573.810266209766269 4466710.32157569937408,2843037.90122332656756 4466825.477400668896735,2843625.22285675117746 4466747.635279382579029,2843996.362039056140929 4466476.799483831971884,2845944.230488957371563 4464342.498923522420228,2847181.21267065173015 4462557.166817271150649,2847892.544216820504516 4461430.574928456917405,2849315.095989667344838 4458055.01112013310194,2849840.41266672173515 4455691.361983134411275,2849840.41266672173515 4455186.559842771850526,2849716.848031942732632 4454022.507642270997167,2848696.382259839214385 4447084.544819872826338,2848355.744618010241538 4445264.886822195723653,2847582.964712924323976 4441274.338995424099267,2844954.82285478617996 4433221.267514560371637,2844676.635447293054312 4432834.411373354494572,2844335.997805466875434 4432525.020197060890496,2837131.066402854397893 4429044.050923293456435,2834348.747049967292696 4427882.867547772824764,2833389.395678310189396 4427727.755652001127601)) +POLYGON ((2875598.852280358318239 4451696.880951384082437,2874207.24732595263049 4451852.34409193135798,2872227.875460157170892 4452976.798601834103465,2871362.032460767775774 4453479.40158396679908,2870990.893278462812304 4453751.997976299375296,2870156.108417002949864 4455379.208257320336998,2870094.103460632730275 4455844.650148556567729,2870373.070104558952153 4456039.683933571912348,2874887.520734189078212 4456620.199491387233138,2876185.617316329851747 4454797.78369896300137,2876340.685367006342858 4454372.868426292203367,2876062.052681550849229 4452626.344511124305427,2875876.483090398367494 4452083.310158590786159,2875598.852280358318239 4451696.880951384082437)) +POLYGON ((2990474.332887533586472 4452395.366584139876068,2989360.915340618696064 4452588.103708253242075,2988866.211523531470448 4452743.579951132647693,2985650.302754006814212 4454527.25419442076236,2979960.874899053014815 4462750.089399657212198,2979836.864986308850348 4463293.672277498058975,2979929.371483158320189 4463721.042233766056597,2980918.779117329511791 4465312.620136441662908,2981228.024662752170116 4465622.831824013963342,2981754.120576242450625 4465737.975780152715743,2985650.302754006814212 4465234.789175631478429,2989484.925253362860531 4464613.279942925088108,2989855.619157702662051 4464380.92201981600374,2990103.193705228623003 4463837.283149088732898,2991432.793703263625503 4460112.482306686230004,2993256.652240420691669 4454332.387901779264212,2993350.049293194897473 4453286.648213068954647,2993288.044336824212223 4452860.677122609689832,2993009.522970859892666 4452588.103708253242075,2990474.332887533586472 4452395.366584139876068)) +POLYGON ((2727482.147207914385945 4454488.866925731301308,2726770.815661745145917 4456079.054110595025122,2726461.681435813661665 4456388.994668911211193,2722905.691621913108975 4458056.128215600736439,2722441.489345305133611 4458095.505906383506954,2720586.238711742218584 4457552.19051359873265,2719936.912121946457773 4456932.250252790749073,2718638.370261843781918 4456388.994668911211193,2718081.661488386336714 4456466.7604606943205,2717834.08694086316973 4456854.481035389006138,2717896.091897233854979 4457396.783153724856675,2718545.307167540770024 4460927.59360805619508,2719627.777896014973521 4463022.925109363161027,2720864.760077709332108 4464808.336003766395152,2722905.691621913108975 4466438.368755174800754,2725039.129662966821343 4467292.402431542985141,2726461.681435813661665 4467408.682696267031133,2729089.82329395134002 4467176.26320618391037,2730790.562474291305989 4465894.623883603140712,2731038.137021814472973 4465506.571240211836994,2731192.648475037422031 4465079.128976142033935,2731223.706612966954708 4464574.856000680476427,2731130.643518663942814 4457319.98790777195245,2728347.544929341413081 4454838.266005696728826,2727482.147207914385945 4454488.866925731301308)) +POLYGON ((2979311.548309254460037 4465002.417568036355078,2978909.017030545976013 4465156.958788872696459,2979465.725804003886878 4466554.639606798999012,2980270.009124987293035 4467951.387469961307943,2980579.143350918777287 4468261.816532250493765,2981104.348708481993526 4468379.085899204947054,2981970.303027362562716 4467990.941858330741525,2982094.312940106261522 4467329.718194139190018,2979743.801892005838454 4465195.245119240134954,2979311.548309254460037 4465002.417568036355078)) +POLYGON ((2604906.808742059394717 4480460.626241956837475,2602402.231518703512847 4480810.886679148301482,2601969.087380025070161 4480966.779411402530968,2602031.092336398549378 4481355.401777615770698,2603268.074518092907965 4482599.313734346069396,2603638.768422435969114 4482832.073717824183404,2613503.011140606831759 4488393.95167086366564,2617801.279319117311388 4490066.156265456229448,2618296.094455695711076 4490183.668753774836659,2621852.084269595798105 4490727.548790625296533,2622872.550041696522385 4490650.650316619314253,2625191.557673902716488 4490260.563810735009611,2625284.50944871455431 4489989.122570147737861,2624387.608311392832547 4488860.853721854276955,2616008.033641930203885 4483338.340961840935051,2615605.836321692913771 4483143.921381197869778,2610380.165465384721756 4482832.073717824183404,2606514.596147587988526 4481315.937130469828844,2606081.785967383068055 4481121.55491092428565,2604906.808742059394717 4480460.626241956837475)) +POLYGON ((2720740.750164965167642 4504939.620102197863162,2719596.719758082646877 4500926.416647368110716,2719905.965303505305201 4500576.606723877601326,2721235.453982049133629 4499408.648530495353043,2723214.825847844593227 4498863.197286057285964,2724235.180300456937402 4498785.117790421471,2725348.263888898305595 4496253.946593862958252,2725502.775342118460685 4495826.234877014532685,2725471.828523677308112 4494735.732925108633935,2725286.704210489988327 4494152.132486761547625,2721328.517076352145523 4488199.438609330914915,2718019.656532015651464 4484582.487382280640304,2716380.922308045905083 4482987.996394182555377,2714339.990763842128217 4481976.779560344293714,2713907.291903128381819 4481821.991483139805496,2713381.641267603263259 4481782.525086294859648,2712917.438990995287895 4482016.246685699559748,2712577.246627131476998 4482327.090460268780589,2712484.740130282007158 4482832.073717824183404,2712577.246627131476998 4498317.774389814585447,2712701.256539875641465 4498823.666840437799692,2713072.395722180604935 4499719.867032280191779,2716040.729944182094187 4503302.488531158305705,2717339.383123775944114 4504588.554254862479866,2720493.620895403902978 4506497.74816232547164,2720957.377894047182053 4506459.311176656745374,2720926.319756117649376 4505484.265295404009521,2720740.750164965167642 4504939.620102197863162)) +POLYGON ((2770123.300795260351151 4489911.109021447598934,2771329.336158513091505 4508368.705593240447342,2770927.58411624096334 4508640.622678660787642,2770680.009568717796355 4509031.393076618202031,2770494.439977565314621 4509459.643658461049199,2770401.93348071584478 4510433.936853010207415,2770711.067706650123 4510785.058240993879735,2772937.457522512413561 4510355.771143369376659,2774638.196702852845192 4509732.571330790407956,2775565.71070014173165 4509226.292628984898329,2776276.930926822125912 4508524.025788694620132,2776771.634743906091899 4507783.223872453905642,2777544.971246448811144 4505562.394675668329,2779832.920740722678602 4495864.773062561638653,2779925.983835025690496 4495397.559652292169631,2779647.351149570196867 4494969.882817408069968,2778070.287923500407487 4493217.878816088661551,2777699.482699668966234 4492984.748683739453554,2770123.300795260351151 4489911.109021447598934)) +POLYGON ((2822567.248741860035807 4496020.889195878058672,2819505.962745046243072 4497498.641979380510747,2817496.089338771998882 4504821.942305842414498,2817403.471522434148937 4505289.575584920123219,2817526.590879250783473 4506459.311176656745374,2817929.233477450441569 4507354.059750561602414,2819907.603467827662826 4508406.167435117065907,2821886.975333623122424 4509226.292628984898329,2827638.408144948072731 4508095.813445599749684,2834255.238677699584514 4505133.32147,2834595.87631952855736 4504783.371205891482532,2834595.87631952855736 4504237.640412975102663,2834440.808268852066249 4502017.562053215689957,2834317.243634073063731 4501510.534085975959897,2833946.104451768100262 4501238.801860622130334,2824298.489462675992399 4496488.130344793200493,2822968.889464643783867 4496098.948133024387062,2822567.248741860035807 4496020.889195878058672)) +POLYGON ((2614214.342686775606126 4509576.250961092300713,2610658.241553387138993 4510317.179670562967658,2610163.537736299913377 4510550.555001398548484,2608555.41637230059132 4512227.417740616947412,2608524.803512333426625 4512773.564833396114409,2614183.284548846073449 4514332.858559628948569,2618017.907048202119768 4512656.781564996577799,2618512.610865286085755 4512422.236411437392235,2618605.228681627195328 4511954.284698275849223,2617739.385682237800211 4510823.65143764205277,2617090.059092439711094 4510160.850577033124864,2616718.919910134281963 4509927.483928119763732,2615760.459094404708594 4509692.999885652214289,2614214.342686775606126 4509576.250961092300713)) +POLYGON ((2892543.571210438385606 4510005.646441966295242,2892172.432028133422136 4510277.60601701028645,2891740.178445384837687 4511135.20899641700089,2891585.221714199520648 4511641.579972072504461,2891492.158619896508753 4512811.042432369664311,2891492.158619896508753 4513435.408083665184677,2892295.996662915218621 4515230.526379526592791,2892543.571210438385606 4515620.419539357535541,2899532.542800913564861 4525373.879790550097823,2901480.411250814329833 4527286.869613168761134,2901882.051973595749587 4527561.387303836643696,2903304.715065933763981 4528067.570174076594412,2929093.210942084435374 4534317.667983707040548,2933422.53725852444768 4535215.788136119022965,2934505.453264963347465 4535255.596973669715226,2934567.012943371664733 4534786.621939474716783,2934443.448308592662215 4534239.323501671664417,2934040.805710393004119 4533262.809594201855361,2930299.691583302337676 4527951.740549314767122,2928630.010540894698352 4525726.627271573990583,2927980.683951096143574 4525101.527531155385077,2924084.056495369877666 4521822.333944291807711,2918239.67190923076123 4517296.97119851782918,2896625.322979355230927 4511057.038053310476243,2892543.571210438385606 4510005.646441966295242)) +POLYGON ((2788985.497954253572971 4533730.590969812124968,2791274.338004454504699 4530449.812572654336691,2792232.798820184543729 4529981.053417854942381,2798261.973761037457734 4529357.807863540947437,2803581.152989613357931 4528965.293322452344,2804199.421441479586065 4528849.453741465695202,2806828.008577582426369 4527598.91793271061033,2809580.160348464269191 4526155.561766492202878,2810538.621164194308221 4525101.527531155385077,2810847.755390125792474 4524748.801150203682482,2811404.464163583237678 4521900.585346129722893,2811434.96570406248793 4520807.366577243432403,2811372.960747689008713 4520260.800048492848873,2808776.322305445559323 4514138.004334425553679,2808405.183123140595853 4513863.698409047909081,2805900.160621819552034 4512851.748590719886124,2804786.631755413487554 4512889.22646953817457,2801725.34575860016048 4513631.372246361337602,2795665.223999302834272 4516204.233429819345474,2782430.561058384366333 4528693.831472559832036,2780636.870103229302913 4531857.200680519454181,2780204.059923024848104 4533185.598148101009429,2780296.677739365492016 4533693.038293369114399,2780729.821878043934703 4533849.719642945565283,2784161.801779200322926 4533966.739923378452659,2787686.844774659723043 4533848.735102883540094,2788985.497954253572971 4533730.590969812124968)) +POLYGON ((2703424.446774617768824 4512500.417545564472675,2702806.067003260366619 4512617.199070055037737,2702496.932777328882366 4512968.393665758892894,2702311.363186176400632 4513396.805260558612645,2701631.089777936693281 4521510.317570915445685,2701693.094734310172498 4522095.584206197410822,2702125.793595023918897 4524242.779033358208835,2702403.981002514250576 4525491.788878583349288,2703022.694732345174998 4526975.814506788738072,2703486.340411497280002 4527951.740549314767122,2704877.945365905761719 4530802.731521660462022,2705156.132773396093398 4531193.205949375405908,2708093.854135433211923 4534005.418790199793875,2708897.692178449127823 4534435.678107378073037,2710721.995993570890278 4534630.911135165020823,2712546.745086652226746 4534630.911135165020823,2712886.8261310281232 4534630.911135165020823,2715546.0261270981282 4533380.807789346203208,2717463.281717028934509 4530802.731521660462022,2717463.281717028934509 4530294.166452379897237,2715886.218490961939096 4525765.275627778843045,2715422.461492316331714 4524828.058152574114501,2714123.47435424849391 4522642.246653633192182,2713010.390765807125717 4521041.959277048707008,2712392.122313940897584 4520340.023033444769681,2706702.249181024730206 4514099.398920571431518,2706052.922591229435056 4513474.993671901524067,2704909.003503835294396 4512733.841532226651907,2703424.446774617768824 4512500.417545564472675)) +POLYGON ((2985371.670068551320583 4528224.167121556587517,2978228.632302818354219 4535918.865503062494099,2977393.847441358491778 4536350.329197475686669,2973498.110541559290141 4538302.90093,2972848.783951760735363 4538302.90093,2970776.460311153437942 4537833.788868735544384,2966632.703585863113403 4536895.487360257655382,2965674.354089627508074 4536584.286487980745733,2963695.872779755853117 4535333.949087027460337,2963385.847997897304595 4535021.669479073025286,2962582.455232843756676 4534357.3327392982319,2960788.764277691952884 4533613.713982847519219,2960387.01223541656509 4533888.398076020181179,2959056.96695941966027 4535137.577576085925102,2958933.847602602560073 4535528.214225790463388,2957943.99469046946615 4541431.604834700934589,2958068.004603210370988 4541938.461062184534967,2960634.586782942526042 4545184.276553530246019,2960974.333868841640651 4545497.987191624939442,2968395.447722577024251 4549878.673453361727297,2968859.649999184999615 4550075.32295002322644,2975538.485488309990615 4552344.245095481164753,2977054.10035545937717 4552775.403284180909395,2977641.42198888445273 4552814.011130857281387,3004389.269236692227423 4548666.459240220487118,3008810.656772019807249 4547219.058094223961234,3013077.978132089134306 4540962.351978728547692,3013356.610817544627935 4538811.71578948199749,3012768.398628192488104 4538108.58410448115319,3012367.203183373436332 4537873.466996195726097,3010047.750273204874247 4537521.293715745210648,2993999.37588299298659 4532247.855179800651968,2985371.670068551320583 4528224.167121556587517)) +POLYGON ((2614461.917234301567078 4533927.076652469113469,2613379.446505827829242 4534200.643767833709717,2612080.904645725153387 4535529.1989243356511,2608400.90491908043623 4541822.477345631457865,2607534.950600197538733 4545068.256700024940073,2607504.449059721082449 4545576.4163274820894,2607720.520191350020468 4545928.721094898879528,2608091.659373654983938 4546202.603337853215635,2612111.40618620114401 4546710.81831453088671,2616904.489501287229359 4547023.44832668825984,2620646.048906339798123 4547101.888951266184449,2622377.734905120916665 4546593.79571055714041,2623120.124589219689369 4545967.444368174299598,2623212.63108606915921 4545497.987191624939442,2623058.11963284900412 4545068.256700024940073,2622563.304496273864061 4544169.146645400673151,2618636.175500068347901 4537639.480786059983075,2617461.198274744674563 4535959.661762742325664,2614461.917234301567078 4533927.076652469113469)) +POLYGON ((2778565.437018549535424 4535100.019835663959384,2777142.773926211521029 4536154.923311424441636,2773710.348747092764825 4539320.555481129325926,2773463.219477529171854 4539671.663718836382031,2768855.817073086742312 4546476.633602500893176,2764124.738714374601841 4553245.188788737170398,2757228.83021820243448 4561233.804123914800584,2756888.749173829797655 4561585.652410380542278,2755466.531359453685582 4562251.587878682650626,2753703.787222743034363 4562643.384345375932753,2751477.397406877949834 4561546.870952818542719,2751075.645364605356008 4561468.321316871792078,2748879.757089216262102 4569110.161207509227097,2748509.063184873200953 4572560.418353465385735,2748539.676044843625277 4573148.561443340964615,2748725.245635996107012 4573697.911005570553243,2749250.896271521225572 4574599.579413051716983,2749962.227817690465599 4575149.00586155988276,2754477.12372528295964 4578091.637048865668476,2758280.242808744311333 4578993.687776558101177,2759795.412397931795567 4579189.759302168153226,2778843.513106551486999 4561429.681318907998502,2782832.313100656494498 4546672.0922771403566,2782863.259919094853103 4546124.169486564584076,2782677.690327942371368 4545576.4163274820894,2781410.095286280848086 4541861.044603277929127,2778565.437018549535424 4535100.019835663959384)) +POLYGON ((2616131.598276709672064 4579307.290986836887896,2616687.861772205214947 4579151.053245951421559,2618172.52982091344893 4578718.798355277627707,2618728.793316406197846 4578522.735742059536278,2620336.91468040831387 4577424.542934398166835,2620522.484271560795605 4576992.50129134953022,2621264.762636167928576 4569815.391704121604562,2621140.752723424229771 4569502.075460354797542,2620491.537453119643033 4568208.969819192774594,2620151.345089255832136 4567855.909279782325029,2612606.555281250271946 4562800.360942334868014,2611833.330098199192435 4562291.500233652070165,2611369.573099555913359 4562174.161167985759676,2610225.542692673392594 4562408.699589834548533,2605896.21637623058632 4564367.295120688155293,2605494.130375487264246 4564641.663395760580897,2605277.947924364823848 4566288.4485735129565,2606019.892330504022539 4569423.465617178939283,2609050.120189387816936 4577424.542934398166835,2614337.907321557868272 4579347.127749821171165,2615296.702095761429518 4579543.347232771106064,2616131.598276709672064 4579307.290986836887896)) +POLYGON ((2319465.043993145693094 4529591.60845682490617,2318908.335219688247889 4529591.60845682490617,2316805.955316566862166 4530333.95652253460139,2316403.757996329572052 4530607.429481688886881,2305828.295051477849483 4540336.33906732685864,2304684.264644595328718 4541744.076462551951408,2296520.761106761638075 4552462.600466134026647,2296211.626880827359855 4553676.24340208619833,2295407.788837811443955 4557904.456598003394902,2295624.305247402284294 4559784.653234807774425,2296366.249653541482985 4561859.947215891443193,2298004.983877507969737 4565073.332014946267009,2301901.500013746321201 4568208.969819192774594,2304282.067324360832572 4569580.685899084433913,2304622.259688224643469 4569267.376742330379784,2314796.081910292152315 4558100.271050187759101,2322495.383171517867595 4555320.305105186998844,2325061.96535125002265 4553245.188788737170398,2326360.507211352698505 4551954.104603708721697,2336873.965199833735824 4540688.466703986749053,2337554.349927561823279 4539085.411044028587639,2337090.592928915750235 4536936.28743973840028,2331401.165073961950839 4539906.821378733031452,2329267.281754945870489 4541157.707229615189135,2328277.874120775144547 4541588.402489566244185,2326113.377941791899502 4541510.003367272205651,2324165.064213925972581 4541119.142574476078153,2323268.608354569412768 4540805.563741405494511,2322897.469172263983637 4540531.682586186565459,2320021.752766603138298 4535333.949087027460337,2319867.24131338018924 4534786.621939474716783,2319465.043993145693094 4529591.60845682490617)) +POLYGON ((2289965.490252418443561 4645757.938416442833841,2294572.892656860407442 4635258.729845934547484,2302148.629283307120204 4618701.199315794743598,2316743.950360193382949 4596587.520767862908542,2316929.519951345864683 4596155.668770621530712,2316960.466769787017256 4595605.126096258871257,2316774.897178634535521 4594347.661371157504618,2315074.157998294569552 4588847.768120587803423,2314610.512319139670581 4587943.72739571146667,2314115.697182564530522 4587826.239007650874555,2308209.307640054728836 4588022.477880411781371,2288481.267481672111899 4592225.824324194341898,2283966.482893567997962 4593914.771249124780297,2283471.667756992392242 4594111.267165295779705,2268443.759138881228864 4601580.599333385005593,2264733.146552269347012 4604176.317799082957208,2264393.065507896710187 4604490.827350170351565,2264237.997457220219076 4605514.005558609962463,2264331.060551526024938 4607284.024811020120978,2264485.572004746180028 4607835.190679491497576,2266031.799731863196939 4612243.311076653189957,2270762.766771087422967 4625518.306838654913008,2275462.786991870030761 4625872.350122183561325,2275679.41472095483914 4625439.269581297412515,2279111.839900073595345 4623193.134194567799568,2279668.548673531040549 4623035.096011804416776,2280224.812169026583433 4623074.108802542090416,2280627.00948926107958 4623271.0192547775805,2282111.12094051623717 4624335.081860420294106,2282853.39930512662977 4624887.160904505290091,2283873.865077229682356 4625833.326717749238014,2286100.254893095232546 4628238.154554751701653,2287027.768890384119004 4630052.117421989329159,2287244.285299977753311 4630564.468378066085279,2287336.903116315603256 4631076.844877948053181,2287676.984160688240081 4634350.751596965827048,2287367.849934756755829 4635258.729845934547484,2286471.0601169266738 4637428.374474236741662,2285883.738483501598239 4640744.381877313368022,2285821.733527128119022 4641296.348635802976787,2286161.925890994723886 4645718.839369736611843,2286409.389119026716799 4646113.817685523070395,2286842.199299231637269 4646311.170363483019173,2287429.854891130235046 4646311.170363483019173,2288976.082618247251958 4646192.872048554942012,2289965.490252418443561 4645757.938416442833841)) +POLYGON ((2306508.568459717556834 4622641.146046263165772,2305952.30496422201395 4622799.178178265690804,2305117.408783270977437 4623311.167885870672762,2304251.56578388158232 4624375.092761349864304,2301066.26987432455644 4629420.693135056644678,2298159.940608693286777 4635810.259656444191933,2294913.085020724684 4644968.308751791715622,2294665.510473201517016 4645916.326625595800579,2294758.462248012889177 4646548.766415651887655,2298623.697607336100191 4650340.953272711485624,2299489.540606728289276 4650459.157233200967312,2301097.216692762449384 4649353.413182482123375,2305024.457008459139615 4642441.305368578992784,2305210.02659961162135 4642046.610592811368406,2309137.15559581713751 4632181.756960334256291,2311115.970864159520715 4625478.291490620002151,2311023.464367310050875 4624966.193919440731406,2308271.312596428208053 4623311.167885870672762,2306508.568459717556834 4622641.146046263165772)) +POLYGON ((2326515.129984064493328 4656586.152049966156483,2326144.436079724226147 4656743.56911623571068,2326484.517124096862972 4659748.621316115371883,2328154.198166504502296 4662161.415901540778577,2330566.268893013708293 4665129.02960529178381,2330906.46125687751919 4665286.578196319751441,2331184.537344879936427 4664891.001936285756528,2331030.025891656987369 4663665.197347464039922,2326917.21598481060937 4656783.706585568375885,2326515.129984064493328 4656586.152049966156483)) +POLYGON ((2304467.636915510520339 4698023.778242218308151,2305395.596190764103085 4697667.228583095595241,2306075.869599001016468 4697031.615140175446868,2307591.039188188500702 4694134.27539895940572,2307653.04414456197992 4693618.729966255836189,2307003.272276801522821 4669521.784697202965617,2306879.707642019726336 4668295.424598209559917,2306601.520234528928995 4667898.59197184164077,2298035.93069594912231 4661845.278220656327903,2286904.204255605116487 4659471.709627117030323,2286811.141161299310625 4659946.379289745353162,2286749.581482890527695 4662874.185581383295357,2288481.267481672111899 4676491.292090846225619,2288635.890254383441061 4677085.265271780081093,2293366.857293607201427 4690048.055367223918438,2297974.371017540805042 4696912.7278260756284,2298561.692650965880603 4697667.228583095595241,2299365.53069398412481 4698142.535632878541946,2304467.636915510520339 4698023.778242218308151)) +POLYGON ((2554163.711295291315764 4605868.353347864001989,2551813.645525152795017 4607009.515250405296683,2542011.519082843326032 4611456.251391385681927,2536012.400404501706362 4612440.156248584389687,2534249.767587282229215 4614014.486036391928792,2525808.076641955412924 4625242.175727065652609,2514459.72247252613306 4626227.398953069001436,2508460.715113675687462 4628277.18708670604974,2505832.573255538009107 4632576.07265236787498,2500668.350758146960288 4639599.614476575516164,2500328.269713774323463 4639954.143361265771091,2495504.684858212247491 4642402.361096421256661,2495009.869721633847803 4642638.729519088752568,2493927.510312651284039 4642915.186569072306156,2493618.376086719799787 4642559.560414928011596,2491144.300403837114573 4634942.284703065641224,2490989.788950616959482 4634390.801502734422684,2491082.740725428797305 4633917.313671095296741,2492257.717950752004981 4630919.679295207373798,2493185.231948040891439 4629105.563329363241792,2493154.173810111824423 4628671.352995689027011,2492845.039584177080542 4628317.213327918201685,2491546.497724074404687 4626976.702904577367008,2491175.358541769441217 4626739.559328150004148,2490031.328134886920452 4626739.559328150004148,2470612.088243962265551 4627173.688082550652325,2467767.318656739313155 4628553.257770746946335,2463005.293479586020112 4632023.580557527020574,2453790.377351210452616 4635810.259656444191933,2446307.592499578371644 4637033.872444457374513,2443215.35968432109803 4637428.374474236741662,2417086.22616634471342 4629420.693135056644678,2411210.783442273270339 4629657.898564474657178,2408582.53026464395225 4629578.829479771666229,2404037.132816575467587 4628080.038832253776491,2398563.776093250140548 4624690.077629146166146,2397079.664641994982958 4623626.120179714635015,2389348.859964874573052 4631352.990770772099495,2378402.703115680254996 4640783.461966125294566,2376732.910753780975938 4640744.381877313368022,2375495.928572087083012 4635376.902166412211955,2375001.22475 4634469.907626545056701,2367425.042850591242313 4627449.871062623336911,2364240.192218995653093 4624966.193919440731406,2357313.670862859115005 4621734.281463987194002,2356850.025183704681695 4621616.265859089791775,2355612.931682519149035 4621774.282252544537187,2354159.878369193524122 4622483.11634130962193,2349830.552052753511816 4628711.380771597847342,2349799.493914821185172 4630840.600502653047442,2350016.121643905993551 4631787.314415527507663,2351840.425459024962038 4633206.554824812337756,2352799.220233228988945 4634193.535923400893807,2353262.97723187180236 4635100.506055671721697,2353231.919093939475715 4635653.163677715696394,2351376.668460379354656 4640309.679216175340116,2350665.336914210114628 4641493.608634190633893,2350045.176031001843512 4640939.641697967424989,2349833.446359514258802 4640430.60968651343137,2349397.853192039765418 4640232.233306324109435,2349150.278644513804466 4640270.600931724533439,2349552.364645259920508 4640467.983316390775144,2349830.552052753511816 4640901.697904825210571,2350047.068462344352156 4641375.507992236874998,2350232.638053496833891 4642520.473560078069568,2350108.628140755463392 4643033.447078661993146,2347325.974829394835979 4650735.967511750757694,2336533.884155458305031 4674511.250916078686714,2336193.691791594494134 4674827.780745665542781,2326700.699575216975063 4683346.833690881729126,2316527.322631111368537 4687271.475570821203291,2312631.14045334700495 4686954.416517946869135,2312074.876957851462066 4687113.444453830830753,2311734.684593987651169 4687469.624644662253559,2311456.163228023331612 4687826.959409487433732,2308023.738048902247101 4692745.833523603156209,2307900.173414123244584 4693222.05346030369401,2307962.178370493464172 4694412.272219481877983,2309848.487141986377537 4708748.118191925808787,2313342.471999516244978 4711887.748553545214236,2334400.446114404592663 4713358.384705453179777,2341017.721925121266395 4711728.332718722522259,2341234.349654206074774 4711291.597673540003598,2341265.296472647227347 4709622.532822352834046,2341172.344697832595557 4708986.171260136179626,2340585.023064407519996 4708230.829801836051047,2340388.432843665592372 4707751.760709575377405,2340585.023064407519996 4706760.79311132337898,2340925.215428271796554 4706443.269096647389233,2342811.078921802341938 4704933.163468154147267,2343213.164922545664012 4704655.021884850226343,2346985.782465530559421 4702233.152319008484483,2347387.534507803153247 4702192.835605268366635,2353386.541866653598845 4711926.958936070092022,2356231.311453876551241 4718130.260653158649802,2356076.68868116196245 4719164.871233865618706,2355891.119090009480715 4719562.562102527357638,2354407.007638754323125 4721949.178253314457834,2353139.412597092799842 4723899.078209044411778,2349861.49887119140476 4728357.566078249365091,2349521.417826818767935 4728675.92032634653151,2348686.521645870991051 4729274.097909522242844,2348191.817828783765435 4729512.490055119618773,2346954.390369127504528 4729791.457565711811185,2342749.519243390765041 4723581.017339921556413,2330256.689389117062092 4729990.438062083907425,2318352.071724192705005 4737997.631647154688835,2317856.922629146371037 4738077.546218933537602,2317424.22376842983067 4737878.263122140429914,2312631.14045334700495 4733893.712523902766407,2310714.330141375306994 4724616.184505134820938,2314053.692226193845272 4721352.435721680521965,2318135.443995110690594 4718050.503362059593201,2318475.636358974501491 4717732.625956661999226,2318753.823766465298831 4717335.006851085461676,2318877.388401247095317 4716857.655423899181187,2318846.77554127946496 4716261.212479316629469,2318692.152768568135798 4715704.172742631286383,2318197.003673519007862 4715585.209854606539011,2308858.968188324011862 4714471.235198235139251,2308302.259414866100997 4714630.694127983413637,2307869.115276190452278 4714869.744076472707093,2307065.277233172208071 4716021.986577992327511,2305673.672278766520321 4718408.914928647689521,2304684.264644595328718 4720596.316280725412071,2304560.700009816326201 4721073.843761810101569,2304591.646828254684806 4721671.572580081410706,2305550.107643987517804 4722545.955924449488521,2305828.295051477849483 4722984.178709830157459,2306013.864642630331218 4723461.818721451796591,2306013.864642630331218 4724616.184505134820938,2304746.269600966013968 4728277.72824427112937,2303725.803828865289688 4730548.263750562444329,2302983.525464255362749 4731742.724844972603023,2301684.983604152686894 4733097.22017261851579,2285883.738483501598239 4748325.045729099772871,2279853.672986721619964 4760939.263072047382593,2278369.561535463202745 4761259.652613712474704,2269309.602138272952288 4762497.303244823589921,2265196.903550914954394 4762937.262405976653099,2264609.136639525182545 4763096.480868607759476,2260280.255601047538221 4766853.299872535280883,2259599.982192810624838 4767492.163285568356514,2258703.192374980542809 4768571.416561366058886,2250230.554611212108284 4784574.497353283688426,2250354.119245994370431 4784894.487552064470947,2253693.926608772017062 4785094.558677786029875,2251745.72420040005818 4796352.389997471123934,2247385.78502398962155 4810753.585069658234715,2245994.1800695839338 4812038.112105596810579,2244788.25602581910789 4812881.642421011812985,2233439.901856390293688 4819548.122277775779366,2233007.091676188167185 4819789.821429608389735,2232419.436084289569408 4819950.812799114733934,2227506.23903863877058 4821169.253002275712788,2227873.927316727116704 4821678.053283439017832,2228739.881635607220232 4822079.961623873561621,2229945.805679372046143 4822040.17515963409096,2236470.129715274088085 4819750.044087561778724,2236841.268897579051554 4819427.781134614720941,2237367.030852595809847 4818664.256145108491182,2238078.362398764584213 4818021.979971669614315,2242129.056029751896858 4816093.519429086707532,2244942.767479042522609 4815250.730131530202925,2247911.546979006379843 4814527.136044285260141,2248560.762249313294888 4814447.767972481437027,2250694.200290367007256 4814688.187219524756074,2251065.339472671970725 4814969.52700593881309,2261424.286007930058986 4825858.951582726091146,2261733.420233864337206 4826220.067245678976178,2261950.047962946351618 4826702.63658981770277,2262104.559416169300675 4827305.519203849136829,2261795.425190235022455 4828231.119852246716619,2259569.035374369472265 4832856.646169865503907,2258610.574558639433235 4837363.906678560189903,2258826.757009759545326 4837886.865226010791957,2259197.896192064508796 4838168.714896005578339,2260032.681053524371237 4838610.995850442908704,2260467.940262524876744 4838677.368671117350459,2267763.485730644315481 4835311.172091944143176,2268258.189547728747129 4835109.949200641363859,2268845.511181153357029 4835069.096669160760939,2269278.655319832265377 4835270.318735658191144,2271133.905953392386436 4836800.115950211882591,2271721.227586817461997 4837565.030186558142304,2272277.936360274907202 4839214.599022117443383,2272525.510907800868154 4840463.079487620852888,2272618.128724138718098 4842274.625529110431671,2272277.936360274907202 4843201.472494915127754,2271906.797177969943732 4844046.626853190362453,2267546.858001559507102 4850171.609533784911036,2264021.926325591746718 4854564.791302010416985,2263836.356734438799322 4855008.962925953790545,2261424.286007930058986 4864528.879033863544464,2261578.908780644182116 4864973.351221796125174,2273360.407088749110699 4874381.827432692050934,2275215.657722309231758 4875836.6350899906829,2276483.252763973549008 4876482.654459309764206,2277771.664550413843244 4876725.59540655836463,2279482.979082378558815 4875553.714852532371879,2280070.300715803634375 4875391.675742907449603,2288264.751072078477591 4875593.570479412563145,2291326.037068894598633 4876199.570307568646967,2293707.049657471477985 4876886.637988428585231,2295562.300291031599045 4878341.813509859144688,2299551.100285136606544 4879230.998674006201327,2300448.001422458328307 4879635.09430920612067,2301190.279787068255246 4880201.321586113423109,2301406.350918697193265 4880686.518698778934777,2306663.079912937711924 4898408.872629605233669,2306694.138050867244601 4899016.271753195673227,2306632.578372458461672 4901852.121546951122582,2305952.30496422201395 4903107.347568359225988,2305519.160825543571264 4904526.268971375189722,2305642.725460325367749 4905823.125966496765614,2305766.735373069532216 4906470.961777910590172,2305982.806504698004574 4906957.450238967314363,2308023.738048902247101 4910403.683680173009634,2308796.963231953326613 4910971.676898519508541,2310837.89477615756914 4911377.07269162684679,2314022.745407752692699 4923469.094507829286158,2314546.392292444128543 4928852.240950585342944,2319155.909767211414874 4933339.7897560717538,2327783.058984199538827 4933786.345486796461046,2328154.198166504502296 4933461.522465254180133,2328649.013303080108017 4933258.294061372056603,2330689.833527792710811 4933664.608754278160632,2331648.294343522749841 4934030.847734886221588,2332019.433525827713311 4934315.449574803002179,2332359.514570203609765 4934680.542152537964284,2342316.375104715116322 4947941.500721678137779,2342470.886557935271412 4948551.964532686397433,2343615.362242782954127 4956248.005617240443826,2343676.921921191271394 4956858.840305649675429,2343738.926877561956644 4962605.337556990794837,2343615.362242782954127 4964276.958845757879317,2343491.35233003878966 4964766.317995359189808,2342904.030696613714099 4966111.374446692876518,2341782.152868398930877 4967980.9327761977911,2340925.215428271796554 4969374.598410090431571,2340028.314290950074792 4970475.897728648968041,2335915.615703592076898 4981864.78276607580483,2335871.421865748241544 4991108.358754687011242,2351240.747362121473998 4991303.813680176623166,2354499.959413566160947 4991345.318920222111046,2372743.77680120524019 4992980.501055343076587,2375897.680614359211177 4993471.30056560318917,2377413.295481509063393 4993839.637246784754097,2378742.784160052891821 4994411.308032580651343,2380072.38415808789432 4995843.650352413766086,2382205.822199141606688 4998625.599215384572744,2382855.148788939695805 4999320.105820367112756,2383968.566335855051875 5000220.313105899840593,2384432.323334497865289 5000426.115919627249241,2394884.22164457058534 4999157.190599179826677,2396677.467321757227182 4998911.055320804007351,2397110.166182470973581 4998666.104603358544409,2397450.358546334784478 4998297.438137140125036,2398749.345684402622283 4996293.067589838057756,2401161.416410911828279 4993920.461186630651355,2401563.057133692782372 4993635.298471942543983,2402243.441861420869827 4993511.637317202985287,2404500.778495727106929 4993593.636264801025391,2424569.344976450316608 5001858.016964388079941,2425898.94497448252514 5002431.337341226637363,2439226.225731744896621 5019636.49462282191962,2439411.795322897378355 5020210.864236337132752,2439442.74214133573696 5020743.636813308112323,2439071.602959033567458 5022260.921871113590896,2438916.980186322238296 5023327.754945302382112,2439690.316688861697912 5026405.025462832301855,2446091.076089984737337 5031535.142056891694665,2446863.967314562294632 5032068.536762963049114,2471911.075382029637694 5037119.283754193224013,2477600.503236983902752 5037654.168938477523625,2478249.829826781991869 5037531.12942180596292,2482950.295325526967645 5034983.882172437384725,2487248.118226072750986 5032191.506953177042305,2497421.495170181151479 5030262.296185959130526,2499153.181168959476054 5030262.296185959130526,2502987.803668315056711 5030262.296185959130526,2513686.497289475053549 5030057.042710175737739,2514212.147925002966076 5029974.735661121085286,2514737.909880019724369 5030057.042710175737739,2529240.501821076497436 5033423.955413688905537,2530198.962636806536466 5033711.618251780048013,2530941.241001413669437 5034327.476029231213033,2531621.514409653376788 5035846.739494321867824,2531807.084000805858523 5036462.732963413931429,2533414.871406331192702 5045996.846888663247228,2533803.376429200638086 5049544.467288149520755,2534218.70944934990257 5056198.060979123227298,2534033.585136162582785 5056651.467682184651494,2533693.392772298306227 5056980.423115460202098,2533569.382859554607421 5057474.47001566644758,2533600.440997483674437 5058091.841868557035923,2534075.552584190387279 5058962.394319006241858,2534992.045951892156154 5060314.914774382486939,2536012.400404501706362 5061385.94889,2538516.977627860382199 5063650.557952541857958,2539537.443399961106479 5063898.342036843299866,2552153.837889016605914 5063073.606010945513844,2553179.758316170889884 5062936.749943591654301,2557627.08329285075888 5061961.613943135365844,2570861.746233772486448 5059738.162071352824569,2573706.515820994973183 5059779.961032719351351,2580478.414404420182109 5060068.408441480249166,2581436.875220153015107 5060355.678604567423463,2582735.862358218058944 5061015.038925304077566,2584251.031947405543178 5062167.545212736353278,2585642.191623848862946 5063567.964670922607183,2585889.76617137202993 5064062.348644714802504,2585982.272668221965432 5064598.726057955063879,2585549.573807508219033 5066617.267039603553712,2585766.201536593027413 5067811.237693785689771,2586106.282580965664238 5068182.557229286059737,2590837.360939681064337 5071480.109988888725638,2592104.95598134258762 5072221.710132919251919,2593156.36857188725844 5072427.860466413199902,2609390.312553251627833 5072922.698618148453534,2620336.91468040831387 5071108.811907929368317,2621697.461496881674975 5070284.646540273912251,2626923.24367268383503 5068677.177638240158558,2630602.798121363390237 5068182.557229286059737,2631128.560076379682869 5068265.190008547157049,2642538.919202179647982 5072799.209335132502019,2649001.683559675700963 5076963.986345325596631,2659020.437731069978327 5079233.29564834292978,2668822.675492870155722 5077541.769708931446075,2669317.379309957381338 5077624.48272927198559,2679057.946073860861361 5084185.278000235557556,2678686.80689155543223 5088933.448895493522286,2678686.80689155543223 5089469.874151663854718,2678903.434620637912303 5090006.478005197830498,2680604.062481486704201 5092485.444011938758194,2682057.227114303503186 5093807.423845406621695,2682521.429390911478549 5093973.130354365333915,2682985.075070063117892 5093931.182835306040943,2689169.318061592523009 5092485.444011938758194,2693930.897960783913732 5092883.74419055506587,2695632.08241908904165 5094550.894234282895923,2699002.502641837112606 5096452.0776751274243,2699930.350597596727312 5096783.584727366454899,2701043.3228665497154 5096865.272915579378605,2701662.147915869019926 5096783.584727366454899,2705589.276912074536085 5093600.964075463823974,2705929.35795644717291 5093270.756654633209109,2723554.906892217695713 5094096.891476961784065,2734501.175060903187841 5086868.015141350217164,2734841.256105275824666 5084804.361992904916406,2738830.501377343200147 5077087.380500149913132,2739448.769829209428281 5076304.574567339383066,2739850.855829955544323 5076015.789874082431197,2757136.212401861790568 5067152.599757673218846,2761774.672944236081094 5064433.523977391421795,2762114.42003013798967 5068305.83906808309257,2762671.128803595434874 5071892.234948397614062,2762887.756532677449286 5072263.71160726249218,2771731.53347875084728 5073294.214975167065859,2772288.242252208292484 5073294.214975167065859,2787051.210482229012996 5067135.689375552348793,2789799.132112461142242 5065968.944561464712024,2801138.135444666258991 5059284.758718376979232,2803674.104764425195754 5057474.47001566644758,2804229.922981958836317 5056908.11123116966337,2809641.720026872586459 5049943.21918898448348,2810136.869121918920428 5049696.829144877381623,2814125.112518570851535 5048257.853040026500821,2814713.324707922525704 5048257.853040026500821,2820371.805744435638189 5049162.610749549232423,2821391.826238573994488 5049367.084981746971607,2839048.767270750366151 5055128.786987651139498,2844212.433170685078949 5058625.516489160247147,2845263.957080718129873 5059656.788016425445676,2846191.805036480538547 5059985.845790454186499,2855684.351974896155298 5059326.555717932060361,2873619.035136600490659 5062043.155677351169288,2881071.318447756581008 5058131.410732832737267,2881690.032177584711462 5058051.087589741684496,2883792.857358670793474 5058338.297770418226719,2891986.862436980940402 5059574.228883455507457,2892946.213808638043702 5059820.722605410031974,2909891.04405820928514 5064803.378875255584717,2916353.697096211835742 5077376.345797964371741,2914776.633870142046362 5091866.014409247785807,2914529.504600583575666 5092814.583342048339546,2909581.464554312638938 5105630.923441110178828,2909303.722424784209579 5106044.513671593740582,2908747.013651326764375 5106044.513671593740582,2907386.021556885447353 5105508.205100575461984,2905778.234151360113174 5105300.302365380339324,2905345.090012684464455 5105547.969245448708534,2901943.722971495706588 5110224.755946486257017,2901634.477426072582603 5114032.66866032872349,2901665.980841967277229 5115772.820630943402648,2902593.828797726891935 5117926.198329390026629,2903304.715065933763981 5118630.52729545161128,2909736.866563459858298 5121986.456692368723452,2912457.626237938646227 5123106.455233114771545,2913447.47915007174015 5123353.537946856580675,2914065.747601937968284 5123313.699904442764819,2919104.179074733518064 5122634.091406902298331,2920441.460117632523179 5122116.099482588469982,2920685.138482979498804 5121704.202507778070867,2923805.98040736746043 5118506.449497965164483,2925166.972501805983484 5117636.011357743293047,2927053.281273298431188 5117347.175186991691589,2928784.07671615248546 5117303.932523739524186,2934503.672153112012893 5117794.226289664395154,2938648.764712288510054 5114777.557564367540181,2952131.002200736198574 5106252.432523016817868,2957789.03795928414911 5102942.946640087291598,2961593.047598672565073 5093227.62228830717504,2965087.032456199638546 5074448.188861912116408,2965149.037412573117763 5073953.272417837753892,2965179.650272540282458 5072838.986960372887552,2965241.209950949065387 5068347.823495480231941,2965179.650272540282458 5066616.228739549405873,2965025.472777790855616 5065422.40590738505125,2964870.404727117624134 5064762.744564876891673,2964622.830179591663182 5064226.358038769103587,2963077.159049927722663 5062167.545212736353278,2962365.493545284960419 5061509.292207544669509,2961500.42978233192116 5061054.619765172712505,2940535.073483780957758 5050684.352076249197125,2937133.59512310102582 5049778.267467464320362,2936576.886349646374583 5049778.267467464320362,2935339.904167949222028 5049903.683825273998082,2934195.873761066701263 5050314.889122676104307,2930485.261174454819411 5047023.36761015933007,2930361.696539675816894 5026074.743701051920652,2935185.726673199795187 5017259.517662289552391,2935927.114481883123517 5016561.515687679871917,2936082.182532559148967 5016111.161323936656117,2936112.684073035605252 5015577.609903871081769,2934535.62084696860984 5005828.190721437335014,2934319.88367381086573 5005254.670228005386889,2926310.557630726136267 4997887.399616753682494,2922259.75268024764955 4995925.668924441561103,2918085.494414484128356 4994247.444294072687626,2913601.54532532999292 4985622.50104670971632,2908777.515191802754998 4976351.49242555629462,2908190.750155831221491 4975536.361069223843515,2907479.418609662447125 4974881.601356188766658,2906304.441384338773787 4974025.307687539607286,2904386.629196954425424 4973495.083830581977963,2901789.545476746279746 4973208.166705247946084,2900073.555526169482619 4973240.633607111871243,2899284.968253387603909 4973453.654416625387967,2898573.191429256461561 4974556.588816134259105,2898202.942802878562361 4976595.88343863748014,2897460.664438268169761 4981741.270735996775329,2898975.834027455653995 4983947.07794916536659,2896842.395986402407289 4987257.753697221167386,2884472.685488945338875 4989913.784546762704849,2872660.685640361625701 4990607.670562290586531,2868826.953696933109313 4990444.753757906146348,2866321.931195609271526 4989955.283870407380164,2863136.635286051779985 4989628.591844335198402,2858931.318882353138179 4990568.376016210764647,2847614.356809327378869 4993101.800134906545281,2838801.638001189101487 4995638.091578741557896,2829678.783091698773205 4998378.446352214552462,2822629.253698233515024 5003044.036221878603101,2821701.405742470640689 5003616.394882757216692,2818671.06656409567222 5004271.907732407562435,2816846.762748976238072 5004477.648835719563067,2816414.063888262957335 5004271.907732407562435,2809209.021166159305722 5003249.898733896203339,2802622.692173883784562 5003780.56369636952877,2798046.236587879713625 5005254.670228005386889,2797705.598946053534746 5005622.421063783578575,2797365.963179643265903 5006523.211384287104011,2797767.269943953491747 5008408.34557940531522,2798076.738128358963877 5008858.195799253880978,2800333.852123682852834 5010414.180400345474482,2801509.274626968428493 5011070.151463992893696,2801478.661767001263797 5011480.893285455182195,2799437.841542288195342 5013569.529487399384379,2798942.692447239067405 5013857.63719923235476,2798355.370813813991845 5014019.618557096458972,2791281.573771356604993 5013465.97211976442486,2787434.594808521680534 5013056.326509311795235,2786933.545780459884554 5012971.803294125013053,2770463.493159124162048 4999893.276780248619616,2767247.584389596246183 4996866.06045457534492,2760872.985068811103702 4990531.289174153469503,2758527.817356270272285 4990527.904270991683006,2742046.298827379476279 4991385.794058518484235,2741520.648191854357719 4991508.103588390164077,2741025.944374770391732 4992326.777999582700431,2738366.299100735224783 4997357.055707762949169,2734995.878877987153828 5004682.215219059027731,2734748.749608426354825 5005051.123535951599479,2734160.982697039376944 5005255.701974437572062,2728192.922156629618257 5005705.55384,2719658.724714456126094 5004108.762255910784006,2715978.724987808614969 5003045.215092875063419,2715143.940126352012157 5002636.008074736222625,2709206.826404383406043 4996906.41126078274101,2707320.517632890958339 4994739.33824,2707011.383406959474087 4994330.480022084899247,2706825.813815806992352 4993757.636229572817683,2706331.109998719766736 4989995.753239088691771,2706825.813815806992352 4987135.350341885350645,2689107.758383184205741 4974433.316091583110392,2688272.862202235963196 4973984.904469298198819,2682428.366296605672687 4971005.957844934426248,2681036.87266169115901 4970557.703413643874228,2679305.075343418866396 4970557.703413643874228,2677449.824709858745337 4970801.9495939752087,2671049.065308735705912 4972353.047903523780406,2670461.743675310630351 4972556.941626336425543,2667895.161495581269264 4973699.001377834938467,2662298.35145696811378 4976270.666917422786355,2661463.455276017077267 4976842.48501711525023,2659051.384549511130899 4979251.219208499416709,2654536.488641915842891 4981006.553489316254854,2653485.521329335868359 4980884.375534555874765,2642198.726838315371424 4976270.666917422786355,2640838.180021842010319 4975046.462662902660668,2640219.911569976247847 4974270.669000033289194,2639632.144658586010337 4973413.253561505116522,2637869.8457998377271 4970068.05446252413094,2637065.562478857114911 4967008.524057738482952,2636911.051025636959821 4965214.307094823569059,2637189.572391600813717 4964235.568462431430817,2648847.0607869643718 4951035.387748647481203,2651970.351740151178092 4940088.866731777787209,2651475.202645102050155 4937566.933847431093454,2651660.77223625453189 4935412.963154092431068,2652155.476053338963538 4933461.522465254180133,2652526.72655513510108 4932567.436698960140347,2653299.951738183386624 4931388.760615543462336,2655928.093596324324608 4927448.821312197484076,2657659.890914593823254 4925214.46749209985137,2658680.245367205701768 4924158.289820204488933,2659112.944227919448167 4923875.004971791990101,2663071.131362054497004 4921925.85208054818213,2667338.452722126618028 4921114.208620633929968,2671883.961489686276764 4921966.041423079557717,2672317.105628361925483 4922168.890499595552683,2690499.363337592687458 4917298.598153837956488,2691921.46983247436583 4916528.525548479519784,2698167.606460886076093 4911701.167743005789816,2698507.79882474988699 4911335.904623419977725,2713536.152720823418349 4893185.70289006549865,2714742.188084079418331 4891688.276716186664999,2715422.461492316331714 4890474.561914285644889,2715793.155396656133235 4889584.220341579988599,2716009.783125740941614 4888046.268354052677751,2715824.213534588459879 4886791.934526039287448,2715515.079308656975627 4886347.501904183998704,2715112.881988419685513 4886105.344038739800453,2707351.575770823284984 4883354.945636302232742,2706300.163180278614163 4883233.97535714879632,2705743.788365294691175 4883233.97535714879632,2705187.079591837245971 4883394.978244399651885,2704754.380731123499572 4883678.2681635459885,2704259.231636074837297 4884486.839078559540212,2704043.160504445899278 4885457.677320634014904,2704012.102366513572633 4886589.665696772746742,2703362.775776718277484 4888410.816652597859502,2690777.439425594639033 4905660.590052857063711,2690499.363337592687458 4906025.643041610717773,2689416.892609118483961 4906998.60003347042948,2688334.421880644746125 4907322.55121900793165,2685489.763612913433462 4908173.192610918544233,2684345.733206030912697 4908173.192610918544233,2682304.80166182667017 4907849.213488264009356,2677449.824709858745337 4908498.349925624206662,2676893.56121436599642 4908701.067877429537475,2674976.194304941222072 4909674.288822386413813,2671822.401811277959496 4911579.849834209308028,2670987.505630326922983 4912146.742837689816952,2668204.295721516013145 4914256.636276696808636,2667864.214677140116692 4914620.985409303568304,2666843.748905039858073 4916244.437710150144994,2665823.283132939133793 4917298.598153837956488,2664648.305907615460455 4918191.297487592324615,2663225.754134768620133 4918962.668895166367292,2661401.450319646857679 4919449.774310674518347,2655031.637736964505166 4920342.668664479628205,2652990.817512251902372 4920018.289235746487975,2641797.086115534417331 4917218.403794144280255,2641363.941976858768612 4917015.51059727743268,2639199.445797872729599 4914783.669091738760471,2638148.033207330852747 4912958.815830420702696,2637931.405478246044368 4912472.031214875169098,2637467.759799094405025 4910566.297773729078472,2637282.19020794192329 4909308.954823482781649,2638178.98002577200532 4905944.373081988655031,2638828.306615570560098 4904120.133484050631523,2641023.749612994492054 4901000.858169175684452,2646497.106336317025125 4894480.925631389953196,2647672.083561640698463 4893550.29500678088516,2648661.491195811890066 4893752.706268275156617,2649187.253150828182697 4893873.805268422700465,2658309.106184900738299 4891242.604193062521517,2661215.880728493910283 4889867.687543207779527,2661649.024867169559002 4889584.220341579988599,2668822.675492870155722 4884730.122082219459116,2670523.303353718947619 4882505.419080154970288,2670801.936039177235216 4882101.206287914887071,2673306.513262533117086 4870382.425105519592762,2673337.460080974269658 4867596.563944501802325,2673213.450168230105191 4866951.268642218783498,2670863.495717586018145 4859404.283974021673203,2670523.303353718947619 4859081.897250337526202,2670090.604493005666882 4858880.19304081145674,2665235.627541040536016 4857710.41842819750309,2664122.543952599167824 4857670.489377525635064,2660535.607320257462561 4861300.187722977250814,2652403.05060086492449 4869655.976180799305439,2648352.356969877611846 4877614.635494385845959,2648475.921604659408331 4878866.788323625922203,2648290.352013506926596 4879312.049303421750665,2645229.066016690805554 4884082.545363639481366,2641116.701387806329876 4890393.419808938167989,2638611.79020597692579 4893833.875951577909291,2635055.689072585199028 4897720.308572799898684,2633045.815666310489178 4899218.64922490157187,2631468.641120752319694 4899867.218228945508599,2606391.031512808986008 4906917.322058567777276,2605247.001105926465243 4906957.450238967314363,2604752.297288839239627 4906836.044753313064575,2603577.208744024392217 4906065.767595267854631,2602278.221605959814042 4904606.506048484705389,2599712.084704192355275 4901649.544250690378249,2598011.345523852389306 4899097.484692858532071,2597300.125297174789011 4897639.106956114992499,2597114.444386530667543 4897031.938285388052464,2597083.4975680927746 4896424.66116469912231,2597269.067159245256335 4895452.745602964423597,2601319.760790229775012 4886873.047090103849769,2613750.585688132792711 4872523.411136692389846,2615884.023729186505079 4870544.382350513711572,2617213.623727221507579 4869736.948540818877518,2626676.114403119776398 4865901.300116297788918,2628562.423174612689763 4865134.05773657001555,2635550.392889669165015 4861784.460797340609133,2643590.331792723853141 4856178.419499859213829,2643713.896427502855659 4855129.58943179808557,2643466.767157942056656 4854645.640672094188631,2643095.627975637093186 4854404.255723091773689,2641271.324160517659038 4853718.887959462590516,2639385.015389025211334 4853154.169983415864408,2631994.403075769077986 4853758.65599603112787,2628500.418218242004514 4854242.56156762689352,2626676.114403119776398 4854605.86908648815006,2608988.560510976240039 4861744.515363811515272,2602587.801109856460243 4864892.417732688598335,2596063.031795989256352 4883274.007475986145437,2596434.170978294219822 4884405.746073025278747,2596465.229116226546466 4891607.124649567529559,2596372.166021920740604 4893266.86791699193418,2596032.08497754810378 4895290.380307371728122,2595351.811569311656058 4897679.197437481023371,2594980.672387006226927 4898570.122811509296298,2594362.292615649290383 4899299.863828825764358,2593558.454572630580515 4899988.538023591041565,2592723.669711170718074 4900555.931994060985744,2589878.454845989122987 4902054.703000235371292,2589383.751028901897371 4902297.251994022168219,2580107.275222118012607 4905700.567219590768218,2572686.050048891454935 4909511.689438340254128,2549154.111570611596107 4923752.36767238471657,2542938.921760641038418 4935209.694389957003295,2545103.306620135903358 4939437.643306219018996,2546371.34693976258859 4939275.722602820023894,2547979.023025796748698 4939437.643306219018996,2551690.080890373792499 4940698.84223267249763,2554410.840564852114767 4941756.798869955353439,2556421.15924908593297 4943017.124122267588973,2557441.513701698277146 4944075.330663150176406,2558245.463064208161086 4945417.549691008403897,2558369.027698989957571 4946069.169994520023465,2557967.275656714569777 4947493.275080964900553,2554812.926565598230809 4956369.87619560956955,2554410.840564852114767 4957266.133481825701892,2553823.518931427039206 4958000.242633783258498,2550514.65838708775118 4959793.137655030936003,2549370.627980205230415 4960118.980449268594384,2548813.919206747785211 4960118.980449268594384,2545412.88612403254956 4959182.119951448403299,2544979.741985354106873 4957836.841750662773848,2545072.805079657118767 4957347.828822636045516,2545041.746941727586091 4956736.963644482195377,2544701.665897351689637 4953152.473242415115237,2544082.952167523559183 4952378.413057223893702,2539970.587538639549166 4949080.69265341386199,2539568.501537893433124 4948795.66245056129992,2527446.810865921899676 4941552.3737254710868,2521695.37805459741503 4940373.790562064386904,2514830.86165483109653 4935453.207648564130068,2513872.066880627535284 4933502.78317275736481,2513996.07679337169975 4933014.981492416001856,2517057.362790187820792 4925377.326289309188724,2518170.335059138014913 4923265.049333589151502,2519159.742693309206516 4921763.050386058166623,2517211.874243407975882 4908417.059591980651021,2516284.026287645567209 4906349.562278912402689,2510130.396156083326787 4889300.906925423070788,2510006.831521304324269 4888653.030961782671511,2509945.27184289554134 4887439.688597288914025,2510130.396156083326787 4885295.476062068715692,2512356.897291440051049 4874260.821259754709899,2515263.560515544842929 4867717.48881509155035,2517583.013425712939352 4865295.929316299036145,2518695.42909721005708 4864368.618201184086502,2525436.937459649983793 4861018.698512369766831,2527292.299412701744586 4859969.357301495969296,2528034.577777311671525 4859364.493334841914475,2528312.653865314088762 4858961.077534260228276,2543897.382576371077448 4835995.418265760876238,2544361.47353348787874 4834626.972891788929701,2544701.665897351689637 4833138.498454585671425,2544825.230532133951783 4829839.327193905599415,2545319.93434921791777 4826743.454863306134939,2545598.010437219869345 4825818.136926871724427,2550669.615118270274252 4810713.843671167269349,2551937.210159934591502 4807060.621618228033185,2552493.918933392036706 4805737.011813800781965,2553514.384705492760986 4804734.201058094389737,2554287.275930070318282 4804131.523004014045,2562667.295877497643232 4797755.149833257310092,2563161.999694581609219 4797514.992656003683805,2573489.888091910164803 4787337.271366065368056,2575716.389227266889066 4784894.487552064470947,2589136.621759341098368 4769291.702638897113502,2590156.976211952976882 4767772.182417872361839,2591115.437027680221945 4766173.904484544880688,2596712.35838578781113 4754231.684601147659123,2596897.927976940292865 4753792.105256145820022,2598567.60901934793219 4749322.24430906958878,2598753.178610500413924 4748325.045729099772871,2598753.178610500413924 4747208.610439524054527,2598351.537887716200203 4746131.641674716956913,2596557.735613073222339 4743818.270347435958683,2595506.323022531811148 4742900.419510322622955,2583292.125853713601828 4736761.83392261620611,2578282.971406996250153 4735088.56864713691175,2573984.703228485770524 4734252.541774426586926,2570397.655276655685157 4733933.008152157068253,2569841.391781160142273 4733893.712523902766407,2569315.629826143849641 4734012.890611511655152,2566810.607324822805822 4735129.016372791491449,2566408.855282550677657 4735408.13877559453249,2566223.285691398195922 4735845.914605639874935,2566377.908464109525084 4736443.368621147237718,2568109.594462890643626 4740827.594982673414052,2568573.351461533457041 4741824.053520331159234,2569130.060234991367906 4742661.711569720879197,2569933.898278009612113 4743099.801662130281329,2572562.485414112452418 4743538.915612219832838,2573180.753865978680551 4742263.112024434842169,2573366.323457131162286 4741824.053520331159234,2573087.802091164048761 4740628.257661385461688,2572376.915822959970683 4739153.656734830699861,2572098.394456995651126 4738755.195526141673326,2571294.445094485767186 4736603.173829577863216,2571572.632501979358494 4736244.261176694184542,2572036.834778587333858 4736363.466963930986822,2579767.082858251407743 4740349.134614394977689,2583817.887808729894459 4743300.192584484815598,2584096.409174694214016 4743698.833050697110593,2585023.811852491926402 4747128.623610292561352,2585085.816808865405619 4747726.888751536607742,2584961.806896121241152 4748205.698733493685722,2580230.839856897015125 4758343.879346866160631,2578530.100676557049155 4760580.634439825080335,2578251.913269066717476 4760939.263072047382593,2574015.650046926457435 4765334.147664797492325,2573675.457683062646538 4765654.677038250491023,2559822.526290275156498 4772330.423905004747212,2554349.280886443797499 4773449.646194599568844,2553854.577069356571883 4773329.857255415059626,2553421.432930680923164 4773169.469010837376118,2541392.805353012401611 4760979.958306251093745,2541052.612989148590714 4760620.034074403345585,2540557.909172064624727 4759741.343782478943467,2539970.587538639549166 4758103.655749533325434,2539970.587538639549166 4756945.602438813075423,2540094.152173418551683 4755947.650050316005945,2540588.855990505777299 4752874.496610631234944,2540835.985260066576302 4751357.449856139719486,2541856.451032167300582 4748643.885778273455799,2543681.200125251431018 4744815.023917119018734,2544144.957123894244432 4744017.527057806961238,2544608.602803049143404 4743977.043748054653406,2546463.964756100438535 4746171.128500794991851,2546711.539303626399487 4746649.864705791696906,2546587.974668844603002 4747168.114335471764207,2550700.227978237438947 4744097.489249191246927,2556482.718927497509867 4738675.27559750340879,2557441.513701698277146 4737081.456931048072875,2559822.526290275156498 4731424.417508943006396,2559791.579471836797893 4727799.861084855161607,2564151.407328752800822 4726845.340932880528271,2568449.786826754454523 4726964.579373490996659,2566068.774238177575171 4724019.284894147887826,2561430.313695803284645 4718488.675038897432387,2553421.432930680923164 4711449.861872198991477,2541763.944535320624709 4706085.422846220433712,2533631.387815924827009 4703225.823126660659909,2533136.683998840861022 4703106.863366958685219,2532611.033363312948495 4703066.5431874319911,2530786.729548193514347 4703265.143064950592816,2525059.675705352798104 4704282.36699833907187,2524521.779925839975476 4704496.148540951311588,2522375.651462836656719 4705251.78436600510031,2521849.889507820364088 4706005.760148600675166,2521757.383010970894247 4706522.935225269757211,2521571.813419817946851 4706920.130974030122161,2521046.05146480165422 4707714.569070810452104,2520643.965464055538177 4707992.937487637624145,2517706.578060491941869 4708668.43460744433105,2517149.869287037290633 4708628.092348868027329,2507687.823889098130167 4704854.653838687576354,2507347.742844725493342 4704536.045393739826977,2507316.684706793166697 4703940.325884783640504,2507254.679750422481447 4701756.510337509214878,2507285.737888354808092 4701239.577770619653165,2510656.158111099619418 4697944.178697569295764,2511150.861928186845034 4697706.527030857279897,2513501.26165679609403 4696753.689637263305485,2514119.641428153496236 4696634.805571066215634,2516500.654016730375588 4696436.335147518664598,2516964.299695884808898 4696555.21689445246011,2517799.195876833051443 4696992.319299702532589,2523451.888299824204296 4697412.721220673061907,2528436.663778057787567 4696356.748023531399667,2533260.24863361986354 4691278.033582872711122,2534960.987813959829509 4690207.131610706448555,2555184.065747900400311 4686161.597936596721411,2567460.37919258326292 4677719.635436965152621,2567985.58455014647916 4676411.86060332134366,2570614.171686249319464 4671422.463489736430347,2572129.341275434009731 4669007.482136218808591,2572469.533639297820628 4668691.132657101377845,2572964.237456385046244 4668453.02201031986624,2573427.883135539479554 4668532.391609331592917,2575221.685410182457417 4669205.276787543669343,2579024.80449364380911 4670669.902895300649107,2581035.123177877627313 4671779.093955654650927,2581405.817082220688462 4672055.34146158862859,2581746.009446084499359 4672372.935548143461347,2581900.520899305120111 4672966.669121246784925,2581808.014402455184609 4673441.96596755925566,2591672.145801137667149 4672253.337692681699991,2592290.525572495069355 4672134.739057185128331,2595537.381160464137793 4670986.313661848194897,2595846.515386395622045 4670630.708550225012004,2597516.196428803261369 4667859.408257691189647,2597701.766019955743104 4667424.550360667519271,2598011.345523852389306 4665959.392137534916401,2598011.345523852389306 4665365.923207202926278,2597856.388792670331895 4664812.800159432925284,2594362.292615649290383 4659907.22603970952332,2597640.206341547425836 4655716.274264503270388,2598072.905202260706574 4655439.471657078713179,2604813.856967248022556 4651407.683157001622021,2612204.469280504155904 4650143.380744406953454,2619873.157681762240827 4650222.6084353486076,2626304.975220814812928 4645087.588124006055295,2626397.48171766474843 4642638.729519088752568,2627356.387811359483749 4640507.06235253252089,2633324.003073804080486 4630603.509744819253683,2633664.084118176717311 4630288.201708055101335,2635550.392889669165015 4628790.443184090778232,2649310.817785607650876 4625281.196888637728989,2655093.308734864462167 4623744.016964351758361,2663504.27550073293969 4621183.364433858543634,2667276.44776575313881 4619291.974656133912504,2679892.842254808638245 4607284.024811020120978,2679923.789073249790817 4606733.879873962141573,2679336.133481351193041 4601934.812091789208353,2678408.730803553480655 4599653.877782011404634,2672286.047490432858467 4589004.152276128530502,2672873.369123857468367 4575383.837715826928616,2675068.812121281865984 4561429.681318907998502,2677975.586664875037968 4557591.499473336152732,2681253.389071284793317 4551210.215276361443102,2681346.006887623108923 4550701.921485038474202,2681717.146069928072393 4548197.866267948411405,2681655.586391519289464 4547649.863189560361207,2679398.138437724672258 4535646.238042507320642,2678594.30039470596239 4533888.398076020181179,2676213.28780612628907 4530919.57703741081059,2675501.956259957514703 4530333.95652253460139,2675038.199261314235628 4530372.481328573077917,2666194.422315241303295 4532872.257741564884782,2665483.202088563703001 4533497.822811718098819,2663256.700953206978738 4539985.208444117568433,2661401.450319646857679 4545733.135561903938651,2659144.002365848980844 4548784.631943291053176,2656268.285960188135505 4551797.150800188072026,2654660.498554659541696 4552932.371845695190132,2651815.395008966326714 4554420.309083460830152,2651320.691191881895065 4554654.67261160351336,2646558.666014725808054 4556064.34747193288058,2622965.056538545992225 4574756.878176536411047,2622625.309452644083649 4575070.353206622414291,2622192.16531396843493 4576404.140101136639714,2622285.228408271446824 4576913.83464674744755,2623089.066451290156692 4577345.873010224662721,2623892.90449430886656 4577776.94067803490907,2625810.271403730846941 4579503.368447734043002,2626304.975220814812928 4580366.690229751169682,2626861.683994272723794 4582054.832788348197937,2626954.190491122193635 4583232.089359253644943,2626830.625856343191117 4583585.815329613164067,2625593.64367464883253 4584920.69917799718678,2624696.853856815490872 4585430.813013034872711,2624047.527267020195723 4585548.274206908419728,2617739.385682237800211 4585155.752665349282324,2616873.431363357696682 4584803.10376604180783,2611400.631237485446036 4582329.810759479179978,2608030.099695246201009 4579974.365063195116818,2607751.578329282347113 4579582.054754681885242,2606978.687104704789817 4578287.691504815593362,2606236.408740094397217 4576600.303862768225372,2597269.067159245256335 4576325.47792212292552,2587992.591352458577603 4576286.78256300650537,2586570.039579611737281 4575973.129527006298304,2586137.340718897990882 4575775.989117351360619,2580014.880044759716839 4572639.051971771754324,2577448.075226048007607 4569933.805126462131739,2576427.720773435663432 4568992.745054850354791,2575283.245088591240346 4568247.776166656054556,2574417.84736716421321 4567855.909279782325029,2572500.4804577389732 4567464.057187832891941,2567460.37919258326292 4567110.88088748510927,2564275.083283026237041 4567934.507249490357935,2562234.151738821994513 4568639.657850485295057,2561646.830105396918952 4567894.573197675868869,2559482.445245902054012 4563074.828868629410863,2559389.382151599507779 4562565.813677283003926,2560626.475652784574777 4558453.0001260926947,2560873.604922345839441 4558100.271050187759101,2561708.389783805701882 4557551.74613460060209,2562752.23264897428453 4557111.791142655536532,2567367.316098280716687 4556768.692737147212029,2569655.822190007660538 4556651.556966966018081,2571882.212005873210728 4557081.766056092455983,2576891.366452590562403 4545302.409746700897813,2578313.918225436937064 4525882.064801930449903,2578406.536041778046638 4525413.510587077587843,2579272.379041166976094 4524711.280757647007704,2582148.095446831081063 4522408.601508493535221,2591239.00166246201843 4516516.934061098843813,2596279.659525074064732 4513591.786066859029233,2596928.874795378185809 4513474.993671901524067,2597825.775932699907571 4513748.026007477194071,2600237.401381246745586 4515034.391883257776499,2600979.679745854344219 4515542.215101568959653,2601134.191199077293277 4516088.5351602723822,2600484.975928769912571 4518389.823100313544273,2598938.748201652895659 4521159.959989694878459,2597021.492611719295382 4523696.032880863174796,2596681.300247855484486 4524009.098110993392766,2605525.077193925622851 4521433.192941724322736,2607302.960781384725124 4512852.731155118905008,2609947.021326709073037 4509692.999885652214289,2615822.46405077772215 4505796.78631027135998,2618327.04127413360402 4503653.371078725904226,2618450.605908915866166 4503185.810764707624912,2618821.745091220829636 4500498.514477780088782,2618543.669003218412399 4500109.183532061055303,2617523.203231118153781 4499135.849273015744984,2616749.866728575434536 4498628.960541841574013,2615915.081867116037756 4498279.227197921834886,2607349.826287009753287 4496448.608842696994543,2606329.360514909029007 4496293.467363177798688,2603978.960786299780011 4496566.192755940370262,2602803.983560976106673 4496877.326984032057226,2599804.702520533464849 4497266.53805273398757,2590466.221757376100868 4495125.985646169632673,2586137.340718897990882 4492284.68887085095048,2585920.712989813182503 4491817.634683608077466,2582179.153584763407707 4482871.684017214924097,2582797.422036626376212 4481627.599916777573526,2583075.943402593489736 4480732.941178858280182,2582735.862358218058944 4480422.28441684320569,2580632.925857643131167 4479645.122927554883063,2580076.217084185685962 4479683.461922108195722,2577479.133363977540284 4480460.626241956837475,2577014.931087372358888 4480654.996255775913596,2568171.154141298960894 4488432.322563018649817,2567738.455280585680157 4489210.133542786352336,2567738.455280585680157 4494035.556405275128782,2568078.647644449491054 4494346.61565656773746,2568542.293323603924364 4494464.316154189407825,2569006.050322249997407 4494230.177533652633429,2569748.328686857130378 4493646.465076813474298,2570243.032503944355994 4493568.424367186613381,2572160.399413366336375 4493957.512804585509002,2575592.824592487886548 4497539.28872649371624,2575499.761498184874654 4500225.827081769704819,2574695.923455166164786 4501744.694952213205397,2558028.835335123352706 4511252.957712199538946,2552772.106340882834047 4513826.217041872441769,2552277.402523798402399 4514059.810971300117671,2535857.888951281551272 4521666.816289963200688,2535270.12203989457339 4521705.449637657031417,2533878.517085486091673 4521510.317570915445685,2531807.084000805858523 4520535.133262865245342,2530353.585409517865628 4519443.040403475984931,2529827.823454501572996 4518623.378475208766758,2529487.742410128936172 4517648.322851930744946,2529518.689228566829115 4516010.327224457636476,2530013.393045654054731 4507238.459212674759328,2530137.402958394959569 4506770.738984745927155,2533476.876362704671919 4496137.487319583073258,2539104.744539250154048 4487382.214990844018757,2550484.045527117792517 4466204.852682583965361,2550514.65838708775118 4465700.665647047571838,2550050.901388442143798 4464303.097930043935776,2549494.192614984232932 4463488.703952226787806,2549278.121483355760574 4462983.389339240267873,2548690.354571968782693 4458909.484027232043445,2548783.417666271794587 4457319.98790777195245,2549432.632936575915664 4455574.233453514054418,2550019.95457 4454876.514948298223317,2550360.146933864802122 4454682.758956250734627,2551442.506342847831547 4454566.618738356046379,2552215.397567424923182 4455651.993250287137926,2552586.536749730352312 4455885.136465031653643,2553112.298704749438912 4455923.528804956004024,2555276.683564241509885 4455651.993250287137926,2555586.263068138156086 4455302.567271819338202,2561059.174513498321176 4442552.857374437153339,2561368.308739429805428 4437790.357810690067708,2561925.017512887716293 4430436.970140744931996,2562017.969287699088454 4429972.643424762412906,2566223.285691398195922 4420808.08774437289685,2570459.660233026370406 4414393.675601180642843,2573057.189231196418405 4407751.86814397200942,2573149.807047537527978 4407288.530879468657076,2572933.179318452719599 4406825.213763133622706,2570026.516094350721687 4404084.911782586947083,2567800.460236959159374 4402927.560478639788926,2567274.809601430781186 4403081.199932725168765,2566223.285691398195922 4403004.935587024316192,2563934.890919161960483 4401923.957566264085472,2563718.708468039520085 4401422.677655462175608,2563316.62246729619801 4399647.90001015458256,2563533.138876886572689 4391357.339631792157888,2563996.895875532645732 4388428.31535981874913,2564120.46051031164825 4387965.816303793340921,2564460.652874178718776 4387118.138279828242958,2569130.060234991367906 4380261.782075865194201,2572593.098274080082774 4378298.006866681389511,2582673.857401847373694 4363524.962273241952062,2583075.943402593489736 4362718.242576610296965,2583106.556262560654432 4362218.79596976749599,2582952.044809337705374 4361026.943705221638083,2582766.363898696843535 4360488.557131772860885,2582426.282854321412742 4360219.304786041378975,2575963.518496827688068 4359412.833394576795399,2575407.255001334939152 4359450.879663170315325,2570366.597138723358512 4361334.13086802046746,2557317.615108445286751 4372255.780158194713295,2556977.422744581475854 4372564.397179501131177,2556730.293475020676851 4372909.870401630178094,2555307.741702173836529 4376296.624132765457034,2547886.516528950072825 4390046.803444558754563,2536754.678769111633301 4410686.203188331797719,2536476.157403147779405 4411072.254005204886198,2536074.405360875185579 4411342.65083082113415,2535054.050908262841403 4411573.988064298406243,2530353.585409517865628 4412076.718998371623456,2520674.91228249669075 4411960.071072018705308,2519623.499691954813898 4411883.604114179499447,2518727.043832595460117 4411613.193550284951925,2515387.125150323845446 4410184.510957996360958,2514583.287107305135578 4409759.293516525067389,2512790.041430118493736 4407636.379376022145152,2506110.649343539960682 4392898.830288428813219,2502740.229120791889727 4384344.893335309810936,2502400.148076419252902 4382495.584676870144904,2502523.71271119825542 4374103.182351047173142,2502740.229120791889727 4373179.441444976255298,2503080.421484656166285 4372332.933580402284861,2503977.211302486248314 4370255.387172147631645,2504224.45189153868705 4369870.808244172483683,2504688.542848655488342 4369510.061651204712689,2504966.730256148613989 4369294.034952556714416,2505152.299847301095724 4368870.302914453670382,2505368.370978930033743 4367948.120464978739619,2505492.380891673732549 4365870.45425434038043,2505553.940570082515478 4364832.25647543463856,2505615.945526455994695 4363140.624535604380071,2505523.439029606059194 4362526.017233554273844,2503451.560666961129755 4353880.126825681887567,2502090.90253099380061 4356184.510326249524951,2493278.183722855523229 4366024.669799675233662,2491051.793906987644732 4374565.082669512368739,2488670.78131841076538 4397294.993674661964178,2482084.452326138038188 4413350.753284458070993,2476147.338604169432074 4421465.160245471633971,2469684.685566164553165 4424171.664067097008228,2465324.301111792214215 4432255.198337392881513,2466901.475657350383699 4439454.563780858181417,2466715.906066197901964 4440964.840840730816126,2466437.718658707104623 4441856.136350994929671,2466035.632657960988581 4442126.342106496915221,2465479.369162468705326 4442281.664736848324537,2462479.642844060901552 4442824.196391643024981,2457161.242851920425892 4443404.963333116844296,2456047.825305008329451 4443404.963333116844296,2454594.660672191064805 4443172.094972506165504,2452275.207762022968382 4442552.857374437153339,2446740.402679783292115 4440112.791726550087333,2443864.574954628013074 4438758.046454407274723,2442070.883999476674944 4437403.334960106760263,2441576.180182389449328 4436512.27448345720768,2440834.347095744218677 4434460.639510140754282,2440432.149775509722531 4420537.311106176115572,2440463.207913439255208 4419997.030746473930776,2440741.284001441206783 4418025.928970955312252,2441391.055869201663882 4414123.062205391004682,2441576.180182389449328 4413698.660809639841318,2442101.94213740574196 4412964.619837751612067,2443431.430815952830017 4411690.631760626100004,2444761.476091949734837 4410994.8202921487391,2442132.888955846894532 4406014.248850472271442,2435824.747371064964682 4400188.259996409527957,2435298.985416048206389 4400341.859992349520326,2434958.904371675569564 4400651.288761326111853,2434433.587694621179253 4401383.509644056670368,2431928.565193300601095 4405628.381286242976785,2430413.39560411311686 4408408.273934078402817,2430042.25642180768773 4409257.644947963766754,2429826.0739706880413 4410184.510957996360958,2429764.06901431735605 4411227.123120685108006,2429578.499423164874315 4411651.425989485345781,2429238.41837879223749 4411960.071072018705308,2428805.719518075697124 4412114.953102174215019,2427846.813424383755773 4412076.718998371623456,2423455.927429535426199 4411304.55852313991636,2423115.846385159529746 4411072.254005204886198,2422899.218656077515334 4410570.543586943298578,2422775.654021295718849 4409952.230872687883675,2416127.32007264951244 4413389.965314585715532,2415941.750481497030705 4413776.114192477427423,2414674.155439835507423 4417291.450314751826227,2414117.446666378062218 4421078.732129293493927,2414148.504804307594895 4422741.433005985803902,2414303.016257530543953 4423939.217541140504181,2415323.482029630802572 4427148.821208208799362,2416405.952758105006069 4427922.133216517046094,2416900.656575188972056 4428812.333245004527271,2417055.168028412386775 4429353.2013742281124,2417147.785844753030688 4429856.773817924782634,2416962.216253600548953 4431365.684519940987229,2416498.459254954475909 4432177.610151867382228,2408675.148080985061824 4440422.404397350735962,2405861.436631694436073 4442862.401929729618132,2402491.016408946830779 4447627.322640165686607,2402305.335498302709311 4448403.246137661859393,2400604.707637453917414 4459336.816227672621608,2400511.644543151371181 4460384.132527649402618,2400728.272272233385593 4461625.711871846579015,2401965.254453930072486 4466166.562688733451068,2402150.824045082554221 4466710.32157569937408,2402892.657131727784872 4467990.941858330741525,2403449.365905185695738 4468728.805150520056486,2405057.598588676191866 4470397.888906689360738,2407871.310037966351956 4471835.833292075432837,2412262.196032817475498 4476574.259107195772231,2412849.851624713279307 4477312.723571316339076,2415045.294622140470892 4481744.038494327105582,2415168.85925691947341 4482365.439225408248603,2415230.864213290158659 4484620.984358500689268,2413561.183170882519335 4491701.224589797668159,2411149.112444373313338 4498356.321723284199834,2410035.694897461216897 4500887.859871429391205,2405026.540450743865222 4509692.999885652214289,2402336.393636235501617 4513358.202579782344401,2401408.545680472627282 4514372.447541481815279,2399800.758274944033474 4516010.327224457636476,2396986.601547691971064 4518428.303903718478978,2382360.444971852935851 4530333.95652253460139,2370393.822350557893515 4548197.866267948411405,2368538.460397506132722 4549684.140608288347721,2363807.493358285166323 4552462.600466134026647,2362013.69108364218846 4553402.164438782259822,2361024.283449470996857 4553832.239126738160849,2357097.154453265480697 4554890.168884339742362,2354066.815274890512228 4555398.808294584043324,2351098.481052888557315 4556103.108478280715644,2349954.116687532514334 4556925.721580040641129,2349552.364645259920508 4557787.167058262974024,2349552.364645259920508 4558883.283774516545236,2349892.557009123731405 4562055.836216751486063,2350232.638053496833891 4564524.438839602284133,2351531.291233093477786 4569463.264422057196498,2351902.430415395647287 4570521.799300007522106,2352582.703823635354638 4571109.826801325194538,2353169.914137568790466 4571069.880526968277991,2353572.11145780608058 4570835.146340511739254,2354314.38982241647318 4569659.296933384612203,2354716.141864688601345 4569384.654872909188271,2355922.177227941807359 4569110.161207509227097,2357499.240454011596739 4569227.578688781708479,2358921.458268384914845 4569580.685899084433913,2360777.154179910197854 4570913.766880535520613,2361797.619952010456473 4571776.373554300516844,2369280.293484154157341 4578601.414601535536349,2372867.341435984242707 4583507.098596780560911,2378588.272706832736731 4595566.217096707783639,2379330.105793477967381 4598788.944715039804578,2379330.105793477967381 4600990.837986891157925,2379206.541158698499203 4602603.489048136398196,2380505.083018801640719 4609331.036991983652115,2387246.480061753187329 4607835.190679491497576,2390400.272555416449904 4606261.662487578578293,2391482.74328389018774 4605356.238316214643419,2396677.467321757227182 4602288.045950640924275,2397790.550910201855004 4601973.745090745389462,2403975.127860201988369 4600480.097339485771954,2405892.383450135588646 4600952.050255228765309,2409139.239038101397455 4601894.888223518617451,2412107.573260106146336 4603193.342537483200431,2412478.712442408315837 4603468.741751751862466,2413066.034075836185366 4604216.392098695971072,2417395.360392276197672 4610077.978883379139006,2418106.580618953797966 4611495.220343335531652,2419250.611025836318731 4614644.965702180750668,2420116.454025225713849 4618149.452001132071018,2420394.641432718839496 4618583.360282224602997,2423827.066611840389669 4622444.10579123813659,2424538.398158009164035 4623035.096011804416776,2432207.086559264920652 4627331.789867335930467,2433258.165191335603595 4627685.895592899061739,2444421.395047577098012 4626069.314146853983402,2451409.364762633573264 4623271.0192547775805,2451780.503944939002395 4622404.102398933842778,2451966.073536091484129 4620867.352217457257211,2452182.701265173498541 4619882.783899360336363,2453728.817672802135348 4618189.580659801140428,2468107.511020606383681 4608228.574823850765824,2468509.597021349705756 4607952.906867854297161,2473024.047650979831815 4605631.695261105895042,2474013.56660464219749 4605159.528320432640612,2491144.300403837114573 4600125.792935026809573,2499740.948080349247903 4598278.171429161913693,2508800.907477539498359 4595447.510181567631662,2521633.818376188632101 4590183.330998354591429,2528065.524595752824098 4586412.100182895548642,2529364.066455855499953 4585627.006463348865509,2529704.258819719776511 4585313.211805400438607,2530230.020774736069143 4584567.068930239416659,2533754.952450707089156 4580327.979775842279196,2538022.273810773622245 4575383.837715826928616,2544485.038168269675225 4571109.826801325194538,2545660.015393593348563 4570677.907047950662673,2550112.906344812363386 4570677.907047950662673,2554009.088522579986602 4571462.009975601918995,2555338.688520614989102 4571932.641348043456674,2555709.827702919952571 4572168.388545202091336,2556575.670702308882028 4573344.663613837212324,2557255.944110545795411 4574756.878176536411047,2557997.888516684994102 4576913.83464674744755,2557812.318925532512367 4577345.873010224662721,2554689.361930816434324 4579660.741659299470484,2550081.959526374470443 4582564.805428810417652,2548164.703936440404505 4583664.532660949975252,2546185.777348610106856 4583820.838507756590843,2545783.691347863990813 4583585.815329613164067,2544639.660940981470048 4583664.532660949975252,2544082.952167523559183 4583860.692636501975358,2544175.903942335397005 4584331.887476808391511,2544547.043124640360475 4584605.795234808698297,2547144.238164340145886 4586490.839011363685131,2554163.711295291315764 4590614.933554857037961,2555060.501113121397793 4590889.997661768458784,2556173.584701562765986 4590850.116448303684592,2559884.197288174647838 4589633.106281627900898,2561337.695879462640733 4588965.268110646866262,2562481.726286345161498 4588101.228964559733868,2562976.430103431921452 4587864.977510432712734,2565419.447648379486054 4587668.741625010035932,2566934.617237566970289 4587551.114982175640762,2571232.551457603927702 4587708.610574227757752,2571758.202093131840229 4587747.490016640163958,2573053.627007491420954 4588014.419006150215864,2574232.277776011731476 4588257.601834961213171,2579148.814406387973577 4589947.031986461021006,2583725.269992389250547 4592932.772047288715839,2584436.601538558024913 4593521.932081802748144,2584652.672670186497271 4593993.567218992859125,2585549.573807508219033 4600557.810958041809499,2585518.626989069860429 4601069.687948988750577,2585178.434625206049532 4601422.892207245342433,2573768.075499403756112 4609094.299441749230027,2573273.371682316530496 4609290.942817504517734,2563161.999694581609219 4610196.854179413989186,2556668.288518649991602 4609645.562073113396764,2554009.088522579986602 4608858.700680968351662,2554163.711295291315764 4605868.353347864001989)) +POLYGON ((2246210.80779866874218 4746649.864705791696906,2244819.202844260260463 4747128.623610292561352,2244510.068618328776211 4747407.934056561440229,2241603.294074735604227 4750440.062611720524728,2240211.800439818296582 4753432.437551503069699,2240057.177667106967419 4755069.366933985613286,2240149.795483447611332 4755588.049187225289643,2241232.154892427846789 4756027.706823918037117,2241695.911891073454171 4756147.290118428878486,2244757.197887890040874 4753592.511805917136371,2247261.775111245457083 4750798.474415720440447,2248591.820387245621532 4748405.042038280516863,2248900.954613177105784 4746888.666924576275051,2248467.810474501457065 4746689.209962364286184,2246210.80779866874218 4746649.864705791696906)) +POLYGON ((2210248.489700448233634 4839577.358212221413851,2211361.461969398427755 4839376.04914362449199,2218164.307371264323592 4836115.814523646607995,2220483.315003470517695 4834546.285969933494925,2220885.51232370827347 4833218.015262758359313,2220885.51232370827347 4831447.938689767383039,2220019.669324318878353 4828834.239611252211034,2218504.499735131394118 4826944.509008724242449,2218195.365509196650237 4826582.209181436337531,2217051.335102314129472 4825737.521235360763967,2216618.190963638480753 4825536.491404929198325,2212536.439194721635431 4824773.51222223136574,2209568.104972720146179 4823285.349628708325326,2208856.884746039751917 4822843.747791707515717,2208578.252060584258288 4822441.953391986899078,2208423.740607364103198 4821839.21976809669286,2208516.692382175475359 4819026.124135456047952,2209320.530425194185227 4815089.669892700389028,2218349.876962417270988 4790261.46493281237781,2218813.63396106287837 4789460.359654772095382,2228399.689271743409336 4784093.954653345048428,2229481.714722255244851 4783733.202406467869878,2230038.423495712690055 4783773.845839191228151,2231739.162676053121686 4784454.575725758448243,2232790.575266594532877 4785214.487949702888727,2233439.901856390293688 4785935.967709517106414,2233903.547535544726998 4786856.596401552669704,2234367.304534190800041 4786856.596401552669704,2234707.385578563436866 4786536.399489356204867,2239933.613032325170934 4775930.260242241434753,2239995.17271073628217 4775369.919439794495702,2239778.990259613376111 4774889.816747831180692,2239191.334667717572302 4774090.080498282797635,2238820.195485412608832 4773809.885471927933395,2235264.205671512056142 4774570.145005719736218,2213494.900010451674461 4785535.651757119223475,2213062.201149738393724 4785816.029818411916494,2212505.49237628094852 4786576.045108576305211,2210217.43156251590699 4791223.16418301127851,2210031.861971362959594 4791663.228585302829742,2209784.287423840258271 4792665.885965898633003,2209351.588563126511872 4796393.084585448727012,2209382.535381567664444 4798717.568192147649825,2209660.722789057996124 4799719.632264917716384,2209042.454337192233652 4801043.601805137470365,2206723.001427023671567 4804533.73761610686779,2206166.737931528128684 4805295.173406920395792,2204837.137933495920151 4806619.735961075872183,2197477.472438680939376 4811556.250606837682426,2190303.48785450682044 4818785.600505285896361,2190025.300447013229132 4819146.460440088063478,2186469.310633113142103 4828873.908391376957297,2186314.687860401812941 4830643.528108220547438,2187520.723223657812923 4832937.319416861049831,2189994.353628575336188 4835914.720264517702162,2192127.791669625788927 4836196.514153338968754,2192653.442305151373148 4836115.814523646607995,2203197.958431564737111 4835512.399046022444963,2203754.667205022182316 4835552.094403728842735,2204558.505248037632555 4836035.115547454915941,2210248.489700448233634 4839577.358212221413851)) +POLYGON ((2158886.567204357590526 4842477.008023939095438,2158268.298752491362393 4842516.876120765693486,2157835.154613815713674 4842757.972777343355119,2157124.268345608841628 4843402.858915512450039,2156938.698754456359893 4843845.372402957640588,2157124.268345608841628 4846424.289312342181802,2157247.832980387844145 4846866.937166050076485,2157556.967206322122365 4847229.830273079685867,2162102.47597388504073 4847109.154517590999603,2162690.131565780844539 4847068.252730667591095,2162999.265791715588421 4846705.365516665391624,2162782.749382121954113 4846181.943603164516389,2160061.544429681263864 4843241.343493040651083,2158886.567204357590526 4842477.008023939095438)) +POLYGON ((2685984.467429997399449 4137939.478070378303528,2684933.054839455522597 4137977.711723309010267,2680944.254845350515097 4140048.761176745872945,2679398.138437724672258 4141141.389746706467122,2678655.860073114745319 4141706.257034968119115,2676645.986666840035468 4143515.109615967143327,2676676.933485281188041 4144080.232682843226939,2679985.348751658573747 4146039.66516522411257,2683417.885250268038362 4145662.756665557157248,2685427.758656539954245 4144984.814713045023382,2685891.849613659549505 4144758.119679499417543,2685984.467429997399449 4144419.7814986188896,2685984.467429997399449 4137939.478070378303528)) +POLYGON ((2636261.724435838405043 4194423.900392930023372,2626954.190491122193635 4195256.682769252918661,2626428.539855597075075 4195445.842539712786674,2625655.648631019517779 4195976.134049149230123,2618358.099412065930665 4203095.897699853405356,2618234.089499322231859 4204989.802524420432746,2623707.334903156384826 4235685.152649534866214,2625191.557673902716488 4241499.250113813206553,2625346.069127122871578 4242031.764515452086926,2626459.486674037761986 4244655.025254325009882,2627851.091628443449736 4247545.376979343593121,2628098.2208980047144 4247203.741505560465157,2628191.283992307726294 4246708.628603436052799,2628222.230810748878866 4246214.496472283266485,2628252.843670716043562 4241271.663181012496352,2628654.929671462159604 4235722.631021910347044,2628933.117078955750912 4234849.308770543895662,2629180.691626478452235 4234469.363472053781152,2632613.116805600002408 4231999.902709701098502,2633478.959804988931865 4231544.033524968661368,2634560.985255498439074 4231506.432682193815708,2638766.30165919708088 4232303.46137120667845,2640374.423023196402937 4233064.035728407092392,2641054.696431432850659 4233633.612149501219392,2641332.883838926441967 4234013.391765197739005,2641827.587656010407954 4238344.382963853888214,2641642.240703840274364 4240678.152914277277887,2641271.324160517659038 4242259.504090448841453,2639539.638161736540496 4246290.757582847028971,2639168.498979434370995 4251768.844274365343153,2639199.445797872729599 4252339.530375071801245,2639323.010432654526085 4252833.80201150290668,2640188.853432043921202 4254698.618115783669055,2642569.866020620334893 4257440.040612590499222,2642910.058384484611452 4257744.304823121987283,2643682.949609062168747 4257553.933116088621318,2646125.967154012061656 4255459.651964718475938,2646682.67592746950686 4254774.938351130113006,2646651.617789537180215 4254204.262232827022672,2646373.541701538022608 4253823.645346481353045,2645723.769833777565509 4252415.834156680852175,2645723.769833777565509 4251920.348532696254551,2646311.53674516454339 4247545.376979343593121,2647393.896154147572815 4240853.04146474134177,2647672.083561640698463 4239485.345059989951551,2648012.164606013335288 4238649.211681501939893,2648568.984698962420225 4237964.453461112454534,2649372.822741981130093 4237547.052382573485374,2654258.412553913425654 4235305.315198254771531,2654784.063189441803843 4235115.3330138316378,2655928.093596324324608 4235000.579349089413881,2668482.483129006344825 4234051.001192430965602,2671172.629943517502397 4234164.787589509040117,2675965.824578094761819 4235965.833204777911305,2676448.060612211469561 4236216.29057889804244,2679416.840112175326794 4238610.628763426095247,2679602.187064348254353 4238816.269073379226029,2679657.735490252729505 4239089.778026862069964,2680944.254845350515097 4241347.889907804317772,2680449.55102826654911 4242107.996526748873293,2680294.928255554754287 4242525.708087950944901,2680325.541115522384644 4243058.272350239567459,2680480.497846707236022 4243477.115157777443528,2681129.824436502996832 4244123.478504728525877,2684809.378885185346007 4245720.386626795865595,2685706.28002250706777 4245986.811611103825271,2686726.745794607326388 4245720.386626795865595,2690839.444381965324283 4244427.372794724069536,2691766.847059763036668 4243970.98697751853615,2694518.99883064487949 4237888.250243920832872,2694518.99883064487949 4237357.031389210373163,2694364.4873774247244 4236824.743879387155175,2692509.236743864603341 4233405.231020795181394,2692137.986242068000138 4233177.675147348083556,2690529.864878068678081 4232418.186851759441197,2689695.080016612075269 4232076.065062922425568,2687314.067428032401949 4232493.25816648453474,2686003.169104450847954 4231680.628215090371668,2684351.855778023134917 4231794.390054260380566,2684073.33441205881536 4231726.570354460738599,2683851.029388943687081 4231589.838361888192594,2683479.667567659169436 4231202.349141264334321,2683145.820414769928902 4230745.966170595958829,2683090.049349883105606 4230450.243409859016538,2683238.660870090592653 4230222.338604199700058,2683461.188532188069075 4230062.794381815940142,2691055.626833085436374 4225696.529316595755517,2692137.986242068000138 4225355.573288939893246,2701290.897414072882384 4213897.260158933699131,2701940.224003871437162 4213252.53551878221333,2703393.8339146473445 4212721.413403984159231,2707258.957954482641071 4211773.892866633832455,2708897.692178449127823 4211697.87090799305588,2710412.861767636612058 4211773.892866633832455,2712422.735173908527941 4211963.335863291285932,2723400.395438997074962 4213176.50336098484695,2725564.780298491939902 4213555.713845239020884,2726956.385252897627652 4213821.22355276811868,2737191.321875414345413 4215793.021008013747633,2738521.255831920541823 4216134.636687589809299,2739356.152012871112674 4216476.262962376698852,2740469.124281821306795 4217197.235682302154601,2741737.164601447992027 4218448.535802278667688,2759486.278172 4219586.341363942250609,2778905.518062922172248 4218979.934135519899428,2788151.047051267698407 4216173.140797854401171,2787965.477460115216672 4215603.375629632733762,2788027.482416485901922 4214200.319708965718746,2788398.621598790865391 4212342.368116431869566,2788553.133052013814449 4211925.938356756232679,2789109.396547506563365 4211242.841993593610823,2790099.360779130831361 4210826.317292449064553,2805405.345485244411975 4209423.86929845623672,2814218.175612873863429 4209347.863541048951447,2816661.193157823756337 4209574.790721394121647,2823402.033603319432586 4209613.408379377797246,2824979.208148877602071 4209574.790721394121647,2826123.238555760122836 4209271.858307455666363,2826432.372781694866717 4208930.455262877978384,2827174.651146301999688 4206808.999097041785717,2828040.494145694188774 4205785.868740106001496,2830854.205594984348863 4203966.840797035954893,2832554.944775324314833 4203588.09621558804065,2834565.263459558133036 4203701.568201827816665,2837657.162316341884434 4204535.050233136862516,2845820.665854175575078 4207262.890102228149772,2851788.615075093694031 4209271.858307455666363,2856241.506026315502822 4210523.350495097227395,2856767.267981332261115 4210523.350495097227395,2868332.138560354709625 4209461.394775788299739,2868579.379149407148361 4209082.461548279039562,2868393.809558254666626 4208551.540276532992721,2868177.181829172652215 4208096.64117119461298,2867342.285648221615702 4206922.50420405715704,2866043.743788118939847 4205709.888042989186943,2864559.632336860988289 4204762.969630401581526,2864250.498110929038376 4204459.078146541491151,2864064.928519776556641 4203929.470390163362026,2863446.214789948426187 4199800.137698410078883,2864064.928519776556641 4199156.372544873505831,2864590.579155302140862 4198967.01293348800391,2865054.336153947748244 4199080.437451334670186,2865301.465423509012908 4199534.965170281007886,2865517.981833102647215 4200595.966169940307736,2865517.981833102647215 4201125.414060858078301,2865670.712174468673766 4202864.466968565247953,2866937.63929918827489 4202347.345232748426497,2867167.959325638134032 4200795.170858329162002,2867052.743652667850256 4198397.045092117041349,2865286.548611742909998 4195436.030137740075588,2862951.39965337049216 4193704.413837648928165,2862827.835018591023982 4193099.427279733121395,2862055.055113505106419 4187611.911719646770507,2862116.614791913423687 4187157.873708344995975,2862858.893156523350626 4185531.987461700104177,2864033.870381844229996 4183186.583633734378964,2867218.721013442613184 4181070.19670689990744,2869816.361331101506948 4179595.716235893778503,2870713.151148931588978 4179142.00657643424347,2871764.22978100227192 4178801.396317170467228,2872939.207006325945258 4178575.099719868507236,2873805.050005715340376 4178838.818027463741601,2875165.70814168266952 4179973.640343573410064,2879494.923138634301722 4184586.79547339072451,2882741.890046091284603 4187952.792925267480314,2897275.094847115688026 4194423.900392930023372,2897707.793707829434425 4194575.570862357504666,2898759.206298370845616 4194537.142029129900038,2904665.261882409919053 4193363.491666988935322,2906768.087063493207097 4191812.442074799444526,2918549.585371600929648 4196619.850263880565763,2927826.061178384814411 4202413.484188492409885,2926651.083953061141074 4181711.957740809302777,2924919.397954282816499 4175777.595123037695885,2921239.732186109293252 4169280.108385692350566,2920745.028369024861604 4168449.139508158434182,2917189.038555124774575 4166825.041265302337706,2910169.565424173604697 4163767.127900073770434,2909736.866563459858298 4163616.829474643338472,2907633.930062885396183 4162899.338765424676239,2906644.52242871420458 4162823.651630151085556,2906118.871793186292052 4162975.026415769942105,2905747.732610880862921 4163276.695059134624898,2905562.163019731175154 4164182.837289299350232,2905562.163019731175154 4164710.684224761091173,2905407.540247019845992 4165126.428893837146461,2904881.778292 4165805.598039625678211,2903954.375614203047007 4166258.762991134077311,2892915.155670705717057 4168373.550528015010059,2849438.660624449141324 4165202.131704864092171,2848603.764443498570472 4164861.948792568873614,2847799.926400479860604 4164484.538700212258846,2845418.913811902981251 4163352.385277642402798,2845047.774629598017782 4163125.31616752082482,2844460.007718211039901 4162446.310707062482834,2840131.126679732929915 4161427.268830968998373,2839141.719045562203974 4161351.591711314860731,2820310.246066027320921 4161841.939673748333007,2803921.234033986460418 4157389.519692450296134,2784873.133325369562954 4154485.457381670828909,2774978.389066716656089 4154447.167112700175494,2763073.326123829931021 4155389.797743631992489,2755466.531359453685582 4156031.163498562760651,2755806.72372331796214 4157125.359262548852712,2756579.503628403879702 4166032.721895240712911,2756177.417627660557628 4168373.550528015010059,2755837.225263796746731 4170223.996930781751871,2754507.736585252918303 4173548.368847156409174,2754043.979586607310921 4174266.411583446431905,2752157.670815114397556 4176193.754266613163054,2749436.465862673707306 4177025.166988498531282,2748879.757089216262102 4177062.582706361543387,2748014.359367789234966 4176797.95424825605005,2747024.506455656141043 4176684.757781474851072,2742757.630373548716307 4176836.321582020260394,2737191.321875414345413 4177062.582706361543387,2734624.739695682190359 4177214.151669078506529,2734099.423018630594015 4177932.56774347089231,2732645.81310785189271 4180124.160337856505066,2731285.266291375737637 4182354.708791858982295,2730295.858657207340002 4183262.409728444647044,2716133.34776052320376 4189315.06064205756411,2714587.565311368089169 4189843.968605193309486,2693560.204056444112211 4191130.724842534400523,2693065.500239359680563 4191130.724842534400523,2687221.449611694552004 4191054.844846785999835,2682892.123295251745731 4190790.835559186991304,2679521.703072503674775 4189843.968605193309486,2677604.781441043596715 4189730.774999252986163,2677109.632345994468778 4189730.774999252986163,2675934.655120670795441 4189882.517353792209178,2674945.247486502863467 4190298.116806690115482,2674574.108304197899997 4190563.204125095158815,2665730.331358124502003 4193969.446526510175318,2659453.136591783259064 4195711.05325828678906,2652093.916374930180609 4197452.798083708621562,2651568.26573940506205 4197414.35924753267318,2638519.172389635816216 4195672.48419216927141,2637653.32939024688676 4195332.591596726328135,2636261.724435838405043 4194423.900392930023372)) +POLYGON ((2895945.494849080685526 4600557.810958041809499,2893873.171208473388106 4601382.970318645238876,2891152.077575521077961 4602563.562593611888587,2890379.631628908682615 4603114.476352541707456,2885957.242218162864447 4606968.438596752472222,2879185.34363473765552 4613147.214297872036695,2878999.774043585173786 4613580.911909928545356,2878999.774043585173786 4614250.202672699466348,2879216.401772667188197 4615352.316827412694693,2879742.163727683480829 4616770.283928641118109,2880267.369085246697068 4617558.883997678756714,2883885.475175011903048 4620513.622941783629358,2885184.462313076481223 4621143.365941953845322,2887256.340675721876323 4621497.258704880252481,2887905.11066806409508 4621497.258704880252481,2893378.912669351324439 4628119.070763909257948,2893161.950981795787811 4632576.07265236787498,2893100.27998389583081 4633798.164051802828908,2892976.381390643306077 4634311.69598819129169,2888276.249850369058549 4643941.198746394366026,2887565.474901653360575 4644533.427058692090213,2885029.394262400455773 4645797.03761225566268,2884040.431906193960458 4646113.817685523070395,2882308.745907412841916 4646310.032873188145459,2881844.988908770028502 4646548.766415651887655,2881133.212084638886154 4647141.145364047959447,2878814.204452432692051 4649432.634765511378646,2877825.242096223402768 4650420.182491442188621,2877144.968687986955047 4651644.401580119505525,2875073.090325341559947 4655439.471657078713179,2874887.520734189078212 4655913.954332295805216,2874825.515777818858624 4656506.875113124959171,2876897.394140463788062 4660340.625274550169706,2877732.290321412030607 4661409.679289782419801,2878907.267546735703945 4662201.717037918046117,2879835.115502498112619 4662597.189264629967511,2881473.849726464599371 4662951.375608975999057,2894461.383397825527936 4664732.319902593269944,2909736.866563459858298 4659551.009535207413137,2911096.968101971317083 4658285.701213761232793,2911870.304604513570666 4657098.691552055999637,2912055.874195666052401 4656624.153959112241864,2912179.438830445054919 4655715.278046328574419,2909767.034145465120673 4640586.215619917958975,2909180.157790002413094 4638573.041791902855039,2909148.654374107718468 4637271.253736288286746,2910571.762744410894811 4630918.685482553206384,2912272.056646786164492 4626030.431900790892541,2912457.626237938646227 4625597.34470337908715,2912241.443786818534136 4622641.146046263165772,2912148.492012003902346 4622089.187507377937436,2905685.727654510643333 4614369.267846181057394,2898264.502481286879629 4606575.102509717456996,2897337.099803486373276 4604924.019413777627051,2897151.530212336685508 4604451.884855173528194,2895945.494849080685526 4600557.810958041809499)) +POLYGON ((2677233.642258738633245 4631234.864729972556233,2678006.533483316190541 4632378.841917960904539,2678254.108030842151493 4632852.258841659873724,2678223.049892909824848 4633403.801450604572892,2678037.480301757343113 4633838.211803013458848,2677202.695440297480673 4634942.284703065641224,2676645.986666840035468 4635100.506055671721697,2671667.779038566630334 4636324.034264756366611,2671080.012127176858485 4636362.955478857271373,2669224.761493616271764 4635021.39507467020303,2668389.86531266849488 4634587.92884689103812,2664802.928680326789618 4634193.535923400893807,2661123.262912156060338 4633956.36778031475842,2650053.096150217577815 4634547.878172442317009,2646435.101379946805537 4634982.478944976814091,2635303.263620108366013 4637507.504002282395959,2631839.891622548922896 4638770.249448481947184,2629026.068853767123073 4643507.355637005530298,2629149.633488546125591 4646113.817685523070395,2629520.772670851554722 4646390.368435713462532,2630077.592763800173998 4647220.349848629906774,2631252.569989123847336 4650735.967511750757694,2631314.129667532164603 4651328.446301036514342,2630695.861215666402131 4653897.768247847445309,2630015.587807429488748 4656229.908803342841566,2629768.013259903527796 4656625.15026574768126,2626985.248629054520279 4660263.597327772527933,2626645.056265190709382 4660618.841949961148202,2615142.190642538480461 4669125.901960948482156,2597238.120340804103762 4684852.740052834153175,2582611.852445473894477 4697467.737713485956192,2582179.153584763407707 4697745.682726180180907,2577880.774086761288345 4699850.165853177197278,2576829.361496219877154 4700247.100893083959818,2575623.326132963877171 4700525.264822202734649,2575128.622315879911184 4700445.645695127546787,2574695.923455166164786 4700247.100893083959818,2574355.842410790733993 4699929.780317495577037,2573489.888091910164803 4699532.85766417812556,2571263.498276045080274 4698698.613053983077407,2541763.944535320624709 4696356.748023531399667,2541454.698989894706756 4696674.100030587054789,2541423.752171453554183 4697230.097177725285292,2541701.939578947145492 4698420.641999876126647,2542289.595170845743269 4700048.70290454197675,2543093.433213861193508 4701835.138999073766172,2543526.577352540101856 4702034.715569250285625,2552555.478611800819635 4706165.086168532259762,2571108.875503333285451 4719323.258309790864587,2574788.54127150401473 4722148.004740169271827,2591455.629391547292471 4726924.020948274992406,2592909.239302323199809 4727243.333369071595371,2593713.077345344703645 4727202.917147055268288,2594919.112708597909659 4726924.020948274992406,2595413.816525681875646 4726685.689738375134766,2601629.006335652433336 4722745.940173259936273,2602062.150474328082055 4722467.166652292013168,2602309.279743889346719 4722069.361808955669403,2602402.231518703512847 4721591.787423379719257,2602278.221605959814042 4720915.286101602949202,2602062.150474328082055 4720437.766089993529022,2602000.145517957396805 4719403.025613098405302,2602185.71510910987854 4718408.914928647689521,2602494.849335041828454 4717494.510806257836521,2610039.973101520910859 4703424.426116740331054,2611771.325141828507185 4700684.504946833476424,2612822.737732370384037 4699135.95050332415849,2617801.279319117311388 4694690.133772805333138,2626242.970264444127679 4688025.119288235902786,2645538.200242625083774 4679740.527113805525005,2654598.493598288856447 4676253.9977050088346,2665730.331358124502003 4673481.171104392036796,2666225.48045317362994 4673560.579788277857006,2672502.675219514872879 4674946.410669950768352,2688798.624157252721488 4671184.289167394861579,2688767.566019320394844 4660737.164641050621867,2692509.236743864603341 4635021.39507467020303,2699188.07223298959434 4612243.311076653189957,2700301.489779901690781 4610235.676682661287487,2700548.619049462955445 4609842.215962531045079,2701631.089777936693281 4608346.295502464286983,2704970.563182246405631 4606300.611813981086016,2708928.750316381454468 4602091.53600356541574,2709392.395995535887778 4601855.955521958880126,2719287.585532151162624 4599811.557890541851521,2722936.193162389565259 4599064.226467856206,2723523.960073779337108 4598985.533351527526975,2724636.932342729531229 4598946.611618131399155,2733326.086516088340431 4599378.580311738885939,2734964.820740058086812 4600283.480249783955514,2737407.838285005185753 4588493.862255386076868,2737438.896422937512398 4587943.72739571146667,2737284.273650226183236 4586215.891848844476044,2737160.70901544438675 4585038.295925966463983,2737036.699102703016251 4583899.557626127265394,2736913.134467921219766 4583272.082540604285896,2735769.104061038699001 4580014.345665957778692,2734470.116922970861197 4577620.72601118311286,2729213.387928730342537 4573227.199521332979202,2728811.635886458214372 4572952.6041593933478,2727822.228252289816737 4572835.144507666118443,2725441.215663710143417 4573148.561443340964615,2724884.506890252698213 4573344.663613837212324,2714772.689624555408955 4578522.735742059536278,2707970.289500651415437 4585744.611236587166786,2694890.249332441017032 4601580.599333385005593,2688210.857245862483978 4609881.178813767619431,2684005.540842166636139 4620237.626103666611016,2677233.642258738633245 4631234.864729972556233)) +POLYGON ((2845542.033168720081449 4654687.090254120528698,2841677.354406850412488 4663505.53736085165292,2841677.354406850412488 4664019.563120831735432,2841893.091580008156598 4664494.443909238092601,2842202.559764413163066 4664812.800159432925284,2846006.235445328056812 4665722.484781499020755,2848881.951850991696119 4664652.979809387587011,2850953.830213637091219 4663467.509881519712508,2851262.964439568575472 4663110.030004478991032,2851664.716481841169298 4662201.717037918046117,2852035.855664146132767 4661290.067269207909703,2850891.825257263612002 4656348.323081401176751,2850768.260622484609485 4655833.544052937999368,2850582.69103133212775 4655360.203599947504699,2850242.053389503154904 4655044.275969006121159,2849778.407710348255932 4654845.616559355519712,2845542.033168720081449 4654687.090254120528698)) +POLYGON ((2734995.878877987153828 4687469.624644662253559,2733264.526837680023164 4688540.381569314748049,2731192.648475037422031 4690722.361493589356542,2722503.494301675818861 4704615.696568389423192,2721792.162755506578833 4706920.130974030122161,2721730.157799136359245 4714073.743910768069327,2721854.167711877264082 4714591.330155618488789,2722070.350163 4715068.57494118437171,2722689.063892828300595 4716340.955700228922069,2722967.251300321891904 4716738.535835119895637,2724791.555115440860391 4718170.640705809928477,2725193.641116186976433 4718408.914928647689521,2725626.785254862625152 4718607.671989032067358,2726214.106888287700713 4718527.910942745395005,2727605.71184269618243 4717772.002121579833329,2728007.352565477136523 4717494.510806257836521,2735954.673652191180736 4711092.840796408243477,2745756.911413991358131 4696515.922894109971821,2747272.081003178842366 4694134.27539895940572,2747519.655550704803318 4693737.578799966722727,2747704.779863892588764 4692785.112969278357923,2747766.784820266067982 4690166.719726325944066,2747457.650594331789762 4689770.177693425677717,2745045.579867822583765 4688421.593383946456015,2743685.03305134922266 4687945.597894004546106,2741397.083557072561234 4688104.64130324870348,2740747.311689314898103 4688263.687195681035519,2740345.55964703951031 4688540.381569314748049,2739850.855829955544323 4689294.119177313521504,2738985.012830566149205 4690959.992929244413972,2738242.734465956222266 4691595.227263710461557,2737655.412832531146705 4691634.359451653435826,2735243.45342551311478 4690285.528267768211663,2734779.696426867507398 4689294.119177313521504,2734779.696426867507398 4688778.96154510229826,2734995.878877987153828 4687469.624644662253559)) +POLYGON ((2640992.802794553805143 4731902.455812389962375,2639323.010432654526085 4732260.210708173923194,2634128.286394784692675 4734012.890611511655152,2633571.577621330041438 4734969.23445587605238,2626119.405629662331194 4750000.648435574956238,2626026.342535359319299 4750479.566294562071562,2626119.405629662331194 4750997.868938315659761,2626459.486674037761986 4751317.942736368626356,2626954.190491122193635 4751437.470205422490835,2628345.795445530675352 4751077.886435991153121,2647517.460788929369301 4739751.306251281872392,2647919.212831201963127 4739472.207421355880797,2648166.787378725130111 4739073.733655912801623,2648197.734197166282684 4738555.899071138352156,2648043.222743945661932 4738038.091010294854641,2646651.617789537180215 4735925.812173804268241,2646094.909016079735011 4735088.56864713691175,2644270.605200960766524 4733655.217149544507265,2642353.349611026700586 4732379.512948556803167,2640992.802794553805143 4731902.455812389962375)) +POLYGON ((2611091.051733588799834 4740309.670538251288235,2604597.674516127910465 4742302.583730178885162,2604164.530377452261746 4742462.48159939981997,2604040.965742670465261 4743499.582626573741436,2604195.588515381794423 4744615.607907295227051,2604412.10492497542873 4745094.270375182852149,2609823.456691927276552 4750200.02719437237829,2611709.765463419724256 4751556.855425072833896,2612853.684550811070949 4751517.491189330816269,2614554.423731151502579 4751118.398229727521539,2614894.616095015313476 4750798.474415720440447,2616162.656414641998708 4749402.248521786183119,2616749.866728575434536 4748684.531427214853466,2617121.005910880398005 4747806.736708818003535,2617337.633639965672046 4746849.177292386069894,2617368.135180441662669 4746290.451448073610663,2617183.010867251083255 4745054.787759500555694,2616966.494457660242915 4744576.127162767574191,2611091.051733588799834 4740309.670538251288235)) +POLYGON ((2941060.278841344173998 4768451.829597287811339,2940473.068527407944202 4767972.056953751482069,2938277.625529983546585 4765574.543738286010921,2937998.992844528052956 4765175.037681098096073,2936576.886349646374583 4762616.963330622762442,2936298.253664188086987 4760938.256478232331574,2936360.258620561566204 4760340.357521200552583,2936607.387890122365206 4759941.059000664390624,2936978.527072427328676 4759660.107263159938157,2939391.043076898436993 4758102.649438905529678,2947151.904016532935202 4753152.960315148346126,2953120.40983490459621 4743777.787836243398488,2961840.622146195732057 4729312.372157116420567,2962458.890598061960191 4728000.092419369146228,2963139.164006298407912 4725412.009837011806667,2963201.16896267188713 4724814.060332874767482,2962984.207275116350502 4723858.532056475989521,2962706.019867622759193 4723461.818721451796591,2952779.772193078417331 4717969.744374337606132,2952006.99228798924014 4717731.480470515787601,2944462.202479986473918 4717135.129314108751714,2937751.418297004885972 4717532.740582932718098,2930361.696539675816894 4718488.675038897432387,2915178.274592925794423 4724138.490071369335055,2909489.292015933897346 4727442.407114513218403,2904232.563021696172655 4732021.753834937699139,2903984.988474170211703 4732419.949844403192401,2904170.558065322693437 4732857.596375327557325,2906304.441384338773787 4734690.267590324394405,2906829.646741901990026 4734809.598490393720567,2907355.853974882978946 4734690.267590324394405,2912952.775332987774163 4736404.063238701783121,2925135.469085911288857 4744096.484334424138069,2926156.380135977175087 4745730.751440239138901,2926897.767944660037756 4746968.651852835901082,2926959.772901030723006 4747566.907514372840524,2926836.208266251720488 4748086.209532883018255,2926248.997952317818999 4748843.381363463588059,2923434.84122506249696 4750718.459133692085743,2922414.820730924140662 4750996.863336456008255,2921085.220732889138162 4750996.863336456008255,2920497.008543536998332 4750958.506883251480758,2916477.373050482012331 4750520.075686290860176,2913509.038828480057418 4749600.609996439889073,2912705.200785461813211 4749083.384517081081867,2912241.443786818534136 4748205.698733493685722,2911870.304604513570666 4745932.343250782229006,2911406.102327905595303 4744415.190888154320419,2906799.145201425533742 4737759.039475684054196,2906520.512515970040113 4737398.938080705702305,2903737.8592046094127 4734531.639991621486843,2902933.575883628800511 4734011.886698773130774,2901882.051973595749587 4733773.388538479804993,2901294.841659661848098 4733813.831005614250898,2899346.973209761083126 4734490.047271586954594,2892982.72660161787644 4736746.62769372574985,2882061.171359889674932 4741903.998352278955281,2879185.34363473765552 4743697.828175585716963,2876124.057637921534479 4747208.610439524054527,2875814.478134024888277 4747566.907514372840524,2875629.799098799470812 4748005.066831605508924,2878133.9310441929847 4757545.456295991316438,2878319.500635345466435 4757984.193004038184881,2878937.769087211694568 4758701.422017343342304,2880979.145909377839416 4760580.634439825080335,2884040.431906193960458 4762857.294552175328135,2885833.343624909874052 4763576.021236031316221,2885617.606451752129942 4762456.745701747946441,2885679.166130160912871 4761858.756625893525779,2885926.740677686873823 4761459.397928185760975,2886390.052398367784917 4761258.64598788600415,2888771.064986944198608 4760979.958306251093745,2891925.748036537319422 4760699.121397132985294,2892575.074626332614571 4760659.577658173628151,2913138.344924140255898 4768131.211150571703911,2913539.540368959307671 4768412.255403438583016,2913880.178010785486549 4768730.580236381851137,2913942.182967155706137 4769331.280291170813143,2913323.469237327575684 4771290.352753089740872,2912673.697369567118585 4774489.940672427415848,2912767.205741835292429 4775089.83274991158396,2914158.254098787438124 4775528.18266983050853,2918981.950273840688169 4776688.375741811469197,2919631.165544147603214 4776688.375741811469197,2930361.696539675816894 4775448.978740118443966,2938401.635442727711052 4770650.096678278408945,2941060.278841344173998 4768451.829597287811339)) +POLYGON ((2666843.748905039858073 4762577.412063265219331,2669286.766449989750981 4760101.092841959558427,2669379.384266327600926 4759581.171874335035682,2669224.761493616271764 4759022.890590374357998,2662947.566727275494486 4747287.449065466411412,2661030.311137341428548 4745133.753145221620798,2656361.23773 4741266.610191371291876,2655588.012551948428154 4740747.658665994182229,2655124.25555330561474 4740987.469512915238738,2653423.51637296564877 4741983.943816756829619,2653145.440284963231534 4742900.419510322622955,2653206.999963372014463 4743499.582626573741436,2663164.194456357508898 4759022.890590374357998,2666008.852724091615528 4763176.594452445395291,2666503.556541175581515 4763256.708673503249884,2666843.748905039858073 4762937.262405976653099,2666843.748905039858073 4762577.412063265219331)) +POLYGON ((2784687.11845625191927 4802324.717224770225585,2786017.609010213986039 4801641.762542511336505,2787995.979000591207296 4800159.203663164749742,2788831.320459504146129 4798997.304603901691735,2788954.885094286408275 4797995.168435634113848,2788522.186233572661877 4796911.594278798438609,2786480.920730894897133 4794065.821631940081716,2782151.928372926078737 4788699.116538592614233,2781750.287650144658983 4788459.320335396565497,2781410.095286280848086 4788659.462531667202711,2780698.87505960278213 4790461.643081465736032,2780358.682695738971233 4791343.022485624998808,2779616.404331129044294 4794708.726498887874186,2779801.973922281526029 4795951.658145077526569,2780389.629514177329838 4798357.44432095810771,2780575.310424820985645 4798917.915251630358398,2782523.178874722216278 4802046.042987594380975,2782987.26983183901757 4802455.826750383712351,2783203.452282958664 4802604.554391590878367,2783698.156100045889616 4802684.983754707500339,2784687.11845625191927 4802324.717224770225585)) +POLYGON ((2832153.30405254336074 4866627.474111362360418,2826617.497094882186502 4858999.850047429092228,2822691.258654603734612 4852952.586062598973513,2822134.104603184387088 4852024.830260905437171,2820619.380291958805174 4848518.04814846534282,2820433.810700806323439 4847953.625437004491687,2820649.881832437589765 4844287.760562262497842,2820804.949883111286908 4843845.372402957640588,2821824.970377249643207 4842274.625529110431671,2822165.496699587441981 4841911.913041533902287,2822567.248741860035807 4841630.972161829471588,2823649.274192371871322 4840624.549848617054522,2824577.122148134279996 4839013.442208985798061,2824453.557513352483511 4838489.410105472430587,2822597.750282338820398 4834948.713055450469255,2820711.441510846372694 4835310.013129176571965,2818361.932338163722306 4836034.101381357759237,2817310.519747619517148 4836478.460898237302899,2816475.623566671274602 4837039.915098377503455,2815733.790480023249984 4837685.590316276066005,2815486.215932500082999 4838086.840005615726113,2812702.560745724011213 4846786.151013397611678,2813971.046343312598765 4849807.448442344553769,2814094.61097809439525 4850331.061157374642789,2814063.218881691340357 4850895.61880284640938,2812795.623840027023107 4852870.589452959597111,2812486.489614095073193 4853192.919844811782241,2811899.167980670463294 4853395.524575931951404,2809672.332886840216815 4853435.291318843141198,2809177.517750264611095 4853314.685373635031283,2808436.129941581748426 4852749.990358631126583,2806766.003621208947152 4850976.43833839148283,2806116.231753448490053 4849847.345919475890696,2803240.960625749547035 4844851.975367177277803,2802869.821443444583565 4843683.849800517782569,2802869.821443444583565 4843159.426888060756028,2805436.403623173944652 4840905.462335231713951,2807693.851576971355826 4838450.71745619084686,2808281.173210396431386 4837685.590316276066005,2808219.168254022952169 4837121.781385788694024,2807817.416211750824004 4836838.802189745008945,2801725.34575860016048 4836880.821121945045888,2801076.130488292779773 4837039.915098377503455,2790438.996545541565865 4843080.990558187477291,2789759.168415267020464 4843886.260946040041745,2789047.50291062425822 4845698.430062600411475,2787779.907868962734938 4860614.344075405970216,2788027.482416485901922 4863558.92646964173764,2788552.687774049118161 4864447.949169343337417,2797737.102361948229373 4866708.42175339628011,2798602.054805412888527 4866909.122436299920082,2808219.168254022952169 4866385.797737795859575,2808806.378567959647626 4866304.852727851830423,2813259.269519181456417 4864244.973579256795347,2824020.413374676834792 4866789.370055871084332,2832833.577460779808462 4870826.141922674141824,2833234.884225090034306 4870866.123934760689735,2833482.45877261320129 4870503.383946880698204,2832586.00291325384751 4867354.863963279873133,2832153.30405254336074 4866627.474111362360418)) +POLYGON ((2856148.554251504130661 4937851.784518413245678,2859828.108700186479837 4934679.517825729213655,2860322.812517270445824 4933908.083727283403277,2860415.875611573457718 4933380.025761160999537,2860477.880567946936935 4928381.487379752099514,2860354.315933164674789 4927854.895997039973736,2860013.678291338961571 4927529.099061571992934,2856458.133755400311202 4926066.655268743634224,2850459.126396549865603 4924035.648990646935999,2849963.977301500737667 4923954.230356738902628,2846036.736985806841403 4923915.202273746952415,2845047.774629598017782 4924441.582823468372226,2840409.314087223727256 4927529.099061571992934,2837564.210541530046612 4929641.12177802901715,2834657.88127589924261 4932281.715096988715231,2834286.742093593813479 4932687.989420698024333,2832400.433322101365775 4935330.279528129845858,2837997.354680205695331 4938339.826400604099035,2841491.784815697465092 4939885.647591807879508,2843408.14984970446676 4940412.884045056067407,2844862.205038445536047 4940575.994863364845514,2846593.445759264752269 4940534.558016330003738,2847489.901618621312082 4940332.500984992831945,2856148.554251504130661 4937851.784518413245678)) +POLYGON ((2743313.893869044259191 4949243.94761651288718,2743221.276052703149617 4949732.55635747499764,2742788.13191402470693 4950586.874108915217221,2738644.820466702338308 4955026.157206594944,2737469.84324137866497 4955962.620278678834438,2735707.099104668013752 4957062.55811027251184,2735057.883834360633045 4957225.94607765506953,2731068.638562290929258 4956533.252610486932099,2730635.939701579976827 4956696.631749966181815,2728842.694024390541017 4958936.990070756524801,2728657.124433237593621 4959385.739382838830352,2728378.491747782565653 4962034.351309319026768,2729739.149883749894798 4967130.675483634695411,2731068.638562290929258 4970272.047401554882526,2731873.033202765509486 4971699.676495995372534,2734624.739695682190359 4975617.033558047376573,2738119.169831174425781 4979495.68278447072953,2738521.255831920541823 4979781.755569377914071,2740840.263464126735926 4981414.853606842458248,2743035.706461550667882 4982395.314114418812096,2743499.463460196740925 4982559.125905169174075,2744550.876050738152117 4982355.02330522518605,2749219.949453080072999 4980026.232426981441677,2753301.701221996918321 4977821.457695773802698,2756424.992175183724612 4975413.075984126888216,2756703.068263186141849 4972883.062906112521887,2757754.592173218727112 4958162.472778163850307,2756981.700948641635478 4955188.484746527858078,2746375.179865857586265 4950424.769324891269207,2743313.893869044259191 4949243.94761651288718)) + diff --git a/src/boost/libs/geometry/test/algorithms/buffer/data/it.wkt b/src/boost/libs/geometry/test/algorithms/buffer/data/it.wkt new file mode 100644 index 000000000..5e1f1ecb7 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/data/it.wkt @@ -0,0 +1,22 @@ +POLYGON ((1384999.923739986261353 4552071.32837841194123,1386205.847783748060465 4552775.403284180909395,1386824.338874596636742 4553440.774611539207399,1387226.313555851578712 4554380.567866337485611,1389081.675508903106675 4560136.452452756464481,1389143.457826291210949 4561429.681318907998502,1389050.61737097078003 4561938.499812935478985,1388834.212280868319795 4562370.056094029918313,1387752.075510867871344 4567581.314941163174808,1392081.179188325535506 4580799.013887928798795,1393163.315958328545094 4582329.810759479179978,1397770.829682261915877 4587864.977510432712734,1398172.693044025683776 4588101.228964559733868,1417498.981160135939717 4599181.98419354762882,1427301.218921939143911 4589161.669990953058004,1433331.061779736774042 4583703.255589353851974,1435155.476914347149432 4582878.516786948777735,1435650.292050925316289 4582722.225165505893528,1436763.486958858091384 4582682.234107964672148,1437876.681866790633649 4582800.935931340791285,1439422.798274416476488 4583075.792400649748743,1442205.785544251091778 4584056.997658606618643,1449286.818353610578924 4587747.490016640163958,1453368.570122527424246 4589985.919842895120382,1454141.683986084535718 4590536.163330434821546,1454976.468847544398159 4591636.738145411014557,1455223.820756087778136 4592068.259930951520801,1455347.608029849361628 4593286.688405959866941,1454296.195439307717606 4596587.520767862908542,1453832.438440661877394 4597413.353552815504372,1453245.005487745627761 4598081.737776983529329,1453090.382715034065768 4598553.581096516922116,1453183.000531374942511 4599025.44597228243947,1457357.48143612104468 4604727.317657791078091,1458377.947208224562928 4605631.695261105895042,1458779.921889479504898 4605868.353347864001989,1482404.478184100240469 4610314.597331520169973,1482837.399683793308213 4610077.978883379139006,1486888.093314780620858 4606065.076858862303197,1487104.72104386263527 4605671.775213534943759,1488217.915951795410365 4602996.67376596853137,1488929.024858984630555 4601187.4685471476987,1488929.024858984630555 4600597.729656166397035,1488186.857813865877688 4599339.657097043469548,1487537.642543558729813 4597609.916010116226971,1487630.149040408199653 4597059.295840914361179,1488310.422448644880205 4595840.422549997456372,1488619.779313558945432 4595487.409135583788157,1489733.085540982894599 4594622.824811748228967,1526344.730229002190754 4576129.460583232343197,1530921.185815003234893 4575383.837715826928616,1532745.60094961640425 4575266.491728635504842,1535219.453993513714522 4575502.314735203050077,1538545.123780964175239 4576422.499402994289994,1545856.476616773754358 4579151.053245951421559,1548484.841113894013688 4580327.979775842279196,1549227.008159012766555 4580837.86738798674196,1549505.306885997299105 4581191.370291410945356,1551886.319474574178457 4583349.666926587000489,1552659.433338134083897 4583860.692636501975358,1560018.764874475542456 4584488.344735810533166,1573253.427815397270024 4582643.514998004771769,1585498.683122147805989 4581151.526435187086463,1593198.207022355869412 4581151.526435187086463,1599166.267562765395269 4581976.127693617716432,1599691.918198290746659 4582054.832788348197937,1616297.112681451486424 4585469.542549388483167,1628944.231349965790287 4589633.106281627900898,1629407.877029120223597 4589789.502311130054295,1630150.155393730383366 4590260.967220051214099,1631912.676891458686441 4591714.385279542766511,1645827.613240619888529 4601266.320010973140597,1655815.42059357278049 4603547.610643842257559,1665741.445629137568176 4602013.669263985939324,1667040.210128222592175 4601305.108923327177763,1678141.212389108259231 4596627.424124195240438,1679439.976888193516061 4596508.705016870051622,1679903.733886839356273 4596627.424124195240438,1681202.498385924380273 4597216.936345137655735,1686583.014653926482424 4600008.165994540788233,1703373.667408748529851 4608740.832485251128674,1726255.945338759105653 4620552.484344797208905,1728080.471792860887945 4621222.370205101557076,1729935.722426421241835 4621537.25857218913734,1731172.593288624193519 4621380.380550798028708,1741933.403185648610815 4617873.660326888784766,1742428.107002732809633 4617676.711307669989765,1742582.95241442671977 4617203.992315398529172,1742335.600505883106962 4616771.276375496760011,1741520.853152768919244 4616357.009014126844704,1738006.496828422881663 4614999.769223774783313,1736986.031056322157383 4614802.875149302184582,1735161.504602220607921 4614133.406744129024446,1734048.309694287832826 4613345.210583809763193,1733522.547739271307364 4612519.093777545727789,1733027.843922187341377 4611691.90952012129128,1732131.165423845406622 4609173.211354583501816,1728668.01606526831165 4598788.944715039804578,1726503.297247302718461 4592068.259930951520801,1725977.646611774573103 4590576.043333165347576,1725730.294703233987093 4590143.452509944327176,1725204.532748217461631 4589357.93419838976115,1717412.168392685940489 4579543.347232771106064,1711134.973626344930381 4571893.821215628646314,1710609.32299081957899 4571109.826801325194538,1695983.27773447195068 4549136.059290452860296,1694251.591735693626106 4546202.603337853215635,1694066.022144541144371 4538734.463261933065951,1694004.239827150246128 4538108.58410448115319,1692148.877874098718166 4530294.166452379897237,1689613.353832298889756 4519638.133899938315153,1688685.728515518596396 4517921.604517630301416,1688438.376606978010386 4517491.884247745387256,1687263.288062163162977 4515853.913106138817966,1686984.989335178630427 4515502.481293311342597,1685995.470381519058719 4514567.446520010940731,1682995.96670209383592 4511759.47473281249404,1680738.518748296191916 4508835.514962027780712,1680213.0907517534215 4508056.248181689530611,1679965.738843209808692 4507628.05495322868228,1679439.976888193516061 4506146.770409090444446,1679347.247752364259213 4503848.170654860325158,1679934.680705277482048 4489131.145430590026081,1680027.521160600939766 4487965.439544102177024,1680243.814931211993098 4486993.229900042526424,1690602.761466469848529 4464768.933271096087992,1692489.070237962529063 4461082.214862537570298,1695333.839825185248628 4456698.944317606277764,1695612.138552166987211 4456349.623337228782475,1697807.581549593945965 4454682.758956250734627,1698302.285366678144783 4454488.866925731301308,1699415.480274610919878 4454255.61491899099201,1702415.095273527316749 4454178.982079457491636,1702909.799090611515567 4453985.238871612586081,1703559.236999901011586 4453364.39118458237499,1703837.424407391576096 4452433.746252713724971,1704981.677453256677836 4445109.52043173648417,1705043.459770647576079 4440345.732249343767762,1698982.558774914825335 4436551.71145364549011,1693633.323283827630803 4432874.670501386746764,1689860.705740842269734 4430088.375027853995562,1686799.419744026148692 4427457.916478905826807,1686335.662745383102447 4426607.090793981216848,1682068.34138531377539 4416827.697679053992033,1680336.655386532424018 4411227.123120685108006,1680429.384522364474833 4408987.162063331343234,1680522.224977684905753 4408446.355883928947151,1681418.903476026840508 4405126.927174153737724,1682470.31606656848453 4403699.114054724574089,1683057.749019484734163 4402425.261041063815355,1684913.110972536262125 4395328.087151520885527,1684944.057790977414697 4394287.167169045656919,1684480.189472840400413 4392745.337360732257366,1680614.954113516956568 4390972.001720665954053,1679347.247752364259213 4390393.951535759493709,1678852.432615786092356 4390316.667791331186891,1675265.495983444619924 4394904.433381571434438,1674059.460620191413909 4396215.70463749859482,1672884.483394867740571 4396986.77291168179363,1671956.858078087680042 4397372.327938619069755,1658753.141955607105047 4400844.061311553232372,1657639.947047674329951 4401075.170747807249427,1655104.311686386121437 4401307.257438722066581,1654021.952277403324842 4401229.894647276960313,1649074.58014807687141 4399455.010206120088696,1645209.122149771312252 4397988.800637569278479,1638777.415930207120255 4399956.197651370428503,1620100.454403895419091 4408523.771070262417197,1609741.507868634536862 4415552.273545492440462,1609432.37364270281978 4416479.687834044918418,1607577.12300914269872 4421465.160245471633971,1605443.462329106638208 4425524.687317130155861,1604577.508010226069018 4427148.821208208799362,1604144.586510530207306 4427922.133216517046094,1602320.282695411005989 4431094.638601732440293,1600062.946061104536057 4434422.324919797480106,1597844.905207050498575 4436857.875537100248039,1596383.280292933806777 4438370.848893498070538,1590075.138708151644096 4444257.27731149084866,1588405.346346252597868 4445806.455539613962173,1585838.764166523236781 4447782.725990596227348,1575572.658086585812271 4452549.723479456268251,1573655.625135634560138 4453286.648213068954647,1570687.068274650489911 4454295.118038680404425,1568924.324137939605862 4454566.618738356046379,1558256.354696238646284 4454488.866925731301308,1553547.5402356821578 4453103.389215351082385,1551236.99288477585651 4452317.630736764520407,1550649.559931859606877 4452317.630736764520407,1546753.37775409524329 4452743.579951132647693,1545176.203208537073806 4453208.905813178047538,1529344.233908427413553 4461121.60383662674576,1522077.408868932863697 4465584.4042056677863,1521737.21650506881997 4465894.623883603140712,1520840.538006729912013 4466904.298374428413808,1520098.482281099306419 4467913.091136327944696,1519665.560781406238675 4468728.805150520056486,1518830.664600455202162 4469815.636636137031019,1510790.837016891920939 4477158.004053992219269,1509708.588927400298417 4478089.852815622463822,1507636.933203737717122 4478673.681781725026667,1503400.66998160071671 4479216.96700004208833,1493103.505763730732724 4484388.044808050617576,1483888.812274337746203 4489560.685465858317912,1478168.103642471833155 4493607.935031009837985,1477580.670689555583522 4494269.690686974674463,1477085.855552977416664 4495670.12163789011538,1475725.308736501261592 4498084.671168078668416,1471457.987376434728503 4502757.816418469883502,1465706.554565107217059 4507316.601669631898403,1464840.711565718054771 4507783.223872453905642,1463758.46347622666508 4508056.248181689530611,1456708.266165816690773 4508056.248181689530611,1446040.185404624324292 4514216.198281607590616,1444926.990496691782027 4515502.481293311342597,1443906.52472458826378 4516400.249436816200614,1441989.157815166050568 4517765.161827243864536,1438835.365321500226855 4519208.483565763570368,1438309.603366483701393 4519364.807388568297029,1425167.780880885431543 4520261.7833088086918,1423003.062062919838354 4519988.580961307510734,1420003.558383494615555 4519286.574958794750273,1417653.603932847268879 4518545.151590287685394,1416262.221617424162105 4518076.926055870018899,1412458.657255997881293 4516907.015571624971926,1410912.652167860418558 4516633.760403543710709,1409892.186395759694278 4516828.801518647000194,1409026.343396370531991 4517258.354130526073277,1408284.287670742953196 4517803.640333087183535,1393070.586822496494278 4531348.724858328700066,1387968.369281479157507 4537014.652177982963622,1383113.614968493580818 4549684.140608288347721,1382835.427561 4550662.053592963144183,1382897.209878391120583 4551210.215276361443102,1383330.131378087215126 4551954.104603708721697,1384319.650331746554002 4552579.689068344421685,1384752.571831442648545 4552345.372283137403429,1384999.923739986261353 4552071.32837841194123)) +POLYGON ((1374733.70634055742994 4566091.492124513722956,1368394.84057631669566 4567659.910831437446177,1367436.157121604075655 4568013.105814421549439,1366137.392622519051656 4569933.805126462131739,1366044.552167198387906 4570443.181730434298515,1366322.962213671533391 4570796.471464061178267,1366910.395166587783024 4570835.146340511739254,1370652.06589113175869 4570873.962511117570102,1373064.025298149557784 4570325.891634424217045,1373589.787253166083246 4570168.660060069523752,1376434.445520897628739 4568561.054540241137147,1376620.015112050110474 4568090.576077600941062,1376341.716385065577924 4567032.289154392667115,1375661.442976828897372 4566405.834136897698045,1375259.468295573955402 4566170.076735302805901,1374733.70634055742994 4566091.492124513722956)) +POLYGON ((1344430.091917829122394 4571619.119993964210153,1341090.618513522436842 4572913.780209045857191,1340719.479331217240542 4573227.199521332979202,1339080.522468268172815 4577109.866820841096342,1339173.362923591397703 4577580.754643878899515,1342420.218511557439342 4577895.445056701079011,1342574.841284268768504 4577542.054597694426775,1344059.175374506507069 4572873.968163629993796,1344430.091917829122394 4571619.119993964210153)) +POLYGON ((1668555.37971741030924 4630998.75869628880173,1667967.835445002885535 4630998.75869628880173,1667534.913945306790993 4631234.864729972556233,1664906.549448186531663 4633246.600269651040435,1664566.357084322720766 4633522.946495647542179,1663236.868405778892338 4636007.556292821653187,1663144.027950458228588 4636521.198722642846406,1663731.572222862858325 4638691.110185885801911,1665215.683674118248746 4640507.06235253252089,1665617.88099435553886 4640625.152998842298985,1666050.802494051633403 4640388.830961012281477,1669421.222716799471527 4635415.81979076191783,1670256.118897747481242 4633128.594459761865437,1670256.118897747481242 4632535.887825555168092,1669792.361899104434997 4631669.325365367345512,1669019.248035544529557 4631155.925488477572799,1668555.37971741030924 4630998.75869628880173)) +POLYGON ((1664288.058357340749353 4642481.528987363912165,1660020.959636251209304 4645482.399947934783995,1659340.686228014528751 4646153.913527280092239,1658845.982410927535966 4646903.535582135431468,1658443.78509069303982 4648364.972749872133136,1658505.790047063492239 4648918.345424103550613,1659093.334319470915943 4651644.401580119505525,1659680.767272387165576 4652395.42129538860172,1660020.959636251209304 4652672.283901928924024,1660453.881135947071016 4652908.889275052584708,1661319.501496356679127 4653146.638363784179091,1665061.172220898093656 4653383.254696160554886,1665555.87603798485361 4653185.623480750247836,1665772.39244757569395 4652790.514767126180232,1666019.744356119306758 4651802.738530470058322,1665679.663311746437103 4643547.441288503818214,1665586.822856423212215 4643073.53087808098644,1665246.74181205057539 4642797.069560501724482,1664813.708992866100743 4642559.560414928011596,1664288.058357340749353 4642481.528987363912165)) +POLYGON ((1654733.172504081157967 4654529.562506003305316,1653558.19527875748463 4654767.349225773476064,1651455.592736653750762 4656032.364955497905612,1647188.271376584423706 4658641.873669360764325,1646817.132194279227406 4659511.85779820010066,1646940.919468040810898 4659946.379289745353162,1647961.273920653155074 4661884.438889589160681,1648487.035875669447705 4661963.757503910921514,1654671.390186690259725 4661607.326979557983577,1655166.094003774225712 4661409.679289782419801,1655691.855958793545142 4660658.994623123668134,1655753.638276181649417 4660143.998707657679915,1655691.855958793545142 4659471.709627117030323,1655135.147185336099938 4654767.349225773476064,1654733.172504081157967 4654529.562506003305316)) +POLYGON ((1464809.653427785728127 4677205.062372087500989,1464376.954567072214559 4677323.577316032722592,1464067.597702158149332 4677640.194386810995638,1464098.655840090475976 4678195.153685863129795,1465211.850748023251072 4680849.563145770691335,1465551.931792395887896 4681127.197677467949688,1466386.827973346691579 4681602.874819892458618,1467314.453290126984939 4681800.913717764429748,1467747.374789820052683 4681563.638463071547449,1468922.463334634900093 4680770.097715876065195,1469231.597560569411144 4680414.294210001826286,1469262.544379007769749 4679819.984521962702274,1468953.410153076052666 4679463.07297567371279,1467283.506471685832366 4677877.521012073382735,1466943.314107821788639 4677601.115892526693642,1466448.610290735028684 4677403.015901028178632,1464809.653427785728127 4677205.062372087500989)) +POLYGON ((1693571.318327454151586 4688858.489445560611784,1692983.774055046727881 4688858.489445560611784,1691097.465283556841314 4690285.528267768211663,1690850.113375013461336 4691278.033582872711122,1690973.900648775044829 4691713.909655039198697,1693107.561328811105341 4694213.845141770318151,1693416.695554742822424 4694571.416674461215734,1693880.67519237101078 4694729.420722863636911,1695117.434735082788393 4694649.846948807127774,1696416.199234168045223 4693935.996592060662806,1696725.333460099529475 4693578.44738319888711,1696725.333460099529475 4692983.369357353076339,1695364.786643626401201 4690325.79782351385802,1695055.65241769189015 4689968.518177315592766,1694035.18664559116587 4689016.40485518053174,1693571.318327454151586 4688858.489445560611784)) +POLYGON ((1581014.956671976018697 4944115.610674955882132,1580427.523719059769064 4944237.330551641993225,1580241.954127910081297 4944725.689978146925569,1580489.306036450667307 4946639.226753560826182,1580613.093310212250799 4947249.462999792769551,1580829.38708082633093 4947696.651813368313015,1581911.635170317953452 4947738.118912516161799,1585344.060349436243996 4946923.168692829087377,1585900.546483911341056 4947004.777881120331585,1586271.796985707711428 4947289.756044737063348,1587230.369120928924531 4947615.036868806928396,1587601.285664251539856 4947331.074902703054249,1587632.343802183866501 4947004.777881120331585,1587044.799529776442796 4946354.12098032142967,1586828.283120182808489 4945905.967861759476364,1586704.718485403805971 4945337.125634915195405,1586395.361620489740744 4945092.34171746019274,1585714.976892758859321 4945743.940422654151917,1585127.543939842609689 4945865.680499922484159,1584169.083124112803489 4945540.457673186436296,1582901.265443468699232 4944848.73577840346843,1581014.956671976018697 4944115.610674955882132)) +POLYGON ((1546413.185390231199563 4967008.524057738482952,1543289.894437044393271 4968355.063527161255479,1542517.114531958242878 4968925.243997490033507,1541991.352576941717416 4969740.852213766425848,1542207.757667044177651 4973291.023627653717995,1543568.304483517538756 4976678.769091141410172,1545021.691755316918716 4977168.74935310240835,1545609.12470823014155 4977046.619399967603385,1552164.729521047091112 4974638.428658995777369,1552690.38015657523647 4974433.316091583110392,1552999.514382506720722 4974107.143081358633935,1553308.648608438437805 4973740.578748620115221,1553834.410563454963267 4972679.162380767054856,1554576.46628908533603 4970924.148409446701407,1554576.46628908533603 4970312.288411883637309,1553061.296699897851795 4968395.296650093980134,1546413.185390231199563 4967008.524057738482952)) +POLYGON ((1442731.54749926738441 4994984.190249461680651,1442144.003226859960705 4995106.692179691046476,1441834.646361945895478 4995475.09067687112838,1441587.294453402515501 4995884.144175119698048,1441123.537454756675288 4996988.438779830001295,1440937.967863603960723 4997479.440201032906771,1441154.372953706420958 4998543.557909308932722,1441618.241271843435243 5000220.313105899840593,1441958.43363570747897 5000466.481477052904665,1443813.68426926783286 5001611.960747523233294,1445823.557675539515913 5002226.81825714558363,1444432.175360116409138 4997234.525480988435447,1444277.441267913673073 4996825.562550690956414,1443164.468998960684985 4995230.226334676146507,1442731.54749926738441 4994984.190249461680651)) +POLYGON ((1335895.671836672816426 4402579.865620532073081,1335060.775655724806711 4402734.611352640204132,1334411.337746435077861 4403004.935587024316192,1330669.667021893896163 4405898.639961685985327,1327639.439163009868935 4410415.684020363725722,1327237.464481754926965 4411844.397632421925664,1327113.677207993343472 4413543.755734885111451,1327330.304937075357884 4414316.217723816633224,1328134.142980094067752 4415398.454096580855548,1328598.011298228288069 4415862.144431585446,1329185.555570635711774 4416209.021380712278187,1329958.669434195617214 4416363.965259992517531,1330793.454295655479655 4416402.214769592508674,1331628.350476603489369 4416286.493038269691169,1335462.750336979748681 4415475.780774854123592,1336668.785700232721865 4414779.860899657942355,1341214.183148304233328 4410841.066689037717879,1341461.535056847846135 4410377.595028585754335,1342018.243830302497372 4407250.453068076632917,1341863.509738099761307 4405937.824564742855728,1341554.375512168277055 4405281.709882943890989,1341152.400830913335085 4404741.091732761822641,1340100.988240371691063 4403930.146450998261571,1338926.011015048017725 4403235.952940950170159,1337596.411017013015226 4402695.438522345386446,1335895.671836672816426 4402579.865620532073081)) +POLYGON ((922529.33313081425149 4734969.23445587605238,921354.355905490694568 4735088.56864713691175,918818.497905220021494 4736523.270909687504172,918509.363679288420826 4736841.738727582618594,915169.667635999154299 4742023.270902130752802,915046.103001217241399 4742542.431482979096472,915200.725773928686976 4744894.992422343231738,915479.024500913219526 4745293.695836432278156,917674.467498337500729 4746370.43163766246289,924260.796490613021888 4748923.381780591793358,924446.366081765503623 4748563.887576275505126,924693.717990309000015 4742343.060330395586789,924662.993810847518034 4740628.257661385461688,924570.153355527087115 4738196.917096892371774,924415.419263324467465 4737041.001395764760673,923456.958447594428435 4735328.245296869426966,923085.81926528934855 4735088.56864713691175,922529.33313081425149 4734969.23445587605238)) +POLYGON ((1006699.224634006619453 4728119.201125808991492,1002648.308364039636217 4719960.268572038970888,991516.470604204223491 4708191.490640126168728,990434.111195221310481 4707277.005363148637116,986197.736653590225615 4704377.888897651806474,985795.873291826574132 4704138.942838804796338,985208.329019421944395 4704059.295401091687381,984033.351794098387472 4704218.59090079087764,970180.197762328200042 4710734.830667356029153,969376.24839982111007 4710218.442612736485898,962511.398041581385769 4705966.429603641852736,959110.142319883685559 4710019.849822008982301,953605.838778120116331 4723103.371709452010691,951936.157735709450208 4728835.459561286494136,947303.931084821466357 4730348.69883138500154,947044.111393308034167 4730468.408637540414929,946376.417087529785931 4730587.689756808802485,946060.937650623265654 4730516.006223312579095,945819.819633563398384 4730372.210585779510438,943686.047634038841352 4727816.343829692341387,943519.179717339924537 4727576.84501826018095,943407.860226545599289 4727314.420448805205524,942888.332163015496917 4724926.110488103702664,940556.74542834807653 4723023.575279343873262,940781.610799753107131 4720640.000373373739421,940649.585883671417832 4719999.653389065526426,939752.90738533239346 4717335.006851085461676,938546.872022076393478 4715903.019962769933045,936320.482206211076118 4715545.842178429476917,935856.725207568029873 4715744.686294911429286,935547.368342651054263 4716101.727918216958642,930847.348121868213639 4725252.381234178319573,930414.426622175029479 4726765.515021025203168,929115.662123089772649 4731981.318530310876667,928991.874849328305572 4732499.820358178578317,929486.801305394852534 4734650.825595170259476,930259.915168951964006 4737200.81604930665344,930445.262121124891564 4737638.669494730420411,930909.130439259111881 4737838.95216157194227,937804.816296448814683 4737120.908406796865165,938113.950522383209318 4736921.644163966178894,940062.041611263994128 4734929.934802027419209,940896.937792214914225 4733813.831005614250898,940760.905374462949112 4735455.185859018936753,940946.363646127050743 4734714.363139407709241,941131.933237279648893 4734116.29415721539408,941243.364047562354244 4733997.114851419813931,941874.100282395607792 4733901.887149323709309,942041.190838076989166 4734140.962010812945664,942764.767528233584017 4735383.467831508256495,942727.47549881762825 4735670.773311780765653,941670.051655772025697 4738515.86807562597096,938918.011204381473362 4744655.08880615234375,938392.360568856238388 4745453.641060731373727,934743.530299635371193 4750440.062611720524728,931311.105120514053851 4754111.118107815273106,937773.86947800766211 4760260.266488189809024,938454.14288624713663 4761538.34803213365376,938825.282068549422547 4763176.594452445395291,938825.282068549422547 4763855.787634761072695,938639.71247739973478 4764975.218668008223176,937155.378387161996216 4770410.586892049759626,936722.456887466018088 4770610.513838365674019,934805.312617023475468 4770570.931154179386795,934341.444298889255151 4770770.86128674633801,933630.33539169980213 4772010.689546692185104,931960.543029800872318 4774970.024270806461573,931867.813893971615471 4775489.732684206217527,934186.821526177809574 4785935.967709517106414,936536.998615804710425 4792625.206503624096513,940587.803566280403174 4812038.112105596810579,940340.451657736906782 4813082.417745406739414,940278.446701366337948 4813684.478796198964119,939907.530158043722622 4819829.454284301958978,939845.74784065282438 4830643.528108220547438,940031.094792822841555 4831086.633741095662117,940433.180793568957597 4831327.453981552273035,940989.666928044054657 4831447.938689767383039,941515.428883060580119 4831327.453981552273035,941886.568065365660004 4831045.797692514024675,942474.112337773083709 4830322.071637745946646,945102.476834893343039 4825617.105472651310265,946710.375559910084121 4826140.461467765271664,948844.036239946144633 4830000.62552766315639,950884.745145167806186 4833942.965504664927721,951967.10455415060278 4839336.338547906838357,952585.373006016598083 4843442.730720230378211,952616.431143948924728 4844772.365634752437472,952523.59068862569984 4846503.912260796874762,952121.727326862048358 4847431.298227426595986,951627.02350977784954 4848236.920728685334325,949214.952783268759958 4851137.934279235079885,948225.545149097684771 4852146.581483527086675,947297.919832317507826 4852589.484085980802774,942937.758016927633435 4853315.701302082277834,941608.269338383921422 4853355.612858886830509,941206.294657128979452 4853073.332743814215064,939783.742884282255545 4851823.269237522035837,939257.980929265730083 4851058.274228597059846,937588.299886855180375 4850211.508471842855215,934929.099890787852928 4850936.536331206560135,934619.743025870993733 4851259.819744938984513,934496.178391091874801 4851783.363831936381757,934496.178391091874801 4852468.743281346745789,934929.099890787852928 4858113.638235126622021,935918.507524956134148 4865739.418661299161613,936227.641750890645199 4868122.132754945196211,942257.484608688158914 4886791.934526039287448,941948.350382756558247 4898935.059481357224286,941453.646565669565462 4912756.01032021548599,931434.892394275637344 4937811.53019680082798,924662.993810847518034 4951197.50262882374227,924075.226899460540153 4951931.157279931008816,923209.606539050932042 4952419.899960006587207,912974.224638574873097 4955800.426560839638114,911768.300594810163602 4955922.29157180711627,909727.591689588618465 4953274.451937887817621,909232.665233522071503 4952419.899960006587207,909109.100598740042187 4951889.672445533797145,909170.882916131056845 4951279.147394481115043,909078.15378029900603 4950668.513789765536785,908521.556326332618482 4948551.964532686397433,908305.039916741894558 4948063.414605832658708,907284.57414463837631 4950343.131673512049019,907068.280374027322978 4950831.795190838165581,906635.358874331228435 4952378.413057223893702,906511.571600569761358 4954252.095652343705297,906542.518419010797516 4956696.631749966181815,906820.928465483826585 4957062.55811027251184,908335.986735180136748 4958285.687341471202672,910407.865097825299017 4958855.281473980285227,909727.591689588618465 4967048.898458839394152,907222.791827247478068 4971332.027387433685362,907130.06269141822122 4974678.834579205140471,911984.81700440379791 4999606.760737029835582,915973.839637488592416 5003699.510524909943342,915880.999182168161497 5003126.115456045605242,915942.781499559059739 5002512.379953646101058,916313.920681861345656 4999279.745014345273376,916499.490273013827391 4998788.652839280664921,921508.867358713643625 4992367.25721278320998,922931.30781206919346 4991059.054102432914078,924508.148399156518281 4989955.283870407380164,924972.128036782029085 4989750.879334655590355,930228.857031022431329 4988197.162302731536329,941484.482064619427547 4986112.930381846614182,943989.281926960684359 4985868.153931086882949,946803.216015233425424 4986358.595614289864898,951008.532418929389678 4987502.417891493998468,955090.172868354944512 4988769.679480756632984,957440.23863849346526 4989750.879334655590355,957873.160138186649419 4989995.753239088691771,958553.433546426123939 4990650.350211219862103,959326.547409986029379 4991916.990628542378545,959945.038500831811689 4994002.46357377897948,960377.960000527789816 4994943.847402790561318,961212.856181475915946 4996130.055730766616762,962047.641042935545556 4996661.510945867747068,962975.377679206896573 4997070.466989534907043,967613.615582598838955 4999115.652072818949819,969654.43580731167458 4999730.351970691233873,972963.073712668614462 4999893.276780248619616,974230.891393315512687 4999811.224794953130186,975900.795074705732986 4999402.153667942620814,976859.255890435772017 4999811.224794953130186,978498.212753384839743 5000835.230063597671688,980755.438068200135604 5002676.530148561112583,984496.997473252937198 5006401.745020342059433,985610.303700676886365 5007998.912972521968186,986105.007517761085182 5008859.375374868512154,987712.906242777826265 5011972.626422861590981,987867.640334980445914 5012546.543189222924411,1003081.229863735614344 5030221.658903826959431,1003483.315864481730387 5030467.406230424530804,1006359.032270142692141 5031493.464903459884226,1006761.006951397517696 5031617.46235082950443,1007379.498042243300006 5031658.105482559651136,1007905.037358280038461 5031535.142056891694665,1019779.042163234320469 5040653.592615447938442,1019686.535666384734213 5047270.725798390805721,1019964.611754386918619 5047558.652180196717381,1021417.999026183504611 5048668.988379723392427,1027818.981066289008595 5049984.975816012360156,1059019.273987356340513 5033998.106992928311229,1064492.408071696292609 5029729.000817683525383,1072439.506519427755848 5010743.782631517387927,1059143.061261117924005 5001980.605376528576016,1058029.86635318514891 5000875.597317012026906,1057937.137217353098094 5000262.003661028109491,1058184.489125896710902 4999852.913598751649261,1058586.35248766024597 4999566.251436783000827,1060534.443576541030779 4999443.693416274152696,1064925.329571392387152 4999525.742305035702884,1070089.55206878320314 5000711.477482918649912,1075253.440607700496912 4990608.700758517719805,1085024.842870553722605 4965621.948026306927204,1085488.59986919676885 4963460.631903587840497,1085581.440324520226568 4962238.030066214501858,1085488.59986919676885 4961626.713038412854075,1084529.916414487175643 4959182.119951448403299,1084560.97455241670832 4957918.541851487010717,1085303.030278044287115 4953396.285539698787034,1085488.59986919676885 4952908.667009911499918,1090405.247819064650685 4945947.280891880393028,1091302.037636894965544 4944848.73577840346843,1091704.012318149907514 4944360.223751781508327,1092507.850361168384552 4944075.330663150176406,1093280.964224728289992 4943505.422831780277193,1093621.045269101159647 4943180.278217161074281,1093806.614860253641382 4942691.995682896114886,1093775.668041812488809 4942040.599573181942105,1091982.311045131646097 4934233.945789236575365,1090961.956592522095889 4930454.639144494198263,1087807.830140385543928 4923469.094507829286158,1086972.933959434507415 4922291.508070710115135,1086261.71373275690712 4921641.46236689388752,1085457.653050758643076 4921154.248518590815365,1084499.192235028604046 4920789.803772863000631,1082860.235372079536319 4919774.135011625476182,1081066.767055907286704 4918191.297487592324615,1079767.891237330855802 4916852.936126994900405,1075036.924198109656572 4910849.200137553736567,1072779.698883291566744 4907038.72854448761791,1071542.716701597440988 4904201.388420439325273,1071233.582475665723905 4903148.481310289353132,1071171.68883878365159 4902540.973792779259384,1071109.906521395547315 4900555.931994060985744,1071264.529294106876478 4895006.903309548273683,1072006.585019734455273 4893104.538529629819095,1074480.438063631765544 4887035.274213382042944,1075500.792516243876889 4885336.535734356380999,1078964.053194312378764 4881494.845270287245512,1080262.817693397402763 4880120.263678282499313,1081314.118964450666681 4871836.645863584242761,1079242.463240788085386 4856540.63636137265712,1076985.015286990441382 4838208.565749828703701,1076521.258288344601169 4833942.965504664927721,1076490.311469906242564 4830684.507312792353332,1076644.822923126397654 4829557.712926625274122,1076892.174831670010462 4828471.871158952824771,1077077.744422822492197 4828030.039779900573194,1077170.584878142923117 4826822.920704463496804,1077077.744422822492197 4824291.036141080781817,1074418.65574624366127 4800642.682296162471175,1073367.131836207816377 4791583.03186391107738,1072099.425475054886192 4783493.524799268692732,1068697.947114374721423 4769450.877706284634769,1065110.899162544868886 4754750.323770856484771,1065018.170026712818071 4754151.642084226943552,1064647.253483390202746 4749961.146627390757203,1064677.977662849007174 4749362.749055639840662,1066100.529435695614666 4748165.055012539960444,1066347.881344239227474 4747766.238205512985587,1066378.716843188973144 4747287.449065466411412,1065234.686436306452379 4743259.712149412371218,1064801.764936610357836 4742343.060330395586789,1063843.081481900764629 4741345.545971967279911,1059947.010623624781147 4738635.818056019954383,1051149.43126623518765 4739509.372322049923241,1047578.190682095242664 4741864.528203593567014,1045537.259137891232967 4744177.452073590829968,1045228.124911956721917 4744496.161182151176035,1042630.595913789235055 4747128.623610292561352,1040002.231416668975726 4749521.609666111879051,1037683.001145480317064 4751197.411061375401914,1034745.502422428457066 4752354.804466783069074,1003916.126044683740474 4759901.518236458301544,1003452.369046040694229 4759701.803801893256605,1003112.176682176650502 4759381.607565020211041,1003050.394364785752259 4758782.650809430517256,1003359.528590717352927 4739791.916132025420666,1003668.662816651863977 4736244.261176694184542,1004194.424771668273024 4733575.33751439768821,1004565.563953973352909 4732618.982027354650199,1006699.224634006619453 4728119.201125808991492)) +POLYGON ((917798.032133119413629 5010292.665438856929541,915509.859999863081612 5010333.219413740560412,914520.452365692006424 5011234.446110470220447,914396.887730912887491 5012996.584893628954887,916252.138364473241381 5018652.277378890663385,922652.89776559616439 5027102.553674321621656,925528.614171257126145 5029646.696552431210876,926301.728034817031585 5030262.296185959130526,926703.591396580683067 5030098.713690760545433,928991.874849328305572 5026363.370345648378134,929208.391258919029497 5025870.908152046613395,929177.444440477993339 5025337.854118551127613,928466.335533291450702 5022097.621853058226407,928311.824080071179196 5021563.59386507794261,927353.140625358792022 5020498.13559403270483,927074.730578885762952 5020415.909573744051158,925003.074855223065242 5021072.556172548793256,922652.89776559616439 5021440.905932917259634,922158.19394850928802 5021235.838951365090907,920333.890133390086703 5020415.909573744051158,917365.333272405900061 5016807.950404336676002,917798.032133119413629 5010292.665438856929541)) +POLYGON ((1147209.13494207453914 5208574.389115321449935,1146033.935077771311626 5208699.645282902754843,1145693.854033395648003 5209035.075002564117312,1145446.502124855061993 5209494.428236635401845,1145322.826170581858605 5210037.821736492216587,1145322.826170581858605 5211878.273705241270363,1145415.666625905316323 5212505.693274946883321,1145817.641307160025463 5213552.489127269014716,1146250.562806853326038 5213803.134832025505602,1146807.048941328423098 5213928.309540370479226,1148291.383031566161662 5213426.114392094314098,1149157.226030958117917 5212925.150810859166086,1149497.418394822161645 5212548.165328990668058,1149744.770303362747654 5210289.428453990258276,1149744.770303362747654 5209744.966559316031635,1148446.005804277490824 5208658.244323135353625,1147209.13494207453914 5208574.389115321449935)) +POLYGON ((1214742.996463156305254 5209578.291588813997805,1213846.095325834816322 5210080.282724525779486,1209919.188968611648306 5214430.531328647397459,1209640.778922138735652 5214848.868976062163711,1209424.262512545101345 5215937.356578757986426,1210908.596602782839909 5219286.465100556612015,1211310.571284037781879 5219411.71235326025635,1212485.548509361455217 5219118.567052458412945,1212949.528146986849606 5218909.226173133589327,1214711.938325226772577 5216816.825460562482476,1214990.348371699685231 5216398.400829484686255,1216505.517960887169465 5211962.158167818561196,1216319.948369734687731 5211418.804848396219313,1215454.105370345525444 5210205.558805547654629,1215144.971144411014393 5209828.832129613496363,1214742.996463156305254 5209578.291588813997805)) +POLYGON ((1122471.383739521261305 5246958.623536276631057,1121574.705241182120517 5247504.175636931322515,1120925.267331892391667 5250066.077587555162609,1122069.409058266319335 5253637.271365517750382,1122316.872286300873384 5254141.609470123425126,1122935.363377146655694 5253973.090374908410013,1123182.715285690268502 5253553.015952173620462,1124512.203964233864099 5250317.542849234305322,1124203.069738302379847 5248806.432877082377672,1124017.500147149898112 5248218.172507207840681,1123028.092512978706509 5247084.389466622844338,1122471.383739521261305 5246958.623536276631057)) +POLYGON ((1159794.359973709331825 5267724.118878492154181,1152682.269026417518035 5275385.549665250815451,1151940.213300789706409 5276017.208317720331252,1151445.509483702713624 5276270.429545163176954,1150827.018392857164145 5276353.82725206296891,1146559.697032787837088 5275470.00084687769413,1139324.041450713761151 5273448.232721309177577,1136479.160544002894312 5271764.414931728504598,1131036.750639118487015 5270879.959258995018899,1129799.991096403915435 5270922.694922543130815,1128686.796188471373171 5271217.606606724672019,1127388.031689386116341 5272059.353027753531933,1126738.705099590588361 5272775.063497086055577,1126212.943144574062899 5273617.101020171307027,1124790.614010707009584 5276312.128306059166789,1124543.262102166423574 5277407.73480365332216,1124388.639329454861581 5278628.444034138694406,1124481.257145792944357 5279935.016820290125906,1125223.535510402871296 5281157.11663833912462,1125965.591236030682921 5281831.94896284211427,1127295.191234065685421 5282548.556269380263984,1129336.122778269695118 5283222.274689030833542,1133541.55050145694986 5283643.676762449555099,1136417.378226611763239 5282969.928093928843737,1137499.514996612211689 5281958.18197787925601,1138087.059269019635394 5281157.11663833912462,1138921.955449970439076 5280566.829845800995827,1139447.606085495790467 5280399.050139931961894,1152094.72475401009433 5281873.672427835874259,1152589.539890585467219 5282042.692288766615093,1153238.977799874963239 5282800.891535591334105,1155156.122070314595476 5285498.708201638422906,1155403.473978858208284 5285963.016680225729942,1156794.967613775283098 5289546.660509708337486,1157104.213159198174253 5290643.813170156441629,1158495.70679411268793 5292036.660662086680532,1158990.410611199680716 5292247.481474158354104,1159608.790382556850091 5292289.25128997117281,1161742.451062590116635 5290263.857331533916295,1162082.53210696298629 5289884.979849116876721,1162206.31938072736375 5289335.900412666611373,1162299.15983604779467 5288324.530427725985646,1161185.853608623845503 5269701.774128708057106,1161000.284017471363768 5268439.499349321238697,1160721.985290489625186 5268060.440910523757339,1160289.063790793530643 5267765.628244360908866,1159794.359973709331825 5267724.118878492154181)) +POLYGON ((1092724.478090250398964 5312647.684638892300427,1092446.068043777486309 5312774.333532541058958,1091704.012318149907514 5313451.447102219797671,1091425.60227167676203 5313874.211260602809489,1090838.169318760745227 5315354.112507400102913,1090405.247819064650685 5316962.019733565859497,1091240.032680524280295 5321150.364205220714211,1091394.655453235842288 5321701.46563699003309,1093497.480634319130331 5323775.434266922995448,1094053.966768794227391 5323775.434266922995448,1094455.941450049169362 5323479.015979854390025,1094734.351496524875984 5323055.81707516591996,1096651.384447476128116 5319965.994673990644515,1096094.898312998237088 5317681.167677925899625,1095847.546404457651079 5317215.283864062279463,1092724.478090250398964 5312647.684638892300427)) +POLYGON ((1547959.190478368662298 5296973.207952031865716,1549969.286523622926325 5288366.282772694714367,1551762.754839792149141 5282125.989551581442356,1556833.914242880186066 5268565.552543614991009,1557266.835742576280609 5267639.737265271134675,1560328.121739389607683 5261876.310809086076915,1564966.359642784344032 5254267.320022436790168,1566821.721595835871994 5251325.890682872384787,1573006.075906853657216 5242382.459166558459401,1580736.657944994280115 5233531.574488886632025,1614596.373501111287624 5200214.12224353197962,1621028.079720675479621 5194116.771688089706004,1621893.922720064641908 5193531.902650608681142,1625790.104897829005495 5191736.184565830975771,1628480.251712340163067 5190817.866451972164214,1632098.246482611168176 5189357.396138948388398,1637756.950158106628805 5187061.816483536735177,1638128.089340411592275 5186770.721155709587038,1638468.281704275636002 5185769.229097432456911,1638468.281704275636002 5185143.575426271185279,1638066.084384038113058 5182264.68772544618696,1638684.575474886689335 5177095.749307778663933,1638931.927383430302143 5176054.016860509291291,1640107.015928242122754 5174511.208078400231898,1640818.236154919955879 5173802.746009979397058,1642488.028516821796075 5172636.740987038239837,1643318.58323762868531 5172188.165579807944596,1650311.339690788649023 5167763.534203924238682,1651702.94464519713074 5167014.504129337146878,1657423.319318589521572 5164224.559410823509097,1658567.572364454623312 5163891.906727771274745,1663082.245633067330346 5163351.146137099713087,1669390.164578867144883 5161644.557721870951355,1672451.561895174672827 5159148.823506492190063,1672915.430213308893144 5158274.677171367220581,1676007.551709072198719 5154531.445670301094651,1677553.668116700835526 5153284.277646607719362,1680831.359203619416803 5151579.639301875606179,1685590.824032485950738 5150203.878475805744529,1686923.207017790526152 5149834.010106040164828,1688809.293150300625712 5149501.85897811781615,1711320.654536988586187 5146841.476119262166321,1713917.960896176518872 5146592.738894795998931,1715773.434168719453737 5146592.738894795998931,1720504.512527434621006 5146966.968975843861699,1725142.750430826563388 5147382.348632914014161,1736583.833736084867269 5149543.003197907470167,1744098.122003614204004 5148878.732747524045408,1744994.689182461937889 5148379.96184997446835,1746231.671364156296477 5148129.987797888927162,1754394.952263010432944 5148504.278133075684309,1755570.152127313660458 5148587.605356510728598,1765186.820297964382917 5149793.014251541346312,1771494.961882746545598 5151288.429525315761566,1782565.017325193854049 5152993.165516478009522,1783121.726098648505285 5153076.531938743777573,1784482.272915124660358 5152952.006420380435884,1787110.414773262338713 5152577.541636026464403,1790295.376724349102005 5151412.933337261900306,1796912.652535065542907 5148129.987797888927162,1797283.791717370739207 5147838.883236545138061,1797531.366264893906191 5147382.348632914014161,1802014.870076083112508 5137456.620890467427671,1802788.09525913419202 5135132.424639264121652,1802942.718031845754012 5134634.370704549364746,1802911.659893913427368 5131232.940412726253271,1802849.654937542742118 5130568.746688964776695,1802262.44462360907346 5128246.222982068546116,1799479.234714794903994 5124763.941258870996535,1796572.46017120173201 5122194.721453896723688,1784512.885775094851851 5112708.945433278568089,1779565.736284748185426 5109521.044011251069605,1778266.860466174548492 5108818.575520431622863,1774834.43528705323115 5107618.315157425589859,1773535.893426950555295 5106955.904836318455637,1772731.832744949497283 5106418.35380541253835,1771649.58465545787476 5105425.251965181902051,1769979.903613050002605 5103688.017569683492184,1769454.141658033709973 5102778.127605186775327,1769052.166976778768003 5100213.598106558434665,1768897.432884576031938 5098849.809853106737137,1768835.650567185133696 5096948.152169370092452,1768990.162020408082753 5095212.598503709770739,1769485.088476474629715 5091866.014409247785807,1770103.468247829237953 5089882.769502552226186,1772206.07078993297182 5085423.485796961933374,1773597.675744341453537 5083111.70893875695765,1779071.032467663986608 5077747.885341422632337,1779813.088193291565403 5077087.380500149913132,1784791.407141059171408 5074324.680039799772203,1789584.490456145023927 5072634.015206900425255,1791625.310680857859552 5071809.571094106882811,1802509.573893170105293 5066411.389156664721668,1835874.696951694320887 5049615.539575739763677,1854335.142068412387744 5040611.728297318331897,1868930.351825810270384 5035189.092132915742695,1897966.259887382853776 5024435.31815954297781,1912437.905009998707101 5016972.342068054713309,1913334.360869358293712 5016438.743359075859189,1920817.479679464129731 5010784.33848778065294,1923909.82381420978345 5008367.799629869870842,1925022.79608315997757 5007425.264511574059725,1926043.261855263495818 5006401.745020342059433,1928269.651671128813177 5003904.207925351336598,1944967.797929101157933 4987298.064753788523376,1945338.937111406354234 4986971.461715657263994,1947688.891562050674111 4985786.219916395843029,1977157.498484336771071 4972719.413300270214677,1996762.419285905314609 4965050.785760941915214,2005049.376139027066529 4960037.261989648453891,2005266.003868111874908 4959629.853561143390834,2006657.163544555427507 4955311.515269698575139,2007801.52790990867652 4950546.714084476232529,2007677.629316655918956 4949976.430176135152578,2008048.768498963909224 4947208.144485590048134,2008172.333133742911741 4946719.661484095267951,2012841.74049455835484 4942528.849704090505838,2017943.958035575924441 4938054.961575789377093,2034332.413470160681754 4925823.52057374920696,2050906.995093354023993 4908133.205422817729414,2051185.071181355975568 4907767.928504401817918,2052823.805405322695151 4904526.268971375189722,2054926.741905900184065 4899583.609860400669277,2060770.681214074371383 4885821.984633077867329,2060832.686170445056632 4885255.435765591450036,2061080.260717971017584 4881534.870356842875481,2060956.250805226853117 4880282.380157456733286,2057153.131721765501425 4872523.411136692389846,2056565.476129866903648 4871755.656355711631477,2055823.531723730498925 4871150.073553312569857,2053566.083769932854921 4870261.467739584855735,2052762.245726914145052 4869776.780788168311119,2050473.850954678375274 4865335.889044402167201,2050257.223225593566895 4864811.484903609380126,2048216.40300088073127 4856661.426643427461386,2047721.699183796532452 4853436.452394020743668,2047691.086323826340958 4852831.840847975574434,2047969.273731319699436 4851864.190583397634327,2048401.972592033213004 4850977.454027935862541,2048463.977548406692222 4850452.791642775759101,2047319.947141521144658 4839537.501882097683847,2047257.942185150692239 4839013.442208985798061,2045835.390412303851917 4837001.228078012354672,2045217.121960437856615 4836317.057725802063942,2042650.539780708495528 4835753.32622239831835,2040640.666374434018508 4837644.727224257774651,2040269.527192129055038 4837967.43429206777364,2037919.461421993328258 4839697.797764395363629,2037486.76256127981469 4839939.985676989890635,2033343.005835992284119 4841510.364267676137388,2031425.750246058683842 4841711.716484273783863,2029014.124797514406964 4841751.436552815139294,2025952.838800698285922 4842355.375071407295763,2023695.390846900641918 4843604.104419228620827,2023262.691986186895519 4843845.372402957640588,2021097.750529238954186 4845135.327377527020872,2013243.937814793083817 4851542.048373718746006,2012532.60626862407662 4852146.581483527086675,2009223.745724284555763 4855532.704514580778778,2008636.424090859713033 4856299.205378639511764,2007647.01645668852143 4857872.169024435803294,2003163.067367537179962 4865094.244126030243933,2003101.173730654874817 4865659.641429153271019,2003379.695096619194373 4866103.001710652373731,2003843.452095265034586 4866223.908378254622221,2004863.806547874351963 4865820.3590586790815,2005358.510364961344749 4865942.279503145255148,2005946.277276351349428 4866749.404473903588951,2006224.464683841913939 4867920.390106751583517,2006224.464683841913939 4868525.775716066360474,2005482.186319231754169 4879635.09430920612067,2005420.515321332029998 4880160.283208736218512,2004770.854773062746972 4881454.965890424326062,1993329.882787292823195 4903067.235041853971779,1988073.153793055098504 4907241.270574956201017,1987640.009654376655817 4907484.093015095219016,1979817.143758369144052 4908822.350372055545449,1977343.068075489485636 4909146.361462992615998,1968004.587312332121655 4910200.930725787766278,1966798.663268570089713 4910241.072268405929208,1963273.620273110922426 4910119.626356519758701,1953656.952102460199967 4909592.988795231096447,1949142.056194867705926 4909187.666344556026161,1948554.845880934037268 4909349.092735268175602,1936154.967801469145343 4914093.961294478736818,1915189.611502918414772 4925295.896553759463131,1914973.429051798535511 4925742.087145387195051,1915035.100049698259681 4926392.403772674500942,1915282.563277730252594 4926838.497880878858268,1919797.125226851785555 4932282.739173918962479,1922271.089590243063867 4934965.309146215207875,1924713.661857228493318 4934437.194369862787426,1926971.109811026137322 4934640.300822516903281,1927774.947854041820392 4935168.426515081897378,1928269.651671128813177 4936022.648326739668846,1928733.853947736788541 4937608.211798747070134,1928517.226218651980162 4938054.961575789377093,1927558.431444450980052 4938502.902788823470473,1926971.109811026137322 4938624.553096695803106,1902419.150838604895398 4941918.760495298542082,1901213.115475348895416 4941960.203185017220676,1900099.697928436566144 4941797.069368064403534,1897657.125661451369524 4941105.464811019599438,1894410.158753991359845 4939804.09757765289396,1892245.773894499288872 4938706.093316215090454,1886555.900761583354324 4934600.205988499335945,1885442.928492630133405 4933706.016632292419672,1884082.270356665598229 4932364.226780466735363,1882814.341356530319899 4930901.063826955854893,1878423.455361678963527 4925011.40944613981992,1877269.18356164265424 4922830.078899132087827,1869888.812641540309414 4912349.53581282030791,1868559.212643505306914 4910241.072268405929208,1864879.658194825751707 4902743.423524659126997,1864261.278423468582332 4900433.438631769269705,1864199.273467097897083 4899785.99895897321403,1863673.622831569751725 4897436.76185,1863333.430467705940828 4896303.530899708159268,1858509.400334178935736 4888167.443125531077385,1856901.724248144542798 4886509.72040990088135,1852506.60811264347285 4883148.379951699636877,1852046.635976685211062 4882788.537976511754096,1850438.959890651050955 4881049.63167215231806,1849820.691438782028854 4880282.380157456733286,1848769.278848240384832 4878624.813382448628545,1848429.086484376341105 4877492.57142814155668,1847810.372754548210651 4872564.417894242331386,1847872.3777109188959 4871998.626864162273705,1848800.225666681537405 4866144.127250761725008,1849170.919571021571755 4864649.621225462295115,1843821.684079934377223 4851137.934279235079885,1840852.904579967726022 4847350.507492264732718,1836802.210948980413377 4840382.345288867130876,1836555.081679422175512 4839939.985676989890635,1835843.750133253168315 4837847.015658987686038,1835503.557769389124587 4835995.418265760876238,1835287.04135979549028 4834023.647542980499566,1835287.04135979549028 4832212.442294713109732,1835720.185498471138999 4829557.712926625274122,1839894.443764237686992 4817500.206171272322536,1840327.587902913335711 4816656.141445172950625,1841564.236126136733219 4815250.730131530202925,1842801.218307830858976 4814447.767972481437027,1843759.679123560898006 4814005.544661113061011,1847563.243484987178817 4812278.473416110500693,1850841.157210885547101 4811275.006845019757748,1863642.564693640219048 4810472.363877268508077,1872795.475865645101294 4803449.600357593968511,1888318.644898294005543 4792505.188626158051193,1896234.46256911335513 4788659.462531667202711,1908015.960877218050882 4779530.377594564110041,1909252.60910044144839 4777690.547005645930767,1907861.449423997895792 4774929.416432349011302,1907273.682512607891113 4773410.052336889319122,1905449.378697488689795 4767452.736756898462772,1905232.862287895055488 4766213.326005016453564,1904552.588879658374935 4759422.152731611393392,1905356.426922677084804 4736363.466963930986822,1905480.43683542101644 4735287.796774490736425,1907891.950964473886415 4729990.438062083907425,1908541.722832234576344 4728755.617958744987845,1909097.986327729886398 4728000.092419369146228,1910984.295099219772965 4726526.041060634888709,1911262.927784675266594 4721352.435721680521965,1911262.927784675266594 4716420.699548071250319,1906562.462285930057988 4710138.747488704510033,1903965.267246233532205 4706681.125117248855531,1903686.745880269212648 4708549.554156251251698,1903037.419290470890701 4709225.088303910568357,1902604.720429757377133 4709463.152554526925087,1890019.384078633971512 4712881.220348970964551,1889462.563985685352236 4713000.294656206853688,1888256.639941920526326 4713040.654293715953827,1886123.201900869840756 4712762.290554499253631,1884576.974173749797046 4712483.791338548995554,1874779.077872087713331 4710019.849822008982301,1873321.237820661626756 4709582.043702185153961,1862467.587468316778541 4703860.680003763176501,1850253.390299495542422 4696197.718525815755129,1848892.843483022414148 4694968.145778483711183,1847346.615755902370438 4693181.772447124123573,1844965.603167325723916 4690166.719726325944066,1842337.461309187812731 4684852.740052834153175,1841100.479127490893006 4681999.099145596846938,1840543.770354036008939 4680492.615568191744387,1840327.587902913335711 4679264.936824827454984,1840482.210675627691671 4678789.368709231726825,1842213.451396443881094 4671461.518337189219892,1843636.114488781895489 4664931.313832703046501,1844563.962444544536993 4658008.686763161793351,1845120.225940037053078 4653185.623480750247836,1845305.795531189534813 4643851.216016387566924,1845244.235852780984715 4642125.775738357566297,1844718.473897764692083 4640547.13628233037889,1844223.770080680493265 4639678.760744840838015,1840420.205719254212454 4634903.368873140774667,1838502.950129323173314 4632812.214933954179287,1835720.185498471138999 4630131.190147726796567,1833493.684363114647567 4628474.197182360105217,1831081.724956096848473 4627133.666292802430689,1827216.489596773637459 4625360.232931300066411,1821681.239236568799242 4623468.075346027500927,1820351.639238533796743 4622917.065487484447658,1818279.760875888634473 4621853.291359129361808,1817506.869651311077178 4621340.239452145062387,1799541.239671165589243 4599103.148644500412047,1799046.535854081390426 4598238.261696002446115,1798737.401628149673343 4597295.757499310187995,1798366.262445844709873 4595605.126096258871257,1797283.791717370739207 4590379.6145936883986,1796851.092856657225639 4588022.477880411781371,1796572.46017120173201 4586177.018160791136324,1796572.46017120173201 4584409.621140083298087,1796448.895536419702694 4583153.375315750017762,1795954.191719335503876 4581583.741559290327132,1794098.941085775382817 4576561.466250188648701,1793387.60953960637562 4575306.312961672432721,1790883.032316247699782 4571815.193247145041823,1788780.20713516138494 4569306.045919299125671,1788068.875588992377743 4568718.26175610627979,1786553.705999807687476 4568443.644600364379585,1780678.931192683521658 4567973.171460186131299,1775236.632607290521264 4568482.451825355179608,1772515.427654847037047 4569227.578688781708479,1766269.068387455772609 4568992.745054850354791,1758260.410261315992102 4568013.105814421549439,1756745.240672128507867 4567698.715125989168882,1756157.696399721084163 4567698.715125989168882,1753962.030763314338401 4568247.776166656054556,1749973.119449720717967 4569698.108704942278564,1744963.965003003366292 4572677.87489365413785,1744252.633456834359095 4573266.024645081721246,1743665.089184429729357 4573972.667296966537833,1741067.560186259448528 4578326.535587314516306,1740634.861325543140993 4579151.053245951421559,1740109.09937052661553 4581073.817227526567876,1740170.881687917513773 4581741.146382659673691,1741624.268959714099765 4588336.354708921164274,1740727.367822392610833 4604255.192098897881806,1739861.747461986029521 4606497.201931188814342,1739552.390597068937495 4607441.67988926358521,1739552.390597068937495 4608621.973974267020822,1739737.960188224446028 4611140.537459671497345,1739799.742505612550303 4611770.841318562626839,1739985.312096765032038 4612282.283004427328706,1742644.734731817618012 4613424.155045670457184,1748489.007998462766409 4615708.137056574225426,1750344.258632025681436 4615550.213732747361064,1751395.671222567558289 4615708.137056574225426,1752354.132038297597319 4616022.85682515706867,1754426.010400942759588 4617086.17041387502104,1758074.840670163510367 4619133.996364675462246,1758445.979852468473837 4619409.963614966720343,1759930.091303723864257 4621222.370205101557076,1761167.073485417990014 4623271.0192547775805,1769485.088476474629715 4643468.265170291997492,1770660.177021286683157 4646429.470043471083045,1772276.424708114936948 4652867.628774406388402,1772670.050427561393008 4654924.880632411688566,1772793.8377013229765 4656189.773505501449108,1772206.07078993297182 4657494.962955967523158,1769392.3593406425789 4661133.719379997812212,1767413.321433320874348 4663585.865534909069538,1764599.276025556726381 4666038.742371333763003,1763238.729209080571309 4666672.426665117964149,1762001.969666369026527 4667463.732407342642546,1761878.182392607443035 4667938.773245671764016,1761939.96471 4668571.435408530756831,1762496.673483452992514 4670115.352534094825387,1763208.005029621999711 4671422.463489736430347,1764104.572208472760394 4672491.394399655982852,1765125.037980573251843 4673441.96596755925566,1779163.538964513456449 4681761.819279043003917,1779596.460464209550992 4681999.099145596846938,1783739.994550514500588 4682197.288425728678703,1786152.065277023706585 4682158.049781472422183,1788625.584362450055778 4681761.819279043003917,1790914.090454180026427 4681245.758200471289456,1792150.627357912017033 4680453.383482984267175,1792707.3361313669011 4680334.832171658985317,1795490.546040181070566 4681008.495863274671137,1800252.571217337390408 4684615.251035280525684,1800994.404303982388228 4685209.840326445177197,1801272.925669946707785 4685567.095846899785101,1802819.153397066518664 4688660.170577370561659,1804117.69525716942735 4692190.08131886087358,1804426.829483100911602 4693301.616071742959321,1805323.730620422400534 4697309.691134516149759,1805601.80670842458494 4699214.415976728312671,1805725.371343206381425 4702868.090166873298585,1805880.439393880078569 4708906.485807630233467,1805725.371343206381425 4710575.432937441393733,1805509.300211574882269 4710973.931955102831125,1805200.165985643398017 4711211.894124387763441,1802726.090302763739601 4711926.958936070092022,1799170.100488863186911 4713835.571500253863633,1798026.070081980666146 4714671.060250979848206,1792367.255086994031444 4724456.568442338146269,1792058.00954157137312 4725412.009837011806667,1788254.445180144859478 4740190.418211804702878,1787450.607137129176408 4747447.42587427329272,1787512.612093499861658 4749322.24430906958878,1787357.989320788299665 4753952.041519186459482,1787048.855094854021445 4758463.490119191817939,1785348.115914516616613 4769091.801893789321184,1784946.029913770500571 4771210.174569513648748,1784605.837549906456843 4772089.866401416249573,1779813.088193291565403 4784413.929537585005164,1778854.404738581972197 4786616.700051632709801,1778637.999648479511961 4787056.706637267023325,1773721.46301810303703 4795069.729307210072875,1772175.346610474400222 4796793.834087126888335,1770412.825112746097147 4798436.684895792044699,1764753.898798268288374 4809428.330720595084131,1759837.250848403433338 4819227.02293486520648,1759620.957077792147174 4819669.477374639362097,1758878.90135216456838 4823245.558361046947539,1758786.060896841343492 4823808.583378199487925,1757456.238259826553985 4835834.02291673514992,1756868.805306910304353 4844168.280471766367555,1757054.37489805999212 4845416.222158938646317,1756961.5344427395612 4846584.69612193480134,1756435.883807214442641 4847954.64081790857017,1753838.466128535103053 4854161.715476316399872,1753096.410402907524258 4855371.137161364778876,1750931.802904430311173 4859686.889231752604246,1749076.440951378783211 4862995.827934707514942,1744005.281548290979117 4870423.42300905007869,1743355.732319512870163 4871069.089653518982232,1741288.195417011622339 4872182.858023261651397,1739428.825962289934978 4874623.698766473680735,1737913.656373102450743 4876038.684358310885727,1735285.291875982191414 4876644.565937500447035,1734110.092011678731069 4876886.637988428585231,1732780.492013643728569 4877048.55606897175312,1731636.461606761207804 4876967.669437383301556,1727647.550293164793402 4876603.542293826118112,1726688.866838455200195 4876321.618443842977285,1725915.864294386468828 4875795.614791359752417,1720844.704891298431903 4870100.678140693344176,1716886.51775716082193 4865214.99319638684392,1716206.244348924141377 4864528.879033863544464,1715742.487350278301165 4864528.879033863544464,1710454.700218108249828 4865497.763916450552642,1709836.431766242254525 4865618.517896985635161,1709403.510266546159983 4865861.338111256249249,1707486.254676615353674 4867313.878741622902453,1704641.485089392634109 4870504.401635702699423,1699879.459912236314267 4875714.592927419580519,1698549.859914204105735 4877048.55606897175312,1686026.30588046903722 4888571.903800709173083,1684139.997108976356685 4890070.023419140838087,1682872.179428332252428 4890879.116960637271404,1681697.20220300857909 4891121.391735074110329,1680553.171796126058325 4891040.244321389123797,1671183.74421453056857 4894399.750633610412478,1663329.597541607916355 4900028.492224540561438,1661690.640678661642596 4905417.958387932740152,1665803.450585508020595 4915676.140557307749987,1668431.815082628279924 4917704.254308669827878,1668648.108853239566088 4918151.269635364413261,1668895.460761782946065 4919368.393595146946609,1669019.248035544529557 4920667.05877994466573,1668988.301217103376985 4923103.394770409911871,1668740.949308562790975 4924118.091525333933532,1665834.174764966592193 4930942.313788516446948,1659093.334319470915943 4946435.725434920750558,1657856.240818285616115 4948510.493992634117603,1651919.238415808416903 4956940.532249818556011,1651084.453554348787293 4958080.917324505746365,1650404.068826620699838 4958773.573558900505304,1644961.770241227699444 4964113.453174284659326,1644498.124562076060101 4964357.685274368152022,1643322.813378278631717 4964602.804147492162883,1641374.722289397846907 4964724.925542198121548,1634967.951635770965368 4959288.47683521732688,1628449.527532881591469 4960770.40512480866164,1627676.413669321686029 4960240.899203443899751,1622540.35500310221687 4955243.181081601418555,1614658.155818502418697 4956411.233342903666198,1609162.53519702097401 4956013.508011143654585,1603216.961193749913946 4953519.293564607389271,1594907.295164504554123 4949563.13797199819237,1594834.158259053248912 4952739.78013854753226,1596223.202865171711892 4956205.91589002776891,1597929.285381071269512 4957592.918933207169175,1598454.936016596388072 4957429.524844794534147,1599042.480289003811777 4957429.524844794534147,1600093.892879545688629 4957673.443593367002904,1601299.928242798661813 4958447.922213912941515,1602691.310558224795386 4959751.766225463710725,1610792.920459178974852 4967538.396273167803884,1611411.411550024757162 4968313.655887323431671,1611596.869821686064824 4968803.217001148499548,1611627.816640127217397 4969496.632536176592112,1611566.034322736086324 4970026.639569115824997,1611380.464731583604589 4970516.28644629381597,1611009.32554927864112 4971413.840235982090235,1609463.320461143972352 4974474.749658642336726,1608288.12059683795087 4975984.843892727047205,1593816.69811320444569 4986317.111590064130723,1592579.93857048987411 4987175.808011767454445,1590260.708299304125831 4988319.578982691280544,1588157.994437709217891 4989014.528749193064868,1587601.285664251539856 4988933.5983229232952,1583643.321169096278027 4986971.461715657263994,1582622.966716486960649 4985990.541388870216906,1581911.635170317953452 4984642.745884642936289,1577056.880857332376763 4983906.633664254099131,1566698.156961054075509 4986112.930381846614182,1563729.600100069772452 4991754.051944985054433,1563636.870964237721637 4992326.777999582700431,1561874.126827527070418 4997315.377585081383586,1561472.152146272128448 4998257.081568679772317,1560451.686374171636999 5000506.99452227819711,1557854.380014983704314 5005869.757899763062596,1556679.402789660030976 5007998.912972521968186,1547340.922026502666995 5023860.698589280247688,1540352.395713992649689 5034860.876555556431413,1536456.213536228286102 5040365.723610517568886,1535528.588219447992742 5041433.515052412636578,1533518.714813173515722 5043529.645964469760656,1529268.647974177496508 5047027.808455464430153,1527272.355545782251284 5048916.38864460028708,1526530.299820154672489 5049492.496008388698101,1525973.702366188401356 5049698.013697383925319,1519201.69246326899156 5050684.352076249197125,1518521.307735541136935 5050766.835312067531049,1516264.082420726073906 5050437.94315212033689,1514841.753286861814559 5049903.683825273998082,1510450.644653027877212 5047641.10876849014312,1510048.781291264342144 5047394.92538221180439,1479899.900960741564631 5056034.18784218467772,1477982.53405131935142 5056034.18784218467772,1476838.503644436830655 5055909.877252626232803,1470654.149333416251466 5054099.183629360049963,1466077.471108432626352 5052083.108234578743577,1463511.111567683052272 5050643.629014539532363,1461037.369843274354935 5049121.894094057381153,1459274.84834554605186 5047477.380575231276453,1450709.370126457419246 5050067.453087715432048,1450183.719490932067856 5051507.883221449330449,1448235.628402048489079 5055540.214564833790064,1447276.944947336101905 5057226.850670457817614,1445359.911996384849772 5060026.608231932856143,1444493.957677504513413 5061180.034284099005163,1441803.810862996149808 5064556.757936586625874,1439608.145226589404047 5067111.807219692505896,1437474.707185535691679 5069089.182860715314746,1435155.476914347149432 5070862.029763774015009,1431012.054147533373907 5073005.372014698572457,1410603.295302946353331 5080305.39269710239023,1409304.753442843444645 5080347.280872231349349,1407789.361214676406235 5079892.907877519726753,1399966.272679686080664 5087446.392993532121181,1393472.450184260262176 5096452.0776751274243,1388370.343962734099478 5102322.69386646617204,1386144.065466357162222 5104845.791433735750616,1385061.706057374365628 5105879.79032856784761,1375568.602521505439654 5114903.823235648684204,1374331.842978793662041 5115731.821385464631021,1360014.931948380544782 5128453.578922646120191,1359705.575083463685587 5130113.185426310636103,1359179.924447938334197 5132891.983550824224949,1358592.380175530910492 5134302.747495085932314,1355840.451043631648645 5140778.201981764286757,1355407.529543935554102 5141691.708376907743514,1354170.547362241428345 5143809.956122267991304,1352779.165046815294772 5145845.369628426618874,1350274.365184477064759 5148795.402983117848635,1348851.924731121631339 5150125.175510711036623,1338183.95528942043893 5158857.3825694154948,1326866.325299449963495 5166056.155309634283185,1325320.208891821326688 5166681.604127373546362,1323928.826576395193115 5166764.041134925559163,1322197.140577616868541 5166514.783783937804401,1320496.401397276902571 5165639.961586920544505,1317868.036900156643242 5165266.047191426157951,1317249.657128799241036 5165223.786046592518687,1316724.006493274122477 5165390.733647421002388,1316136.462220866698772 5166181.901246403343976,1314126.366175612434745 5169595.810840096324682,1307540.037183336913586 5180848.011921763420105,1306797.981457709334791 5183433.074948986060917,1306544.061699211364612 5184332.35948512237519,1306395.895456966012716 5185017.578626218251884,1305282.811868521617725 5188314.319086527451873,1302870.852461503818631 5194659.284594492055476,1295233.110878689447418 5204895.12574138212949,1294583.78428889112547 5205605.760693510062993,1293872.564062213292345 5206275.208896695636213,1283977.485845089657232 5212464.275675216689706,1279895.734076172811911 5214682.254791825078428,1274754.777352356119081 5217195.035769269801676,1267650.590088913450018 5221128.716414152644575,1266228.260955046396703 5221840.721633467823267,1265084.007909181294963 5222091.436209564097226,1254013.95246673678048 5223850.243343479931355,1253395.461375888204202 5223934.234002343378961,1250303.45119961630553 5223724.93730207812041,1247551.299428731668741 5223138.237601600587368,1247334.894338629208505 5222594.091464896686375,1246932.697018394712359 5220248.997410544194281,1247025.537473715143278 5219160.013780177570879,1245077.446384834358469 5216188.065437851473689,1244768.312158899847418 5215812.155301850289106,1244366.337477647932246 5215560.401790638454258,1243871.411021578358486 5215769.66860228870064,1236388.514850455103442 5219537.11198577657342,1235522.560531574767083 5220039.631516434252262,1235213.203666660701856 5220416.915522176772356,1234316.636487809941173 5222259.387033171020448,1233790.87453279341571 5225442.573880292475224,1234069.284579269355163 5225861.549616342410445,1235398.773257813183591 5227327.507567701861262,1236233.669438761193305 5227830.441295086406171,1237223.299711914733052 5227621.058315231464803,1238150.925028695026413 5227160.673436434939504,1239326.013573509873822 5227034.116778525523841,1241737.972980527672917 5226992.635525181889534,1242665.598297307733446 5227453.012218613177538,1243253.142569712363183 5228249.522893417626619,1243716.899568358203396 5229171.477308727800846,1244644.524885138496757 5232525.126696899533272,1245324.798293377971277 5235251.145810292102396,1245541.426022459985688 5236508.981606354936957,1245634.155158292036504 5237138.037857012823224,1245479.421066089300439 5238312.005777490325272,1244737.254020970547572 5240284.8544487869367,1242108.889523850288242 5244480.681527711451054,1233450.682168929604813 5256158.021519499830902,1221607.624182416358963 5269280.997038608416915,1219783.209047803189605 5270964.369958871975541,1216907.381322650937364 5272985.603699072264135,1215546.834506174782291 5273743.07207756396383,1212207.361101868096739 5275343.855017091147602,1209207.857422442641109 5276564.29603,1198292.424752709688619 5285329.626087565906346,1198756.181751352734864 5287016.941038453020155,1199065.315977287245914 5288872.487807004712522,1199962.217114608734846 5294863.390536140650511,1199807.594341897172853 5296087.589000712148845,1199498.237476980313659 5297142.500170947983861,1198663.341296032303944 5298366.99646352045238,1195880.465345691889524 5300477.603128615766764,1195014.62234629993327 5301027.487799968570471,1194055.938891590107232 5301491.501863869838417,1189757.893352062208578 5303560.992627472616732,1188180.94144548359327 5304109.841755610890687,1178749.62022700579837 5305504.692949242889881,1172348.638186900410801 5318780.556692740879953,1172781.559686596272513 5321235.228965300135314,1173400.162096933228895 5330762.657925860956311,1173616.455867544515058 5334194.762092789635062,1173585.73168808594346 5335509.116886302828789,1173121.752050460316241 5339536.95071707572788,1172225.073552121175453 5346069.740550464950502,1171328.283734291093424 5349973.917030206881464,1170462.552054390311241 5352521.965257641859353,1160258.228291843784973 5372756.408133405260742,1155898.177795942174271 5379355.975739465095103,1154568.577797907171771 5380804.152923504821956,1152991.403252349002287 5382039.690444423817098,1150177.691803058842197 5383487.059747753664851,1149157.226030958117917 5384595.323452513664961,1148971.656439805636182 5385106.780062098056078,1146405.074260073481128 5393548.203246452845633,1146095.940034141764045 5394614.364878811873496,1145848.588125598384067 5395766.196948881261051,1145211.172721316572279 5402411.380398472771049,1143962.279354105703533 5417464.773698929697275,1144024.061671496834606 5418875.50736443605274,1144024.061671496834606 5421356.784633309580386,1143807.767900885548443 5424522.91005699057132,1143622.198309733066708 5427091.544705638661981,1143096.436354716541246 5433386.414165782742202,1142849.084446173161268 5434500.677478602156043,1141272.132539597339928 5441229.06421360000968,1139818.745267800753936 5446032.463010535575449,1139169.307358511257917 5447447.576143579557538,1137901.489677867153659 5449678.408129567280412,1136510.107362441020086 5451825.102187506854534,1133170.41131915175356 5456890.993654573336244,1126120.214008742012084 5465442.183322738856077,1125161.530554032418877 5466602.898962718434632,1123306.279920472064987 5468322.265889196656644,1120832.426876571960747 5470085.771911464631557,1118853.611608229810372 5471031.990547205321491,1116237.714894079603255 5472280.758308938704431,1111369.93620067066513 5473783.872010364197195,1081468.407778688473627 5483211.944635030813515,1075469.845697802957147 5487262.03327033855021,1043372.65163941681385 5509695.18218650482595,1039754.879508125479333 5513195.578483929857612,1038919.983327174559236 5513799.799361262470484,1027880.763383679906838 5519203.006595519371331,1027324.27724920201581 5519376.417850414291024,981342.982340607559308 5531535.25295789167285,975282.303983857156709 5532141.781189842149615,973921.757167381118052 5532097.821734223514795,973334.212894973577932 5531968.126987632364035,972406.587578193517402 5531492.543419234454632,961800.289134392049164 5525734.979049458168447,946091.884469064418226 5515830.859540457837284,945287.823787063360214 5515182.626233979128301,940587.803566280403174 5510084.256210665218532,939412.826340956846252 5508399.632279393263161,939319.985885636298917 5507752.081683677621186,939969.312475431943312 5506975.081543704494834,940154.882066584425047 5506456.807260926812887,940216.664383975439705 5505809.394329653121531,940062.041611263994128 5505247.200427022762597,936784.350524348206818 5494935.359381960704923,935021.717707125819288 5493080.607807430438697,934093.981070854468271 5492607.04509655945003,927538.710216511273757 5490019.878882913850248,925095.692671563941985 5489631.657537028193474,923116.877403221675195 5488813.684665060602129,921756.21926725434605 5487994.69892231374979,920364.614312848658301 5486529.426226388663054,916901.464954268769361 5481447.153078906238079,916375.702999252243899 5480542.331147252582014,908150.417144027655013 5464581.491353617049754,907841.282918096054345 5463421.031195510178804,907748.553782263887115 5462089.777179732918739,908088.634826639434323 5461014.549457357265055,908583.33864372363314 5460112.977297240868211,908985.31332497857511 5459081.745380172505975,908985.31332497857511 5458523.647880590520799,898100.938793175038882 5448906.468552299775183,884866.275852253311314 5441700.138175642117858,880969.982354997773655 5440714.491300228051841,865261.689009158522822 5436900.232531908899546,861705.587875766912475 5434114.641316646710038,861272.666376073728316 5433814.676318937912583,854408.038656816468574 5431415.770272734574974,853758.600747526739724 5431330.04603192396462,852552.565384273650125 5431415.770272734574974,847574.246436506160535 5432829.872741126455367,845162.287029488245025 5433258.109033377841115,843770.682075082673691 5433258.109033377841115,843183.249122166424058 5433129.959896800108254,838451.168888035812415 5431774.556455984711647,838019.24926375807263 5432786.387129276059568,836287.674584468011744 5437799.532530904747546,834741.446857348200865 5442172.471129544079304,834154.013904431951232 5444145.263422732241452,834030.337950161658227 5445259.593940312974155,834154.013904431951232 5446547.33329422865063,834339.583495584432967 5447147.022073629312217,835019.856903824023902 5447962.525617859326303,845842.449118236545473 5459984.453628581948578,852398.053931050584652 5466258.073714859783649,852707.299476476269774 5466731.515286680310965,857623.836106852861121 5476625.205139553174376,858087.704424987081438 5477743.482703793793917,858166.963902430958115 5479583.35151132568717,853696.707110647461377 5484461.131951802410185,852892.757748137577437 5485753.295859139412642,852521.729885323788039 5486701.133015509694815,852459.836248441599309 5487865.628858491778374,852954.651385019766167 5491916.690127269364893,847666.864252847037278 5493382.67011009901762,837153.406264365999959 5489631.657537028193474,831154.621544497902505 5486917.671189052052796,826330.702730462187901 5485064.542988886125386,825866.834412327967584 5484891.781309290789068,818569.2851933746133 5485753.295859139412642,818012.57641991705168 5485883.421841571107507,782730.531729935668409 5503736.73788,776607.959736303193495 5509523.043212020769715,765754.309383961139247 5523441.47423,765537.904293858679011 5523917.883894205093384,762940.486615179572254 5545921.989374942146242,762847.646159856230952 5549522.386100337840617,773763.190149083384313 5568891.892854604870081,775958.633146507665515 5572022.133211215026677,777040.881235999171622 5573110.518941170535982,782390.450685560121201 5581422.007276556454599,782761.478548373910598 5595015.136241452768445,780349.519141356111504 5597719.632858700118959,779545.569778849137947 5598373.781873165629804,776329.661009321454912 5599944.497992424294353,775278.359738268190995 5600423.681968959979713,773484.891422098851763 5601078.026639787480235,772155.180104572558776 5601296.204413988627493,770083.413061418570578 5599812.57372566126287,768599.190290672122501 5599376.452081390656531,767238.532154707587324 5599551.400765324011445,763404.354933313792571 5600554.358637172728777,761518.046161821228452 5601732.418674577958882,754220.385623379494064 5606664.187908839434385,751530.238808868336491 5608499.027238465845585,751066.370490731205791 5608848.023700808174908,741573.266954862512648 5627819.764427215792239,736908.312373682158068 5638877.157360182143748,737120.487323131761514 5639468.044683436863124,737738.978413980337791 5640344.194073245860636,738506.97158096334897 5641064.075980572029948,738913.955639304011129 5641396.190811677835882,743150.330180932185613 5644201.432871735654771,744603.71745272888802 5644815.556234005838633,745562.178268458810635 5645210.473432439379394,752612.486898359842598 5648060.16809159796685,753849.357760565704666 5648016.905216329731047,758796.841209380538203 5646175.110267776995897,759971.929754195385613 5645122.554714355617762,772495.372468436486088 5649815.490037723444402,786441.255636038724333 5656705.234768318012357,793151.260582584538497 5661755.27549668494612,793460.506128007429652 5662194.42680343799293,793615.240220210049301 5662896.765627984888852,796892.819987637456506 5681147.420140702277422,795594.166808040696196 5689559.370667011477053,789161.570032552350312 5696908.356797621585429,779545.569778849137947 5703141.078135533258319,779174.541916035348549 5703493.769818068481982,778092.182507049641572 5705878.298872189596295,775834.957192234462127 5715992.010152684524655,758549.48930083704181 5735901.1696185041219,758054.785483752959408 5736831.935233124531806,757838.2690741593251 5737895.330790909007192,756857.878318744129501 5745270.828688966110349,756941.590575820184313 5747823.664414085447788,757776.375437279930338 5752703.724473900161684,757961.945028429618105 5753369.278529448434711,759044.193117924034595 5754612.65290523506701,764733.843611857620999 5757275.420254977419972,765321.387884265044704 5757320.653597633354366,767671.564973891945556 5756387.74251137021929,769001.164971927064471 5756254.93410968221724,770578.228197996853851 5756698.755269134417176,772990.187605014652945 5757675.495579027570784,776236.931873489404097 5759363.42670333571732,777102.774872881360352 5759895.177825654856861,777844.830598509055562 5760650.331891181878746,778865.296370609663427 5762027.61805006954819,783472.587455563363619 5769448.937399193644524,786224.850545936380513 5765804.617287534289062,787894.531588344136253 5763849.456169717013836,789378.75435909058433 5762338.828264348208904,790306.490995361935347 5761716.57865209877491,790924.982086207717657 5761494.460009311325848,792316.364401633734815 5761272.506826262921095,799614.024940078146756 5761006.586070370860398,800232.516030923929065 5761006.586070370860398,801160.141347706899978 5761494.460009311325848,804870.753934318665415 5764026.365982461720705,811642.763837235164829 5767849.502521211281419,812137.467654322157614 5768026.492041511461139,812663.229609338566661 5768159.636573953554034,816961.275148866581731 5767627.230445208959281,821414.05478059721645 5766693.396474911831319,823021.953505614073947 5766915.485166182741523,827072.869775581057183 5769049.611826782114804,830226.884908229345456 5770916.913367445580661,838977.821398979285732 5777411.830715832300484,851315.694522067788057 5777322.601085154339671,851934.185612916364335 5777144.144516784697771,858180.544880307628773 5771272.298975272104144,861983.886602751445025 5769494.072722079232335,866498.559871364268474 5768115.62824435159564,873668.759592847898602 5767339.197155674919486,874497.199243332725018 5767386.722004764713347,875682.306542316218838 5772072.288830789737403,876826.448268689913675 5775942.779918514192104,877413.99254109733738 5776788.523642092011869,879702.164674353669398 5778923.744606571272016,880660.848129066172987 5779414.046482460573316,884989.951806523604318 5779414.046482460573316,887556.422666764468886 5779859.026912304572761,890339.409936596173793 5780704.983949757181108,891514.387161919847131 5781684.36936969961971,892194.660570156527683 5782485.45918957516551,907130.06269141822122 5804329.028831167146564,907284.57414463837631 5804910.085715529508889,908243.2575993508799 5808705.409745917655528,908305.039916741894558 5809375.181189171969891,908181.475281959981658 5810670.656085169874132,906573.465237451950088 5815629.527358345687389,906140.543737755855545 5816657.03570813126862,923951.66226468142122 5847866.014556093141437,924260.796490613021888 5848314.455828784033656,924631.935672918101773 5848674.258859932422638,930321.697486342978664 5852757.147801582701504,931218.264665193622932 5853340.272219540551305,938454.14288624713663 5854866.531655132770538,939134.416294483817182 5854912.105356306768954,940371.175837198388763 5854686.501682759262621,940835.155474823899567 5854373.316487493924797,941762.780791604076512 5853115.839877008460462,941948.350382756558247 5851859.835356808267534,942443.054199840757065 5841006.434300081804395,942412.107381399604492 5839526.940069970674813,941577.211200451594777 5834061.257762528955936,940371.175837198388763 5832314.695755726657808,939907.530158043722622 5831329.686754268594086,938979.793521772371605 5827793.844951007515192,938887.06438594032079 5827122.675267956219614,940031.094792822841555 5820278.080910610035062,940154.882066584425047 5819831.06327177491039,941824.563108994974755 5817819.683413408696651,958893.625910290051252 5799955.93660254497081,959326.547409986029379 5799644.687999539077282,967582.78008364897687 5796611.470668218098581,968603.245855752495117 5796522.047478867694736,970149.139624398667365 5796789.035370232537389,971107.823079108260572 5797280.326977665536106,971691.693808319163509 5797767.79226940125227,973736.187576228519902 5799778.308349657803774,981652.339205521624535 5796477.898122441023588,982518.182204910786822 5795853.248463023453951,983538.647977014188655 5794693.48517609667033,984528.055611182469875 5793489.89982680324465,984806.35433816711884 5793044.234372034668922,985239.275837860303 5791974.215310244821012,985548.521383285871707 5790146.591843887232244,985455.68092796264682 5789478.27416699193418,985177.27088148961775 5789078.045642017386854,982239.772158437757753 5786137.762547732330859,981497.71643280738499 5785424.530495824292302,981064.79493311420083 5778523.992386957630515,982579.964522301685065 5777811.372602418065071,990248.652923560119234 5773273.129402481950819,990743.468060135492124 5772294.672244289889932,993711.913601628388278 5764471.855215387418866,994794.161691120010801 5760650.331891181878746,994825.108509561046958 5759984.232462356798351,994763.214872678858228 5759363.42670333571732,996433.118554069078527 5755589.164013448171318,1001689.847548309597187 5753058.382221064530313,1005956.946269396459684 5754390.71173145249486,1011213.675263636978343 5763627.444139027968049,1011399.244854789460078 5764204.558994263410568,1011399.244854789460078 5764648.777425896376371,1010935.487856146413833 5766338.034122814424336,1010718.971446552895941 5766871.643010417930782,1009296.64231268572621 5768204.765342131257057,1005431.406953362515196 5769405.082730820402503,1004658.404409293783829 5770071.729086371138692,1003823.508228345657699 5771405.332113275304437,1001504.277957157115452 5776076.043274521827698,1001658.900729868444614 5776655.249581840820611,1003730.667773022432812 5783955.434123713523149,1005864.105814076028764 5789523.511554550379515,1011151.892946246080101 5799778.308349657803774,1016594.191531639080495 5806070.06399183999747,1017954.293070153100416 5807320.208165261894464,1019531.69025469373446 5807900.81863880995661,1021603.568617335986346 5808749.620170827023685,1021974.707799641066231 5809106.526970790699124,1022964.226753303431906 5810312.399774529971182,1028437.249518155003898 5817372.790195073001087,1028971.694393453770317 5818363.645895052701235,1032673.846698765759356 5827346.446524394676089,1034374.363240123377182 5832270.367180626839399,1034529.097332326113246 5832852.137008135206997,1034992.854330969159491 5836435.647314595989883,1034931.072013580938801 5837107.364886010996997,1033292.115150631871074 5847911.552022943273187,1033106.54555947938934 5848449.945459634065628,1032240.925199069781229 5849256.951331281103194,1030478.18106235913001 5849751.171959038823843,1030045.259562663035467 5850064.192708505317569,1029705.289837781572714 5851186.830285984091461,1029674.343019340536557 5852442.73875443264842,1032333.654334901832044 5858863.531711880117655,1033261.279651682008989 5860165.005625654943287,1034034.170876259449869 5860884.302576385438442,1034931.072013580938801 5861467.804299912415445,1035518.504966497188434 5861602.364515618421137,1042043.051641381811351 5862231.687285590916872,1043372.65163941681385 5862052.800414891913533,1052525.785450401250273 5856393.055900792591274,1052000.023495384724811 5848988.371822570450604,1052711.132402571383864 5842709.208854768425226,1052927.760131656192243 5842216.674272446893156,1059915.9524856954813 5831732.961380750872195,1062266.240894813556224 5829673.423972892574966,1062791.891530338674784 5829449.754830258898437,1066657.126889661885798 5828063.068261316977441,1071419.15206681843847 5827256.711796850897372,1079458.757011399138719 5828107.214579149149358,1080726.574692043242976 5828286.702248344197869,1081468.630417671054602 5829002.272423130460083,1087653.207367673981935 5835359.070643681101501,1092384.285726386588067 5837958.979595701210201,1096806.118539678864181 5839796.3605413492769,1102619.444987882860005 5841947.018412406556308,1103299.718396122334525 5841992.525285633280873,1106948.548665343085304 5841454.526439026929438,1107628.822073582792655 5841320.435260448604822,1111494.168752397177741 5838540.963643821887672,1112298.006795415654778 5837869.136813011951745,1112483.576386568369344 5837331.389643575996161,1112236.224478024756536 5836077.472626405768096,1111184.811887483112514 5834151.061745003797114,1111246.594204871216789 5833613.541321155615151,1112638.199159279698506 5827212.408632332459092,1119564.60919592785649 5816970.010244192555547,1120214.158424705965444 5816120.57970158662647,1120616.133105960907415 5815852.846599481999874,1121296.406514197587967 5815719.143983705900609,1121945.621784504735842 5815763.389510984532535,1127666.330416370648891 5816836.290717949159443,1128099.251916066743433 5817103.892712489701807,1128872.365779623854905 5817819.683413408696651,1132088.27454915153794 5821217.583891655318439,1132397.40877508604899 5821664.671735699288547,1132830.330274779116735 5823453.410602651536465,1132923.05941061116755 5824125.428588450886309,1130325.753051423234865 5843113.004470694810152,1123522.796330062905326 5848449.945459634065628,1123058.928011928685009 5848584.306723592802882,1120677.915423351805657 5849929.808856029063463,1119379.262243755161762 5850872.638866139575839,1118668.042017077328637 5851635.440765372477472,1118389.631970604415983 5852084.074112302623689,1118204.062379451701418 5852622.722826115787029,1118142.280062060803175 5853295.837715988978744,1118111.555882602231577 5860525.293595851399004,1118173.3382 5862007.027957756072283,1118791.829290841706097 5867309.807847258634865,1119039.181199382292107 5867805.043999289162457,1126460.295053117442876 5878870.817192661575973,1133355.980910304235294 5882247.789267834275961,1139169.307358511257917 5883509.442457898519933,1139756.740311427274719 5883328.824589560739696,1140096.932675291318446 5882968.897018011659384,1141426.755312308901921 5880626.485985483042896,1141488.537629699800164 5879951.436530011706054,1141364.750355938216671 5879276.276938788592815,1140684.588267189916223 5876936.147314792498946,1140499.018676037434489 5875586.343792392872274,1140529.854174987412989 5874956.063754633069038,1140746.370584581047297 5874416.044837267138064,1146776.213442378444597 5869873.523135174065828,1147209.13494207453914 5869558.501449602656066,1150734.177937533939257 5868838.494297962635756,1163257.509332286426798 5867175.322064250707626,1164127.025874872226268 5867716.02890782058239,1164989.306650558952242 5868344.656602023169398,1165638.52192086330615 5869199.137986212037504,1166133.448376929853112 5870951.740405191667378,1167215.696466424269602 5875496.115887394174933,1167308.536921744700521 5876170.984770490787923,1167370.319239135598764 5879501.378385384567082,1167339.261101203272119 5880176.393220584839582,1165607.797741404734552 5882832.874181524850428,1163010.15742374304682 5903483.850762403570116,1165652.548176704905927 5921100.829666555859149,1166009.661103168269619 5920382.762147471308708,1166380.800285473465919 5919975.394967852160335,1168607.078781847376376 5918482.366077532991767,1175626.551912798546255 5917398.285085798241198,1176244.820364664774388 5917487.64343505539,1179955.655590259004384 5918889.826470982283354,1184717.680767415324226 5920699.616414674557745,1185707.088401583489031 5921196.576460282318294,1187438.663080873666331 5921648.782552178017795,1188830.156715790741146 5921648.782552178017795,1189417.70098819816485 5921467.376217443495989,1189943.462943214690313 5921241.193521786481142,1197581.204526031855494 5915815.052161823026836,1198292.424752709688619 5915046.649550860747695,1198477.771704879822209 5913781.584807644598186,1198292.424752709688619 5913194.591840097680688,1201322.763931084889919 5909714.929498679935932,1206053.84228979726322 5907366.659082536585629,1212021.791510715615004 5904793.260868625715375,1226153.132949976250529 5905018.856075410731137,1226617.001268113264814 5905289.155395154841244,1232337.487260996829718 5913058.098843742161989,1232584.839169540442526 5913555.763559863902628,1235275.208623031154275 5922779.318738023750484,1235429.831395742716268 5923368.421558274887502,1235522.560531574767083 5924860.982305553741753,1235058.692213437519968 5926581.253746844828129,1235027.856714490568265 5927259.908403181470931,1235275.208623031154275 5927803.196016415022314,1235584.342848965665326 5928209.787591485306621,1236945.000984930200502 5929839.929153327830136,1237656.221211608033627 5930654.625035401433706,1242820.221070019295439 5935909.430494053289294,1243593.334933576406911 5936633.832732361741364,1245263.015975986840203 5937223.707934216596186,1278380.675806476501748 5944385.651184423826635,1293006.609743329929188 5944205.077841812744737,1294491.055153059074655 5944114.139518273063004,1303179.986687438329682 5941846.212676409631968,1303953.100550998235121 5941121.540710750035942,1305313.647367471596226 5938809.521506185643375,1306488.624592795269564 5938447.304117489606142,1308653.343410760862753 5938401.130639228969812,1309859.267454525455832 5938627.758288027718663,1344213.686827726662159 5951781.759280477650464,1351433.2010836340487 5955928.553575082682073,1356211.36758695426397 5957503.384859363548458,1356891.64099519373849 5957548.351520949043334,1360509.635765464743599 5956504.203788704238832,1361004.339582548709586 5956231.006341747008264,1361560.937036518007517 5955276.926172877661884,1361530.101537568029016 5953870.191901532933116,1360756.987674008123577 5952371.352891006506979,1358592.380175530910492 5948468.651897044852376,1357943.053585735382512 5947606.231817622669041,1356984.48145051416941 5946972.048166031949222,1356458.719495497643948 5946790.114734231494367,1352840.947364206425846 5946063.725377027876675,1351232.937319698277861 5945474.395034133456647,1350769.069001564057544 5945202.849461250938475,1350181.524729156633839 5944249.97592759039253,1349996.177776983706281 5943660.768167781643569,1350057.960094374604523 5942345.520582800731063,1350985.585411154897884 5936679.833734239451587,1353675.732225666055456 5930338.71352715138346,1356026.02063478413038 5927350.671258931048214,1356953.645951564190909 5926761.462782397866249,1361684.724310279591009 5923956.098117461428046,1369415.195028926013038 5916177.634063296020031,1377980.673248014645651 5897571.922480093315244,1379124.592335405992344 5895768.045488107018173,1380176.116245438810438 5894595.050855925306678,1381505.604923985432833 5893693.453481604345143,1384876.136466221651062 5891754.213365165516734,1389954.531636211555451 5890381.196063704788685,1397554.201953177107498 5887022.01578124333173,1401543.224586264695972 5886571.594767960719764,1412922.525574134895578 5886707.675595275126398,1416880.490069290157408 5883913.981606365181506,1417375.193886374356225 5883688.929068332538009,1418055.467294611036777 5883554.030026430264115,1418581.229249630356207 5883734.652531616389751,1419092.964948805049062 5884238.112806749530137,1419694.424157560104504 5884860.465314764529467,1420683.831791731296107 5885310.798456043936312,1421426.110156341223046 5885266.201956855133176,1423528.824017936363816 5884319.836620754562318,1427517.73533152975142 5882247.789267834275961,1427950.656831225845963 5881932.485370380803943,1475818.149191824486479 5870862.855327591300011,1494896.974079902982339 5871041.921630823984742,1508595.394019467756152 5870008.212113135494292,1509275.667427707230672 5869873.523135174065828,1515181.945650725625455 5868613.82788628898561,1527153.688968597678468 5865144.367665428668261,1527241.520046832505614 5864523.572789241559803,1527179.515090461820364 5863130.058490800671279,1526313.894730052212253 5859671.493280951865017,1524860.507458255626261 5854417.756432486698031,1524489.368275950662792 5853295.837715988978744,1523901.935323034413159 5852352.90966123342514,1523499.960641779471189 5852038.51505540497601,1520376.669688592664897 5852711.58526014816016,1504080.943389837164432 5842216.674272446893156,1496226.574077937984839 5836031.996287107467651,1489794.867858373792842 5828107.214579149149358,1489887.596994205843657 5827436.182164571247995,1493134.452582171885297 5815003.523469381034374,1493474.644946035929024 5814602.138507105410099,1493969.348763122688979 5814333.325347594916821,1494556.893035527318716 5814289.247848195955157,1497339.768985870759934 5815048.891574122942984,1497803.748623496154323 5815316.439426437951624,1498916.720892446348444 5817193.524297099560499,1501235.95116363489069 5817685.790094697847962,1501823.495436042547226 5817506.517843868583441,1508440.771246756194159 5815360.682936813682318,1520376.669688592664897 5810446.020605336874723,1521118.948053202824667 5809732.113247328437865,1521644.710008219350129 5808839.167054362595081,1521644.710008219350129 5808169.436218553222716,1521397.135460696183145 5807677.700247274711728,1519572.83164557418786 5804195.339728902094066,1519047.069690557662398 5803213.461623244918883,1513233.854561842046678 5797234.889387219212949,1510450.644653027877212 5794872.295518704690039,1509523.019336247816682 5794381.298037350177765,1508935.475063843186945 5794291.897372752428055,1507884.285112281097099 5793846.191549910232425,1507142.00674767093733 5793088.206127466633916,1505255.92061516083777 5790504.032555452547967,1500524.730936957290396 5782485.45918957516551,1500586.735893327742815 5782129.463760108686984,1503122.259935127571225 5778835.781549809500575,1504699.211841703392565 5777455.724974877201021,1507049.388931330293417 5775408.785544328391552,1507544.204067908460274 5775142.441037106327713,1509523.019336247816682 5775986.827080307528377,1509955.940835943911225 5776254.47835486382246,1510698.219200553838164 5777010.865113094449043,1511780.467290045460686 5778923.744606571272016,1512244.224288691300899 5779146.299843342043459,1514161.479878622107208 5779324.796704498119652,1516944.46714845392853 5779102.236988009884953,1517531.900101370178163 5778923.744606571272016,1517841.034327304456383 5778523.992386957630515,1518026.603918457170948 5777989.842596611008048,1518119.444373777601868 5776298.366886912845075,1517903.039283675141633 5772695.264635243453085,1517717.469692522659898 5771316.32295782212168,1516016.730512182461098 5766159.958293042145669,1515552.862194048240781 5765093.018077117390931,1515243.72796811372973 5764694.048322720453143,1513202.796423912514001 5763094.190074193291366,1512955.444515369134024 5762604.788901153020561,1512739.15074475784786 5762027.61805006954819,1511471.110425131395459 5757009.619079410098493,1511594.897698892978951 5755765.90944635309279,1513481.206470385659486 5750529.598205229267478,1513728.558378929039463 5750086.084850848652422,1515119.940694352146238 5749243.039231339469552,1524798.502501882379875 5745828.555422958917916,1534477.175628903554752 5741350.488490627147257,1534971.879445990547538 5741085.003159157931805,1535806.998265921138227 5740420.526800279505551,1540136.101943381363526 5735236.920443259179592,1549227.008159012766555 5722889.085833868011832,1549474.582706538727507 5722446.946490606293082,1549412.57775016524829 5721872.37322176899761,1543289.894437044393271 5714755.285961385816336,1541867.565303180133924 5714136.351848170161247,1539300.983123450772837 5714004.012727280147374,1536456.213536228286102 5714313.549367372877896,1526963.221319847973064 5715859.643524307757616,1534539.18058527703397 5716654.827380261383951,1535992.345218091038987 5717317.534706059843302,1536703.565444768872112 5718069.086846118792892,1536734.623582701198757 5718644.529269199818373,1529220.446634663036093 5731296.610033622011542,1528880.254270802019164 5731694.244267485104501,1520191.322736422764137 5740952.423003669828176,1517531.900101370178163 5743434.599971846677363,1517037.196284285979345 5743699.995792209170759,1511660.019601006759331 5745476.739755330607295,1508378.988929365295917 5746315.756891110911965,1506740.03206641622819 5745074.818549583666027,1506029.034478720743209 5744320.985903737135231,1505534.108022654196247 5742548.30229636002332,1505472.325705263298005 5741794.683575135655701,1505379.485249940073118 5739844.793744533322752,1505348.761070481268689 5739091.403803232125938,1505441.490206313319504 5738648.460050696507096,1506183.54593194113113 5737939.030324744991958,1506059.758658179547638 5736343.976766265928745,1502751.120752822607756 5733908.73006200324744,1495422.736034919507802 5728950.212082599289715,1494371.323444374836981 5728596.513294658623636,1490815.222310986137018 5728020.428552349098027,1490166.007040678989142 5728109.164844336919487,1489176.376767525449395 5728640.32657225523144,1489083.536312204785645 5729215.336051075719297,1489609.298267221311107 5729260.26769726537168,1490258.513537528458983 5729127.704059341922402,1490784.275492544984445 5729304.084237006492913,1492361.450038103153929 5729880.251936238259077,1492732.366581425769255 5730189.065108028240502,1494309.541126986732706 5731517.976161592639983,1494680.457670309348032 5731871.790892866440117,1494866.027261461829767 5733244.629406725056469,1494835.191762512084097 5733908.73006200324744,1493258.017216953914613 5735946.134986658580601,1492917.936172578250989 5736300.285057056695223,1492423.232355494052172 5736565.46832615043968,1488112.607713504927233 5738373.485527486540377,1471303.475923211779445 5744675.309620556421578,1468675.111426091520116 5744853.115215347148478,1461748.367430972401053 5743877.781904123723507,1461222.939434426836669 5743699.995792209170759,1459893.116797412047163 5742857.554947594180703,1459583.982571477536112 5742459.422071952372789,1455193.096576629206538 5735236.920443259179592,1454945.74466808559373 5734750.484207047149539,1454883.739711715141311 5733997.524995472282171,1455316.661211408209056 5731783.01713805552572,1457852.185253208037466 5724702.930322032421827,1457110.129527580458671 5722446.946490606293082,1456739.212984257843345 5722137.127656619995832,1454234.413121916586533 5721872.37322176899761,1447245.9981288977433 5721252.945403352379799,1438526.008456586161628 5719396.193162002600729,1432001.461781701538712 5715771.188073347322643,1424765.583560648141429 5711530.013975550420582,1414530.535618642810732 5705524.241816928610206,1406861.735897893318906 5700935.323180567473173,1404542.728265689918771 5699699.410609594546258,1401234.090360330184922 5698024.006955681368709,1383175.619924864033237 5689824.280003686435521,1382649.857969847740605 5689647.725784155540168,1382000.420060560805723 5689779.546260248869658,1381814.96178889949806 5690308.433967448771,1381784.014970458578318 5690925.720653479918838,1382062.313697440316901 5692159.311038088984787,1382835.427561 5693658.094286494888365,1384567.00224029016681 5696788.49658642988652,1385711.143966663861647 5697979.073429070413113,1386113.118647918803617 5698288.055525898933411,1386638.769283444155008 5698641.826140682213008,1389823.73123453068547 5700626.408435072749853,1391524.470414870651439 5701023.790705783292651,1391740.986824461491778 5701067.468891063705087,1392050.121050396002829 5700096.910501285456121,1391957.391914563952014 5699744.193973142653704,1390905.868004530901089 5699390.538553238846362,1390596.733778599416837 5698949.560792960226536,1390689.574233919847757 5698508.445989167317748,1391184.278051006840542 5698244.390912932343781,1392575.883005412528291 5698244.390912932343781,1393101.533640937646851 5698420.162125693634152,1393998.212139276787639 5698949.560792960226536,1400120.784132906468585 5706628.730077524669468,1400677.381586875533685 5707555.175210346467793,1400553.705632602330297 5707996.577689937315881,1391710.040006020339206 5711573.584522604010999,1391122.495733615709469 5711573.584522604010999,1389267.245100055588409 5711043.437635013833642,1379743.194745745742694 5705833.484771220013499,1368425.564755775267258 5697185.708370835520327,1367157.747075131163001 5695509.505560465157032,1353459.438455054769292 5671072.988943821750581,1353053.010994167532772 5669679.273364440537989,1352748.106908885762095 5667994.915523500181735,1353768.572680986486375 5663160.88833929784596,1361808.288945058593526 5652666.802543873898685,1376125.311294963117689 5630358.714091095142066,1385226.792862222064286 5622818.169033823534846,1389761.948917139554396 5619291.300263643264771,1390287.599552664905787 5619509.918482333421707,1391091.437595683382824 5619640.714204238727689,1392730.394458632683381 5619465.375967753119767,1393565.290639583487064 5618985.180702562443912,1393905.483003447530791 5618591.25394815672189,1395420.541273143840954 5616580.339353838935494,1395853.462772839935496 5615400.341432969085872,1395822.515954398782924 5614657.493871530517936,1390287.599552664905787 5600685.037194169126451,1389421.756553275743499 5598591.737373092211783,1388679.700827648164704 5597108.707317903637886,1386453.199692291440442 5593532.692404269240797,1386144.065466357162222 5593096.716500352136791,1385510.100966289406642 5592560.328604126349092,1385061.706057374365628 5592312.546336263418198,1383299.184559646062553 5598198.855970585718751,1383391.9136954753194 5598809.85516042727977,1384133.969421102898195 5600293.164249338209629,1384876.136466221651062 5602561.707933638244867,1385092.65287581528537 5603827.545774286612868,1384876.136466221651062 5605006.032520085573196,1384133.969421102898195 5605703.769102424383163,1383577.483286627801135 5605878.840294533409178,1382124.207334322389215 5605966.377162630669773,1381691.174515137914568 5605703.769102424383163,1379403.002381881698966 5601514.230372644029558,1379155.650473338318989 5601034.831520568579435,1379186.597291779238731 5600380.647037318907678,1380021.493472727481276 5588738.42594544775784,1375475.873385676182806 5590700.00887639913708,1370033.46348079200834 5596715.733335105702281,1368085.483711399603635 5596760.163816282525659,1367621.72671275655739 5596497.823039858601987,1366786.830531805753708 5594405.492027342319489,1365209.655986247584224 5587606.285310071893036,1364684.005350722232834 5585122.596821637824178,1363632.815399160375819 5579419.340504639782012,1363168.835761534748599 5576894.81504534650594,1363045.271126752952114 5574719.77161415386945,1363261.564897364005446 5572196.554246256127954,1367003.235621908213943 5539418.591574959456921,1367992.643256079172716 5535605.736053942702711,1374795.488657945534214 5509955.02954685036093,1375568.602521505439654 5507277.603155229240656,1376836.420202152337879 5503694.002836186438799,1382093.149196390062571 5495797.664347818121314,1383608.318785577779636 5493771.050577757880092,1385525.574375511379912 5491441.790903420187533,1393565.290639583487064 5482479.661394861526787,1396595.629817955894396 5479164.730311054736376,1411716.490210878895596 5464065.610026260837913,1413510.069846542319283 5462948.997959485277534,1416045.593888339353725 5461874.907196897082031,1418272.095023695845157 5461144.324976924806833,1419721.363474333891645 5460955.617436963133514,1420962.241838207002729 5460843.47749740909785,1426064.459379224572331 5460112.977297240868211,1426620.945513699669391 5459940.684847366064787,1427579.517648920882493 5459468.830414902418852,1436361.512277603149414 5453799.965532219037414,1452657.461215338204056 5440756.933988732285798,1454110.625848155235872 5439385.285293327644467,1461130.09897910640575 5432486.311159324832261,1466209.38470502034761 5427460.796584993600845,1468675.111426091520116 5424652.172178206965327,1479219.516233013477176 5415968.519969736225903,1480827.526277521625161 5414728.59871931001544,1486857.36913532204926 5411308.750155470333993,1494587.617214988917112 5407249.659536902792752,1499256.913256310392171 5405328.096473288722336,1500493.895438007311895 5405242.4603635603562,1501390.573936346452683 5405583.779559140093625,1508007.849747060332447 5404474.230768864043057,1509213.885110316099599 5403534.823596091940999,1513883.069832149194553 5399138.049250357784331,1516356.922876046504825 5396662.575030981563032,1516604.274784589884803 5396321.584791301749647,1516820.679874692345038 5394528.827866432256997,1516635.221603031037375 5393974.77601421251893,1516140.295146964490414 5393078.504560767672956,1516016.730512182461098 5392482.317885842174292,1516573.32796614873223 5388644.488429551012814,1517006.249465844826773 5387024.149807943962514,1517686.522874081507325 5385576.228183223865926,1526375.677047443343326 5365483.024864223785698,1541558.431077245622873 5323902.234062903560698,1543166.329802265390754 5312943.911780398339033,1544093.955119045451283 5307912.977343989536166,1544712.557529382407665 5305208.701262459158897,1545392.830937621882185 5303180.512615978717804,1547062.511980029754341 5298789.079752064310014,1547959.190478368662298 5296973.207952031865716),(1391091.437595683382824 5453585.289285531267524,1392668.612141241552308 5456032.339174258522689,1392792.176776023581624 5456676.39981646835804,1392637.665322803426534 5462776.652309426106513,1392606.607184871099889 5463421.031195510178804,1392111.903367786901072 5463679.569022727198899,1390689.574233919847757 5463765.749915907159448,1388339.508463784120977 5463421.031195510178804,1387319.154011172009632 5463077.563113337382674,1386360.470556459389627 5462605.547529310919344,1385989.331374154426157 5462304.497489670291543,1382120.311152143403888 5458937.771847099997103,1381351.093470762483776 5458480.040692410431802,1380918.171971066389233 5457448.992007585242391,1380794.607336287386715 5454100.582523406483233,1381232.42689357791096 5452090.267730949446559,1381722.232653067447245 5450923.194803402759135,1382185.989651713287458 5450708.585703196935356,1386948.014828866813332 5449379.171511695720255,1387566.505919715389609 5449293.125406513921916,1388648.64268971583806 5449550.030257171019912,1390133.088099444750696 5450880.705203127115965,1390936.926142463227734 5452254.222979106940329,1391091.437595683382824 5453585.289285531267524)) +POLYGON ((1377944.717052487889305 5687847.00814144872129,1377454.911292998120189 5687268.62842885311693,1374269.838022420415655 5682292.490324959158897,1373249.59488930227235 5680355.545075224712491,1372383.751889910083264 5678287.206523188389838,1372198.182298757601529 5677714.196076676249504,1371857.989934893790632 5675822.903720771893859,1371053.929252895526588 5676879.063695115968585,1376001.524021201534197 5687225.176128564402461,1376836.420202152337879 5688546.442341073416173,1377393.128975607221946 5689163.60754800401628,1378073.402383846696466 5689427.394808987155557,1379310.161926558474079 5689604.103310342878103,1380609.037745134904981 5689427.394808987155557,1382897.209878391120583 5687974.044170440174639,1383237.40224225516431 5687665.57653837185353,1383391.9136954753194 5687136.84491257276386,1382804.480742559069768 5686960.185094306245446,1377944.717052487889305 5687847.00814144872129)) diff --git a/src/boost/libs/geometry/test/algorithms/buffer/data/nl.wkt b/src/boost/libs/geometry/test/algorithms/buffer/data/nl.wkt new file mode 100644 index 000000000..e9bd976db --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/data/nl.wkt @@ -0,0 +1,8 @@ +POLYGON ((471871.966884626832325 6683515.683521211147308,470695.876464393688366 6681756.129975977353752,469211.542374156008009 6679924.978601523675025,464542.357652322971262 6674631.078279769048095,463243.59315323777264 6673494.345109832473099,459502.033748187706806 6670774.304660517722368,452204.484529234410729 6666030.372161027044058,439990.287360413349234 6659313.515823394991457,434547.988775020290632 6657783.034025833010674,433867.715366783668287 6657685.311832630075514,433063.65468478546245 6657783.034025833010674,423725.285241116478574 6659758.338574352674186,422581.143514745577704 6660350.880751021206379,422333.791606202081311 6660844.461689073592424,421993.599242338153999 6662622.453031159006059,421993.599242338153999 6663363.130126810632646,422612.090333183819894 6667314.244697011075914,422241.062470370030496 6667759.324870104901493,421096.80942450783914 6668303.522556710988283,408449.802075482031796 6673245.655735924839973,401646.845354124438018 6675273.665065255947411,400842.895991614612285 6675372.844085373915732,400255.351719210040756 6675224.699206517077982,392370.258227849320974 6672455.311684883199632,391968.283546594379004 6672009.975794731639326,391875.554410762328189 6671219.573235900141299,391937.336728153284639 6670527.121663697995245,392122.906319305824582 6669933.841785561293364,392339.311409408226609 6667957.501854715868831,392308.475910458364524 6665733.178529324010015,391937.336728153284639 6665289.631341196596622,387793.802641845482867 6664449.731981083750725,385814.7647345236619 6664202.740090588107705,384268.648326894966885 6664300.5401631873101,382846.319193030707538 6664646.406163938343525,382289.610419573145919 6664943.560305980034173,377186.502322628628463 6668957.888622742146254,376352.608017096004914 6669834.728738470934331,376197.985244384559337 6670428.001423852518201,375548.658654586179182 6676313.056885857135057,375243.086652359867003 6687692.866469252854586,379228.324422756850254 6689778.692146780900657,391782.713955441897269 6694388.125634397380054,393885.427817036863416 6694487.537080916576087,395215.139134563156404 6694091.147844122722745,405171.999669074953999 6689084.665672835893929,414263.128523688821588 6684478.40333267301321,415778.298112876422238 6683439.398042757064104,416396.677884233708028 6683192.009851422160864,419025.042381353967357 6682597.809754087589681,429909.63955213711597 6681508.792763692326844,430497.183824544539675 6681656.873437026515603,440979.806314075656701 6686955.330480101518333,467325.344922157470137 6687797.546342735178769,468129.294284664443694 6687698.216345063410699,468747.785375512961764 6687450.699095219373703,469211.542374156008009 6687054.651439971290529,469489.952420631831046 6686707.835750493220985,471871.966884626832325 6683515.683521211147308)) +POLYGON ((651775.618594615836628 6910615.531329743564129,641076.47969549393747 6910570.804219521582127,632170.920432032668032 6910671.440567950718105,630593.857205962878652 6910875.650077483616769,623605.55353243520949 6919587.805025231093168,623327.25480545067694 6920097.437898073345423,623265.361168571282178 6920811.565646826289594,622863.386487316340208 6935201.449006372131407,623079.791577418800443 6937551.666144162416458,623296.307987009524368 6938317.750503590330482,625522.697802874958143 6942304.410853908397257,629975.477434605592862 6949464.147566119208932,631026.890025150147267 6950948.190662933513522,631954.515341930207796 6951715.74194479547441,636564.032816697261296 6953092.028148499317467,636128.996246676309966 6953506.858369459398091,629109.634435216430575 6956271.529448029585183,628491.254663859144785 6956323.702235525473952,622832.439668875304051 6954991.835633082315326,622152.166260635829531 6953865.314060490578413,621904.814352095127106 6953200.386877841316164,621564.733307722490281 6952739.135313027538359,620575.103034568834119 6951971.670147938653827,619307.396673416020349 6951766.41102575045079,603197.017326830653474 6955606.402309623546898,602516.632599102682434 6955862.270618843846023,600908.733874083030969 6956886.194421971216798,598249.42255852452945 6959396.044058399274945,597630.931467676069587 6960421.895862255245447,597043.498514759819955 6962162.935771110467613,597321.79724174446892 6962880.823850900866091,598002.070649981033057 6963905.646472387947142,600414.030056998948567 6965700.786434393376112,601558.171783372759819 6966161.309305724687874,602547.579417543835007 6966879.556432018056512,602640.308553373091854 6967700.700297676026821,603197.017326830653474 6973651.159239649772644,603413.422416932997294 6976422.804836014285684,602392.956644832389429 6988342.651874950155616,601990.981963577447459 6989473.858503223396838,598404.045331235975027 6996058.252481586299837,597136.22765059187077 6996007.301794677041471,594353.35170025145635 6995132.482933780178428,590333.382248722715303 6992765.469048694707453,588818.212659535231069 6991736.752791685052216,585880.602616992080584 6989524.767496313899755,578673.222185580991209 6982131.554157050326467,567760.23854464374017 6973394.536373405717313,566801.666409425321035 6961906.681384002789855,570636.066269798669964 6950231.556555071845651,578088.238261463469826 6937704.509299132972956,578552.106579597690143 6938062.442223727703094,579108.70403356407769 6938267.350385984405875,580654.70912170142401 6938267.350385984405875,582293.665984650608152 6938010.57222749479115,587581.341797332162969 6937040.922623857855797,588447.184796721325256 6936172.347171620465815,588941.888613808318041 6935201.449006372131407,589158.405023399158381 6934640.477947434410453,589498.486067774705589 6933414.605105147697031,590457.058202995918691 6928972.662642612121999,590240.541793402284384 6928207.287246040068567,585017.876563346129842 6926152.746073319576681,583499.590028415317647 6920454.585592744871974,582231.77234777121339 6919180.415641265921295,578490.21294271829538 6916274.604389509186149,575274.304173190612346 6914644.192939248867333,572986.132039934396744 6913727.79363471083343,572398.587767526973039 6913523.511554286815226,571625.473903969861567 6913523.511554286815226,571409.068813867401332 6914134.90628450922668,568440.51195288321469 6917090.576447782106698,567883.914498916943558 6917447.406852015294135,562812.755095828906633 6917192.578789404593408,562163.317186542088166 6917038.658487668260932,561142.962733929976821 6916428.510036098770797,560308.066552979056723 6915612.605292757041752,559813.362735894857906 6914237.054455798119307,559720.522280574426986 6912963.871302771382034,559782.304597962531261 6912250.441571875475347,561328.532325082458556 6904563.504942306317389,561915.965277998708189 6902783.287589466199279,564142.46641335519962 6898612.494178399443626,566306.96259233832825 6894292.940797603689134,566832.613227863563225 6892413.307839044369757,566925.34236369561404 6891092.01116908621043,566647.154956202255562 6878858.980998607352376,565286.496820237720385 6875715.472913923673332,561759.227434962289408 6873256.105032159946859,559751.469099012669176 6868368.06827775016427,559102.031189725850709 6868266.50125537533313,558421.757781489286572 6868368.06827775016427,547846.51747561735101 6870242.091181426309049,546393.130203820648603 6870647.189855287782848,542741.182988856686279 6875623.668803266249597,537204.374155780300498 6877465.974288232624531,524666.125949261826463 6880262.455467365682125,519691.035266728780698 6884805.796635908074677,509843.267833192367107 6885861.807772698812187,509781.374196313030552 6886572.898058867082,510801.839968413638417 6889111.113103160634637,511883.976738413970452 6893581.167424697428942,514543.399373466556426 6908737.390477580018342,515625.647462958120741 6915612.605292757041752,516089.404461603960954 6918925.716031574644148,516058.568962654098868 6924125.539233602583408,518099.389187366934493 6937193.756036232225597,526541.191452185274102 6973394.536373405717313,527004.948450828203931 6974780.286891556344926,527808.897813338087872 6975703.699679739773273,528736.634449609438889 6976063.336574338376522,531426.892583609092981 6976475.109277882613242,533560.553263645153493 6976576.57717508263886,533900.634308017906733 6976422.804836014285684,535384.85707876435481 6974420.892511567100883,535446.639396155369468 6972368.496757010929286,535168.45198866201099 6971752.6406673733145,534982.88239750941284 6970983.34901758749038,535106.558351782616228 6969598.25660895742476,535292.127942935097963 6968982.613911346532404,535817.778578460332938 6967904.891698936931789,537271.054530765744857 6966726.155135438777506,538353.413939748541452 6966059.97354016173631,541290.912662803195417 6964520.898361743427813,542404.107570735854097 6964008.43121213465929,544074.011252123280428 6963804.339287329465151,545991.155522565823048 6964161.780380129814148,549083.388337823096663 6964982.645179284736514,550258.365563143976033 6965444.603228171356022,566152.339819626882672 6974729.471795010380447,568069.484090069425292 6976166.277760792523623,576665.797808107919991 6983562.477738646790385,577103.172087433398701 6984021.071227142587304,581582.445757972891442 6989010.694141771644354,584056.187482381705195 6991686.014863005839288,584952.977300211903639 6992508.231254843063653,590178.759476011269726 6996471.057679757475853,593023.640382725163363 6997705.153901337645948,596765.199787778081372 6998632.704716780222952,598744.237695099902339 6999970.569348660297692,599579.022556559648365 7000898.19824477378279,599857.432603032561019 7001516.306643777526915,601403.437691170023754 7005482.31315781455487,602362.121145882527344 7008987.081130541861057,603011.447735678055324 7013215.818960219621658,602795.042645575711504 7014505.064065941609442,602825.878144525573589 7015278.748407906852663,605856.217322900774889 7022297.152813855558634,607649.796958561288193 7024931.230772349983454,608484.581820020917803 7025809.32644284516573,620420.591581348679028 7036459.062683599069715,621843.032034704228863 7037699.555328891612589,623296.307987009524368 7038735.527002183720469,655764.52990821225103 7054013.049992605112493,665876.124534929520451 7057124.955283883027732,678213.997658018139191 7059354.494095638394356,687119.556921482319012 7059873.128965702839196,688325.369645752944052 7059925.797418337315321,688765.749551333254203 7059653.680838636122644,689593.298645888222381 7059199.115663656964898,700972.599633758421987 7057694.604557750746608,718288.90302410570439 7062053.55874643381685,745562.178268458810635 7068905.082907687872648,748190.542765579069965 7069425.837881463579834,750509.773036764934659 7069632.653463661670685,754467.737531920196488 7068385.857831250876188,763095.109387891017832 7064699.345445416867733,763960.952387280180119 7064284.481631927192211,764672.061294466722757 7063661.479123589582741,764919.413203010219149 7063297.865574918687344,764857.519566130824387 7061481.915560700930655,764950.360021451255307 7060340.433603593148291,768290.056064740521833 7048053.600529603660107,772526.319286877522245 7043288.733632164075971,773144.699058234808035 7042668.679420317523181,787956.4252252234146 7031442.636537296697497,789100.566951597225852 7030667.566429600119591,790491.94926702324301 7030098.175257831811905,800417.974302588030696 7027566.180380370467901,801624.009665841120295 7027462.573641837574542,802087.766664487076923 7027669.602455112151802,802431.409932565060444 7028037.170917252078652,802304.283074077800848 7015639.987778211012483,802798.986891164793633 6985926.763937522657216,802644.47543794172816 6983356.405981163494289,801531.169210520689376 6977552.50908828061074,801252.981803027330898 6976525.750653848983347,800758.166666451958008 6975089.064843827858567,799242.997077264357358 6970829.684263568371534,794048.050400414853357 6962471.04226852580905,789373.967620987328701 6952886.740292699076235,787801.802452512085438 6950589.865589384920895,786997.853090002201498 6948850.052315478213131,786688.607544579426758 6945934.755589783191681,786533.984771867981181 6943479.739347828552127,786441.255636038724333 6940310.832676274701953,786503.037953426828608 6937296.198354857042432,786317.579681765520945 6931626.505381292663515,785791.817726749111898 6921066.508683867752552,785389.843045494169928 6918873.786195711232722,784987.868364239227958 6917345.21780888363719,784585.893682987196371 6916478.773067839443684,784060.243047459167428 6915765.214261484332383,783225.235547019867226 6915357.83548819553107,782668.749412544770166 6915307.579476804472506,782019.422822746331804 6915307.579476804472506,770361.823107894393615 6916478.773067839443684,769990.683925589430146 6916784.026854607276618,769557.762425893335603 6917600.050719144754112,768722.866244945325889 6918619.096319805830717,768351.838382131536491 6918873.786195711232722,767516.942201180616394 6919078.20452397223562,754931.605850057327189 6919281.343515948392451,753416.436260869726539 6918925.716031574644148,752148.618580225622281 6918364.231043037958443,748159.707266629207879 6914746.347592758946121,747947.087039214675315 6914259.428196498192847,748747.140219545457512 6913218.565124199725688,749118.279401850420982 6912300.861791249364614,752612.486898359842598 6903342.218692814931273,752457.864125648513436 6902885.291445909999311,752086.724943343433551 6902631.1083012111485,748345.276857781806029 6901918.595977255143225,744758.22890594904311 6900545.388899485580623,744603.71745272888802 6900036.995631285011768,746118.775722425198182 6889314.775330664590001,746458.968086289125495 6888451.348726056516171,751777.590717411832884 6884237.738637372851372,753014.461579614784569 6883577.095073698088527,773237.53951355535537 6879062.383805339224637,773763.190149083384313 6879164.087136859074235,774134.21801189717371 6879417.529398015700281,775432.98251098243054 6880635.186092871241271,776329.661009321454912 6881649.553733525797725,777442.967236745287664 6883730.375623905099928,777844.830598509055562 6883932.440025738440454,778215.969780814019032 6883678.85549449827522,785791.817726749111898 6872521.743362235836685,786132.01009061303921 6871610.133388453163207,786533.984771867981181 6870190.657328464090824,787152.475862716441043 6865278.779280195012689,786997.853090002201498 6864164.956917324103415,785705.656440874328837 6861406.672263115644455,783472.698775054537691 6856877.968839676119387,782823.372185256099328 6854348.619862906634808,782452.344322442309931 6852175.466523764654994,782359.503867119085044 6850961.922468082979321,782359.503867119085044 6850355.309895443730056,782730.531729935668409 6848889.730106042698026,785146.832597091794014 6843230.573374897241592,783936.567093188758008 6842122.70097856875509,775309.306556709227152 6834603.368340478278697,768568.243472233880311 6831475.797690022736788,768228.162427858333103 6831173.943298545666039,765599.797930738073774 6827543.680441894568503,765445.175158026628196 6827039.87337779533118,765290.552385315182619 6825326.583949914202094,764981.306839892407879 6823714.664112947881222,764610.167657587327994 6822858.23583247512579,763713.489159248303622 6821902.363806513138115,762816.810660906368867 6821549.742302386090159,761703.615752973710187 6821448.763039967976511,752456.083013794384897 6820866.479953240603209,749891.281945919152349 6813998.452031110413373,749025.550266018370166 6806505.417759709991515,756354.046303412760608 6801983.881148537620902,757034.31971164944116 6801430.485762349329889,759879.200618363334797 6798066.077498474158347,760312.122118059312925 6796056.922751138918102,760404.739934397279285 6794952.606078728102148,760188.334844297729433 6793899.38985523302108,755766.502031005336903 6787127.314730651676655,754405.955214532092214 6785923.677891809493303,751004.476853851811029 6783165.807122839614749,748561.681947884149849 6781712.175924683921039,748128.760448188171722 6781662.745861535891891,746056.993405034183525 6782715.635300729423761,745129.256768762832507 6783666.889495360665023,744912.962998151662759 6784068.932611936703324,744232.578270423808135 6784619.699097042903304,743181.165679882047698 6784570.07083138730377,734121.094963197712786 6781362.744317370466888,726637.864833603496663 6777454.89918074849993,719433.044750479515642 6773698.881650594994426,707002.331172067555599 6772697.979166365228593,688201.693691482651047 6781211.214384685270488,681677.147016598028131 6779909.436419078148901,668257.025804015109316 6769444.36770489718765,663742.463854893459938 6765443.416698913089931,663989.815763436956331 6765042.475906951352954,665845.066396997193806 6761392.431272137910128,666216.205579302273691 6760542.567708348855376,666432.610669404617511 6758093.88185746781528,666339.881533572566696 6757544.913390408270061,665783.284079606295563 6756895.984118143096566,662579.509134577703662 6754603.384045966900885,671132.853529167245142 6747259.51691164355725,678275.779975409037434 6729414.292051946744323,678399.455929682240821 6728916.545924234203994,682543.101335478480905 6723193.129806969314814,683130.534288394614123 6722595.828769395127892,685573.329194362391718 6720655.932496306486428,690428.194826839142479 6713248.359249284490943,691015.739099246566184 6712006.607999907806516,692623.637824263423681 6704657.283376707695425,692654.473323213285767 6704110.657425539568067,692716.366960095474496 6686063.100847483612597,692654.473323213285767 6685518.967087414115667,683841.754515072447248 6673691.236981774680316,676698.716749342158437 6664300.5401631873101,676420.418022357509471 6663905.790672333911061,675956.661023714463226 6659954.899998827837408,675894.767386832274497 6659412.501455130986869,675863.820568391238339 6658820.027227970771492,676234.848431205027737 6654970.700426151044667,676451.364840798662044 6653392.195125944912434,676760.610386221436784 6652454.613303555175662,677224.478704358567484 6651714.922815941274166,677966.645749477436766 6651221.892127034254372,678770.595111984410323 6644517.349501308053732,668257.025804015109316 6636194.175751654431224,657929.02608719537966 6632355.287225363776088,657557.998224381590262 6632602.737515078857541,657063.183087806217372 6632453.947612538002431,653105.218592650955543 6629797.616577193140984,652857.755364619079046 6629453.041968816891313,652795.973047228064388 6629011.455181543715298,653383.517319635488093 6624634.586756318807602,655857.259044044301845 6616478.640488278120756,656815.83117926272098 6616331.556941458024085,657681.67417865479365 6616675.580997887998819,660402.879131095483899 6618148.541728066280484,661763.425947571638972 6618639.587373713031411,662227.294265705859289 6618639.587373713031411,669865.035848523140885 6617804.455944258719683,670761.714346864959225 6617461.975834362208843,671070.95989228785038 6617166.538544823415577,676853.339522053604014 6606419.037251188419759,676977.015476323897019 6606025.652477322146297,677348.154658628976904 6598966.114496985450387,677286.372341237962246 6598427.734061955474317,675894.767386832274497 6595537.452529109083116,675461.957206627586856 6594753.153016392141581,675121.764842763543129 6594508.427381386049092,674688.843343067565002 6594361.736543165519834,674194.139525983482599 6594508.427381386049092,673668.377570966957137 6595145.998728960752487,673049.997799609671347 6595145.998728960752487,670823.607983744353987 6594410.221807206049562,669462.949847776908427 6593332.858471809886396,669401.167530388804153 6592794.846682395786047,668813.623257981380448 6586382.312027862295508,669230.292112019611523 6578469.565867424942553,659722.605722858803347 6578264.212123840115964,656664.547991276951507 6577873.403077592141926,653507.193273905781098 6579095.160888321697712,645374.747874004417099 6580611.216105410829186,639252.064560883562081 6578998.546908744610846,638664.631607967312448 6578850.900411964394152,634366.363429456832819 6578558.078957350924611,633620.634160632733256 6579048.173620061948895,634675.608974879723974 6581490.810956662520766,635140.033890470163897 6582813.812666072510183,635077.694975625840016 6583496.258340136148036,634737.502611761912704 6587019.253929817117751,633846.501407453091815 6587544.732879367657006,632696.682387049077079 6587997.661707130260766,629573.502753353444859 6589955.002541372552514,629140.692573148757219 6590346.209386374801397,627934.657209892757237 6592991.220433191396296,627625.411664469866082 6594215.048321127891541,627563.629347078967839 6594851.362685392610729,627718.140800301916897 6596370.323665414005518,627903.710391454515047 6597104.865034353919327,628955.122981996159069 6599554.280731073580682,629789.907843455905095 6600142.489045863039792,640983.750559661886655 6614221.05678747035563,641664.023967901361175 6619524.675407296046615,643086.46442125691101 6625864.554084338247776,647662.920007260749117 6641660.802050296217203,651033.340230008587241 6645996.561992342583835,651373.532593872514553 6646489.455612326040864,651787.975058094598353 6647575.061716639436781,651775.618594615836628 6648066.630606294609606,651126.737282782443799 6649002.29017847776413,649487.335141871124506 6650680.249494910240173,640550.940379459992982 6654970.700426151044667,628367.578709588735364 6657388.598869441077113,619864.105446873581968 6660428.195207690820098,618688.905582567444071 6668105.337185661308467,618194.201765483361669 6669143.817844766192138,617854.120721107814461 6669637.929732556454837,614576.318314700736664 6672949.623776196502149,613463.123406768077984 6673543.122581887058914,612751.903180090361275 6673691.236981774680316,611947.953817580477335 6673839.176038899458945,610680.136136936373077 6673642.280603107064962,609535.99441056267824 6672208.255844502709806,608670.151411173515953 6671466.777171560563147,602392.956644832389429 6668648.312504703179002,601805.523691916139796 6668500.467356356792152,601125.250283676665276 6668401.371683558449149,593301.827790215727873 6667808.246031130664051,583199.917959198937751 6667820.342945166863501,583190.455802480923012 6675372.844085373915732,583035.721710278186947 6676015.489202303811908,582602.911530076293275 6676412.248521762900054,581458.65848421130795 6677005.998856753110886,578985.02807929366827 6678044.008002767339349,578242.861034174798988 6678094.415716417133808,577655.316761767375283 6677944.796556040644646,575305.362311122938991 6677103.774120018817484,573851.975039326352999 6677350.978000446222723,572614.992857629316859 6677845.764428257010877,572182.071357936132699 6678242.434510445222259,565843.094274204107933 6689827.745338121429086,565348.279137625941075 6690868.991159215569496,565193.76768440566957 6691512.678448060527444,565131.874047526274808 6692158.022346547804773,565255.550001796684228 6692950.275396405719221,565503.013229828560725 6693595.554530601017177,566152.339819626882672 6694635.853357532992959,566554.314500881824642 6695082.603269991464913,567852.967680475790985 6697214.060236595571041,568100.430908510577865 6697809.325327101163566,568224.10686278087087 6698603.555868846364319,567296.370226509519853 6700587.32728680036962,565533.84872877842281 6704309.718664849177003,564760.846184709691443 6705153.549264686182141,561204.856370812165551 6707834.658026187680662,560555.418461522553116 6707934.233513563871384,559225.818463487434201 6706841.830017799511552,558483.651418368564919 6705848.944184473715723,558298.081827216083184 6705153.549264686182141,558019.783100234344602 6702026.524319423362613,557648.755237420555204 6700637.695787316188216,556597.453966367174871 6699099.453493699431419,555422.365421555237845 6697809.325327101163566,551649.859198061167262 6694140.226961788721383,549949.120017721084878 6692603.030695979483426,549485.251699586748146 6692255.979198729619384,548804.978291347273625 6692107.527743558399379,540239.611391749931499 6694934.100385319441557,537982.274757443461567 6697709.87339807394892,539311.986074969754554 6703317.319796664640307,539466.49752819002606 6706195.323383280076087,539404.71521080180537 6706841.830017799511552,537209.2722133747302 6708827.606974888592958,535106.558351782616228 6710119.479814188554883,533034.791308628744446 6710764.867113076150417,532230.841946118860506 6710864.47840621881187,530901.130628592567518 6710715.687839202582836,529571.530630557565019 6709622.911521073430777,523819.98649974167347 6704756.820061821490526,523046.872636184561998 6703862.463100403547287,519985.69795885955682 6700239.757390116341412,519707.399231874966063 6699644.314919441007078,519954.751140418462455 6698355.529079964384437,520202.103048961958848 6697859.676676279865205,520016.533457809418906 6697310.649490186013281,517697.414506111992523 6696520.650814447551966,517048.087916316464543 6696470.30772893037647,506163.490745530463755 6696966.075689535588026,505606.893291564134415 6697115.865310021676123,505081.24265603889944 6698156.61311623826623,504864.726246445265133 6699446.796214780770242,504864.726246445265133 6700190.820166668854654,505173.97179186809808 6701729.268326397053897,505761.516064275521785 6702870.118661225773394,505946.974335936829448 6703565.318852389231324,506503.571789903158788 6705749.394165238365531,506596.412245226441883 6706543.147232828661799,506441.789472515054513 6707139.09370874427259,506008.867972819018178 6707535.938862201757729,505359.430063532199711 6707635.510700548067689,499453.374479493359104 6706791.244431678205729,498927.723843968124129 6706543.147232828661799,489527.349443928571418 6701778.393419239670038,489125.374762676481623 6701331.455293647013605,489434.731627590605058 6695379.438650756143034,489960.270943624607753 6694288.715398989617825,491784.686078234983142 6692058.639273658394814,493856.453121388913132 6688589.376254479400814,494011.187213591590989 6687945.919433905743062,493330.802485863678157 6686014.070270576514304,492928.827804608794395 6685567.816408730112016,491877.526533558324445 6685072.74028184171766,490609.708852911368012 6684825.302607020363212,488476.048172878101468 6684776.27946191187948,485229.303904400556348 6685221.063865593634546,483899.592586877115536 6685667.120491985231638,476411.130441211920697 6688181.324582676403224,473371.440425609995145 6687922.735960659570992,467820.048739241552539 6693248.460823108442128,451524.099801503645722 6696966.075689535588026,437361.922863293089904 6698603.555868846364319,437238.246909022738691 6697809.325327101163566,436990.783680988010019 6697164.962625569663942,434888.06981939583784 6692355.364674746990204,434115.06727532716468 6691463.793541227467358,426322.702919798495714 6690521.834996420890093,425580.535874679626431 6690572.141398129984736,397750.663176360132638 6700290.302348867058754,394442.025271003250964 6702075.472559181042016,393359.777181508834474 6702721.652592265978456,384330.541963777155615 6713995.075210301205516,383279.129373235453386 6715386.002728635445237,383000.830646250862628 6715882.922369535081089,383031.777464691956993 6716628.44815225340426,383650.268555540533271 6717722.164530069567263,384423.271099609206431 6718618.04394091386348,385722.035598694405053 6719761.082120044156909,388010.207731947884895 6721552.13471569865942,390824.141820220625959 6723541.50101828482002,392277.529092017270159 6724536.366483209654689,395771.625269038253464 6726726.071965947747231,397286.906177714234218 6727622.942697529681027,398554.612538869958371 6727871.862005602568388,410980.316740196140017 6728175.987576616927981,426662.895283662423026 6729315.887540238909423,427157.599100746563636 6729315.887540238909423,430682.753415697079618 6728369.544241077266634,431115.563595901825465 6727970.249058127403259,433403.847048649389762 6725333.206342491321266,433929.609003665857017 6724287.728284727782011,434547.988775020290632 6722546.757108798250556,434455.259639191091992 6721900.435720023699105,434053.284957936150022 6721452.392647816799581,430280.778734442195855 6718567.38519386947155,427860.247726633329876 6719886.226348519325256,425302.237147695035674 6719015.448576989583671,430344.453483175602742 6717135.645112561993301,432625.055891059164423 6717920.842569227330387,436527.026682345021982 6719015.448576989583671,437330.976044851995539 6718866.509072133339942,437980.302634650375694 6718618.04394091386348,446020.018898722541053 6714740.249320256523788,449761.578303775459062 6712503.321566273458302,451493.264302553783637 6711212.322722436860204,452791.917482150602154 6709324.126813971437514,452977.487073303083889 6708728.020573273301125,454399.927526658633724 6704706.426112459041178,455946.043934287270531 6701530.270068481564522,457646.783114624558948 6700140.454425781965256,459254.681839644210413 6699198.922365704551339,461512.018473950622138 6698751.946991816163063,462223.238700628397055 6698703.018693890422583,471778.124553888104856 6698553.021361322142184,472365.668826292734593 6698703.018693890422583,473416.970097345998511 6699247.853638328611851,474697.366880448476877 6700205.822787902317941,476138.17504978668876 6700438.724161761812866,476663.825685311923735 6700686.814305482432246,477127.694003449054435 6701034.224633770994842,477467.775047821749467 6701579.393962631002069,477715.23827585647814 6702174.977733274921775,477962.590184397122357 6704557.747906730510294,477807.967411685734987 6705898.094103609211743,477653.34463897428941 6706493.993424595333636,476972.959911246376578 6708131.957925477996469,474994.033323412935715 6711708.98787375818938,474530.165005278657191 6712106.055609175004065,470840.480482936603948 6713548.719037894159555,469242.600512088334654 6713150.149903920479119,467974.671511952998117 6712901.680179470218718,454492.656662487832364 6715734.04013223387301,444783.148036519531161 6724436.587850103154778,444164.76826516224537 6725382.473957089707255,444257.49740099144401 6726030.326040482148528,444628.525263805291615 6726477.366876103915274,445618.044217467599083 6727125.30611277744174,449947.147894927940797 6729065.490169101394713,452204.484529234410729 6729962.618760659359396,454090.681981235800777 6730360.577594690024853,464171.329789509123657 6729116.214282694272697,466459.501922765455674 6728269.718608728609979,467077.993013613973744 6727970.249058127403259,468377.870707605790813 6726235.478004965931177,468500.433466969465371 6726328.290810784325004,468593.162602801516186 6727125.30611277744174,468191.076602055400144 6728269.718608728609979,467665.537286021397449 6729315.887540238909423,467139.775331004930194 6730360.577594690024853,466001.978815605980344 6731175.91620625089854,463738.408289815939497 6730858.59133658092469,462408.80829178087879 6730709.434995472431183,460831.745065711147618 6730809.290560748428106,460275.147611744818278 6731007.571132538840175,457894.135023168055341 6733547.997870199382305,457584.889477745222393 6734743.893964459188282,457093.859203854750376 6737262.163697628304362,456749.993296794302296 6736687.331080910749733,455976.879433237132616 6735790.71636797580868,455142.094571777503006 6734993.031220311298966,453750.600936860253569 6733947.566869896836579,452668.241527877398767 6733448.108686688356102,447473.406170519127045 6731655.871175682172179,446267.370807266037446 6731307.152481587603688,443051.573357229586691 6730758.735166290774941,441660.079722312337253 6730709.434995472431183,434578.935593461384997 6734145.923941204324365,434053.284957936150022 6734445.620878846384585,418777.690472810470965 6741572.370338529348373,413290.975410590937827 6741514.926574288867414,412376.819752196199261 6741921.708969135768712,411480.141253857174888 6742720.253640330396593,410521.569118635903578 6744165.481415218673646,410335.999527483421843 6744764.18873658683151,410274.105890604027081 6745413.586426031775773,410490.622300197661389 6747807.790705696679652,410676.191891347349156 6748506.839547562412918,411170.895708434341941 6749805.027319742366672,412253.143797925906256 6751202.091095076873899,413459.179161181848031 6752151.095711477100849,414510.48043223231798 6752650.266304742544889,420540.323290032742079 6754348.251149994321167,421220.596698269422632 6754448.397497565485537,424405.558649356011301 6754098.519945784471929,425781.467555560055189 6753661.104309195652604,431765.001505188643932 6753949.116395185701549,432507.168550307513215 6753949.116395185701549,440361.315223227138631 6752500.709635380655527,441783.755676585482433 6752100.227690063416958,442587.705039092455991 6751251.51568235643208,445772.66699017904466 6747858.452208904549479,452730.135164759645704 6742370.880695099011064,456873.669251067447476 6739229.532591589726508,457832.35270577709889 6740824.735579328611493,458203.380568590888288 6741273.846702259965241,459131.005885373859201 6741971.077149564400315,462625.213381883280817 6743168.212657215073705,463952.253031628497411 6743470.935613225214183,459440.251430796692148 6747259.51691164355725,451926.185802249819972 6755297.623429431580007,451585.993438385834452 6756495.285398138687015,448710.277032722136937 6761642.206949398852885,448370.195988349441905 6762092.65038232319057,447473.406170519127045 6762893.180459219031036,445865.507445502327755 6763842.112430988810956,444504.849309534940403 6764292.497952505014837,443113.466994108923245 6764542.542910403572023,440361.315223227138631 6764343.262396307662129,431272.746716903173365 6761590.019753465428948,430373.50787027424667 6765343.134634239599109,430280.778734442195855 6765992.919597920030355,430311.61423339205794 6766743.054722192697227,430558.966141935496125 6767392.95179845765233,432012.353413732140325 6768343.670853907242417,443422.601220043376088 6772396.867568836547434,444721.36571912857471 6772647.162421485409141,446020.018898722541053 6772447.682745578698814,447009.53785238484852 6771746.569530131295323,448339.137850419909228 6770545.213911932893097,452080.697255469975062 6774900.704509798437357,447133.213806655199733 6794250.988753986544907,446607.563171129964758 6796108.067231423221529,446638.398670079826843 6796811.291415024548769,446947.64421550265979 6797362.744317251257598,447628.028943230572622 6797965.391000369563699,449606.955531064013485 6797864.705754549242556,450225.446621909679379 6797613.811523754149675,451864.292165370425209 6797362.744317251257598,454183.522436556231696 6797212.541525310836732,456348.018615539360326 6797262.066566329449415,457646.783114624558948 6797513.130650509148836,459254.681839644210413 6798266.188852529972792,460646.175474558607675 6799370.957642260938883,461913.993155205564108 6800576.594967762008309,485600.331767214403953 6831223.676799517124891,486311.440674403740559 6832232.026064394041896,489805.759490404394455 6837427.337965262122452,490795.278444063907955 6839043.451185440644622,492093.931623660668265 6841213.068797083571553,493021.55694044084521 6842929.733256683684886,494444.108713287569117 6845909.181217420846224,500324.783453424344771 6859508.11005649343133,502916.635157564480323 6865633.317320908419788,505266.700927700148895 6871356.936847810633481,505699.62242739618523 6872724.986073872074485,506627.247744176303968 6876374.193557461723685,508513.55651566607412 6881751.289774001576006,509503.075469328439794 6883375.039597983472049,510336.524496898986399 6884004.972518337890506,518521.512696455756668 6882474.620797081850469,523964.033920828427654 6877745.286580849438906,539370.985405091196299 6874637.068852295167744,543904.805626119719818 6871020.022674607113004,546231.8282616607612 6868062.641690432094038,551298.86884359002579 6867874.103537785820663,555700.664148536976427 6865683.446066621690989,570728.795405627926812 6860065.317734476178885,582942.992574449046515 6856826.438155461102724,584334.486209363443777 6856726.473209341056645,584952.977300211903639 6856473.744048312306404,588818.212659535231069 6854855.409194731153548,589838.678431638632901 6854147.114423211663961,590271.599931334611028 6853793.081382708624005,593382.089143077726476 6850152.812618617899716,594198.617608048836701 6850102.780382162891328,597105.392151642008685 6849295.030145579017699,598373.209832286112942 6848941.028177227824926,599331.670648016151972 6848183.232419079169631,601960.035145136411302 6845807.896826192736626,603073.341372560244054 6845302.948558202013373,603846.343916628975421 6845201.671778611838818,604526.617324865655974 6845302.948558202013373,614916.510678564663976 6848030.626860643737018,615998.647448567906395 6848587.223648309707642,617173.847312871133909 6849850.07684785220772,618163.254947042209096 6851518.721625553444028,619214.556218092679046 6854095.783219169825315,620049.563718534889631 6856927.861052793450654,620915.295398432761431 6858699.41688181553036,621719.244760942645371 6859609.566708965227008,626141.188893723418005 6864417.927434918470681,626666.83952924865298 6864822.550974307581782,631243.295115252491087 6867557.026598610915244,633127.934094382217154 6868665.665205390192568,634830.231747591169551 6869634.02544180303812,636994.727926577092148 6870647.189855287782848,638137.979097023839131 6870968.583851937204599,638357.055854904465377 6871065.989560154266655,639313.958197762956843 6871508.525462773628533,640798.292288000578992 6872420.123930553905666,641942.545333865564317 6873123.093938153237104,642777.218875834019855 6873738.357098407112062,646795.407215508748777 6877538.448507283814251,647298.348674910143018 6878089.967661938630044,647839.138761183596216 6878718.208817130886018,651218.909821161068976 6883984.144481226801872,651497.319867634098046 6884593.295492532663047,654342.089454856701195 6892767.763182668946683,653714.247526781400666 6895324.58443112205714,650940.722413667826913 6903495.87662121001631,651064.398367938119918 6907057.022029438056052,651775.618594615836628 6910615.531329743564129)) +POLYGON ((624718.74844036786817 6867253.636315573006868,620915.295398432761431 6867202.22154681943357,620389.644762907526456 6866949.163567860610783,619492.966264568502083 6866139.540842087939382,617390.252402973477729 6864013.324219234287739,617266.465129212010652 6863202.720901956781745,617328.358766091288999 6862545.076839198358357,618843.528355278889649 6859255.293650598265231,618905.421992161078379 6858597.971687586046755,616586.191720972419716 6852782.216056739911437,616060.541085447184741 6851518.721625553444028,615565.837268363102339 6851164.622024189680815,614143.396815004758537 6850557.994202722795308,604310.212234763312154 6848030.626860643737018,602887.771781407762319 6848030.626860643737018,601619.954100763658062 6848535.74592808727175,600846.840237203752622 6849446.204271980561316,597754.60742194915656 6852276.64893630053848,596425.118743402534164 6853490.390911912545562,593394.66824553895276 6856220.840738679282367,590611.680975707364269 6857787.912969232536852,587612.177296282025054 6859255.293650598265231,584272.592572484049015 6860469.904891512356699,580190.952123058377765 6861836.105926984921098,578057.40276251360774 6861734.621235017664731,577438.911671665031463 6861583.216467522084713,576356.66358217340894 6861025.721633481793106,575057.899083088268526 6860824.231357043609023,574501.190309630706906 6860975.804043037816882,573975.650993596646003 6861330.152757038362324,573511.782675462425686 6861734.621235017664731,572831.509267222951166 6862696.681903212331235,572398.587767526973039 6863810.301253801211715,571687.367540849139914 6869177.732720479369164,571934.719449392636307 6869634.02544180303812,575320.501761871273629 6871644.975898801349103,576758.526943937176839 6873788.536328140646219,579201.433169396128505 6875462.147214124910533,589591.326523095136508 6882207.017270667478442,599115.265557913808152 6888197.621671507135034,602583.090335105662234 6889820.296779514290392,606821.691266550100408 6892769.043493457138538,607198.619062376674265 6895471.136501003988087,607464.227367408806458 6896223.515795066952705,609814.29313754721079 6899985.37089054659009,620420.591581348679028 6907210.751049702987075,628243.90275531844236 6909551.313650550320745,648683.385779361356981 6903952.838604759424925,649147.142778007197194 6903546.241897705942392,650043.932595837512054 6902223.11355740018189,651837.512231498025358 6899122.261683489196002,652486.727501805173233 6897443.720290059223771,652658.159517624881119 6895108.145999730564654,651837.512231498025358 6889669.094085128046572,650940.722413667826913 6887841.905434045009315,649116.307279057335109 6884339.507416386157274,645467.477009833673947 6878351.95706673245877,645127.395965460920706 6877794.760553145781159,644168.712510748533532 6877084.445710801519454,641633.077149460325018 6875563.80505657941103,640550.940379459992982 6875056.806178122758865,636840.216473356937058 6875158.458901119418442,633840.824113422888331 6874245.272934719920158,627718.140800301916897 6870698.626624670810997,626110.242075282381848 6869076.155485482886434,624718.74844036786817 6867253.636315573006868)) +POLYGON ((529169.555949305417016 6980891.171579005196691,527499.652267915196717 6981095.885235757566988,526293.728224150487222 6981712.461949429474771,525489.778861640719697 6982585.811323672533035,524964.128226115484722 6983716.202593334950507,524129.232045167358592 6986800.759420288726687,523943.66245401481865 6989627.882342561148107,524098.285226726264227 6991222.536963094957173,524747.611816521850415 6993382.947670524939895,525613.454815913806669 6995235.670258097350597,528025.414222931722179 6998940.923794481903315,540270.558210191084072 7016620.709887278266251,540981.778436868800782 7017445.501473945565522,542002.244208972202614 7017910.506082023493946,543146.385935343103483 7017548.977978130802512,543610.142933989060111 7017136.566155183129013,543888.441660973592661 7016671.792471358552575,546826.051703516743146 7009295.700681791640818,546826.051703516743146 7001258.971952266991138,546455.023840702837333 6999765.371052864938974,545836.532749854377471 6998580.440245276317,542867.975888870190829 6993536.861748124472797,540858.102482598507777 6990245.118266388773918,534859.206443239119835 6984282.290747075341642,532941.950853305403143 6982791.863197959028184,530406.426811508485116 6981198.891291120089591,529169.555949305417016 6980891.171579005196691)) +POLYGON ((544321.363160666776821 7022091.564807342365384,543579.196115547907539 7022297.152813855558634,543239.003751683980227 7022762.254849835298955,543362.679705954273231 7023640.297281604260206,543610.142933989060111 7024260.172107204794884,544692.391023480566218 7025809.32644284516573,546826.051703516743146 7027979.132663373835385,552670.324970161775127 7033251.73728009313345,555422.365421555237845 7035579.791402135044336,556844.805874910671264 7036665.208321936428547,557896.107145961141214 7037286.098368016071618,562689.079141558613628 7039562.613101799041033,565441.119592949165963 7040701.114828187972307,567049.01831796602346 7040546.286905073560774,567698.456227255635895 7040287.50183436833322,568255.053681221907027 7039925.14235998224467,568440.51195288321469 7039303.86003131698817,568162.324545389856212 7038682.812492519617081,551835.428789213648997 7027102.099661372601986,544321.363160666776821 7022091.564807342365384)) +POLYGON ((578923.13444241147954 7047898.629384644329548,577377.018034785636701 7047949.726636526174843,576078.253535700496286 7048467.617682208307087,575367.144628513953649 7049452.393762632273138,575212.521855799714103 7050074.28301886189729,575150.628218920319341 7050800.130723227746785,575397.980127461021766 7052458.393901550211012,575645.443355495692231 7053131.835597528144717,576634.850989666767418 7053805.33436681702733,580871.225531295058317 7056190.564999433234334,581984.420439227716997 7056708.993350408039987,616678.920856804586947 7066568.743981409817934,618565.229628297151066 7067036.44279860239476,620575.103034568834119 7067191.974648762494326,621131.700488535221666 7066828.3863256406039,621379.163716569892131 7066257.894661020487547,621131.700488535221666 7065271.033392799086869,620884.348579991725273 7064647.953481527045369,620513.320717177935876 7064076.310389488935471,620111.346035922993906 7063610.093876085244119,619059.933445381233469 7062987.144270327873528,595930.303606827161275 7053805.33436681702733,591261.007565502892248 7052044.168835401535034,580314.628077328787185 7048002.316121919080615,578923.13444241147954 7047898.629384644329548)) +POLYGON ((632727.517885998939164 7062053.55874643381685,630346.505297422176227 7062260.182387406006455,628955.122981996159069 7062779.007032842375338,627594.464846028829925 7064024.922457631677389,627068.81421050359495 7065115.726056921295822,627007.031893112580292 7065841.45415199175477,627099.761028944631107 7066309.11012776568532,629356.986343759926967 7070360.290713070891798,629789.907843455905095 7070828.212971966713667,630408.398934301570989 7070983.819131521508098,631057.725524100009352 7070724.040841515175998,631676.216614945675246 7069736.811271750368178,634428.257066339021549 7069061.960253968834877,636809.269654915784486 7068853.663713132962584,646209.532735461252742 7069268.766355936415493,651744.671776177594438 7069840.970446583814919,657341.59313428204041 7070360.290713070891798,660928.529766620718874 7070515.887699528597295,662505.481673199217767 7070204.696776681579649,662969.349991333438084 7069788.236187247559428,663031.243628215626813 7069061.960253968834877,662134.453810385428369 7068283.213466011919081,646920.752962141879834 7064596.74872830696404,645467.477009833673947 7064543.862413764931262,643117.411239698063582 7064907.533021925017238,642467.973330408334732 7065218.32947981916368,639932.337969120242633 7065581.844079240225255,638664.631607967312448 7065271.033392799086869,632727.517885998939164 7062053.55874643381685)) +POLYGON ((682944.964697242132388 7067347.509545885957778,682419.425381208071485 7067347.509545885957778,681986.503881512093358 7068230.302590296603739,680873.197654088260606 7070775.472153359092772,680966.038109411485493 7071347.597836940549314,681213.390017952187918 7071763.017973368056118,683068.640651515219361 7074413.352900328114629,684027.324106224928983 7075348.580324811860919,684491.192424362059683 7075557.047399014234543,685511.54687697137706 7075868.261131060309708,701683.819860436138697 7078155.860175435431302,702951.637541083036922 7078104.381006670184433,704930.675448404974304 7077531.767976427450776,705703.677992473705672 7076960.506457528099418,705889.136264134896919 7076545.001310390420258,705796.518447794136591 7076076.741859563626349,705487.272902371245436 7075764.022820981219411,698251.394681317731738 7073114.5463876593858,694046.078277618973516 7071607.396536909975111,693025.612505518365651 7071347.597836940549314,686068.144330937764607 7070724.040841515175998,684924.113924055243842 7069892.209034128114581,682944.964697242132388 7067347.509545885957778)) diff --git a/src/boost/libs/geometry/test/algorithms/buffer/data/no.wkt b/src/boost/libs/geometry/test/algorithms/buffer/data/no.wkt new file mode 100644 index 000000000..331fed69d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/data/no.wkt @@ -0,0 +1,95 @@ +POLYGON ((973334.212894973577932 8053884.146248292177916,972035.448395888437517 8053884.146248292177916,971478.962261413340457 8054532.742954319342971,971849.878804735955782 8056954.001087690703571,972252.076124973245896 8058134.837113064713776,972653.939486737013794 8059257.590725538320839,973427.053350296919234 8059906.440469287335873,974323.731848635943606 8060143.366520590148866,975313.362121789599769 8059611.250459576025605,975313.362121789599769 8056363.652912438847125,974911.164801552193239 8055241.333193119615316,974261.949531245045364 8054414.367739056237042,973334.212894973577932 8053884.146248292177916)) +POLYGON ((642622.707422611070797 8168508.759361777454615,641292.996105087571777 8168688.086103021167219,640891.021423832629807 8169766.727228626608849,640643.558195797959343 8170965.544597610831261,641571.29483206931036 8171505.658280909992754,642282.515058747143485 8171026.418760725297034,642993.735285427654162 8170245.885660168714821,643241.087193968356587 8169047.184162639081478,642622.707422611070797 8168508.759361777454615)) +POLYGON ((662752.833581742714159 8173844.87628058437258,661732.479129130486399 8174024.547566497698426,661794.372766012675129 8175523.848948497325182,662134.453810385428369 8176664.401431584730744,663340.377854147343896 8176905.06305546592921,663464.053808420430869 8176484.666408353485167,663680.570218014065176 8174385.198934731073678,662752.833581742714159 8173844.87628058437258)) +POLYGON ((636252.672200949513353 8197035.620977196842432,633902.606430810992606 8197696.782875221222639,618194.201765483361669 8207754.688487220555544,617637.604311516974121 8208658.279032220132649,619523.801763518364169 8211310.458211339078844,633284.226659456500784 8208357.142292996868491,635912.591156576760113 8206428.898080044426024,637334.920290441019461 8204861.985183708369732,638540.955653694225475 8201669.758200289681554,638788.307562237721868 8200465.766226581297815,638726.52524484670721 8198961.429616848006845,638231.71010827133432 8197997.704663413576782,637458.596244711428881 8197275.426180954091251,636252.672200949513353 8197035.620977196842432)) +POLYGON ((659939.010812961147167 8229720.160191170871258,657434.322270111297257 8230264.777509041130543,656877.72481614490971 8231232.697862201370299,657588.945042822626419 8233590.57342291995883,657156.023543129558675 8237461.481430970132351,657372.428633229108527 8238852.51390967797488,657867.132450315984897 8239881.252787824720144,661547.020857469178736 8242120.701780800707638,663680.570218014065176 8242908.820884956978261,666123.476443470222875 8243392.936655785888433,668689.947303711087443 8243695.497807884588838,669865.035848523140885 8243331.248828722164035,670885.501620626542717 8242847.355046395212412,672060.478845947305672 8241879.662159014493227,672617.076299913693219 8240970.276663227006793,673328.296526594203897 8240183.888642981648445,673730.159888357971795 8239095.198028516955674,674255.921843374380842 8238187.678507706150413,674503.273751915083267 8236976.227975433692336,674441.491434526978992 8235766.717224058695138,673823.000343678402714 8234921.222080203704536,673019.05098116863519 8234195.344563053920865,667329.289167743641883 8231049.89748075325042,666277.987896693171933 8230628.385664460249245,662660.104445910663344 8229902.927828874439001,659939.010812961147167 8229720.160191170871258)) +POLYGON ((574470.354810680844821 8211310.458211339078844,573882.810538276215084 8212214.698363776318729,571440.015632308553904 8224101.598424789495766,571192.552404273767024 8225310.949379506520927,571285.392859594314359 8228271.233170941472054,571903.883950442774221 8237521.378020780161023,572089.342222104081884 8238913.946661612018943,576418.445899564423598 8269049.81442712713033,577036.936990412999876 8269961.11941110342741,578242.861034174798988 8270204.605127209797502,579448.785077939624898 8269413.579235861077905,580160.005304617341608 8268624.168841223232448,581304.147030991036445 8266802.218379785306752,588385.291159842046909 8250177.80430403444916,588632.643068382632919 8248964.394318503327668,589220.298660281347111 8236190.263107877224684,589282.080977672245353 8233348.286932905204594,589220.298660281347111 8231837.059263065457344,588632.643068382632919 8227847.921390503644943,585540.410253128153272 8212395.299116335809231,584643.7317547891289 8212153.486124090850353,582571.964711635140702 8213119.048583812080324,581396.876166820293292 8213119.048583812080324,577778.992716040578671 8212395.299116335809231,574470.354810680844821 8211310.458211339078844)) +POLYGON ((573171.701631086878479 8307060.936651901341975,569028.056225290638395 8319285.840398147702217,564389.818321895902045 8349505.106222408823669,564296.977866575471126 8350919.12982542347163,564482.54745772795286 8352270.82161067891866,568564.187907153507695 8369618.815166511572897,568904.380271017551422 8370850.411758496426046,569832.116907288902439 8371405.517939433455467,571223.610542206093669 8371529.053045417182148,572584.157358679454774 8371342.753139815293252,573480.947176512563601 8370542.604206785559654,585324.005163025809452 8355957.768027927726507,585911.549435433233157 8355035.803404971957207,591601.199929366819561 8344164.160059821791947,592436.096110317739658 8342015.122747676447034,595033.513788996846415 8334165.527328440919518,594538.809971912764013 8333123.3837023479864,591261.007565502892248 8330366.593392915092409,589374.810113501502201 8329202.37519608438015,588323.508842451032251 8328773.255222165957093,587086.637980248080567 8328527.613997281529009,586499.093707840656862 8329447.818327486515045,586993.797524924739264 8330181.550052169710398,587766.911388484761119 8330916.898650721646845,588539.913932553376071 8331345.922566045075655,591044.602475400548428 8333369.17777940351516,589560.379704653983936 8342260.992009840905666,589282.080977672245353 8343488.251664707437158,588725.372204214683734 8344408.554069240577519,581582.445757972891442 8344838.583421535789967,580500.19766848126892 8344408.554069240577519,577995.509125631302595 8342384.040168043226004,577377.018034785636701 8341463.990038911812007,577160.612944683292881 8340114.275195159949362,575769.119309765985236 8330610.531267096288502,576861.720111902686767 8326710.916295466013253,578335.590170006849803 8325343.837148684076965,578892.187623973237351 8319406.964900879189372,578985.02807929366827 8318061.273030547425151,579015.863578243530355 8314270.606176851317286,578799.458488141186535 8312925.848813962191343,578181.078716783900745 8312009.23900003824383,576913.261036139796488 8310237.067546,575490.820582784246653 8308649.601275852881372,573913.757356714457273 8307183.400110903196037,573171.701631086878479 8307060.936651901341975)) +POLYGON ((601187.032601067679934 8344594.175177833065391,598465.938968118163757 8344654.724025002680719,597414.526377573609352 8345145.320586212910712,596517.84787923458498 8345821.601717912591994,591570.253110928577371 8351777.981728664599359,590982.708838521153666 8352701.088000318966806,590580.734157266211696 8353806.843887247145176,585942.496253874269314 8373314.444023955613375,584612.784936347976327 8379479.350803301669657,587024.744343365891837 8391146.36602265574038,587364.825387738528661 8392381.565090583637357,588168.774750248412602 8393123.139850189909339,589096.511386519763619 8393678.146403893828392,593394.66824553895276 8393555.796677067875862,594445.96951658942271 8393060.412280477583408,602454.850281711784191 8386453.20816345885396,603939.184371949522756 8384908.816815600730479,605237.837551543372683 8383181.481893667951226,605825.381823950796388 8382193.472817794419825,608330.070366800762713 8375718.051319615915418,608732.0450480527943 8374485.641529529355466,610494.566545783891343 8368756.110456235706806,611174.839954020571895 8366417.049969287589192,611422.191862564068288 8365186.193400012329221,611515.032317884499207 8363832.133859531022608,611669.54377110756468 8359585.442610097117722,611700.601909036980942 8356634.819240366108716,611453.138681005104445 8354053.327462916262448,610958.434863921022043 8353008.373284208588302,608824.774183884961531 8349014.219862466678023,604712.075596526963636 8345514.615448227152228,603784.450279746786691 8344961.674542512744665,602578.526235984871164 8344654.724025002680719,601187.032601067679934 8344594.175177833065391)) +POLYGON ((613679.52849687053822 8375965.268149510025978,612628.227225817157887 8376457.951185116544366,596826.982105166185647 8395718.349463768303394,596425.118743402534164 8396830.353418527171016,596765.199787778081372 8398005.517020201310515,606227.356505205738358 8408834.523635905236006,607000.359049274469726 8409577.75709306076169,612937.361451751668938 8412115.883129445835948,615132.915768667124212 8412983.680152548477054,628460.30784542078618 8416391.179978201165795,629851.801480335299857 8416515.471773384138942,630160.935706269694492 8412673.884275950491428,630470.181251692585647 8405613.895087666809559,630501.128070133621804 8402644.792710902169347,630377.452115860534832 8399613.880949351936579,630037.259751996491104 8398377.468654157593846,622832.439668875304051 8383551.130843658931553,615998.647448567906395 8376644.380379218608141,615040.186632837867364 8376026.296919170767069,613679.52849687053822 8375965.268149510025978)) +POLYGON ((585509.574754178291187 8400293.395026724785566,578830.293987091048621 8402644.792710902169347,577933.72680824319832 8403263.33123467490077,575738.172491327743046 8405676.952485956251621,575305.362311122938991 8406729.177174603566527,575026.952264647115953 8407967.215577473863959,574006.486492546508089 8413851.579501213505864,575336.197810072801076 8425820.108320936560631,575830.901627156999893 8426875.440652079880238,580902.17234973621089 8422035.072538206353784,581489.716622143634595 8421105.026901001110673,585509.574754178291187 8413293.266019543632865,586777.392434822395444 8410009.598158149048686,586870.121570654446259 8408647.278089808300138,586437.200070958468132 8400850.500847680494189,585509.574754178291187 8400293.395026724785566)) +POLYGON ((660279.203176825074479 8416391.179978201165795,659877.117176078958437 8417508.096297198906541,658052.702041468583047 8424701.929609199985862,657867.132450315984897 8427432.997893655672669,658454.78804221469909 8430040.334403241053224,659475.142494824016467 8432152.138536371290684,660124.46908462245483 8433022.302218748256564,660928.529766620718874 8433767.983140118420124,662814.727218622108921 8434949.060256255790591,665474.038534183404408 8435570.320320192724466,666865.53216909780167 8435631.845149155706167,667762.210667439736426 8435010.579887183383107,669803.142211643746123 8432462.755697591230273,670205.116892898688093 8431345.35554170794785,670699.932029474060982 8428861.833473129197955,670638.038392591872253 8427308.521530479192734,670421.521982998237945 8425942.995468150824308,669895.87134747300297 8424889.584097852930427,668597.10684838774614 8423089.861994924023747,667793.157485880772583 8422406.677062468603253,666834.585350659559481 8421786.527823593467474,664639.142353232484311 8420980.65756075643003,663680.570218014065176 8420421.802972020581365,662876.509536013007164 8419677.473684389144182,660279.203176825074479 8416391.179978201165795)) +POLYGON ((579510.567395327729173 8453552.101097218692303,578768.511669700033963 8454361.549572180956602,578830.293987091048621 8455857.323824422433972,579479.731896380661055 8456792.000851007178426,580407.357213160838 8457353.402691235765815,581798.850848075235263 8457478.388876119628549,582571.964711635140702 8456667.026343930512667,582355.448302041506395 8455296.036300098523498,581706.121712245978415 8454361.549572180956602,580747.549577024765313 8453801.94627894833684,579510.567395327729173 8453552.101097218692303)) +POLYGON ((568131.377726948820055 8440667.215994441881776,556040.856512400903739 8448444.696799362078309,552299.29710734798573 8452431.490738846361637,551124.208562535932288 8454300.092056877911091,550691.28706283995416 8455420.987485880032182,549330.740246363799088 8461593.574104757979512,549083.388337823096663 8462840.660601289942861,548959.71238355000969 8464274.824857203289866,550196.471926264581271 8495536.860414164140821,552948.623697146307677 8498669.432870667427778,553567.003468503709882 8498543.743230545893312,564668.005729389260523 8476950.807085178792477,566121.393001185846515 8473763.847862087190151,566554.314500881824642 8472703.559456989169121,567512.886636103037745 8469081.294536210596561,567636.562590373447165 8467707.760607615113258,567852.967680475790985 8464898.569331634789705,568997.109406849602237 8448010.369155924767256,569151.843499052221887 8444025.972340550273657,569059.003043728880584 8441227.387266619130969,568131.377726948820055 8440667.215994441881776)) +POLYGON ((572027.559904713067226 8488460.616994647309184,569059.003043728880584 8492906.172493057325482,558916.572918064659461 8510149.669313287362456,556690.183102199225686 8518943.804926730692387,566214.233456509187818 8514922.525742484256625,574006.486492546508089 8510149.669313287362456,575830.901627156999893 8508830.792141057550907,576573.068672275869176 8508015.313268365338445,577748.157217090716586 8506133.211745273321867,578768.511669700033963 8504061.899902671575546,579046.810396684682928 8502807.788358265534043,579850.759759194450453 8494597.236793134361506,579634.354669092106633 8493155.556851323693991,578335.590170006849803 8491339.033234747126698,572027.559904713067226 8488460.616994647309184)) +POLYGON ((575800.066128207137808 8513226.54072424583137,567914.861317357979715 8519384.162292718887329,565193.76768440566957 8521333.502815362066031,559906.091871726908721 8522464.688581865280867,555175.013513011741452 8525735.176008542999625,548588.573201244929805 8534675.950771888718009,548464.897246974636801 8535745.241344138979912,557803.378010131884366 8534675.950771888718009,559040.248872334952466 8534359.389083979651332,568131.377726948820055 8530770.455306090414524,569213.625816443236545 8530267.315457915887237,570141.251133223297074 8529574.081644382327795,574810.435855056392029 8524917.813547700643539,577067.772489359951578 8522528.757361479103565,577655.316761767375283 8521583.856275361031294,578521.159761159447953 8519321.931356966495514,578768.511669700033963 8518065.205885538831353,578675.782533870893531 8514986.302437208592892,578181.078716783900745 8513918.22907923348248,577222.395262074191123 8513288.719909401610494,575800.066128207137808 8513226.54072424583137)) +POLYGON ((615318.374040328431875 8495911.976630812510848,613926.880405413918197 8496099.654723631218076,612844.743635410792194 8496602.033062634989619,610432.7842283929931 8498857.181552346795797,608360.905865750624798 8501428.15221768245101,607031.305867715622298 8503185.083114022389054,596672.470651946030557 8517310.912096908316016,600661.381965542444959 8523722.395545054227114,607093.088185103726573 8529071.023991847410798,615627.619585754116997 8535745.241344138979912,618503.335991414962336 8537510.422753373160958,619307.396673416020349 8538266.800103075802326,621317.270079687703401 8540976.243378663435578,621657.462443551630713 8542238.723545519635081,622090.383943247725256 8545013.903774200007319,622368.682670229463838 8547978.694540169090033,622183.224398568156175 8550818.324475578963757,622245.006715959054418 8552396.423557344824076,622585.087760331807658 8553596.761402437463403,624347.720577554078773 8554670.412230769172311,625491.862303925096057 8555050.388683488592505,626728.621846639667638 8554734.763527067378163,631830.839387657120824 8553407.604183606803417,632573.006432775990106 8552587.145897965878248,633315.062158406362869 8551449.477800389751792,633809.765975490561686 8544381.488769957795739,632480.165977455442771 8505755.765226829797029,631985.350840880069882 8504689.036139139905572,624069.421850569546223 8497729.6334264036268,617823.062583178281784 8496414.567699441686273,615318.374040328431875 8495911.976630812510848)) +POLYGON ((574315.732037969399244 8529323.228305839002132,573078.861175766447559 8529385.54427694901824,564637.170230439398438 8533541.290183974429965,563554.810821456601843 8534170.955208657309413,557463.185646267957054 8539085.654210977256298,555948.01605708047282 8540661.224745711311698,547351.702339041978121 8550818.324475578963757,546145.77829527715221 8552712.175160458311439,542898.922707311226986 8558777.978641113266349,540394.234164461377077 8564657.775017572566867,541043.560754259699024 8565542.213346214964986,542311.378434903803281 8565225.907329149544239,551155.155380974174477 8562127.105432936921716,554371.064150501857512 8560611.308684622868896,555144.066694570588879 8559788.221577636897564,571038.040951053611934 8538140.429282853379846,572213.018176377285272 8536124.236317778006196,573944.704175155609846 8531652.393288545310497,574223.002902140142396 8530393.550450190901756,574315.732037969399244 8529323.228305839002132)) +POLYGON ((516697.208881333761383 8625823.200203359127045,515501.971508687769528 8627352.595506140962243,514605.181690857512876 8629587.099676379933953,514296.047464923060033 8630863.150678196921945,514481.505736584367696 8638141.875399263575673,514697.910826686711516 8639547.560232542455196,515192.725963264936581 8640634.155667331069708,515996.786645263142418 8641401.288832142949104,517944.877734146721195 8642616.119873970746994,519027.014504147053231 8642424.872384421527386,519800.128367707016878 8641657.631470480933785,520573.242231266980525 8640186.43019656650722,525229.959170130081475 8625823.200203359127045,525397.049725811462849 8625057.704454137012362,524871.287770794937387 8623973.427930204197764,522799.520727641065605 8622889.542107276618481,521686.325819708406925 8622761.699190378189087,516697.208881333761383 8625823.200203359127045)) +POLYGON ((534859.206443239119835 8636034.661100735887885,534271.66217083169613 8636992.640230840072036,533807.905172188649885 8638078.624805625528097,533715.064716865308583 8639547.560232542455196,533003.844490187591873 8659513.108392348513007,533344.036854051519185 8660794.411405647173524,539899.419027886004187 8667269.893092583864927,548557.626382803777233 8669579.96870612539351,549794.608564500929788 8669195.82913457415998,550567.611108569661155 8668425.763109721243382,552113.727516195503995 8666436.533454291522503,552392.026243180036545 8665154.237266402691603,555020.390740300295874 8652851.382969986647367,555144.066694570588879 8651443.129496851935983,555082.173057691194117 8649843.475520046427846,554371.064150501857512 8647348.044012269005179,553041.352832975564525 8645492.802216781303287,551433.342788467532955 8643959.596590783447027,546578.699794973246753 8640890.471323212608695,542898.922707311226986 8645429.718024102970958,542466.001207615248859 8646580.284576816484332,541847.510116769582964 8647541.26316287368536,540579.803755613858812 8647604.595942294225097,539775.743073615711182 8646836.809473570436239,536312.593715035705827 8642296.686443379148841,535972.401351171778515 8641018.63253173045814,534859.206443239119835 8636034.661100735887885)) +POLYGON ((594105.888472216785885 8763221.402761217206717,595169.54620674601756 8762571.628681134432554,595039.747680480475537 8761713.931816887110472,594353.240380760282278 8761440.92193977534771,593481.274809375870973 8761363.255197957158089,589715.002477365429513 8761440.92193977534771,587989.550370070617646 8761674.862935228273273,587414.362561141955666 8762103.930334772914648,587451.431951575446874 8762649.308366073295474,588137.939251298550516 8762922.597726603969932,589009.904822682845406 8763000.047183837741613,594569.645470862626098 8762377.199141819030046,594105.888472216785885 8763221.402761217206717)) +POLYGON ((547970.193429890437983 8805528.037937372922897,544321.363160666776821 8808013.684085886925459,543362.679705954273231 8808732.300561495125294,535230.234306052909233 8820320.066677244380116,534797.312806356931105 8821433.820105869323015,535322.963441884960048 8822612.859030725434422,541909.403753648977727 8831991.148552358150482,543610.142933989060111 8833564.594707367941737,547042.456793619086966 8834943.886084113270044,548372.056791654089466 8835207.155765391886234,549670.9326102277264 8834878.897287927567959,550938.638971383450553 8834484.014287674799562,579108.70403356407769 8824645.135241981595755,581304.147030991036445 8822612.859030725434422,581427.822985261445865 8821433.820105869323015,581056.795122447656468 8820188.701306842267513,576078.253535700496286 8817110.670371191576123,556164.532466673990712 8808471.876256538555026,549268.846609484404325 8805790.239338211715221,547970.193429890437983 8805528.037937372922897)) +POLYGON ((563183.78295864269603 8840329.587576221674681,559844.198234844719991 8852953.153467200696468,557679.702055861591361 8862370.915530567988753,567698.456227255635895 8863688.569878071546555,568657.028362476848997 8863292.109518865123391,570759.742224069079384 8857362.985682358965278,565379.225956066977233 8843022.169257597997785,564884.52213898289483 8841905.086203658953309,564173.301912305061705 8840919.679329739883542,563183.78295864269603 8840329.587576221674681)) +POLYGON ((624409.502894942183048 8903208.068589337170124,618008.632174330763519 8903340.952571718022227,616709.978994736913592 8903737.710521725937724,615751.295540024410002 8904402.203727781772614,612875.57913436065428 8911297.697582732886076,612937.361451751668938 8912558.864629279822111,614143.396815004758537 8917802.238659394904971,617081.006857550702989 8925243.468728188425303,617606.657493075937964 8926439.584894007071853,619492.966264568502083 8927836.501701008528471,620822.566262603620999 8928103.181790247559547,633067.710249862866476 8929233.928847411647439,634706.555793320760131 8929166.17000206373632,646549.725099328090437 8924179.144955152645707,646673.401053598383442 8923049.430081078782678,645343.801055563380942 8911430.730742376297712,644941.826374308438972 8910104.330354142934084,644416.064419291913509 8908976.580469056963921,642684.489740001969039 8907384.707069391384721,640674.616333730285987 8906191.987291527912021,639499.41646942414809 8905727.555434968322515,634335.527930506970733 8904467.821279974654317,628707.771073452662677 8903737.710521725937724,624409.502894942183048 8903208.068589337170124)) +POLYGON ((648683.385779361356981 8916208.415345817804337,651342.585775431478396 8924511.489971548318863,651404.479412310756743 8925510.052854109555483,649765.633868852863088 8937285.006740231066942,649487.335141871124506 8938616.420530084520578,646704.347872039536014 8938883.50003675557673,645745.775736818206497 8939615.262321623042226,645652.935281494981609 8941080.688787825405598,645993.127645358908921 8945213.353919671848416,646209.532735461252742 8946679.920287111774087,648776.114915193407796 8952549.415487254038453,650414.960458651301451 8955951.567216804251075,651126.180685329018161 8956886.719899877905846,652857.755364619079046 8958489.572057463228703,655919.04136143240612 8960358.975553579628468,658300.05395001207944 8961228.563941031694412,659784.388040246907622 8961362.522599851712584,660928.529766620718874 8961094.607776125892997,663216.701899876934476 8960024.971887607127428,664793.765125946723856 8958289.797012276947498,665412.25621679238975 8957288.360936760902405,670885.501620626542717 8943280.467361753806472,670576.256075200857595 8937151.495386043563485,661485.127220586990006 8926373.767017278820276,659939.010812961147167 8924578.965777814388275,656815.83117926272098 8921124.155267059803009,653538.028772855643183 8917802.238659394904971,652517.674320243531838 8917205.828291108831763,650167.608550107805058 8916275.813453871756792,648683.385779361356981 8916208.415345817804337)) +POLYGON ((693334.858050941140391 8952281.82855324819684,691696.012507483246736 8952347.883649010211229,684398.35196903871838 8952347.883649010211229,681244.225516902050003 8952347.883649010211229,678646.919157714117318 8953148.759839145466685,676544.093976630712859 8954417.036131804808974,674626.949706188170239 8955819.631785601377487,670947.283938014646992 8961962.601419348269701,670483.415619880426675 8963166.517662664875388,687676.154375448590145 8964836.698686137795448,688974.807555042556487 8964768.844537330791354,703322.665403896942735 8959357.251498026773334,704435.860311829601415 8958823.50446187518537,705054.351402675267309 8957821.994117161259055,704992.457765795872547 8956487.023994281888008,704281.237539118155837 8955485.83873563632369,702240.30599491414614 8954616.943975815549493,699859.404725825763308 8953749.835840472951531,696179.627638163743541 8952615.473038770258427,693334.858050941140391 8952281.82855324819684)) +POLYGON ((743366.735271034645848 9015814.731092220172286,742222.704864152125083 9016419.373320501297712,740305.449274218408391 9020998.85851551219821,740243.666956827393733 9022549.611951494589448,743088.54786354128737 9031717.637747580185533,743521.358043746091425 9033066.6579499412328,744232.578270423808135 9034011.900436030700803,745129.256768762832507 9034821.929711643606424,746489.80358523898758 9035024.086847975850105,765414.228339585592039 9037657.023309530690312,766898.451110334834084 9037386.248518185690045,767702.400472841807641 9036509.095869733020663,768290.056064740521833 9035430.119169089943171,770268.982652571168728 9029288.87486239336431,770361.823107894393615 9027738.606828320771456,769372.192834740853868 9025647.998897779732943,767300.425791586982086 9024435.511730995029211,763713.489159248303622 9023154.821657678112388,755890.177985278540291 9021269.015734620392323,751097.317309172358364 9019585.670278165489435,749922.228764360304922 9019113.86119794100523,743366.735271034645848 9015814.731092220172286)) +POLYGON ((765074.035975721664727 9045696.932462204247713,755055.281804327620193 9052662.342695903033018,754220.385623379494064 9061124.639441916719079,754282.279260258888826 9062479.446538602933288,755333.580531312152743 9063089.742131577804685,758209.296936973114498 9063428.57374738715589,769372.192834740853868 9064106.041064839810133,770887.362423928454518 9063834.265785899013281,771846.045878640958108 9063156.824153253808618,772619.04842270957306 9062209.440248070284724,773051.96992240275722 9060988.807021044194698,773330.268649387406185 9057129.266813635826111,767795.240928165148944 9046237.173159876838326,766589.316884400439449 9045763.608617439866066,765074.035975721664727 9045696.932462204247713)) +POLYGON ((836040.322675924631767 9085212.764414835721254,833102.712633381481282 9088953.060059424489737,832329.598769821575843 9089836.654196102172136,831340.079816162004136 9090583.717833237722516,830195.938089788309298 9091196.657151298597455,828897.284910194342956 9091605.883961191400886,825866.834412327967584 9092149.596690639853477,824722.692685954156332 9092762.425121016800404,823764.231870224117301 9093510.03905370645225,821073.973736224579625 9095891.55788829177618,820269.913054223521613 9096777.724302690476179,819836.991554527543485 9098002.510380929335952,819929.832009850768372 9099364.310639448463917,823671.391414903686382 9114362.713343568146229,846522.833845964400098 9123102.932957325130701,851594.104568543611094 9120166.4558509234339,858489.679106242023408 9100862.712810622528195,858087.704424987081438 9099841.185829885303974,857160.079108207020909 9099092.910512855276465,840276.585898064426146 9087591.524933168664575,836040.322675924631767 9085212.764414835721254)) +POLYGON ((865880.068780515808612 9104541.760994059965014,863777.354918920784257 9105904.560643384233117,857994.975289155030623 9110405.065800419077277,856077.719699224224314 9111905.781524712219834,855304.605835664202459 9112793.933053163811564,854871.795655459398404 9114021.708977423608303,858087.704424987081438 9120916.938165206462145,858860.818288547103293 9121873.843543892726302,860066.631012817728333 9122284.828326731920242,870518.418003398925066 9123376.967275321483612,873424.969908012542874 9123651.012093007564545,879269.354494148865342 9122352.221262881532311,880042.35703821759671 9121464.849816029891372,881124.605127709219232 9119688.224284609779716,881000.929173438809812 9118322.551286373287439,879671.329175403807312 9114158.550996148958802,878156.159586216206662 9112246.930672906339169,872559.238228111760691 9107745.267367605119944,869374.276277025230229 9105974.008049458265305,865880.068780515808612 9104541.760994059965014)) +POLYGON ((891143.470618594437838 9134866.580414947122335,888236.696075001149438 9134934.338423326611519,882577.992399508599192 9141164.905603770166636,882361.587309406255372 9142536.675210744142532,882949.020262322388589 9143701.480243461206555,883722.134125879500061 9144659.712926955893636,895874.437657818431035 9156321.264945721253753,897544.230019717360847 9157761.697677342221141,898750.154063482186757 9158174.751104362308979,900141.759017887758091 9158380.421561868861318,901502.083195381448604 9158312.440887700766325,903017.475423551513813 9157969.333757622167468,904161.505830434034579 9157418.616998018696904,906356.948827858315781 9154810.9514852296561,909418.234824674553238 9148225.842106709256768,909820.209505926584825 9147060.05268794298172,911211.814460335066542 9139042.905531378462911,911304.54359616432339 9137878.612844455987215,910222.295506672700867 9137261.907900866121054,905707.622238059877418 9136302.941273488104343,900203.541335278772749 9135345.82812025770545,897265.819973244448192 9135071.581157008185983,891143.470618594437838 9134866.580414947122335)) +POLYGON ((914767.804274235502817 9138630.956460142508149,913809.120819522999227 9139385.105096459388733,912108.381639182916842 9145824.864046489819884,910407.865097825299017 9152272.406987305730581,910531.429732607211918 9153644.334308434277773,911118.974005011841655 9154810.9514852296561,912046.599321794812568 9155565.079879296943545,913128.847411286318675 9156115.653762897476554,914520.452365692006424 9156388.979539280757308,916190.133408099762164 9156251.326824,917179.763681253301911 9155497.373094579204917,921508.867358713643625 9148155.983181226998568,924477.424219697830267 9142741.649372370913625,924879.287581461598165 9141507.206773424521089,924972.128036782029085 9140344.485309161245823,920457.45476816908922 9139315.579074922949076,914767.804274235502817 9138630.956460142508149)) +POLYGON ((934093.981070854468271 9139385.105096459388733,932548.087302208296023 9139385.105096459388733,931032.695074041024782 9139658.03825069963932,930074.345577802276239 9140412.295259222388268,929301.231714242370799 9141371.813356924802065,920797.647132033132948 9156183.613535173237324,920210.102859628503211 9157282.92176653444767,920457.45476816908922 9164425.624416215345263,920581.242041930672713 9165800.135548580437899,937897.656751769245602 9170338.271670263260603,939257.980929265730083 9170200.349846655502915,940804.097336891572922 9168413.549746599048376,952647.377962387283333 9153026.020445449277759,954255.38800689810887 9149596.9926169347018,954688.309506591293029 9146852.980196597054601,954533.464094897382893 9145139.617689225822687,953729.626051881583408 9143701.480243461206555,952059.9450094710337 9142329.487086249515414,948844.036239946144633 9140549.64320183172822,944855.124926349846646 9139658.03825069963932,934093.981070854468271 9139385.105096459388733)) +POLYGON ((953203.975416353554465 9178940.992583755403757,947545.271740861004218 9178940.992583755403757,945999.155333232367411 9178940.992583755403757,942968.816154857166111 9179493.371759297326207,939505.555476788897067 9181353.131123596802354,938546.872022076393478 9182110.067937606945634,939010.62902072223369 9183419.520072679966688,944545.768061435781419 9191899.937907146289945,945318.770605504396372 9192866.399424720555544,947143.297059606062248 9194452.613972177729011,949462.304691812256351 9195419.421368774026632,950884.745145167806186 9195626.167685238644481,956450.831004322390072 9194661.319977257400751,959110.142319883685559 9193694.615303097292781,960099.661273543140851 9192934.461530903354287,964799.681494326097891 9188107.388178516179323,965387.337086224812083 9187003.324123172089458,965789.311767479637638 9185762.945123331621289,965263.549812463228591 9183419.520072679966688,964645.058721614652313 9182248.220048721879721,962480.673862122814171 9181076.864222479984164,961243.580360934487544 9180664.467729305848479,953203.975416353554465 9178940.992583755403757)) +POLYGON ((888916.969483240623958 9176393.857850415632129,889999.328892223420553 9184040.471384260803461,889597.242891477304511 9185212.065607745200396,888638.78207574726548 9185969.411824887618423,882114.124081371468492 9188381.94141716696322,876950.124222963117063 9187898.873789299279451,868663.056050347397104 9189762.81144780293107,867642.701597735285759 9192038.279676890000701,866622.235825634677894 9194384.537381554022431,866374.772597602801397 9195764.581728642806411,865880.068780515808612 9200460.321950348094106,866127.420689059305005 9201634.864522144198418,889226.215028663515113 9215672.965294299647212,892318.44784391799476 9215811.768975213170052,899028.564109955099411 9215741.24540282972157,900760.027469753869809 9215602.692288832738996,901533.141333313775249 9214703.408490102738142,909943.996779690962285 9199424.706460217013955,910531.429732607211918 9198318.8898217510432,910995.409370232722722 9195557.831400901079178,908614.396781655959785 9189416.203343864530325,908026.85250924853608 9188245.656436743214726,905150.913464605109766 9184521.293011961504817,900914.650242465315387 9180938.734781721606851,899832.402152973692864 9180318.301214659586549,888916.969483240623958 9176393.857850415632129)) +POLYGON ((941237.01883658755105 9205573.219218233600259,937990.163248618831858 9205711.826425323262811,936444.26947997265961 9205989.048921681940556,923426.011629153275862 9208615.233878647908568,922034.406674747704528 9210621.304013704881072,921818.001584645244293 9212074.731566667556763,921725.272448813193478 9215119.771009724587202,922281.981222270755097 9219757.964191079139709,922560.057310272939503 9221281.838479291647673,923024.036947898450308 9222598.502774864435196,923642.52803874691017 9223776.698258532211185,927816.897624004632235 9228281.480740176513791,931218.264665193622932 9231750.538917848840356,938639.71247739973478 9238066.497776770964265,940835.155474823899567 9239247.003958828747272,942071.91501753567718 9239662.802724005654454,945040.471878519863822 9239941.348966374993324,958955.40822768106591 9240983.118444873020053,958986.355046119308099 9251201.833998205140233,981312.146841657697223 9258718.812858806923032,995721.78700790007133 9262411.425967779010534,997113.391962308553047 9262619.874358177185059,998659.285730954841711 9262342.446196204051375,1021510.839481506845914 9240080.62617240473628,1021170.647117642802186 9238552.726627701893449,1020243.021800862741657 9237788.024837402626872,1011801.442175026866607 9230986.566873313859105,1007595.903132345643826 9228420.530187413096428,997608.095779392751865 9223291.476656336337328,994206.617418712587096 9221696.590173365548253,987960.258151321322657 9219757.964191079139709,978158.020389520912431 9218165.862343123182654,976766.526754603721201 9217956.71660329028964,970551.336944633163512 9217819.616051115095615,969159.731990227592178 9217610.480469632893801,964026.79026974865701 9216157.668542135506868,957811.377820798545144 9214150.289431078359485,954409.89946011826396 9212557.446623453870416,951627.02350977784954 9210207.196147430688143,950853.9096462179441 9209238.382280271500349,948998.65901265759021 9207646.636265860870481,946833.940194691997021 9206471.352161223068833,945566.122514047892764 9206057.236357560381293,941237.01883658755105 9205573.219218233600259)) +POLYGON ((1190168.216995125636458 8284703.032004872336984,1188211.665624942164868 8288214.093219860456884,1186727.554173687007278 8291137.739954115822911,1186078.227583888685331 8293332.385226213373244,1184680.166099017020315 8301614.792361312545836,1184394.18632716848515 8313571.240210314281285,1182201.748955996241421 8320263.922394087538123,1175595.60509436042048 8337108.948291527107358,1175286.359548934735358 8339561.517688265070319,1175471.929140087217093 8341094.897703899070621,1178254.916409918805584 8353129.830822634510696,1180048.3847260910552 8357864.249844301491976,1183758.997312702937052 8367093.510173511691391,1184470.106219889363274 8367895.280080622062087,1185521.518810431007296 8367648.333641176111996,1186356.414991382043809 8366909.31712344661355,1187995.371854331111535 8364139.883053360506892,1190623.736351451370865 8355219.700258206576109,1190778.247804671525955 8353930.084646079689264,1195420.604529225034639 8356178.870762954466045,1197884.995416407007724 8363441.760625810362399,1196498.956436537439004 8374609.228248851373792,1195818.683028300991282 8375472.618034961633384,1193994.15657419920899 8376766.227721373550594,1190469.113578740041703 8378122.664449438452721,1189232.131397045683116 8378246.312151135876775,1187841.194359581917524 8374658.264128014445305,1187191.311172330053523 8373869.513873307034373,1186201.792218670481816 8373377.003764178603888,1178100.293637207476422 8372513.859313231892884,1175502.764639036962762 8372637.412988265044987,1173028.911595139885321 8372329.309025813825428,1171915.716687207110226 8372021.439739348366857,1169102.005237914156169 8370358.103244932368398,1168390.673691745148972 8369495.312055198475718,1165978.714284727117047 8365923.485946821980178,1165700.526877236785367 8364939.337641714140773,1165855.149649948114529 8363646.249817178584635,1166782.774966728175059 8355896.905074450187385,1166937.397739439737052 8354667.802163255400956,1168019.757148422533646 8350983.269316586665809,1167926.805373610695824 8347172.360336062498391,1167865.023056219797581 8341647.549110042862594,1168205.104100595461205 8339194.286973289214075,1170988.091370427049696 8329079.546429534442723,1171483.017826493596658 8328100.297107167541981,1172132.344416289124638 8327242.430528695695102,1175041.122710719006136 8325945.788112540729344,1177667.372137514175847 8323690.983417624607682,1178347.756865242263302 8322895.761919976212084,1179831.868316497420892 8319957.996327276341617,1180481.19490629574284 8317755.438105562701821,1181254.197450361680239 8311520.837541490793228,1181254.197450361680239 8310176.580112248659134,1181068.850498191546649 8308649.601275852881372,1180759.493633277481422 8307366.329556939192116,1179429.893635242478922 8303824.195209635421634,1178162.187274089548737 8301993.563049919903278,1175317.195047884481028 8298698.863476018421352,1170307.817962187575176 8294733.94592524971813,1167524.830692355986685 8293087.918423535302281,1165453.174968693172559 8292295.980435701087117,1164216.19279 8292113.642626120708883,1162701.023197811329737 8292295.980435701087117,1160721.985290489625186 8293454.621655784547329,1160227.2814734026324 8294429.074008265510201,1159887.089109538588673 8295527.681477443315089,1159918.147247470915318 8296869.279325398616493,1160381.792926625581458 8303519.168266501277685,1160536.638338316697627 8304984.643191265873611,1160845.772564251208678 8306327.957187492400408,1161031.342155403690413 8307854.456712753511965,1161031.342155403690413 8309198.292076102457941,1159361.438474013470113 8325099.852681935764849,1159206.815701301908121 8326324.264263962395489,1158897.681475367629901 8327425.85700552444905,1155557.985432078363374 8333000.489730575121939,1154908.770161774009466 8333859.025195124559104,1145261.043853190960363 8340481.551661839708686,1143096.436354716541246 8341463.990038911812007,1140746.370584581047297 8340971.871024956926703,1138643.768042477080598 8340174.787318889051676,1137932.436496308073401 8339315.517463223077357,1138272.628860172117129 8338212.150471033528447,1141952.405947834020481 8332877.597803191281855,1143312.952764310175553 8331529.450944238342345,1144024.061671496834606 8330979.100059797056019,1147204.125564988935366 8329996.511345787905157,1148755.140030212001875 8329508.463663742877543,1149744.770303362747654 8328833.895021919161081,1154939.494341232581064 8324977.092089437879622,1155434.420797299128026 8323997.064038683660328,1155774.613161163171753 8322956.353508682921529,1156269.316978247370571 8320569.640860165469348,1157382.511886179912835 8311948.957074985839427,1157537.134658894268796 8309320.790931625291705,1157537.134658894268796 8307916.46436027251184,1156145.529704485787079 8297294.795132456347346,1155836.395478554069996 8295953.120143852196634,1155279.686705096624792 8294978.467107569798827,1154444.790524145588279 8294306.821483101695776,1153084.243707672227174 8294306.821483101695776,1150888.800710245268419 8295038.610898490995169,1149868.33493814454414 8295588.049252193421125,1147239.97044102451764 8297722.092077150009573,1145415.666625905316323 8299003.691740701906383,1141735.889538240386173 8301566.23905233014375,1140746.370584581047297 8302115.942643615417182,1139385.823768104892224 8302115.942643615417182,1139385.823768104892224 8300711.445425292477012,1139571.393359257373959 8299796.347936762496829,1140684.588267189916223 8297539.400949654169381,1142508.892082309117541 8294918.104305221699178,1151878.430983398808166 8283950.565215631388128,1160351.068747164215893 8277074.505776195786893,1166040.719241100596264 8272635.30685,1167030.126875271787867 8270690.506650036200881,1170678.957144492538646 8247874.414420293644071,1170678.957144492538646 8246541.658895640634,1170369.822918561054394 8245209.142798563465476,1165916.931967339012772 8235464.261462231166661,1164772.901560456492007 8233529.18472315184772,1163937.894060014514253 8232864.826029441319406,1162979.433244284475222 8232380.090680210851133,1162329.884015506366268 8233167.175872694700956,1162020.749789574649185 8234314.867801863700151,1161866.238336351700127 8235525.883918495848775,1161185.853608623845503 8236311.560649147257209,1155867.342296995222569 8238609.837727922946215,1154537.519659977639094 8238609.837727922946215,1153702.734798518009484 8237945.024067861028016,1153269.813298821914941 8236795.246144124306738,1149620.983029601164162 8224887.806344782933593,1138921.955449970439076 8188735.590249897912145,1129769.044277965789661 8184650.788425982929766,1130603.829139422625303 8185310.85016795899719,1131284.102547662099823 8186152.448945162817836,1131840.922640607925132 8187112.909290679730475,1132150.056866542436182 8188435.043025740422308,1131995.43409383110702 8189636.871981224045157,1131346.107504032552242 8190478.960395676083863,1130140.18346027075313 8190599.513878800906241,1127975.464642302365974 8189939.199102500453591,1116163.464793721446767 8181843.152640882879496,1116503.545838094083592 8178124.693359077908099,1116503.545838094083592 8176745.197195158340037,1116379.7585643325001 8175543.720715305767953,1116070.62433839822188 8174286.503979259170592,1115513.915564940543845 8173266.588773526251316,1113874.958701991476119 8171947.147212847135961,1108154.472709107911214 8170006.950100851245224,1099558.158991069532931 8170665.714228374883533,1094703.293358592549339 8172645.595161084085703,1095538.412178523140028 8173304.376913759857416,1096094.898312998237088 8174324.297297744080424,1096373.197039982769638 8175644.160348477773368,1096373.197039982769638 8178345.738988350145519,1096187.627448830287904 8179545.939052617177367,1095692.923631746321917 8180505.546846997924149,1093775.668041812488809 8183509.01123983040452,1093336.957928594900295 8184074.904280018061399,1089477.511182793183252 8188195.739089679904282,1070244.06352200335823 8205886.242545313201845,1064214.220664202934131 8205644.641278378665447,1062884.509346679551527 8205585.001240779645741,1062080.671303661074489 8205222.833835712634027,1061956.884029899490997 8204079.628327452577651,1062451.810485966037959 8203115.239635395817459,1071604.721657970920205 8192885.205382134765387,1078036.427877532085404 8187294.415616703219712,1079025.835511703277007 8176725.322220095433295,1069563.790113766910508 8164553.448047610931098,1069038.139478241559118 8163893.714842210523784,1058370.058717049192637 8157066.891990075819194,1047454.403408333659172 8146182.788648740388453,1040693.525454495218582 8128412.324504864402115,1039723.821370193152688 8126725.906876810826361,1023149.796344455913641 8106903.145362290553749,1021541.786299947882071 8105595.394800359383225,1009018.232266212697141 8097931.115906058810651,1005276.672861159895547 8095971.182234183885157,1002215.386864346452057 8094725.598479961045086,1001411.437501836568117 8094072.011839110404253,996494.900871460093185 8088673.50874641072005,983074.668339385883883 8069009.876127737574279,979271.660575415706262 8065579.625146339647472,972850.641026970348321 8062180.942358937114477,969887.204862560261972 8060733.162052438594401,969985.945250893360935 8055638.589630582369864,967582.78008364897687 8046980.668542343191803,947359.702149708522484 8024308.62835927400738,935392.856889430899173 8020958.44473572075367,918169.282634915667586 8009859.422913095913827,917798.032133119413629 8009037.448659811168909,917705.525636269827373 8002527.787571116350591,915231.672592369723134 7993387.265882426872849,914706.021956844488159 7992449.691836322657764,914056.695367046166211 7991631.307281938381493,913036.229594945558347 7991571.876182373613119,911923.034687012899667 7991923.833164190873504,907831.375483415904455 7996786.320594782941043,905274.700738366693258 7988703.936146878637373,904749.050102841458283 7987709.020355594344437,903697.748831788194366 7987358.735188421793282,883289.212626186432317 7984023.313611553050578,869343.329458586988039 7981509.9328489061445,852769.081793867284432 7976601.371131798252463,849089.416025693761185 7971811.198058685287833,848316.30216213373933 7971168.241061267443001,847265.00089108326938 7970818.725884389132261,841544.403578708530404 7969592.083498089574277,838050.196082196314819 7969008.568686692044139,833102.712633381481282 7968484.347500520758331,819620.697783916373737 7970001.012109574861825,807189.984205504530109 7974614.872442333959043,804128.69820869108662 7976541.848456952720881,796088.870625127688982 7977360.273964766412973,788203.777133766910993 7973971.675658767111599,787430.663270207005553 7973270.71900865342468,787647.17967980063986 7972103.163665763102472,788018.207542614429258 7971052.644947407767177,788234.612632716773078 7969883.962953849695623,788172.830315325874835 7968716.72320478502661,787399.827771257143468 7968075.711439660750329,784709.569637257489376 7966500.201823559589684,780844.334277934278361 7964750.512557877227664,779391.058325626072474 7964808.051981281489134,772124.233286134200171 7975548.751660912297666,768413.732019010814838 7979113.110691390000284,754931.605850057327189 7990751.901457586325705,749334.684491952881217 7991806.442086434923112,748994.603447580127977 7980808.272943530231714,735605.317733944277279 7981742.921995780430734,734461.176007573259994 7982094.418839399702847,730132.07233011291828 7987826.347421145066619,729853.884922619559802 7992742.460373332723975,733286.198782249703072 7999655.66139199025929,736131.079688960686326 8004168.711907312273979,744077.955497712362558 8010974.967593573965132,753323.595805546385236 8017550.119763416238129,751715.697080529644154 8019959.456610713154078,736563.889869165490381 8021839.915782598778605,708022.796944171073847 8024426.52892289031297,706610.152606004383415 8024416.792001812718809,699550.159180402872153 8032015.858337538316846,693860.508686469285749 8035194.6210319949314,691881.582098635728471 8036195.641332347877324,684831.273468734696507 8038138.494083553552628,682852.235561412875541 8039081.795771449804306,669246.544757677358575 8047510.401468094438314,667143.830896082450636 8049752.680068468675017,666061.582806590828113 8051582.421472614631057,664917.441080217016861 8054709.565432957373559,664670.089171673636883 8055891.747987180016935,664422.737263132934459 8059848.167167673818767,664082.544899266096763 8065107.138852822594345,663680.570218014065176 8066172.403520179912448,663123.972764047794044 8067058.998129826039076,660990.423403502907604 8067887.361868102103472,659506.089313265169039 8067945.910706260241568,656877.72481614490971 8067768.775261412374675,655702.6362713300623 8067531.820580099709332,651590.049003463354893 8067413.239608043804765,643210.140375527204014 8069542.873860809952021,640891.021423832629807 8070252.886670751497149,640025.17842444346752 8070844.331504521891475,628367.578709588735364 8082626.528659483417869,626264.86484799371101 8084938.038040732033551,625708.15607453614939 8085826.860030055046082,613401.341089377179742 8108389.221411719918251,612999.255088633857667 8109400.084788913838565,607556.956503240857273 8125353.961807542480528,607545.267956706578843 8126779.768484493717551,608732.0450480527943 8128752.959324805065989,614297.90826822782401 8142836.698410353623331,617081.006857550702989 8153357.767818887718022,618255.984082871465944 8160779.588445977307856,618039.578992771916091 8173365.486140774562955,616802.708130566054024 8176544.073537944816053,616648.085357854724862 8180085.162885540165007,617513.928357243887149 8186632.663616484031081,618132.308128601172939 8187474.411960972473025,619307.396673416020349 8187112.909290679730475,620173.239672805182636 8186512.174409518018365,635603.345611151074991 8175044.350661769509315,636178.53342007973697 8174010.510591099970043,635169.978833492961712 8167853.42267526499927,639465.797983204829507 8164885.169923665933311,644956.965825056657195 8164016.210737592540681,647571.860663791536354 8164957.425998339429498,647459.87325605249498 8169047.83159064501524,649456.499642921262421 8172345.697117233648896,650817.046459394623525 8172465.957156729884446,651992.023684718296863 8172105.182866706512868,654001.897090992773883 8171085.782342465594411,655733.583089771098457 8169827.591589765623212,660742.960175468120724 8165930.902305148541927,661454.180402145953849 8165152.41305391676724,668906.352393813431263 8156350.298397602513433,674379.597797644790262 8150008.240084203891456,675090.818024322506972 8149231.628221835941076,680223.871064292616211 8145406.360164386220276,682419.425381208071485 8144569.353715144097805,686686.63542178622447 8144211.648708716034889,693211.070777179556899 8144628.506828442215919,693551.263141043600626 8145526.186049027368426,692870.989732806920074 8146302.627016363665462,690211.678417245508172 8146422.46731083188206,687521.420283245970495 8146241.954567885957658,686191.82028521085158 8146481.419976065866649,683872.590014022309333 8147198.786480580456555,682852.235561412875541 8147676.710527835413814,680131.141928460565396 8149410.491463392041624,679265.298929071403109 8150069.15846224501729,677719.182521442766301 8151443.721392393112183,675771.091432561981492 8153955.833186843432486,674657.896524629322812 8155750.317395746707916,674255.921843374380842 8156828.594348207116127,674194.139525983482599 8158145.359541978687048,674534.220570356119424 8159342.307332886382937,677997.481248427298851 8166409.813932738266885,679605.491292935330421 8169346.733534428291023,680873.197654088260606 8171026.418760725297034,681677.147016598028131 8171746.153161397203803,682573.936834428342991 8172284.812164810486138,689284.053100465447642 8175823.875074476934969,692190.716324567445554 8177325.267401888035238,696426.979546707239933 8178884.875855069607496,712908.498075594892725 8184109.719892483204603,721968.680111770518124 8186632.663616484031081,733471.657053910894319 8189577.576621572487056,735574.482234997209162 8190358.408866608515382,737306.056914284359664 8191562.2803919557482,737367.839231675257906 8192764.614842044189572,736192.862006351700984 8193124.876767247915268,724009.500336483237334 8190959.670932640321553,712382.84744006965775 8188195.739089679904282,709970.888033051742241 8187533.906902715563774,691355.820143619319424 8181526.454688332974911,687119.556921482319012 8179966.508677003905177,685140.519014157587662 8179005.241603391245008,682512.043197548948228 8177204.928822759538889,680966.038109411485493 8175764.473693327046931,679048.782519477768801 8173184.319257402792573,672648.023118354729377 8160000.12863503023982,672462.453527202247642 8159401.577840687707067,671843.962436356581748 8158564.721952884458005,670978.119436964509077 8159222.259058487601578,669865.035848523140885 8161018.228099280036986,665091.544763817917556 8172162.827854244969785,663896.196071677841246 8183183.377362267114222,660833.017643521889113 8183110.727923827245831,653692.762865058379248 8193726.146026897244155,653290.67686431214679 8194809.939196091145277,653043.324955771560781 8196012.798912043683231,653259.841365362284705 8197336.516005608253181,653599.922409737831913 8198480.41818337328732,654094.737546313204803 8199503.579808888025582,655362.443907466134988 8201247.959522259421647,656290.180543737486005 8201790.49326588679105,663000.185490283300169 8205404.782799035310745,668968.246030692826025 8211370.144219322130084,668411.648576726438478 8212274.391636410728097,668164.2966681830585 8213480.081349120475352,668380.813077776576392 8214806.913504043594003,668720.894122149329633 8216014.751757897436619,675121.764842763543129 8224705.379556931555271,684243.84051581856329 8233529.18472315184772,686593.79496646579355 8235645.428587857633829,702456.822404504870065 8246723.096719471737742,704312.184357556398027 8247814.652294090017676,706445.733718101284467 8248601.631572772748768,708857.693125119083561 8249085.900900777429342,712939.444894035928883 8249328.920037560164928,715784.214481258648448 8249026.129011893644929,718474.472615258186124 8249147.636605600826442,719711.454796955222264 8249388.912522186525166,719618.614341631997377 8250419.331924235448241,718598.148569531389512 8250965.252601576037705,713186.796802579425275 8251268.122811656445265,709754.482942949398421 8251268.122811656445265,704868.781811522785574 8250297.803493444807827,702735.232450980693102 8249510.426059810444713,700879.87049792916514 8248420.365916961804032,699302.80727185937576 8247025.793736808933318,696736.225092130131088 8243514.352004612796009,695004.650412840186618 8242120.701780800707638,682883.18237985111773 8236554.161679781973362,681677.147016598028131 8236371.447958056814969,680811.415336700039916 8236976.227975433692336,667422.129623064189218 8251995.891070691868663,667638.534713166533038 8253389.433808936737478,670978.119436964509077 8260730.316803643479943,671472.93457354279235 8261762.313746605999768,672122.26116333832033 8262610.874516508542001,676049.390159543720074 8266195.001094698905945,679358.028064900659956 8268927.980176351964474,691819.688461753539741 8283341.940624457783997,692469.015051551978104 8287421.141530956141651,693489.480823652585968 8289492.511941725388169,694138.807413451024331 8290346.010589113458991,695066.544049722375348 8290895.100675165653229,711455.110803798306733 8298211.340050421655178,714547.343619055580348 8299553.424600059166551,717639.57643431017641 8300895.752635965123773,720113.318158718990162 8301383.45298229996115,715506.02707376528997 8303153.723872282542288,696643.495956300874241 8307305.865597635507584,695561.24786680645775 8303701.787353371270001,693613.156777925789356 8297906.324837221764028,692901.936551247956231 8295832.598657839000225,686995.880967209115624 8283464.01219785399735,686501.065830633742735 8282428.98796265386045,684985.896241446142085 8279325.221062841825187,684336.458332159323618 8278472.991806040517986,682264.691289005451836 8275978.632918519899249,680038.412792631308548 8273668.744362223893404,677038.909113206085749 8270690.506650036200881,662258.129764655721374 8257210.63396127987653,661639.638673810055479 8256785.886106536723673,660557.390584315638989 8256422.522165949456394,659691.547584926476702 8257029.157735844142735,659135.061450451379642 8257938.767360270954669,655022.362863093381748 8267165.872862375341356,654218.413500583614223 8269291.739003543742001,654342.089454856701195 8272027.61135237198323,654775.010954549885355 8274702.544970967806876,655115.091998925432563 8275918.424822954460979,655640.853953941958025 8276952.539479707367718,656413.967817499069497 8277682.615468640811741,657774.514633975224569 8277438.664855912327766,658640.246313876006752 8276770.360170527361333,661485.127220586990006 8276526.43960218410939,666494.504306284012273 8277316.692562642507255,683841.754515072447248 8283584.332468495704234,684769.379831852507778 8284132.921250207349658,684367.516470088856295 8285230.001554160378873,683501.56215120840352 8285898.850946831516922,682295.749426934984513 8286263.663495570421219,681089.714063681778498 8286325.4904805701226,656259.233725296333432 8284132.921250207349658,646518.778280886937864 8282489.249010889790952,635974.373473964864388 8275370.663103073835373,630655.750842845067382 8269851.739394003525376,630266.132625068887137 8269340.956091376021504,630618.681452411576174 8268939.572936235927045,630068.317889928817749 8267651.356451342813671,632418.272340573254041 8269839.27017458807677,634119.011520913336426 8271116.052168231457472,635046.636837693513371 8271661.967684770002961,637056.621563456486911 8272635.30685,639190.282243492547423 8273425.144769687205553,641787.699922171770595 8273790.656599882058799,643148.246738647925667 8273850.847403174266219,644477.958056174218655 8273668.744362223893404,645374.747874004417099 8272999.247746773064137,651590.049003463354893 8264311.785087327472866,652146.646457429626025 8263401.39311068225652,652548.621138684567995 8262307.540581278502941,652641.461594007909298 8260972.188437905162573,651961.188185768434778 8255451.52815346326679,651033.340230008587241 8254845.021650132723153,633129.492567253881134 8247390.224186033941805,626203.082530605606735 8249934.757349522784352,626481.269938096171245 8253692.621332230046391,624762.0517222849885 8256943.989919777028263,624613.66284105705563 8257671.441931375302374,623667.335849823430181 8261057.18404793087393,623259.238596576149575 8262259.899924050085247,622832.439668875304051 8262696.107467362657189,622201.703434039256535 8263024.591315007768571,621311.147507695364766 8263061.090418994426727,620587.570817538886331 8262877.722485880367458,620290.681735591962934 8262259.899924050085247,620810.209799124859273 8261894.956423005089164,621608.036589639494196 8261785.695396965369582,622053.203233322943561 8261312.176726019009948,622294.432569871307351 8260657.123239548876882,620667.943489889381453 8251025.25832487270236,620327.751126025337726 8249874.97861891053617,619833.047308941255324 8248844.634841575287282,616277.057495040819049 8241758.273560464382172,614699.994268971029669 8240305.251485222950578,613493.95890571794007 8240062.527785854414105,610649.18931849533692 8240364.953145058825612,608299.123548359726556 8241031.726952186785638,600414.030056998948567 8243271.523294094018638,599393.564284898340702 8243755.444745782762766,588570.860750994528644 8255694.537661084905267,587426.719024620717391 8257573.818136020563543,579294.162305228179321 8274094.679878973402083,577374.791644969489425 8287471.356361660175025,576511.175035396474414 8289736.860019963234663,576418.445899564423598 8291077.408468172885478,576604.015490716905333 8292418.19974922016263,590457.058202995918691 8316410.046808616258204,604557.564143306808546 8333184.059217867441475,609505.047592121525668 8338948.298980118706822,610278.161455681547523 8339684.520873728208244,611360.40954517305363 8340051.77596745826304,613432.176588327041827 8334717.660451551899314,613679.52849687053822 8333429.855313805863261,613122.931042904150672 8326813.644809202291071,612906.525952801806852 8325466.60383363161236,610308.996954631409608 8312803.290225265547633,607093.088185103726573 8299918.69119044393301,607774.920066214748658 8293466.252875459380448,610803.812091206782497 8294673.585117329843342,611731.437407986843027 8295222.996369487605989,612535.498089987901039 8295953.120143852196634,613803.204451140831225 8297722.092077150009573,614238.90893810626585 8298635.176159449853003,615132.915768667124212 8300955.944543217308819,616678.920856804586947 8305595.050352720543742,616895.437266398104839 8306938.475220559164882,616771.761312125017866 8308342.616086570546031,616524.409403584315442 8309565.794730065390468,615720.460041074547917 8311703.874308820813894,615132.915768667124212 8312620.226242296397686,614885.563860123627819 8313842.35220495890826,614947.346177514526062 8315064.900302571244538,615349.432178260758519 8317755.438105562701821,616462.515766702126712 8322895.761919976212084,616802.708130566054024 8324059.207224760204554,617792.227084228419699 8326139.101698081940413,618441.553674023947679 8327059.229061296209693,619214.556218092679046 8327794.266967128030956,620173.239672805182636 8328344.380663487128913,621688.409261992783286 8328283.744880983605981,632047.244477759464644 8326201.483330014161766,639128.388606610358693 8328344.380663487128913,639623.092423697351478 8329385.629808701574802,646364.266827663988806 8337905.480376842431724,647168.216190173756331 8338579.332352060824633,648095.841506953933276 8339194.286973289214075,655702.6362713300623 8342200.46278855483979,660526.555085365776904 8341647.549110042862594,661423.344903198885731 8341034.157166390679777,662783.780400180956349 8340788.10788187943399,674255.921843374380842 8342507.090376737527549,675338.281252357177436 8342937.008998402394354,701219.95154230191838 8364200.592473832890391,702024.012224302976392 8364939.337641714140773,702549.55154033692088 8365985.983022426255047,702766.067949930555187 8367032.776938728988171,701529.19708772469312 8366785.859374655410647,690922.898643923341297 8362415.855451660230756,687150.392420432181098 8360200.599619137123227,685418.817741142120212 8358909.891896876506507,683006.858334124321118 8356758.107235258445144,681708.093835039180703 8354974.948054731823504,679760.002746155485511 8352638.703349508345127,674348.650979203637689 8347416.853945689275861,673390.078843982424587 8346865.317896196618676,671225.582664999295957 8346005.269152809865773,666463.557487845770083 8344900.902188607491553,664948.276579166878946 8344961.674542512744665,650167.608550107805058 8348030.776395179331303,645436.530191392521374 8350979.730571517720819,634335.527930506970733 8362599.936332741752267,635108.530474575702101 8370050.09449643176049,638417.279699423816055 8379541.962877272628248,642406.191013020230457 8383181.481893667951226,648343.193415497429669 8386266.752950662747025,654094.737546313204803 8387996.367248709313571,656568.479270722018555 8388550.987729794345796,662381.805718926014379 8388550.987729794345796,663464.053808420430869 8388983.376140877604485,664268.114490418694913 8389724.608928915113211,664917.441080217016861 8390589.771254096180201,665783.284079606295563 8392875.346818389371037,666154.311942420084961 8394049.879584979265928,665752.448580656433478 8395161.631678953766823,662752.833581742714159 8400356.184223035350442,665968.742351267486811 8406480.925945356488228,668287.972622456145473 8410382.156674740836024,670916.337119576404803 8413912.699889324605465,671720.28648208337836 8414656.446298962458968,679976.519155749119818 8423461.296442979946733,675925.714205273427069 8438491.415977092459798,675832.985069441376254 8439859.274343805387616,675894.767386832274497 8441102.677178602665663,676265.906569137354381 8442284.933248195797205,677131.638249035342596 8443964.377221945673227,690706.382234332500957 8465835.970262030139565,704868.781811522785574 8479388.523122683167458,720329.834568309714086 8492716.772316992282867,721164.730749260634184 8493406.753647042438388,724040.558474412770011 8495159.95899510756135,726266.836970789707266 8495975.588138602674007,730781.510239399736747 8495849.944663491100073,734584.851961843669415 8494846.678661836311221,736718.512641879729927 8493781.760923016816378,738511.980958049069159 8492467.402877731248736,739223.201184726785868 8491652.163771353662014,739006.796094624442048 8490274.624628817662597,737646.249278148286976 8488460.616994647309184,735543.424097064882517 8484266.836297852918506,733595.33300818130374 8479826.511208830401301,732451.191281807492487 8476200.730425897985697,727101.733151737833396 8457603.377187637612224,724566.097790449624881 8433954.079670986160636,724071.393973362632096 8425075.232712985947728,724411.586337226559408 8422406.677062468603253,725370.047152956598438 8417444.937466036528349,725926.755926414160058 8416825.206242062151432,726297.783789227949455 8418003.566004473716021,726483.353380380547605 8421105.026901001110673,726174.107834957656451 8426626.508901184424758,726421.459743501152843 8431220.812948813661933,727349.19637977250386 8436751.686992963775992,732296.679828587337397 8456730.298629367724061,736038.239233640255406 8471015.734361508861184,736811.353097200160846 8473451.479755027219653,740274.613775268546306 8482765.263552153483033,740800.264410793781281 8483766.878434067592025,750478.826218326576054 8497667.586081262677908,753849.357760565704666 8502180.81302903778851,755333.580531312152743 8503812.144341226667166,757127.160166972782463 8505066.42773274704814,760744.93229826411698 8505945.276638805866241,771196.607969351229258 8508454.788392703980207,772588.101604268536903 8508516.927104746922851,776917.205281728878617 8507889.463291959837079,780596.871049899607897 8506760.525223830714822,781648.394959932542406 8506195.104890357702971,784091.189865900203586 8505442.031835343688726,785482.572181326220743 8505505.726081192493439,787430.663270207005553 8506634.696790041401982,788265.670770649099723 8507387.892394635826349,790584.78972234367393 8509710.092550029978156,791265.06313058314845 8510589.498467607423663,790863.088449328322895 8511719.026535239070654,789657.1644055636134 8512096.780290644615889,776948.152100169914775 8513226.54072424583137,776267.767372439266182 8522338.59018255956471,780287.736823968007229 8529385.54427694901824,780844.334277934278361 8530644.213815908879042,780751.605142102227546 8531714.729085221886635,779483.787461458123289 8531778.652162408456206,776577.012917864951305 8530078.760240664705634,773948.648420744691975 8527938.590934308245778,769032.111790368100628 8521836.029260100796819,766991.180246164090931 8519133.657708553597331,765414.228339585592039 8515928.317208310589194,758302.137392296339385 8509334.043689521029592,744603.71745272888802 8498356.228221153840423,742810.1378170682583 8497041.050126710906625,740862.046728184679523 8495911.976630812510848,738202.846732114558108 8495598.889733206480742,736996.811368861468509 8495975.588138602674007,735203.343052692129277 8497290.575136639177799,734461.176007573259994 8498106.666946297511458,733904.578553606988862 8499108.573733374476433,733502.715191843220964 8500174.265384612604976,733719.008962454390712 8501615.745808402076364,731152.538102213526145 8502807.788358265534043,719896.913068616529927 8498795.124665338546038,709661.642487628967501 8493719.746971433982253,706260.275446439976804 8490964.150830034166574,703013.419858471257612 8488022.113214673474431,701374.574315013363957 8486581.724886484444141,700261.379407080588862 8486143.333396466448903,699024.508544877637178 8486206.860242202877998,696736.225092130131088 8487083.451712969690561,695839.546593791106716 8487771.100751098245382,695097.379548672237433 8488584.331177894026041,693056.559323959401809 8491151.702350065112114,692499.961869993130676 8492154.237535655498505,691603.172052162815817 8489524.762386409565806,688820.296101819491014 8477575.629518415778875,685758.898785514873452 8462528.756849925965071,684645.703877582214773 8458911.50634454190731,683377.886196938110515 8455359.296778462827206,682357.531744325882755 8453302.488677559420466,681398.959609104669653 8452679.5038390327245,680347.547018563025631 8453240.815756382420659,665937.906852317624725 8452493.156866928562522,656754.048861874616705 8433518.81799584813416,654620.388181838439777 8410382.156674740836024,654403.983091736095957 8409019.767666101455688,652888.813502548495308 8405862.11708408780396,651590.049003463354893 8404067.263951621949673,647291.892144444049336 8400726.473243188112974,645560.206145665724762 8399427.092357685789466,640829.127786950441077 8396584.21600347571075,639777.826515899971128 8396769.374666815623641,635788.915202303673141 8400478.424300361424685,635046.636837693513371 8401283.834513384848833,632727.517885998939164 8407967.215577473863959,632817.464034558739513 8409524.921283403411508,633098.657068304019049 8413293.266019543632865,628522.201482300180942 8432587.319324677810073,627563.629347078967839 8431966.311215473338962,623852.905440975911915 8431220.812948813661933,621069.918171144207008 8431034.785571010783315,619709.371354670962319 8431220.812948813661933,618627.011945685255341 8431717.207107,617730.333447346230969 8432401.25737783126533,617173.847312871133909 8433332.956137264147401,617204.682811820995994 8434575.255673166364431,627099.761028944631107 8469518.443249419331551,631583.487479116418399 8479889.983387826010585,632387.436841623391956 8480638.861501038074493,634737.502611761912704 8481265.573880368843675,636778.322836474748328 8482265.407988838851452,638108.034154001041315 8484079.460710724815726,638602.737971085123718 8485143.19598856754601,638355.386062541627325 8486394.290170058608055,637613.219017422758043 8487207.367977697402239,636376.348155219806358 8486957.960465317592025,635417.776019998593256 8486394.290170058608055,626790.515483521856368 8480827.725006695836782,626141.188893723418005 8479951.880545001477003,625120.72312162281014 8477826.293438911437988,617204.682811820995994 8457415.110146898776293,606783.953959172125906 8439734.587462406605482,602362.121145882527344 8428674.301138937473297,601310.819874829263426 8429172.311698196455836,596796.146606219233945 8432401.25737783126533,590672.350098188850097 8442045.779747545719147,581367.599140742095187 8445296.738812210038304,581419.696662432514131 8446503.419907357543707,591558.564564394415356 8457737.792484818026423,591063.304149854113348 8458526.157425314188004,575305.362311122938991 8461718.632462777197361,574470.354810680844821 8463901.322288880124688,572429.423266476835124 8477263.099153118208051,572522.263721800060011 8480389.677161674946547,572738.780131393694319 8481765.361336825415492,573233.483948477893136 8482828.761155808344483,579294.162305228179321 8487583.860960559919477,584705.625391668407246 8495662.498525235801935,582200.936848821351305 8504752.723842449486256,582108.096393498126417 8505819.462198864668608,582139.043211939162575 8507387.892394635826349,582850.263438616879284 8509835.747792230919003,585478.627935737138614 8513478.426211116835475,587581.341797332162969 8516052.721969483420253,589189.240522349020466 8517561.12812315300107,590457.058202995918691 8517498.912671010941267,592281.473337606294081 8516242.499846762046218,595280.977017031633295 8512974.663895409554243,597198.00996798009146 8510275.558106619864702,600011.944056252832524 8506886.355817701667547,607742.526094393339008 8497603.959894379600883,609999.86272869980894 8495159.95899510756135,611638.708272157702595 8493719.746971433982253,614112.449996566516347 8492967.954084601253271,615503.943631480913609 8492780.581591894850135,617050.171358600840904 8492716.772316992282867,624193.097804839839227 8492716.772316992282867,627130.70784738578368 8492780.581591894850135,627934.657209892757237 8493532.355271315202117,634799.284929152927361 8501615.745808402076364,635325.046884169336408 8502682.027754560112953,636036.267110847053118 8505128.53772646188736,636252.672200949513353 8509835.747792230919003,636747.376018033595756 8551449.477800389751792,634613.826657491619699 8555933.438329050317407,630191.993844199227169 8559409.81919433362782,626481.269938096171245 8560231.043216234073043,619214.556218092679046 8555050.388683488592505,616091.487903888337314 8543435.579684773460031,596703.306150895892642 8526616.507730970159173,592126.850564894964918 8525106.235927596688271,587241.149433468235657 8523848.517769968137145,585695.144345330772921 8523912.37222002632916,584458.273483127821237 8524288.943649772554636,582479.124256311915815 8525420.585975850000978,578706.618032820755616 8529449.447023523971438,567049.01831796602346 8545013.903774200007319,566616.0968182728393 8546148.754546973854303,566337.909410779480822 8547410.310156811028719,566987.23600057780277 8548294.255531150847673,568100.430908510577865 8548736.154666231945157,569522.871361866011284 8548862.708589235320687,570759.742224069079384 8548483.280583579093218,572584.157358679454774 8547157.254736468195915,575552.714219663641416 8542363.57609998062253,577067.772489359951578 8540787.639095697551966,578737.676170750171877 8539338.430673971772194,580562.09130536345765 8538014.287516003474593,581644.228075363789685 8537825.532673187553883,581984.420439227716997 8538708.32102920114994,572336.694130647578277 8558777.978641113266349,571161.716905323904939 8560673.664095532149076,569337.30177071352955 8562318.081694405525923,568409.676453933352605 8562950.228212632238865,566245.068955459049903 8564025.480862164869905,559596.846326301223598 8567187.726380709558725,548681.302337076980621 8579789.028084997087717,549176.006154161179438 8580549.791019462049007,556288.208420944400132 8581120.757526831701398,557957.889463352155872 8579663.534911941736937,567945.808135796221904 8572884.630996899679303,580871.225531295058317 8565225.907329149544239,587364.825387738528661 8562191.294752173125744,588261.615205568843521 8561495.030067017301917,589776.784794756444171 8559914.96686153113842,590951.873339571291581 8557955.325326573103666,591075.549293841584586 8556565.260622266680002,590704.521431027795188 8555301.898018071427941,590766.303748418809846 8552333.911357259377837,593332.885928148054518 8545644.556571155786514,594507.86315347161144 8543750.944811491295695,596023.03274265921209 8542112.284129301086068,597259.90360486228019 8541797.216595765203238,603629.938826526631601 8540725.225992927327752,604866.809688729583286 8540725.225992927327752,605299.619868934387341 8547410.310156811028719,605175.943914664094336 8548862.708589235320687,602362.121145882527344 8556756.091693751513958,601774.576873475103639 8557703.497249960899353,597136.22765059187077 8563709.468123039230704,593456.561882418347523 8565860.127206742763519,592374.202473435550928 8566365.720702240243554,585725.979844280635007 8569276.751861358061433,584643.7317547891289 8569782.581714434549212,583715.995118517661467 8570478.040979696437716,583128.56216560152825 8571427.45425040088594,582695.640665905550122 8572694.974156156182289,582912.045756007893942 8574088.337218048051,583406.860892583266832 8575165.001532079651952,595621.058061404386535 8591079.910045016556978,597259.90360486228019 8592603.869134269654751,598373.209832286112942 8593048.455211011692882,604402.941370595362969 8594700.175252972170711,605701.705869680503383 8594953.281493378803134,607247.822277306346223 8594890.404237031936646,609257.695683580939658 8593746.132759056985378,610370.890591513598338 8593555.933581445366144,611793.219725377857685 8593620.628178466111422,613865.098088023019955 8594635.699726624414325,615658.566404192359187 8595970.139067381620407,615998.647448567906395 8596605.432511284947395,607866.202048663632013 8602450.987907737493515,595868.409969947766513 8597367.949104152619839,593920.430200555478223 8596223.289333522319794,592899.96442845207639 8594000.80624227412045,592312.420156047446653 8591397.108674747869372,591910.445474792504683 8588541.674610201269388,591539.417611978715286 8587335.813508817926049,591044.602475400548428 8586194.323557266965508,590240.541793402284384 8585495.768535550683737,585416.734298857860267 8582515.5000238455832,584303.539390925201587 8582388.362244611606002,572800.562448781798594 8581818.894314724951982,569708.329633527318947 8583530.855609161779284,569936.645909143495373 8587935.178571939468384,569059.003043728880584 8587145.781196678057313,567945.808135796221904 8586701.554273208603263,566677.990455152117647 8586447.135184548795223,565100.92722908523865 8586511.53846089169383,563709.544913659221493 8587145.781196678057313,562781.808277387870476 8587842.895076951012015,562008.805733319139108 8588604.497228885069489,561421.261460911715403 8589620.699590163305402,560555.418461522553116 8591841.849837835878134,554773.038831756799482 8613586.50317738391459,554649.25155799521599 8614732.055343251675367,554834.821149147697724 8616133.234290506690741,557039.948942272458225 8625823.200203359127045,557123.104601892409846 8633161.708701770752668,557463.185646267957054 8634373.55791100114584,557988.947601284482516 8635459.382244454696774,559287.600780878448859 8637311.8412701562047,561761.453824775642715 8639612.663971547037363,562719.914640508475713 8640251.539642764255404,564822.739821591880172 8641273.120894197374582,568193.160044339718297 8642616.119873970746994,570883.418178342166357 8642359.97365490719676,574810.435855056392029 8641720.683016322553158,576078.253535700496286 8641401.288832142949104,582973.939392890082672 8638908.746265264227986,583901.564709670259617 8638269.988283429294825,584643.7317547891289 8637439.939565783366561,585973.331752824131399 8634054.485508862882853,586715.498797943000682 8633288.125137321650982,588910.941795367281884 8632202.624133555218577,590333.382248722715303 8632011.419865014031529,603289.746462662704289 8631692.450827483087778,607340.440093647222966 8633926.446691896766424,608051.771639816230163 8636417.055818937718868,609412.318456292385235 8638269.988283429294825,610370.890591513598338 8638845.719041734933853,626203.082530605606735 8646325.610803812742233,637396.813927323208191 8648244.172715365886688,644756.256783155957237 8649523.49472594819963,648930.737687904853374 8650611.578931730240583,659104.114632010227069 8654133.35848175548017,680162.088746901717968 8652659.636164044961333,681584.417880765977316 8652404.749786766245961,695623.030184197472408 8647604.595942294225097,696705.389593180269003 8647028.172796174883842,697447.445318807847798 8646197.356225118041039,698034.989591215271503 8645238.166450314223766,698467.911090911366045 8644085.970260290428996,703693.693266710732132 8641018.63253173045814,709352.508261694456451 8640060.124131008982658,713217.743621020577848 8641146.795994088053703,725029.966108583845198 8648115.884359935298562,733657.226645063492469 8660665.901813838630915,740831.211229234817438 8660731.194554628804326,758363.919709684560075 8658615.592323815450072,759631.848709819838405 8658232.030785273760557,760714.096799314254895 8657654.996702531352639,761610.775297653279267 8656951.178493097424507,774072.32437501498498 8644918.618060924112797,775216.466101388796233 8642935.797461753711104,780256.790005526854657 8629459.139291200786829,793522.399764889618382 8609194.632492987439036,793769.751673430320807 8607922.36610871553421,793646.075719159911387 8606330.398445025086403,793213.154219463933259 8602070.369585348293185,792718.450402379850857 8599273.673941873013973,792316.364401633734815 8598065.810771960765123,790801.306131937308237 8593746.132759056985378,791914.501039869966917 8593810.600431364029646,793707.858036550926045 8595080.409527448937297,795099.462990956613794 8596922.871255623176694,796181.711080448119901 8599018.816480444744229,797356.688305771793239 8602768.909823700785637,797882.450260788202286 8605566.945157723501325,797975.179396620253101 8607158.74628215841949,798098.855350890662521 8611739.83088973723352,797882.450260788202286 8613012.763080948963761,796985.660442958003841 8613714.185396766290069,795563.331309090834111 8613967.722603056579828,791852.607402987778187 8615115.168854750692844,790770.35931349627208 8615687.239941459149122,789131.402450547087938 8617216.345896419137716,787245.20499854569789 8620019.927719179540873,781339.038095018477179 8634182.526574714109302,778927.190007491852157 8644022.898246001452208,778865.296370609663427 8645429.718024102970958,778958.025506441714242 8646708.545896241441369,779329.164688746677712 8647924.262154597789049,781462.825368779944256 8648948.762501949444413,782761.478548373910598 8649140.411655722185969,785760.982227799249813 8648820.461739126592875,788482.075860751559958 8649140.411655722185969,798439.047714754589833 8650676.551201542839408,814085.558743202826008 8654259.908753069117665,826949.193821310764179 8667592.271149190142751,824104.312914596870542 8670478.837500179186463,821445.112918529543094 8671120.426498282700777,819620.697783916373737 8672532.491144159808755,819064.10032994998619 8673560.459801316261292,818074.47005679924041 8675678.560721373185515,813126.986607981612906 8692266.963425669819117,813065.092971102218144 8693746.874335961416364,819775.209237139322795 8710118.048921881243587,829917.639362803660333 8724327.35627462528646,831340.079816162004136 8726137.165742436423898,833040.818996499292552 8727625.620998840779066,837060.677128536743112 8729953.326282968744636,838204.818854910554364 8730342.320289259776473,839225.173307519871742 8730923.520821446552873,840925.912487860070542 8732413.190639510750771,841637.132714537787251 8733319.86281693354249,842750.327622470445931 8735519.322052616626024,843183.249122166424058 8736750.209930812940001,842379.299759656656533 8736943.953908730298281,841358.833987556048669 8736362.504357295110822,830907.26963595720008 8729372.203400820493698,829051.796363414498046 8728076.897641589865088,826485.325503176427446 8725879.458580426871777,815786.297923542908393 8712635.105367565527558,813652.637243509641849 8709536.652457354590297,810343.999338149907999 8700961.406565168872476,809632.779111472191289 8690142.406530635431409,812384.819562862743624 8683581.2824776917696,818631.17883025680203 8669579.96870612539351,810189.376565438578837 8662333.01114466227591,795779.736399193177931 8658680.636031227186322,775556.658465252723545 8651059.715060131624341,774288.840784608619288 8651123.078433882445097,771969.721832911251113 8652084.656472489237785,771072.932015080936253 8652724.626703476533294,770640.010515384958126 8653876.57652797177434,769990.683925589430146 8656310.836811566725373,769928.901608198415488 8657720.031831003725529,770176.253516741911881 8659192.933196667581797,768815.595380774466321 8663037.349732775241137,762012.749978908221237 8666052.559718087315559,758580.436119278194383 8667527.147783648222685,754127.656487547443248 8667463.641516607254744,750262.309808733058162 8666693.758697602897882,748809.033856427646242 8666628.643369318917394,747386.59340306930244 8666885.64448812417686,733286.198782249703072 8673881.49865042977035,731461.783647639211267 8675294.099145846441388,730719.616602520341985 8676128.242394154891372,730651.60039364581462 8677798.203343782573938,730707.26013904158026 8678761.460883058607578,731430.83682919817511 8679957.09519780986011,732142.05705587589182 8681589.757498826831579,733657.226645063492469 8683260.046826278790832,737027.646867811330594 8686281.796522589400411,739099.525230456492864 8689048.397570079192519,745098.421269812970422 8704376.503893997520208,745469.44913262675982 8705667.590494615957141,747850.46172120643314 8716055.694074962288141,747603.109812662936747 8717348.857580045238137,747201.135131407994777 8718510.855070536956191,746242.451676695491187 8718574.576137965545058,745531.34276950894855 8717671.603099035099149,733750.067100383923389 8687762.110974250361323,725848.387004897347651 8682575.038345418870449,727870.616874647908844 8672889.536642007529736,724071.393973362632096 8656757.709586584940553,723391.120565125951543 8655797.128407290205359,716186.30048200476449 8652084.656472489237785,715042.158755630953237 8651636.457289479672909,706445.733718101284467 8651188.055265879258513,703941.045175251318142 8651956.300469554960728,702858.908405250986107 8652467.894405402243137,694355.212503553368151 8656886.150230012834072,664051.709400316234678 8661820.723779480904341,639994.231606002431363 8660986.372506504878402,619307.396673416020349 8656310.836811566725373,618194.201765483361669 8655862.146947605535388,614885.563860123627819 8652788.004561016336083,612875.57913436065428 8650034.917833529412746,608762.991866493946873 8646197.356225118041039,601929.199646186549217 8642040.321325452998281,600816.004738253890537 8641592.739573219791055,592807.123973131529056 8647924.262154597789049,587519.559479941264726 8651316.397732738405466,574346.678856410551816 8656374.015302328392863,569491.924543424975127 8658423.924351498484612,562163.317186542088166 8662333.01114466227591,561544.937415184802376 8663294.454907344654202,561266.638688200269826 8664576.42355196736753,561792.289323725504801 8665666.759241154417396,563122.000641251797788 8667527.147783648222685,566028.663865356589667 8669324.489379080012441,567481.939817662001587 8669451.303945960476995,570326.820724375895225 8669067.171164097264409,574717.706719224341214 8667014.26390821300447,575490.820582784246653 8666181.164420468732715,578119.185079904505983 8664000.733080124482512,579046.810396684682928 8663359.540422081947327,580314.628077328787185 8662974.113405900076032,581582.445757972891442 8663230.985550815239549,583963.34702706115786 8667335.014156810939312,583344.96725570387207 8668297.118748780339956,580438.415351090370677 8671762.072055228054523,578737.676170750171877 8673237.817313881590962,571718.314359290292487 8677476.066670652478933,569182.678998002083972 8677541.51036810874939,566461.585365049773827 8677155.100450452417135,558761.950145353213884 8675294.099145846441388,556040.856512400903739 8675549.788105849176645,555267.742648843792267 8676385.810377150774002,551216.937698365189135 8684289.532223803922534,551402.50728951767087 8685446.256950665265322,575614.496537054656073 8702830.844234123826027,602795.042645575711504 8711472.188491672277451,606814.900777613162063 8712117.404301246628165,611112.946317141177133 8711472.188491672277451,614761.776586362044327 8710247.435125809162855,619183.720719142816961 8709084.900262476876378,626543.163574978359975 8708762.303671520203352,627192.490164773887955 8709084.900262476876378,625337.128211722359993 8710440.473403656855226,622956.115623145597056 8711344.406777333468199,606351.032459476031363 8712635.105367565527558,601867.306009304360487 8712764.53639760799706,585942.496253874269314 8710311.083762690424919,584643.7317547891289 8710052.543679069727659,575119.792719970457256 8707020.900986129418015,572831.509267222951166 8706117.505187459290028,570883.418178342166357 8704957.255572626367211,569059.003043728880584 8703538.882661705836654,565781.311956813093275 8700444.536319050937891,564791.681683659553528 8699865.768773872405291,562534.456368844374083 8698963.261716607958078,561112.015915488824248 8699156.232477720826864,556999.428647622116841 8706182.974971681833267,551031.479426703881472 8720125.682099934667349,550907.803472433588468 8721224.146376987919211,552546.649015891482122 8722775.585594380274415,553536.167969553847797 8723421.806133326143026,563647.651276777032763 8728400.353108618408442,564760.846184709691443 8728853.308124784380198,565904.987911083502695 8729242.476105473935604,577036.936990412999876 8730665.876688696444035,594044.106154825771227 8730406.37818693369627,615318.374040328431875 8724908.075574155896902,616617.138539413572289 8725231.389927670359612,625800.996529859490693 8730276.632413804531097,641725.917604780755937 8730406.37818693369627,642467.973330408334732 8729565.750586081296206,643581.168238340993412 8729048.704641422256827,645003.720011190627702 8728853.308124784380198,646147.750418073148467 8729242.476105473935604,646209.532735461252742 8730536.126278530806303,642437.137831458472647 8736362.504357295110822,641694.970786342513748 8737203.686198832467198,638881.036698069772683 8739212.378802904859185,636500.024109490099363 8740119.900648482143879,635077.694975625840016 8740377.880538776516914,632325.543204744113609 8740313.734591972082853,628274.738254268304445 8739666.008923718705773,627130.70784738578368 8739212.378802904859185,626295.811666434863582 8738498.755893170833588,625615.53825819818303 8737527.548544954508543,624100.257349519408308 8735844.741052189841866,621595.568806669441983 8733513.515265394002199,619802.211809991393238 8732153.629681499674916,618658.070083617581986 8731700.235763331875205,608299.123548359726556 8729889.272382065653801,606876.683095001266338 8730083.066279066726565,577562.587625938234851 8741285.548136126250029,572831.509267222951166 8744655.711891274899244,572058.395403662929311 8745497.855521259829402,571470.962450746796094 8746472.231216695159674,571161.716905323904939 8747768.956079060211778,571068.876450003474019 8749195.994812631979585,572491.316903359023854 8753673.220754725858569,584427.326664686668664 8753543.058366280049086,587086.526660756790079 8755036.444035874679685,584266.470000488916412 8757646.517257565632463,580283.681258887634613 8759648.248661004006863,574223.002902140142396 8761791.602314576506615,573109.807994207483716 8762310.986661938950419,573140.754812645842321 8763285.751580465584993,579634.354669092106633 8764715.846702108159661,587055.691161806927994 8764456.999875668436289,592838.070791572681628 8763612.418393967673182,594105.888472216785885 8763221.402761217206717,594569.645470862626098 8762377.199141819030046,589009.904822682845406 8763000.047183837741613,588137.939251298550516 8762922.597726603969932,587451.431951575446874 8762649.308366073295474,587414.362561141955666 8762103.930334772914648,587989.550370070617646 8761674.862935228273273,589715.002477365429513 8761440.92193977534771,593481.274809375870973 8761363.255197957158089,594353.240380760282278 8761440.92193977534771,595039.747680480475537 8761713.931816887110472,595169.54620674601756 8762571.628681134432554,594105.888472216785885 8763221.402761217206717,592256.76041064877063 8764521.359661048278213,589585.092631611507386 8765769.584400555118918,588063.689150940394029 8766238.221529725939035,586319.646688680397347 8766471.380955884233117,582757.422983296448365 8766901.902853511273861,578286.164316094713286 8766667.793158460408449,569739.27645196847152 8767251.910946689546108,582726.58748434658628 8770049.773592194542289,582448.288757364847697 8771350.72126405313611,577933.72680824319832 8771220.241185249760747,569708.329633527318947 8771286.300823897123337,556319.043919894262217 8771416.782091779634356,554680.309695924748667 8771481.203691530972719,553752.573059656191617 8771806.365812668576837,552948.623697146307677 8772651.902456713840365,552515.70219745032955 8773824.665027434006333,549825.444063450791873 8781640.037756308913231,549701.768109177588485 8782812.37884127907455,550072.795971991377883 8784051.320407550781965,552763.054105993825942 8792856.253026844933629,554185.494559349375777 8797033.991152079775929,554711.145194874610752 8798144.401987317949533,555700.664148536976427 8798797.373907249420881,564142.46641335519962 8804352.014372773468494,587890.587342755054124 8824972.929529178887606,596115.873197979759425 8836256.548490468412638,597136.22765059187077 8836847.962575476616621,602238.445191609323956 8838161.207182940095663,603846.343916628975421 8838096.189461128786206,622925.28012419573497 8834352.391413096338511,631428.864706404972821 8831268.328604243695736,632387.436841623391956 8830547.706519497558475,634706.555793320760131 8828054.308306338265538,639499.41646942414809 8821826.104042986407876,666525.339805233874358 8819010.057354129850864,674812.519297340768389 8819074.90372054092586,693767.779550637118518 8820580.917732937261462,695375.678275653976016 8820516.057866772636771,696829.065547453472391 8820253.322393847629428,700694.300906776683405 8819074.90372054092586,701776.548996268189512 8818551.433281240984797,703662.857767760870047 8817175.499716689810157,705208.862855898332782 8815474.098628239706159,706136.599492169683799 8814753.162791708484292,707249.794400102342479 8814230.00490241125226,712537.470212781103328 8812789.866481326520443,720144.264977157232352 8812069.19799399189651,724597.044608890661038 8813248.361131383106112,725617.399061500094831 8813902.696970483288169,727318.138241840177216 8815407.634718462824821,728709.743196245864965 8817306.574640529230237,728802.47233207791578 8818878.951566927134991,728709.743196245864965 8820384.688937624916434,728802.47233207791578 8821694.947214672341943,729049.824240621412173 8823136.62343423999846,729575.474876146647148 8824250.810609880834818,730286.695102824363858 8825169.046820482239127,732884.224100994761102 8827594.874408883973956,734028.254507877281867 8828054.308306338265538,736656.619004997541197 8828578.466892506927252,738140.953095235279761 8828645.051918691024184,741202.239092048606835 8828317.091173445805907,743954.279543442069553 8827661.450380336493254,747788.679403815418482 8826479.936000328511,750169.691992392181419 8825496.864851128309965,752921.732443782733753 8827922.802405828610063,744480.0414984584786 8831203.609035016968846,740460.18336642102804 8831924.532711200416088,735203.343052692129277 8831268.328604243695736,731090.644465334247798 8830677.370682213455439,729049.824240621412173 8829497.252712942659855,728214.928059670492075 8828709.984715459868312,727503.70783299265895 8827791.298896379768848,726947.110379026387818 8826678.218642549589276,726019.485062246210873 8824250.810609880834818,725617.399061500094831 8823006.858449114486575,725370.047152956598438 8821498.688200611621141,724566.097790449624881 8818943.560956517234445,723731.312928989878856 8818223.92982067912817,722556.224384177941829 8817765.355573825538158,714980.265118748764507 8818682.7689269464463,710620.325942341471091 8819402.445703979581594,706785.926081965211779 8820580.917732937261462,692345.339097281685099 8824578.587027912959456,662493.236529211630113 8828290.174969188868999,660637.763256668928079 8828251.453587887808681,658040.456897480995394 8826992.413340860977769,656834.421534227905795 8826283.783163458108902,646797.077007868676446 8825431.960893725976348,645807.669373697601259 8824776.581563053652644,644354.282101901015267 8825037.593367375433445,641694.970786342513748 8827267.197352714836597,640118.018879764014855 8828973.027536425739527,637520.489881593617611 8832448.971891494467854,637860.682245457544923 8833106.700732227414846,641354.88974196696654 8834419.265931459143758,645281.907418681192212 8835271.911177400499582,646630.097771678585559 8836230.31181601062417,649283.286515247542411 8836427.916498737409711,650155.252086629043333 8836270.96688362583518,653086.628237688564695 8836151.838727310299873,654756.420599587610923 8836348.495785761624575,656055.185098672751337 8836979.630888218060136,655888.205862482544035 8837570.39489727653563,655108.96942693029996 8837805.862914714962244,653364.926964673097245 8838081.767427522689104,649468.744786908850074 8838279.186287658289075,643674.008693664334714 8839081.211511770263314,616060.541085447184741 8841840.034801328554749,604866.809688729583286 8843746.165339693427086,600939.680692524183542 8842892.283514874055982,599764.5921477121301 8842431.905854679644108,592312.420156047446653 8838686.098933130502701,588849.048158485093154 8837307.984756756573915,574532.248447563033551 8833762.835406757891178,573078.861175766447559 8833631.461940139532089,568162.324545389856212 8837832.81456246599555,567883.914498916943558 8839212.920503525063396,568255.053681221907027 8840459.427279630675912,571872.825812510447577 8851111.385628135874867,572398.587767526973039 8852230.129592351615429,573233.483948477893136 8853018.06806218996644,574377.514355360413902 8853150.031281244009733,575150.628218920319341 8852295.03769195638597,577500.805308547220193 8848807.882354237139225,581118.57743983855471 8849993.051660731434822,600846.840237203752622 8862039.76041224040091,601527.113645440433174 8862962.81009859405458,601248.926237949868664 8864280.572444029152393,600475.812374389963225 8865138.647070020437241,587643.235434214351699 8876880.730906281620264,579603.40785065095406 8882099.888952668756247,577346.071216344600543 8883156.354403112083673,569491.924543424975127 8883751.621022421866655,567574.780272982432507 8884809.994040377438068,566956.289182136766613 8885801.407762518152595,564791.681683659553528 8895525.717217918485403,564853.575320541742258 8896849.438554175198078,565317.44363867607899 8901486.523885285481811,565688.471501492662355 8902744.067423172295094,566214.233456509187818 8903539.448107874020934,573326.213084309943952 8909572.310333408415318,574501.190309630706906 8910036.751128090545535,575800.066128207137808 8909639.646424487233162,578181.078716783900745 8907118.792474433779716,584179.8634366519982 8899961.641030279919505,606320.085641034995206 8872788.701327998191118,608175.447594086523168 8869753.495657734572887,609041.179273987305351 8867445.702720070257783,608979.396956596290693 8865797.696720067411661,608107.542704703169875 8861366.584991125389934,608299.123548359726556 8860459.866106323897839,609288.531182530801743 8861051.604085324332118,611269.572840686305426 8863945.533368345350027,612442.65763466747012 8866324.599982975050807,617637.604311516974121 8877740.304348198696971,613493.95890571794007 8880513.934854524210095,608144.500775648280978 8881902.22029372677207,603629.938826526631601 8884016.67559527605772,599950.16173886472825 8886925.301615785807371,599517.240239168633707 8888115.077577939257026,599393.564284898340702 8889570.070280013605952,602795.042645575711504 8900955.139302244409919,603629.938826526631601 8901750.322696166113019,604650.293279135948978 8902347.364136530086398,607309.604594697360881 8902944.216449748724699,610432.7842283929931 8902944.216449748724699,632665.624249116750434 8900094.465206857770681,650693.259185633040033 8906257.382463213056326,652177.593275870778598 8906323.016899770125747,654775.010954549885355 8905529.238304112106562,655733.583089771098457 8904864.64123754017055,658083.648859909619205 8902281.765876078978181,658702.139950755285099 8901286.415310340002179,659135.061450451379642 8900094.465206857770681,659413.360177433118224 8898770.148253750056028,659598.929768585599959 8895789.536423448473215,659537.036131706205197 8894135.046643389388919,659011.27417668979615 8886131.750603951513767,662381.805718926014379 8884479.711698280647397,672617.076299913693219 8882562.802086908370256,697107.252954943920486 8877080.163744458928704,698065.936409656424075 8876353.056766074150801,698839.050273216329515 8875495.312063539400697,699271.86045342113357 8874372.958867967128754,699859.404725825763308 8873316.114995278418064,700817.97686104697641 8872656.378809574991465,701962.118587420787662 8872393.641464062035084,707682.715899795526639 8872261.326185811311007,708548.558899187482893 8873053.353640556335449,708424.882944914395921 8874175.501689065247774,707497.257628134218976 8874900.48828793130815,698529.804727790644392 8879325.649054635316133,697416.498500369605608 8879853.540549458935857,695963.222548061399721 8880118.452001132071018,687490.58478429610841 8881504.758547542616725,681615.364699207013473 8882099.888952668756247,678894.271066257613711 8883223.444348786026239,677935.587611545110121 8883949.578275077044964,677162.585067476378754 8884809.994040377438068,659598.929768585599959 8906455.958298206329346,658980.438677739934064 8907517.668044602498412,658733.086769196437672 8908843.592587079852819,658794.980406078626402 8910501.460654702037573,661979.831037673982792 8919064.305309662595391,662536.428491640253924 8920193.634693099185824,665350.362579913111404 8924047.790352415293455,668875.516894863569178 8928833.849627917632461,670607.09157415071968 8930362.937658913433552,673668.377570966957137 8932226.728074623271823,699550.159180402872153 8947146.99956089630723,700725.247725217719562 8947612.188792387023568,702054.847723252838477 8947813.588088059797883,703198.989449623739347 8947278.776121420785785,703972.103313183644786 8946412.551442923024297,719494.938387361704372 8918000.893710942938924,721133.783930819598027 8914815.423239689320326,729111.71787750069052 8898504.551118262112141,730595.940648247255012 8895194.943987760692835,730843.292556790751405 8893871.526198145002127,730750.563420961494558 8892215.570557190105319,729637.368513028835878 8889966.07146736420691,727503.70783299265895 8887123.345949210226536,726947.110379026387818 8885999.183252224698663,726854.381243194337003 8884347.174691470339894,727812.953378415550105 8884016.67559527605772,732698.654509842279367 8888974.085411451756954,733409.874736519996077 8889900.585706166923046,733657.226645063492469 8891355.938554370775819,733162.522827976499684 8894069.523029506206512,731616.406420350656845 8898902.950489228591323,721968.680111770518124 8921189.686045296490192,720762.756068005692214 8923182.68033055216074,717546.847298478125595 8928169.015467956662178,715042.158755630953237 8930762.862326741218567,714454.72580271482002 8931826.482612419873476,713403.201892681885511 8934023.19630684517324,711145.976577866706066 8941413.814557243138552,710898.513349831919186 8942747.671177418902516,710805.895533491158858 8944279.716441599652171,710898.513349831919186 8945879.763426529243588,711145.976577866706066 8947346.465565644204617,711547.951259121531621 8948679.981371901929379,712104.548713087919168 8949813.724090423434973,712815.768939765635878 8950748.079586775973439,713681.611939154798165 8951547.096560303121805,715722.43216386763379 8952749.271464308723807,745469.44913262675982 8965504.927803268656135,746953.67190337611828 8965304.957883056253195,764486.491703314241022 8958957.418353701010346,765445.175158026628196 8958221.764177406206727,766218.177702095359564 8957354.461998803541064,766465.640930130146444 8956019.338269302621484,766372.800474806805141 8954351.202312037348747,765135.929612603853457 8950414.761783162131906,764888.577704060357064 8948947.434442097321153,764795.737248739809729 8947346.465565644204617,764950.360021451255307 8944345.69815238378942,765785.367521890555508 8941947.951177440583706,771011.038378198747523 8932559.205008920282125,772557.266105318674818 8930762.862326741218567,775587.605283693759702 8928768.00987465120852,777102.774872881360352 8927038.435525486245751,778123.240644981968217 8924845.525318814441562,778803.514053218648769 8922319.348573172464967,779298.217870305641554 8919662.782409502193332,780225.843187085818499 8908047.626634960994124,780380.577279288438149 8905064.849131306633353,780256.790005526854657 8903406.560467747971416,779452.840643017087132 8900824.207192406058311,777999.564690711675212 8898968.518024208024144,776267.767372439266182 8897446.074417216703296,773392.050966778304428 8893671.39051953330636,772835.453512812033296 8892546.445418436080217,772371.696514166193083 8890231.354413548484445,772278.856058845645748 8888643.612422840669751,772340.74969572504051 8887123.345949210226536,772588.101604268536903 8885801.407762518152595,773021.02310396451503 8884610.347503501921892,774350.73442148801405 8882562.802086908370256,775896.739509625476785 8880844.273582506924868,776824.476145896827802 8880118.452001132071018,779576.516597287380137 8879456.191601349040866,781215.362140748067759 8879325.649054635316133,784029.407548509305343 8879655.933401210233569,786379.361999156535603 8880513.934854524210095,787399.827771257143468 8881109.221400368958712,789286.136542749707587 8882430.300279054790735,788667.645451904041693 8885470.842060027644038,786935.959453122923151 8883949.578275077044964,785915.493681019404903 8883355.960719441995025,783565.427910883794539 8882495.718282306566834,780442.359596679336391 8882495.718282306566834,777257.397645592805929 8884347.174691470339894,775896.739509625476785 8886264.320391142740846,775649.38760108477436 8887586.343392539769411,775773.063555355067365 8889239.331886490806937,776329.661009321454912 8890363.999544491991401,778648.779961018823087 8893142.487237680703402,779514.734279899275862 8893936.809751423075795,781648.394959932542406 8896716.912476174533367,782792.425366815063171 8898968.518024208024144,783287.129183902055956 8901948.774454571306705,783503.645593492779881 8905196.096893388777971,783287.129183902055956 8909639.646424487233162,782792.425366815063171 8912360.120631596073508,781833.853231593850069 8920791.966437695547938,781772.070914205629379 8922319.348573172464967,782328.668368172016926 8923383.397655621170998,783379.969639222486876 8923980.319520125165582,790832.141630887170322 8924380.129310131072998,811859.280246828799136 8925442.568327898159623,813343.503017575247213 8925177.901073874905705,815569.781513949390501 8924047.790352415293455,816528.353649170603603 8923315.933044137433171,817301.467512730509043 8922452.585322676226497,819589.63964598684106 8919794.057105202227831,822527.249688529875129 8914682.327602095901966,823300.363552089896984 8913820.01343554072082,825402.966094193630852 8913156.562889166176319,825495.806549514061771 8914483.525050740689039,823671.391414903686382 8919064.305309662595391,823083.847142496262677 8920060.43970213457942,819589.63964598684106 8924911.329236634075642,816930.439649916719645 8926905.113951431587338,814518.480242898920551 8927902.332941845059395,811395.300609203288332 8928302.360432967543602,810065.700611168169416 8928035.672970941290259,805334.622252453002147 8926373.767017278820276,802798.986891164793633 8925709.159820565953851,799830.430030180606991 8925575.862841237336397,798346.207259434158914 8925842.459265982732177,776484.28378203290049 8933025.36926150508225,775092.790147115592845 8934622.917335338890553,774505.357194202253595 8935620.965736689046025,770083.413061418570578 8944213.975265672430396,769805.114334436831996 8945546.670949917286634,770701.904152267146856 8946279.110743328928947,771876.881377590820193 8946679.920287111774087,774721.762284301803447 8947013.305224066600204,775896.739509625476785 8947480.166089735925198,776298.825510371592827 8948412.538237916305661,775680.33441952301655 8949480.449547931551933,769001.164971927064471 8959157.211934408172965,763125.944886840879917 8966507.508209196850657,756044.800757989985868 8972927.96015409193933,754900.659031616174616 8973464.681971604004502,743706.92763489857316 8971363.071371113881469,743001.941299704369158 8971082.019981440156698,741944.294817676302046 8970158.74592805467546,739940.6553028881317 8968193.390448775142431,728895.201467907172628 8963166.517662664875388,725339.211654009530321 8961828.631588099524379,711764.356349221081473 8959291.132036617025733,710280.133578474633396 8959157.211934408172965,708795.910807728185318 8959425.054631214588881,696550.766820468823425 8966373.453721106052399,696210.685776096070185 8969851.9773901514709,709105.156353153870441 8974868.827775482088327,716526.38152637751773 8977078.961176702752709,723391.120565125951543 8977948.885922387242317,724906.290154313552193 8978014.936045298352838,733471.657053910894319 8976876.741045366972685,736805.119205716648139 8977292.274629674851894,739606.696830510627478 8977332.768745532259345,740218.842710381490178 8977694.092409946024418,740256.023420306155458 8978296.499579155817628,738264.629049505572766 8981766.083974720910192,729822.826784690143541 8985853.897129219025373,728338.60401394078508 8986122.735890431329608,723514.796519396360964 8986189.102482041344047,719000.123250786331482 8985988.31525307521224,702951.637541083036922 8984513.714555369690061,697694.908546842634678 8985787.774952884763479,695530.301048368215561 8995513.543181424960494,695406.625094095012173 8996721.398753024637699,695963.222548061399721 8997862.740568624809384,697416.498500369605608 8999744.102363292127848,700014.027498537208885 9002162.890925604850054,702085.794541691080667 9003371.86491802893579,704157.561584844952449 9004447.969686148688197,705672.842493523727171 9004985.114660678431392,728431.444469264126383 9005791.875413047149777,729915.66724001057446 9005522.299803121015429,730874.239375231787562 9004850.340728146955371,734894.097507266444154 8998938.020430382341146,746304.345313577679917 9011641.301544955000281,749829.499628528254107 9014803.553478822112083,752210.512217105017044 9015611.417949881404638,775247.524239318212494 9014938.514314906671643,789255.078404817380942 9014400.624457931146026,819682.48010130727198 8999474.753588698804379,835669.183493619551882 8989073.141677305102348,836596.808810399728827 8988334.400714036077261,837215.299901248188689 8987262.637047415599227,837617.274582503130659 8986054.680603696033359,839256.120125961024314 8978484.054009823128581,842657.598486641189083 8988872.273873772472143,843245.142759048612788 8990012.611177692189813,844265.608531149220653 8990614.844082923606038,845471.421255422756076 8991018.373191734775901,855088.312065053032711 8992494.309056343510747,866034.69155322725419 8996050.262260094285011,864457.628327160258777 8997460.760667283087969,861334.448693464626558 8997862.740568624809384,859819.279104277142324 8997796.50781681202352,846770.297073999186978 8995244.594577923417091,844234.550393216894008 8994641.73198770545423,840647.613760878215544 8993366.101337961852551,837617.274582503130659 8993231.545170499011874,834648.717721518944018 8993767.852246452122927,832051.300042839837261 8994641.73198770545423,830134.155772397294641 8996118.412260284647346,829361.041908837389201 8996990.644333219155669,825866.834412327967584 9001758.977371033281088,825434.024232123163529 9002969.334777677431703,824722.692685954156332 9007001.218321099877357,824815.533141277497634 9008345.601870270445943,825402.966094193630852 9009489.034212788566947,837431.816310841822997 9018978.821859944611788,846244.535118982661515 9025109.306112393736839,849398.661571119446307 9026862.632546117529273,866096.473870618152432 9032864.798858029767871,867302.509233871358447 9033270.466091014444828,871075.015457365312614 9034282.547916296869516,875311.278679505223408 9034821.929711643606424,889164.321391781326383 9036104.946627585217357,890679.490980968927033 9035834.230401890352368,891792.685888901585713 9035226.006692318245769,898038.933836804353632 9031245.030590787529945,899925.242608294123784 9029761.110410852357745,903357.667787415441126 9026457.327340157702565,904872.837376603041776 9024637.376512294635177,905831.186872841790318 9023896.909926295280457,906728.08801016327925 9024637.376512294635177,906697.141191722243093 9026188.673568112775683,906449.677963690366596 9027536.654812691733241,906047.814601926715113 9028749.908761706203222,904872.837376603041776 9030841.177708134055138,903357.667787415441126 9032662.70254335552454,895719.926204598275945 9040155.244796512648463,890524.979527748655528 9042587.689274804666638,856325.071607764810324 9034755.355170618742704,853758.600747526739724 9034078.711028456687927,841173.375715894741006 9026929.376616073772311,839379.796080231317319 9025379.618069352582097,837462.651809791685082 9024030.10093579813838,834308.525357655016705 9022211.007858127355576,832947.978541178861633 9022009.211294723674655,831278.297498771105893 9022077.608052125200629,822650.92564280028455 9023019.706289296969771,820177.183918391470797 9033404.074092185124755,829732.069771651178598 9040492.994463082402945,833906.661995891365223 9042925.553486179560423,839472.636535554658622 9045494.474358538165689,844914.823801456368528 9046508.282248791307211,850542.691978001967072 9047251.086041286587715,851748.6160217638826 9047657.567602682858706,855057.253927120706066 9049279.098446056246758,850573.638796440209262 9050090.853594042360783,848903.846434541163035 9050226.479713907465339,847543.188298576627858 9050023.893708642572165,830752.535543754580431 9045832.475516073405743,829701.234272701316513 9045223.403585951775312,827907.765956531977281 9043667.986331023275852,826145.244458800880238 9042114.608822843059897,825402.966094193630852 9041168.298314495012164,823300.363552089896984 9039953.186183283105493,815600.728332390426658 9037927.565241146832705,801871.361574384616688 9035698.876119151711464,777659.3723268477479 9032325.321257578209043,776144.091418168973178 9032256.826778033748269,774659.868647422408685 9032527.408070914447308,773701.296512201195583 9033270.466091014444828,776380.756655596429482 9051107.016152169555426,778344.877751152496785 9065162.256662024185061,772371.696514166193083 9077264.577229799702764,773608.567376369144768 9083447.07013762742281,783287.129183902055956 9092286.021183278411627,789286.136542749707587 9096301.05312742292881,791543.361857565003447 9097321.82993371412158,807993.933568014297634 9103179.22078412771225,809509.103157201898284 9102905.958926726132631,812415.766381303896196 9100726.124788448214531,821661.406689140712842 9089769.321905542165041,828402.581093107350171 9079845.835634749382734,829175.472317684791051 9078894.531615525484085,830505.183635211084038 9078487.986084032803774,832020.353224398684688 9078555.212406054139137,837215.299901248188689 9080049.266304900869727,842472.028895488707349 9083038.309250919148326,844141.821257387637161 9084805.860142862424254,845904.342755115940236 9088204.208185978233814,846646.62111972598359 9089223.831270849332213,848285.35534369549714 9090923.85227020457387,851470.428614270524122 9092693.350708791986108,855119.147564002894796 9093986.769428942352533,859231.846151360892691 9094667.1328563131392,862447.643601397285238 9094599.755127843469381,865261.689009158522822 9093917.438219003379345,866220.149824888445437 9093169.781749462708831,866807.694097295985557 9092080.528189927339554,866529.39537031413056 9090583.717833237722516,865941.962417397997342 9089427.528477974236012,864457.628327160258777 9087524.213748278096318,862633.213192549883388 9085961.548258410766721,860685.233423157478683 9084600.581673391163349,858706.084196344367228 9083241.830606654286385,856603.481654240633361 9082019.321731196716428,854809.902018580120057 9080457.856654841452837,854067.846292952424847 9079506.471364295110106,853449.355202103964984 9078351.824157370254397,854593.496928477659822 9077809.157808469608426,860499.663832004996948 9080049.266304900869727,878372.564676318550482 9088543.984817065298557,879454.812765810173005 9089156.749564645811915,884278.620260354597121 9092625.99155137874186,886567.015032593393698 9093646.489469578489661,888082.073302289703861 9093713.858228014782071,889597.242891477304511 9093373.591238133609295,890741.273298359825276 9092829.785561922937632,892813.151661004987545 9091469.472425974905491,896833.121112530934624 9088407.631595533341169,899677.890699753537774 9086164.907976193353534,900110.812199446721934 9085282.011400271207094,902522.548967484966852 9079573.462749324738979,902955.470467178151011 9078351.824157370254397,902708.118558637448587 9075295.584369966760278,902739.176696566981263 9073802.521360902115703,906573.465237451950088 9058280.49957288429141,907222.791827247478068 9055706.995230322703719,908552.391825282480568 9053743.914832880720496,910098.50823291123379 9051917.273372020572424,911057.191687623620965 9051173.98615163192153,914427.611910371575505 9049414.709215039387345,922467.328174443682656 9046913.018027007579803,924724.776128238532692 9045696.932462204247713,945040.471878519863822 9031245.030590787529945,945782.750243129907176 9030302.095024921,948472.897057641181163 9026390.58765952847898,949802.497055676183663 9024435.511730995029211,950389.930008592433296 9023356.407841380685568,951194.102010081871413 9020932.412067813798785,951595.965371845522895 9015881.372528620064259,954008.036098354612477 9020392.133126279339194,953946.031141981249675 9021874.11748643219471,953636.896916049532592 9027805.359044533222914,953420.491825947188772 9029155.586235366761684,952832.947553539765067 9030233.619852852076292,952059.9450094710337 9031110.005690952762961,950359.205829133745283 9032797.999566616490483,927445.869761190842837 9051850.296430770307779,926487.297625969629735 9052593.653758751228452,924044.50272000185214 9053677.164441654458642,918447.581361897406168 9055099.033401023596525,917303.328316032420844 9055706.995230322703719,912572.361276811221614 9059498.721213491633534,911026.13354969129432 9061327.539341848343611,910438.700596775161102 9062343.588443674147129,909974.94359812932089 9065122.240113692358136,909356.45250728353858 9072039.636760696768761,909665.586733215139247 9073532.332436364144087,910098.50823291123379 9074889.24300335906446,910129.566370843560435 9079303.056107304990292,908243.2575993508799 9085485.351824101060629,907841.282918096054345 9086708.207743916660547,906295.166510467301123 9088543.984817065298557,891235.977115444024093 9099227.751204712316394,886968.878394357045181 9101272.492515590041876,885175.410078187705949 9099704.617297854274511,883938.539215981960297 9099296.888689894229174,879516.706402692361735 9098956.356255257502198,878186.995085166068748 9099364.310639448463917,877073.800177233410068 9099977.756967414170504,876826.448268689913675 9101339.687835801392794,877104.858315165736713 9102838.503610523417592,886999.825212798197754 9119072.840164832770824,888515.106121476972476 9120986.285524681210518,894297.263112260261551 9125291.564552284777164,895348.78702229319606 9125905.515300273895264,897636.959155549528077 9126863.088383313268423,899183.075563175370917 9126930.524473862722516,900512.675561210373417 9126521.241487514227629,902430.042470635380596 9124949.792764101177454,903605.019695958937518 9122830.876955771818757,905212.918420975795016 9119483.664040800184011,905645.839920671773143 9118253.229745279997587,905676.675419621635228 9116751.182178223505616,904779.996921279700473 9114090.989528743550181,904687.267785450560041 9112724.66505990549922,904903.561556061729789 9111360.566116413101554,905336.483055757707916 9110133.492234770208597,924786.558445629430935 9085009.431729655712843,927662.274851293186657 9074956.435565708205104,930383.479803733876906 9071022.212262291461229,945875.479378961957991 9062615.06329114921391,948132.704693777253851 9061396.312005316838622,949647.874282964738086 9061463.378181362524629,950544.552781303878874 9062209.440248070284724,950853.9096462179441 9063700.089690122753382,950822.962827776791528 9065191.293199777603149,950235.418555369367823 9066274.757345117628574,947390.648968149558641 9068580.103832056745887,936846.244161227485165 9087524.213748278096318,936784.350524348206818 9088747.662687107920647,937681.029022687231191 9089496.571394195780158,940123.82392865489237 9090312.89519852399826,943030.598472248180769 9090583.717833237722516,948070.922376386239193 9090109.417661065235734,954193.383050524629653 9090312.89519852399826,957069.322095170849934 9090516.623387038707733,962573.402997951954603 9091400.16558588296175,963655.651087443577126 9092013.174797164276242,964397.706813074066304 9092966.223014786839485,964707.063677988131531 9094463.28654414974153,964490.435948903206736 9095824.168636130169034,963346.516861511976458 9096437.556745482608676,947916.188284183619544 9096097.160290146246552,938485.08970468537882 9095007.216304529458284,933908.634118684451096 9093033.585372969508171,932238.730437294230796 9093169.781749462708831,915757.211908406578004 9107063.659827975556254,908305.039916741894558 9128230.147071830928326,908274.204417792032473 9129804.040390964597464,909016.371462910901755 9130760.41193526238203,917272.604136573849246 9136030.382614884525537,918509.363679288420826 9136440.210282888263464,924044.50272000185214 9137331.413951335474849,925714.18376240960788 9137194.127828707918525,949771.661556726321578 9133633.496847784146667,954100.765234186663292 9134454.871922368183732,953698.67923344054725 9135688.09717408940196,953822.466507202130742 9138905.586536513641477,953946.031141981249675 9140274.949955688789487,954564.522232829709537 9141371.813356924802065,956543.560140151530504 9142741.649372370913625,960841.716999170836061 9145139.617689225822687,971014.982623787829652 9146099.770680630579591,976031.595476386719383 9147694.635199129581451,980075.164659960544668 9148361.365432646125555,995010.566781222354621 9151105.957250017672777,995412.652781968470663 9151722.129181325435638,987558.283470066380687 9151791.776004562154412,982350.869010249734856 9151311.424309551715851,960161.443590934155509 9148911.384474545717239,959017.413184051634744 9149527.367183107882738,958244.299320491612889 9150488.109934616833925,944174.851518113166094 9171713.673801463097334,943741.818698925897479 9172609.536391600966454,950049.848964219680056 9176325.705480078235269,951286.831145913922228 9176737.851380275562406,955615.934823371469975 9177220.164170030504465,960254.172726766206324 9177358.221671229228377,963037.159996597911231 9177770.427188953384757,965356.39026778365951 9178734.977004332467914,975096.734392704674974 9184040.471384260803461,975560.714030330185778 9185418.516372190788388,974230.891393315512687 9185831.187663080170751,971138.769897549413145 9185762.945123331621289,969809.058580023120157 9186245.86818048171699,968819.53962636354845 9187003.324123172089458,968046.537082294933498 9187969.122599378228188,962016.694224494392984 9195557.831400901079178,961429.149952086969279 9196593.134146392345428,961367.367634698865004 9197835.148942733183503,961676.501860630465671 9199354.344764253124595,962295.104270970216021 9200528.70521580055356,963222.729587750392966 9201289.420004641637206,965387.337086224812083 9202464.099126420915127,972632.120866543031298 9202968.800493609160185,973055.914167991839349 9203500.404821446165442,974138.162257483461872 9204052.698358841240406,998288.369187629432417 9210136.727991070598364,1000576.652640376938507 9214218.554957564920187,1001349.655184445669875 9215188.045820098370314,1002431.903273937175982 9215811.768975213170052,1003575.933680819696747 9215188.045820098370314,1008770.880357669317164 9209998.034749327227473,1010316.996765297953971 9208131.043092891573906,1013996.88517245114781 9203293.430152807384729,1015171.862397774704732 9201150.8987170252949,1018140.419258758891374 9192589.686452744528651,1027633.411475136410445 9187554.341935388743877,1043434.656595787382685 9191141.962033340707421,1047330.838773551746272 9192176.624129051342607,1049495.223633046494797 9193279.50168577209115,1053267.841176028829068 9196386.359804959967732,1055154.149947521509603 9199769.812036937102675,1054442.818401352502406 9199492.831166373565793,1045846.504683314007707 9194729.399209059774876,1026922.079928967519663 9191071.930318292230368,1025716.378524185158312 9191003.637641126289964,1024386.555887167691253 9191486.667159486562014,1020521.431847335654311 9195832.919993467628956,1019933.887574928230606 9196870.002445446327329,1018573.340758452075534 9218719.293067989870906,1018542.282620522659272 9219965.168017039075494,1018851.416846454259939 9221489.336009379476309,1019315.396484079770744 9222806.038640657439828,1020088.399028151296079 9223776.698258532211185,1028901.229155780514702 9232583.284329572692513,1029983.477245272137225 9232859.805306032299995,1038363.274553716997616 9233763.131995890289545,1048258.464090331923217 9232373.715056566521525,1054102.737356979865581 9240635.761665150523186,1056669.319536708993837 9245569.365875687450171,1057287.587988575221971 9246403.728460893034935,1060905.58275884622708 9249671.546900486573577,1061864.043574576033279 9250437.776207149028778,1073954.676108615240082 9254890.549003781750798,1081747.040464146761224 9256490.880807396024466,1108370.87779921037145 9209167.923697678372264,1108742.016981515334919 9207923.933988874778152,1108927.586572665022686 9206541.535227386280894,1108742.016981515334919 9204813.78912515938282,1108401.935937139904127 9203293.430152807384729,1106886.766347952187061 9197283.336606888100505,1110535.485297684790567 9188107.388178516179323,1117709.358562364708632 9186107.638663977384567,1130170.907639729324728 9179079.083370314911008,1141550.319947087904438 9171783.763503590598702,1141766.836356681538746 9164563.434752305969596,1142447.109764921013266 9164493.663298277184367,1143096.436354716541246 9165594.251330083236098,1143560.415992344962433 9166900.924955349415541,1143776.709762956015766 9168619.267705805599689,1144271.413580040214583 9177634.344683825969696,1144085.843988887732849 9179011.153277920559049,1142601.732537632342428 9182454.337056191638112,1141859.676812004763633 9183419.520072679966688,1139385.823768104892224 9184591.260468784719706,1137870.654178917175159 9184935.649296171963215,1131531.565775693859905 9185073.856113690882921,1126831.434235419845209 9185969.411824887618423,1122471.383739521261305 9188658.491253193467855,1120585.07496802858077 9190244.01880556344986,1118915.393925620708615 9192176.624129051342607,1118327.84965321328491 9193279.50168577209115,1117956.71047090832144 9194522.927337143570185,1117771.36351873818785 9195902.998457623645663,1117771.36351873818785 9197490.136949812993407,1118451.636926974868402 9200528.70521580055356,1120368.781197417294607 9203914.123393462970853,1121976.679922437062487 9205780.260061338543892,1123862.988693926716223 9207301.149342365562916,1127140.679780845530331 9209031.241012141108513,1129490.634231489850208 9209998.034749327227473,1142972.871719937538728 9214496.108391620218754,1144209.631262649316341 9214842.193294813856483,1145755.85898976912722 9214842.193294813856483,1147487.322349567897618 9214703.408490102738142,1162546.511744591174647 9212074.731566667556763,1171699.422916596056893 9207509.982736803591251,1174513.35700486600399 9206680.161256385967135,1177481.802546361694112 9206887.234239773824811,1195323.979211216792464 9208685.687000276520848,1208414.372092069126666 9209884.243565650656819,1212176.414283426944166 9210760.009379453957081,1214526.368734074290842 9211729.030031058937311,1215175.917962852166966 9212834.935396553948522,1215021.183870649663731 9214218.554957564920187,1214062.723054919624701 9215049.254282515496016,1211805.275101121980697 9216365.016962198540568,1210506.621921527897939 9216849.767267832532525,1208991.341012849239632 9217195.966454477980733,1204353.10310945706442 9217610.480469632893801,1202837.933520269580185 9217956.71660329028964,1200209.569023152114823 9218995.027294371277094,1199467.513297521742061 9219965.168017039075494,1198323.260251659667119 9222181.952628055587411,1197797.498296643141657 9224816.106702180579305,1197797.498296643141657 9226341.062984749674797,1198014.126025725156069 9228074.034992648288608,1198385.042569047771394 9229599.688691142946482,1199683.807068132795393 9231889.656079567968845,1200487.867750133853406 9232791.111197970807552,1201446.328565863892436 9233553.528015740215778,1202559.523473796667531 9234110.153809731826186,1203827.341154440771788 9234456.942673478275537,1212269.143419258994982 9235497.910341378301382,1214804.778780547203496 9236260.366984313353896,1215608.616823565680534 9237164.374935384839773,1215917.973688479745761 9238344.731612434610724,1215794.186414718395099 9248489.311675649136305,1214650.156007835874334 9249115.706654196605086,1213135.097738139331341 9249463.477294826880097,1211588.870011019520462 9249532.082004379481077,1210475.675103086745366 9248976.252644242718816,1195076.404663690831512 9240914.345959266647696,1193159.260393251199275 9239455.025322129949927,1189757.893352062208578 9235844.766766099259257,1188799.209897349821404 9235080.35559269413352,1187716.961807858198881 9234525.652845326811075,1186387.361809823196381 9235011.640070790424943,1186541.984582534525543 9236399.572237400338054,1193406.612301791785285 9250158.819130396470428,1195849.40720775956288 9253011.507988639175892,1216103.543279632460326 9270708.421807931736112,1219968.77863895567134 9273707.538461375981569,1221483.83690865477547 9274545.206084921956062,1228626.874674384947866 9277338.814345421269536,1230358.671992657473311 9277127.923481378704309,1231286.297309437533841 9276289.951718170195818,1232399.492217370308936 9274056.51277744397521,1233914.66180655779317 9273707.538461375981569,1241830.590796865522861 9275452.078649202361703,1243933.415977951837704 9276778.79847490042448,1245850.560248391469941 9278314.925844455137849,1248850.06392781669274 9282436.029998600482941,1249220.980471139308065 9283973.631317,1249220.980471139308065 9285511.313473926857114,1249963.258835749467835 9288587.675579592585564,1252746.246105581056327 9291036.980331042781472,1254972.635921449400485 9292155.525796784088016,1256271.17778155207634 9292505.15457552112639,1262084.726868738420308 9292995.369119964540005,1271453.931811354355887 9294885.00141778588295,1275257.384853289462626 9295934.594160355627537,1275937.658261526143178 9297124.992131199687719,1275999.663217899622396 9300277.497636087238789,1275659.4708540327847 9301537.983420707285404,1273185.729129626881331 9307987.157457392662764,1272628.909036678029224 9309108.121085286140442,1271886.853311050450429 9310090.624480068683624,1270742.822904167929664 9310791.918545523658395,1257353.425871043698862 9315705.190566468983889,1255992.87905456754379 9316194.986054824665189,1254261.304375277366489 9316407.039054710417986,1251571.157560769002885 9315915.207097187638283,1249468.332379682920873 9314581.164299977943301,1246561.780475072097033 9312335.665939591825008,1245417.638748698402196 9311774.654800731688738,1240470.043980392394587 9310160.068950299173594,1239047.60352703393437 9309949.969941569492221,1237316.140167235163972 9310160.068950299173594,1236388.514850455103442 9311002.042450424283743,1235615.400986895198002 9311984.807769482955337,1235275.208623031154275 9313247.119309654459357,1234594.935214794473723 9318933.458805881440639,1234749.557987506035715 9320339.886363493278623,1235275.208623031154275 9321673.240579877048731,1235955.482031270628795 9322798.389673167839646,1253983.005648295627907 9339824.604491263628006,1263166.863638741662726 9342853.037812685593963,1270340.736903421813622 9343698.896493069827557,1271763.288676268421113 9343840.221043236553669,1273031.106356915552169 9344264.21157824061811,1278195.106215323787183 9349692.563735766336322,1279029.891076780622825 9350678.66708118468523,1279710.164485020330176 9351806.390752989798784,1279741.22262295265682 9353430.729399494826794,1279370.08344064746052 9354702.464498601853848,1271670.559540439397097 9356606.554799109697342,1260012.848506093258038 9357948.518553284928203,1264249.111728233285248 9376830.779351525008678,1264403.73450094461441 9377892.812972687184811,1260167.359959316439927 9379308.935325650498271,1258559.461234296672046 9379379.06036539748311,1248200.514699038816616 9360916.789480423554778,1247427.512154970085248 9356183.859554167836905,1247056.484292156295851 9354702.464498601853848,1244582.742567747365683 9351806.390752989798784,1239016.879347575362772 9346872.145401289686561,1234811.340304896933958 9344264.21157824061811,1230296.667036283994094 9342009.055551314726472,1225256.454451637109742 9338416.087703865021467,1218422.550911838421598 9333135.68717266432941,1215979.756005870876834 9330250.423656506463885,1215454.105370345525444 9328913.432794604450464,1214773.720642617670819 9327719.722804516553879,1213135.097738139331341 9325819.568169759586453,1202961.720794033957645 9318864.181365046650171,1198354.207070097792894 9316757.862921211868525,1194705.488120368216187 9315843.937253646552563,1191365.79207707894966 9314089.458722351118922,1190376.384442907990888 9313387.839132014662027,1189417.70098819816485 9312617.07226936519146,1177760.212592834839597 9301537.983420707285404,1177110.663364056730643 9300416.195611160248518,1177358.015272597316653 9299646.582094499841332,1178780.678364935331047 9299856.376731524243951,1184377.488403548486531 9302729.067936910316348,1196900.931117792380974 9310651.502668805420399,1208001.822059189667925 9318372.179270146414638,1209795.401694850297645 9320127.715935844928026,1212578.277645190712065 9322587.916578887030482,1213846.095325834816322 9322939.298823880031705,1215423.269871395779774 9322939.298823880031705,1226122.297451026272029 9318794.651766141876578,1227482.955586993834004 9318231.360687954351306,1228225.011312621412799 9317319.267701461911201,1232554.114990081638098 9309740.129656309261918,1233110.601124556735158 9308617.046560660004616,1218051.634368516039103 9283554.984413959085941,1216134.378778582205996 9282017.725117657333612,1215021.183870649663731 9281459.352850893512368,1211217.73082871735096 9280411.642828598618507,1207568.900559493573382 9279084.245353544130921,1203085.285428813192993 9276849.929105840623379,1184624.840312092099339 9266731.89506009221077,1183789.832811652682722 9265757.371227150782943,1183480.698585718171671 9264572.210854638367891,1183078.723904463462532 9261158.105090210214257,1182553.073268938111141 9259834.043410439044237,1180945.063224430195987 9257883.005947109311819,1174080.435505172703415 9252803.340759346261621,1156918.532248554518446 9241122.416023021563888,1148260.43621312500909 9238274.23468004912138,1142045.023764174897224 9238274.23468004912138,1140622.583310819463804 9238134.992789037525654,1138272.628860172117129 9237164.374935384839773,1136355.484589729690924 9235637.100696366280317,1131981.853115954436362 9230725.601404765620828,1123522.796330062905326 9224469.537209134548903,1118513.419244365766644 9222944.981293391436338,1113194.907932734349743 9222731.953629590570927,1105216.973986053140834 9224745.493984090164304,1104258.401850834721699 9225509.046712869778275,1103423.505669883918017 9227380.595931645482779,1092044.093362522544339 9253846.743126543238759,1091672.95418021758087 9255099.02785000577569,1089724.86309133679606 9264572.210854638367891,1091054.46308937179856 9270637.603678392246366,1091858.523771370062605 9271614.805426606908441,1093435.475677948445082 9271614.805426606908441,1096682.331265914486721 9271126.062204549089074,1097950.148946561384946 9271474.909923881292343,1103763.586714256554842 9273987.420031163841486,1113751.39406721224077 9279153.387619558721781,1120306.998880026396364 9284883.468211377039552,1123986.553328708745539 9288169.008724492043257,1124141.064781928900629 9289567.346601998433471,1122780.740604435326532 9290057.106825178489089,1113782.452205141773447 9292226.558494191616774,1103639.79944049497135 9287260.513421131297946,1101722.766489543719217 9285722.453052096068859,1083447.779644483933225 9274267.312611654400826,1065358.251071085454896 9264292.95025971531868,1064245.056163155706599 9263735.716358089819551,1062884.509346679551527 9263875.459797931835055,1061926.048530949512497 9264641.212240654975176,1061864.043574576033279 9265895.146692672744393,1062420.752348033711314 9289988.110284514725208,1062729.886573968222365 9291246.521052319556475,1065914.959844543132931 9295094.403586408123374,1066718.909207053016871 9296005.664624473080039,1071171.68883878365159 9300277.497636087238789,1073057.997610276332125 9301818.962498802691698,1079891.678511092439294 9305112.088293496519327,1093744.832542862510309 9315423.661900037899613,1097826.584311779588461 9320901.321403600275517,1128439.44427993055433 9334401.763654790818691,1130016.39618650637567 9334401.763654790818691,1131160.537912880070508 9333769.583979016169906,1131933.651776439975947 9332783.80006462149322,1132892.112592170014977 9332008.899232398718596,1134314.664365016855299 9332149.991256069391966,1134994.93777325632982 9333346.219763269647956,1132490.137910915073007 9337640.57193055935204,1126553.135508438106626 9346025.908480364829302,1119812.183743451023474 9345390.916325867176056,1118698.98883551848121 9344827.541594479233027,1111215.870025412645191 9347366.126368956640363,1115452.13324755243957 9366639.676542995497584,1131686.29986789659597 9398104.045912761241198,1141488.537629699800164 9408125.705992599949241,1152063.777935568941757 9419726.812027115374804,1162979.433244284475222 9432562.101616529747844,1164618.167468253988773 9437346.345283566042781,1166411.635784423211589 9440701.485693810507655,1169442.197601780761033 9443704.640170279890299,1171050.096326797734946 9443704.640170279890299,1174389.569731104420498 9443131.33618912473321,1175348.1418663256336 9442346.077772380784154,1177296.232955209212378 9440630.750827562063932,1177883.777227613842115 9439488.802130654454231,1178254.916409918805584 9438201.758833423256874,1179028.030273478943855 9437275.901045873761177,1180388.577089955098927 9436703.117731988430023,1185799.928856906946748 9439987.224637942388654,1185768.870718974620104 9441274.335555799305439,1176222.445147017482668 9449433.798482529819012,1167685.130759097635746 9452352.033628346398473,1164483.582203885074705 9452800.346616121008992,1168330.449847225798294 9458212.231720490381122,1170214.977506867144257 9459376.807886581867933,1171884.992507748538628 9459664.113256677985191,1178718.673408564645797 9460163.95957732014358,1185707.088401583489031 9458590.001686220988631,1188026.318672772264108 9455651.148405473679304,1198044.850205183727667 9446921.201754033565521,1203147.067746204091236 9443276.459016947075725,1207352.60678888252005 9443991.309584433212876,1208156.444831900997087 9444992.685024941340089,1203023.50311142206192 9458444.306441627442837,1201291.817112643737346 9461884.031056765466928,1200147.786705761216581 9462600.507007770240307,1197055.442571015562862 9462384.034346783533692,1195756.678071930306032 9462025.927261678501964,1193468.394619182683527 9460880.261235155165195,1192169.852759080007672 9460522.230305703356862,1190561.954034060472623 9460522.230305703356862,1189201.295898095937446 9461022.137296225875616,1188026.318672772264108 9461738.525905858725309,1187067.635218059644103 9462529.810797268524766,1186294.632673991145566 9463533.814855961129069,1186449.144127214094624 9464967.173850817605853,1190623.736351451370865 9469844.422486986964941,1202559.523473796667531 9479463.416139900684357,1203858.399292373098433 9479893.535848628729582,1206141.45072905253619 9479218.494968203827739,1213506.014281461946666 9475297.033055119216442,1217031.168596412520856 9494926.403389679268003,1217866.064777363324538 9498815.469416026026011,1219968.77863895567134 9503933.891623500734568,1221422.054591263877228 9504147.748017447069287,1228441.305083232466131 9498384.196055322885513,1231379.026445266790688 9495863.990916170179844,1231719.218809130834416 9492909.599346693605185,1231317.132808387512341 9489743.274954035878181,1231286.297309437533841 9488162.716453520581126,1231626.489673301577568 9483631.998490884900093,1231997.406216624192894 9482265.742654789239168,1254941.689103008247912 9465396.412245471030474,1256302.235919481609017 9445491.238064089789987,1249190.144972192356363 9430492.373460557311773,1253333.679058497305959 9434989.158109061419964,1262888.564911757130176 9449282.368527960032225,1273340.240582847036421 9468839.521825321018696,1273896.726717322133482 9474362.429288195446134,1274267.865899627096951 9475944.039418777450919,1274669.840580882038921 9477521.86660654656589,1280637.901121291564777 9488735.540644824504852,1281503.744120680727065 9489743.274954035878181,1283668.128980175592005 9491039.736764572560787,1286729.414976988919079 9491181.96054526604712,1288306.589522549882531 9490751.153048364445567,1289955.787778649944812 9490559.461226016283035,1293594.154015737352893 9491328.332271473482251,1305560.999276014976203 9498526.567812358960509,1301046.326007405063137 9501122.957005435600877,1290223.733792989514768 9498237.678027246147394,1285338.143981054192409 9494206.642514800652862,1283872.288926290348172 9494234.374110294505954,1283167.30259109614417 9494667.467641578987241,1281905.607482444494963 9495428.750262508168817,1280359.491074815858155 9497446.273908399045467,1277700.291078748414293 9501768.182006075978279,1275783.035488814814016 9505086.56078390404582,1268949.354587998706847 9520244.749288337305188,1268207.298862368101254 9522845.236961467191577,1268763.784996845992282 9524219.107994912192225,1271021.010311661288142 9529209.089919881895185,1273309.293764405883849 9532683.461502306163311,1285925.576933973236009 9545869.382063386961818,1290440.250202583149076 9548335.691195508465171,1291769.850200618151575 9548698.202986754477024,1296037.171560687711462 9549351.972734749317169,1298974.670283739455044 9548479.074394909664989,1306735.976501338649541 9547901.380644848570228,1313013.17126767965965 9550149.220278855413198,1318084.553309750277549 9553996.710510956123471,1317868.036900156643242 9555085.698385795578361,1313538.933222696185112 9556609.675078619271517,1312116.492769340751693 9556829.05654582194984,1307168.898001034744084 9556609.675078619271517,1301467.002363110659644 9558193.87245356105268,1296098.953878078609705 9560608.510089734569192,1297088.361512249801308 9566495.415503894910216,1297768.63492048624903 9567658.092799441888928,1306148.543548422399908 9575666.66007125005126,1330576.937886061845347 9589955.473633432760835,1343182.423065019072965 9596761.534396087750793,1344801.231100134085864 9597475.797814585268497,1346439.965324103599414 9597403.474031148478389,1351201.990501257125288 9596159.621236972510815,1352593.595455665607005 9595650.046915028244257,1353552.16759088402614 9594771.393927253782749,1354325.28145444393158 9593752.745935287326574,1354696.197997766546905 9592364.993074264377356,1355438.253723397152498 9591342.48886095918715,1357046.263767905067652 9590977.776434736326337,1360169.554721091873944 9591049.771483473479748,1360818.769991396227852 9591851.751504458487034,1360262.283856921130791 9593022.827424675226212,1358747.002948245266452 9595136.565828956663609,1356582.50676925922744 9596673.176948200911283,1353242.810725969960913 9599008.973844232037663,1351047.367728545796126 9600253.330239551141858,1349130.334777594543993 9600835.596204418689013,1345697.909598476020619 9601200.819680778309703,1341090.618513522436842 9600911.639011770486832,1339760.795876507647336 9600546.430538782849908,1326186.051891210488975 9593897.056393254548311,1323990.608893786324188 9592509.537902468815446,1307694.659956051036716 9580184.747484851628542,1274020.513991083716974 9550511.825330477207899,1268207.298862368101254 9543475.445886068046093,1267372.180042437510565 9542535.687217408791184,1266351.825589828193188 9541735.386116173118353,1263878.195184910669923 9540795.859283959493041,1258745.030825449153781 9539128.187836211174726,1257446.266326364129782 9538765.906855866312981,1251725.780333480564877 9537822.863800935447216,1250736.15006032702513 9538694.183166673406959,1251416.42346856649965 9539852.544775301590562,1257075.349783041514456 9542969.667396035045385,1266228.260955046396703 9557335.830304669216275,1261218.772549858083948 9557990.140097845345736,1251787.56265087146312 9559443.071455433964729,1250581.527287615463138 9560097.576904563233256,1250427.015834395308048 9561622.637738049030304,1251107.2892426319886 9562788.436872601509094,1254292.362513209925964 9566203.728825146332383,1255467.339738533366472 9566787.114257078617811,1266197.202817114070058 9569552.56788431853056,1272907.319083150941879 9570859.588995466008782,1277607.561942916363478 9570571.913509979844093,1285709.060524379601702 9572606.854174703359604,1301479.247507098130882 9581421.8454674705863,1302499.713279201649129 9582150.824869554489851,1300879.458090703235939 9582953.629222484305501,1300267.200891341082752 9583258.083702672272921,1299376.756284485571086 9583127.901555696502328,1297966.560975117608905 9582473.09035350382328,1294305.48556190636009 9581129.802534068003297,1259023.329552433919162 9570495.935606628656387,1253117.16264890646562 9569768.423167187720537,1251942.07410409161821 9570495.935606628656387,1252622.458831819472834 9571663.203790688887239,1257601.000418566633016 9577779.391028996556997,1258621.466190670151263 9578579.861223395913839,1263692.625593758188188 9582442.910142483189702,1272103.481040135258809 9588275.866811184212565,1284843.217524987645447 9594771.393927253782749,1286018.417389293666929 9595357.150401378050447,1293934.34637960139662 9598499.193241242319345,1295171.328561298549175 9598133.846880834549665,1296346.305786619195715 9597403.474031148478389,1300273.434782824711874 9597022.405712559819221,1300774.372491395333782 9596584.820609252899885,1303965.457014474086463 9597505.779528114944696,1311343.490225272020325 9601421.594357799738646,1313786.28513123979792 9605884.09542821906507,1313569.880041137337685 9606980.87234221957624,1313600.938179069664329 9608588.55846942961216,1314713.91044801985845 9611370.480632830411196,1322320.927851378452033 9618547.589501794427633,1329494.689796570222825 9623971.264487341046333,1332176.153690796345472 9625304.799439823254943,1333050.679610470542684 9625731.763583429157734,1335833.889519281918183 9624559.456621043384075,1336792.350335011957213 9623677.186863742768764,1336823.297153452876955 9622505.222240658476949,1336919.254554516635835 9622001.918091053143144,1336761.514836061978713 9620818.094452481716871,1336699.509879691526294 9619135.328297652304173,1336854.132652402855456 9617666.07336113974452,1337998.385698267957196 9615251.833316037431359,1338411.492328600725159 9615456.965365834534168,1339513.443967964267358 9620890.39540040679276,1340255.611013083020225 9622138.891374867409468,1341121.454012472182512 9623093.291793281212449,1342389.160373627906665 9623093.291793281212449,1352408.025864513125271 9618692.409269304946065,1364158.466034685494378 9622360.323962019756436,1382649.857969847740605 9630649.131976159289479,1405377.624446638161317 9643652.232104629278183,1440443.264046519994736 9690056.707357162609696,1441030.808318927418441 9691463.880803050473332,1441339.942544858902693 9693314.423424726352096,1441185.319772147573531 9694799.582148475572467,1440628.610998689895496 9695983.668088838458061,1439546.362909198505804 9696203.439349273219705,1438495.172957636415958 9695389.466661293059587,1427208.601105598267168 9680073.079618250951171,1414567.493689585011452 9665555.847290793433785,1413602.79898237157613 9664271.47368591837585,1410931.131203334312886 9661353.098557103425264,1390163.812278903322294 9644092.490057153627276,1388957.888235141523182 9643579.432033076882362,1387690.070554494624957 9643579.432033076882362,1379990.546654286328703 9645268.058292534202337,1378598.941699880640954 9645785.476526819169521,1377083.772110693156719 9647919.103640267625451,1376650.85061 9648873.035975772887468,1376589.068293608957902 9650934.989387409761548,1377021.989793305052444 9652479.863565895706415,1382835.427561 9669361.754505548626184,1392637.665322803426534 9671944.825804207473993,1404573.4524451487232 9672609.881248639896512,1410906.529595867963508 9674248.865804752334952,1411518.786795230116695 9674691.045071426779032,1411073.397512566996738 9675311.95110441558063,1410572.459803996374831 9675711.646855261176825,1408036.935762199340388 9678372.077965373173356,1384659.731376122217625 9680369.526570752263069,1382990.050333711551502 9680442.708848666399717,1376774.637884761439636 9679703.735934119671583,1374579.194887337274849 9678741.351614415645599,1372661.939297403441742 9676967.525635959580541,1364714.952169163385406 9668182.149023519828916,1363539.974943839712068 9668846.848291600123048,1363570.921762280864641 9670541.558112429454923,1373218.648070861119777 9685768.167538953945041,1389050.61737097078003 9703838.360455816611648,1392516.883675290970132 9705606.971984535455704,1395724.55480249854736 9708619.150561600923538,1389236.186962123261765 9725011.374113462865353,1389390.809734834590927 9726127.177354885265231,1396224.71327463327907 9727018.126138847321272,1397739.771544329589233 9727169.486173870041966,1398729.290497991954908 9726274.232357596978545,1402779.984128976473585 9722110.473792031407356,1404326.100536605110392 9720027.513988699764013,1406428.814398200251162 9716684.080603498965502,1406861.735897893318906 9719582.469278160482645,1406150.626990706892684 9722331.064999608322978,1403460.257537215948105 9730366.759123237803578,1398389.09813412791118 9742515.320819390937686,1394956.895593989174813 9745871.36640946380794,1392853.959093414479867 9744305.799567209556699,1391338.900823718169704 9744154.337644720450044,1389483.538870666641742 9744453.504949005320668,1388308.561645342968404 9745199.330390820279717,1383206.344104322837666 9748556.661807283759117,1382216.93647015444003 9749454.497310552746058,1379866.870700015919283 9752588.282904785126448,1379279.215108117321506 9753786.470064977183938,1375414.091068285284564 9765597.529463088139892,1374981.058249098015949 9778029.735624324530363,1375414.091068285284564 9779677.083945620805025,1376001.524021201534197 9781102.093789527192712,1383855.893333103507757 9794762.777529532089829,1384597.949058731319383 9795968.203564759343863,1389978.24268775084056 9801981.391684221103787,1391060.713416224811226 9802733.36982649564743,1392421.260232700966299 9803109.253798903897405,1394276.622185752494261 9802807.840911444276571,1395698.951319616753608 9802208.574255725368857,1398110.910726634552702 9800779.261059731245041,1399100.429680296918377 9799874.550306588411331,1399873.432224365649745 9798825.427227687090635,1401017.46263124817051 9796343.9948427118361,1404048.024448602925986 9786504.594238214194775,1403460.257537215948105 9785078.484378207474947,1403398.475219825049862 9783351.548768613487482,1403738.667583688860759 9782004.381064590066671,1404326.100536605110392 9780801.357204135507345,1407882.201669996837154 9778177.883954808115959,1418921.310294002993032 9775555.663091130554676,1420622.049474343191832 9775481.481394587084651,1421982.707610307727009 9775855.904675608500838,1423034.120200849371031 9776679.274702474474907,1423621.553153765620664 9778029.735624324530363,1423714.393609088845551 9779755.088914472609758,1410015.862350030103698 9789881.788904769346118,1400646.546087925788015 9802658.899534208700061,1397554.201953177107498 9807023.92602857016027,1397183.062770872144029 9808454.515693513676524,1397461.472817347850651 9810261.937526069581509,1403645.82712836842984 9833946.553140513598919,1407604.014262503478676 9848696.824960144236684,1408191.558534910902381 9850057.174267860129476,1410139.649623794481158 9854147.723308073356748,1410881.705349422059953 9855363.431690486148,1412736.955982982413843 9857561.847345501184464,1413664.581299762474373 9858544.754200261086226,1418705.0165233919397 9862944.827744802460074,1422972.115244478685781 9866054.730412825942039,1425291.34551566443406 9867422.564328895881772,1426497.380878920434043 9868031.27506510913372,1428043.49728654907085 9868181.615927271544933,1429496.884558345889673 9867576.718654217198491,1435774.079324686899781 9863932.590181494131684,1437969.522322111064568 9862261.179079296067357,1453337.734623577678576 9849907.222979608923197,1464747.871110397623852 9835607.122907780110836,1465737.390064057195559 9834702.248463448137045,1466634.179881887510419 9835681.944889511913061,1466943.314107821788639 9837496.419083660468459,1463820.245793617563322 9851346.888210438191891,1463480.164749241899699 9852707.753630144521594,1460728.12429785146378 9860519.44747544452548,1459676.711707309586927 9861123.73380683362484,1455935.152302256785333 9860365.448834700509906,1454079.901668696431443 9860669.35366871021688,1445761.775358151411638 9864616.129265492781997,1441556.236315470188856 9868106.445091618224978,1439577.421047130832449 9870004.551399648189545,1438742.524866179795936 9871978.111999504268169,1439020.712273673154414 9873881.374743169173598,1442174.727406318765134 9886733.627992790192366,1442638.707043944159523 9888410.908469274640083,1436639.699685093481094 9891607.601467927917838,1434382.474370281212032 9890620.029536144807935,1418457.664614848326892 9887570.162020985037088,1416911.548207219690084 9887419.677173988893628,1415272.591344270622358 9887875.52740179002285,1410819.923032031161711 9893817.460458902642131,1410850.647211489733309 9895190.745483733713627,1428661.765738412505016 9911598.589367929846048,1429898.74792010942474 9912131.667799279093742,1435464.722459772834554 9913584.224452305585146,1438587.790773977059871 9913890.730547798797488,1442174.727406318765134 9913508.562991818413138,1444679.527268656995147 9913659.611596548929811,1446070.90958408289589 9914041.787429582327604,1454790.899256391683593 9917098.847168853506446,1465273.633065414149314 9922683.339055044576526,1472447.50633009430021 9926514.023557825013995,1476158.230236197356135 9930569.660911114886403,1476931.344099757261574 9931798.756797697395086,1477549.612551623256877 9933255.140795912593603,1480177.977048743516207 9936472.457990547642112,1481878.716229083715007 9937546.607559639960527,1486269.602223932044581 9938313.327503776177764,1508378.988929365295917 9941689.057894539088011,1510017.945792314363644 9941153.714783040806651,1511038.411564417881891 9940230.634553467854857,1511811.302788995439187 9939156.071280864998698,1511718.684972654562443 9937395.040573230013251,1511316.487652420066297 9933865.759412566199899,1510512.649609401356429 9932640.713243896141648,1505843.464887568261474 9929959.606716427952051,1505688.842114856932312 9910373.323587341234088,1506152.599113499978557 9907394.529057363048196,1506492.68015787540935 9906022.962648900225759,1507049.388931330293417 9904802.797574678435922,1508348.042110926937312 9904421.12759174965322,1515089.105195402400568 9928810.797862,1515707.596286250976846 9930186.853938391432166,1520067.535462661180645 9937930.095036908984184,1520871.596144659211859 9939156.071280864998698,1522819.687233542790636 9940614.269747542217374,1525633.621321815764531 9941229.400631995871663,1530179.018769884249195 9941840.718294447287917,1531725.246497004292905 9941996.525858150795102,1533456.709856803063303 9941840.718294447287917,1536549.053991548717022 9940770.049893761053681,1537322.05653561744839 9939695.403455222025514,1542362.269120264332741 9937622.530331006273627,1544867.068982602562755 9938772.792473370209336,1558349.083832067670301 9945298.034001804888248,1573531.837861872976646 9962593.768250377848744,1574799.655542517080903 9965439.638653673231602,1574706.815087193856016 9967059.718497034162283,1574150.328952718758956 9968291.109272303059697,1573129.863180618034676 9969213.477906072512269,1571707.534046750981361 9969907.692181406542659,1570439.493727124528959 9969289.746565883979201,1554824.040836608503014 9959668.741541782394052,1530333.641542598605156 9952977.851040041074157,1528014.411271410062909 9947445.074579585343599,1527241.520046832505614 9946217.639372725039721,1526004.537865138147026 9945605.937644733116031,1518335.960783371236175 9942531.933718955144286,1516913.409010524395853 9942148.469213109463453,1515212.669830184197053 9942228.586134172976017,1512769.874924216652289 9943839.131594222038984,1500834.087801871355623 9946141.622905790805817,1488032.34636064292863 9943223.494015576317906,1468860.68101724400185 9931718.75967332907021,1466510.392608125926927 9930342.40121035091579,1462954.402794225607067 9928428.087455520406365,1455471.172664628364146 9925058.771408125758171,1454512.823168389732018 9924983.260930873453617,1452657.461215338204056 9925285.858939049765468,1450801.987942795502022 9926896.628904407843947,1450183.719490932067856 9927965.16828915476799,1449843.527127065462992 9929345.193794459104538,1450431.071399472886696 9930801.341047672554851,1470128.387378399726003 9951749.440845660865307,1471210.635467891348526 9952517.725184954702854,1484476.35654674237594 9959436.376614136621356,1486053.197133829817176 9959592.578166825696826,1493196.234899562783539 9958439.151042096316814,1501854.442254480673 9958130.679735351353884,1504822.999115464976057 9958591.176486663520336,1506863.819340177811682 9960437.899819964542985,1506492.68015787540935 9961824.371881112456322,1505286.75611411081627 9962593.768250377848744,1499937.186664549866691 9963130.761411555111408,1483548.619910473935306 9964441.55325991846621,1475447.01000951952301 9959592.578166825696826,1471519.769693822832778 9958054.533175691962242,1468551.324152329936624 9957589.918747860938311,1463727.516657785512507 9958743.205249208956957,1452008.023306051269174 9963900.302115369588137,1450771.152443848317489 9964669.927855875343084,1449750.797991236206144 9965596.25209385715425,1448977.684127676300704 9966674.90154604613781,1448390.139855268877 9967905.946986429393291,1447308.003085268428549 9972142.516993649303913,1447184.215811506845057 9973683.676740776747465,1447957.218355575576425 9974916.239545719698071,1449039.466445067198947 9975767.587413879111409,1451853.400533339940012 9976458.013429500162601,1455626.018076322274283 9978157.025010127574205,1463263.759659139672294 9983714.263746079057455,1465149.845791649771854 9985796.731574719771743,1465768.336882498348132 9987188.262915391474962,1466232.316520123742521 9988885.445795023813844,1464593.359657174674794 9995768.241424631327391,1464253.167293310631067 9997157.591359168291092,1456893.835756969172508 10013266.72787781059742,1455656.742255781078711 10014041.832235952839255,1453925.278895985102281 10014118.31462568603456,1450925.775216559879482 10013654.129701651632786,1449472.38794476329349 10014271.840209314599633,1444617.633631777716801 10019082.256916288286448,1443813.68426926783286 10020169.229088250547647,1444741.420905539067462 10021179.530841154977679,1456677.208027884364128 10025372.063083849847317,1459212.843389172572643 10025372.063083849847317,1461686.58511358150281 10023819.133894523605704,1470344.792468502186239 10018306.590634029358625,1470932.336740906583145 10017066.318860976025462,1478755.647914876462892 10021021.940927919000387,1498020.153713598614559 10031509.456604544073343,1501019.657393023837358 10036720.507064299657941,1502132.852300956612453 10037498.230543710291386,1507822.280155907617882 10041230.10513773187995,1510203.292744487291202 10042632.772588927298784,1516356.922876046504825 10043334.352645,1517964.821601066039875 10043488.24443793669343,1519696.618919335771352 10043411.157959042117,1521582.705051845870912 10043022.094524966552854,1525076.912548358086497 10042868.213053835555911,1526654.087093916255981 10043022.094524966552854,1527921.793455069186166 10043569.536560162901878,1526715.869411307154223 10044348.026864368468523,1519974.695007337722927 10046213.450455036014318,1518243.23164753918536 10046371.612502647563815,1505874.189067027065903 10044891.367771724238992,1504537.01934361923486 10044339.616348292678595,1500184.538573093246669 10041153.323923345655203,1499226.077757360413671 10040144.318243550136685,1497030.634759936248884 10036173.604206819087267,1495144.325988443568349 10031821.19794443808496,1494185.753853225149214 10030809.069015311077237,1493289.075354883214459 10030185.691073540598154,1491866.746221018955112 10029797.367182921618223,1478044.316368707455695 10026225.133612379431725,1476158.230236197356135 10026536.638089412823319,1473220.508874163031578 10027778.320646982640028,1470746.767149754101411 10029332.134482402354479,1469942.817787247244269 10030420.710304075852036,1469757.248196094762534 10031663.086810441687703,1466417.663472296670079 10055805.027095451951027,1466417.663472296670079 10057206.146169777959585,1467994.838017854839563 10059627.94843315705657,1468953.410153076052666 10060721.280656160786748,1490629.652719833655283 10057986.165917914360762,1500957.65243665035814 10055256.339480351656675,1506801.814383807126433 10052763.36120599322021,1504742.62644311436452 10055710.674451110884547,1504519.876142034307122 10056599.77432794496417,1504185.917669656919315 10057347.706086425110698,1502757.354644306236878 10059362.15786330960691,1500790.784519951557741 10060952.838525848463178,1492701.531082475790754 10065873.019270127639174,1491000.791902138618752 10066340.704956831410527,1483765.025000573368743 10067512.447913892567158,1482157.126275556627661 10067358.02304607629776,1480858.250456980196759 10067748.451749756932259,1479621.490914268419147 10068607.022034415975213,1472756.863195008365437 10073378.071341678500175,1472540.235465926351026 10074628.153628138825297,1478229.885959859937429 10077051.814534058794379,1479992.407457591034472 10076974.354695884510875,1491959.252717868657783 10075801.295877804979682,1501514.361210108036175 10074237.056398851796985,1502751.120752822607756 10073378.071341678500175,1507228.613311507971957 10071483.668378744274378,1507302.863411868922412 10070547.635638983920217,1509139.52369046676904 10068810.990276554599404,1510141.510427096392959 10068529.656337182968855,1511199.156909124460071 10068482.674679815769196,1524025.499957816442475 10068139.183715563267469,1525478.775910121854395 10068452.572826879099011,1526746.593590765958652 10068997.802308555692434,1543351.899393417872488 10076583.406954267993569,1545578.177889792015776 10078147.893449118360877,1546536.750025013228878 10079166.661122929304838,1545980.26389053533785 10080495.284371735528111,1529474.032434690045193 10078616.406587718054652,1524687.294330582022667 10078289.599139209836721,1524130.808196104131639 10077679.411922795698047,1523833.919114159885794 10076647.906182136386633,1523166.002169399289414 10076177.272742131724954,1516511.545648760627955 10074628.153628138825297,1512368.011562452884391 10073378.071341678500175,1510945.571109097450972 10073064.459881857037544,1509399.454701468814164 10073296.429651878774166,1508378.988929365295917 10074237.056398851796985,1507822.280155907617882 10075487.574959356337786,1507204.011704044416547 10080104.138331368565559,1507234.847202994395047 10081514.396575391292572,1507327.576338823651895 10083235.051567228510976,1508966.533201772719622 10085898.340973667800426,1510079.728109705261886 10086763.389652404934168,1511347.545790349366143 10087310.058977592736483,1514223.262196013238281 10088016.166717937216163,1515800.214102591620758 10088171.051732767373323,1516455.885903362184763 10088722.064146596938372,1517476.240355974296108 10088439.9222696069628,1519220.282818231498823 10087684.684902453795075,1521261.103042944334447 10087122.753596734255552,1522300.159170010127127 10087030.231116881594062,1523932.770821984391659 10087592.154932415112853,1524600.799086233368143 10088063.280737401917577,1524136.930768099147826 10088767.207911189645529,1523116.464995995862409 10089049.363092042505741,1518793.59521002182737 10089990.151338495314121,1513790.340696317143738 10091387.460030145943165,1510419.920473569305614 10091228.269483527168632,1507853.338293839944527 10090052.517633499577641,1506616.467431636992842 10090836.235992223024368,1504359.019477839348838 10092563.438058108091354,1503555.1814348208718 10093739.333021886646748,1503215.100390448002145 10095148.410743234679103,1503988.102934516733512 10096406.93923450447619,1505286.75611411081627 10096954.086194,1510543.485108351334929 10099075.288678150624037,1515800.214102591620758 10101114.88757967017591,1530240.801087275380269 10097898.206802254542708,1557452.405333728762344 10094678.780511079356074,1557452.405333728762344 10095622.591608088463545,1553927.251018778188154 10098208.704213118180633,1551236.99288477585651 10099622.928663788363338,1549319.73729484481737 10100015.176228085532784,1541187.291894940659404 10099622.928663788363338,1539641.175487314816564 10099860.026666274294257,1538188.010854497784749 10100485.167746551334858,1524211.069548966130242 10107790.378239646553993,1505750.624432245036587 10126049.687474749982357,1505163.191479328786954 10127387.319343529641628,1506121.763614550000057 10130777.804417584091425,1508038.907884992659092 10135197.260163636878133,1509028.315519163617864 10136220.178955307230353,1510141.510427096392959 10137009.131113274022937,1511409.328107740497217 10137642.176017392426729,1512862.715379537083209 10137958.720148954540491,1514470.614104556618258 10138114.724324392154813,1531323.049176766769961 10138271.016180885955691,1550494.937159148044884 10133221.16195560246706,1552257.458656879141927 10133065.267858918756247,1553679.899110234808177 10133381.603074105456471,1572109.397408514749259 10150439.914511252194643,1579685.245354452636093 10148303.229459270834923,1581447.87817167211324 10148224.969901436939836,1582746.531351265963167 10148781.058802396059036,1583736.161624419502914 10149805.984370090067387,1588343.452709370292723 10160094.088385451585054,1588838.379165437072515 10161834.352684363722801,1588992.890618660021573 10165006.669851053506136,1588652.809574284590781 10166430.30688539147377,1592332.364022966707125 10171347.385464612394571,1602443.958649681182578 10173330.1036122366786,1604391.938419073587283 10173011.939496027305722,1617008.332908129319549 10168890.550573777407408,1618492.444359384477139 10168254.644664915278554,1619265.558222944382578 10167144.232632026076317,1619822.044357419479638 10165798.906299848109484,1619945.831631183857098 10164214.523994950577617,1619822.044357419479638 10162469.384309405460954,1619451.127814096864313 10160490.057031417265534,1620038.672086504288018 10159224.120132623240352,1621337.436585589544848 10159776.531612452119589,1622450.408854539738968 10160568.170149583369493,1624120.423855421133339 10163022.054623141884804,1624769.639125728281215 10164528.005528954789042,1624893.426399489864707 10166273.663957063108683,1624800.697263657813892 10167936.71360126696527,1624243.988490200368688 10169204.243796482682228,1623440.150447184452787 10170314.986144287511706,1622419.68467508116737 10171347.385464612394571,1621182.702493386808783 10172140.347501309588552,1605783.543373482069001 10176346.534260459244251,1599784.758653613971546 10176185.095236361026764,1591621.255115780280903 10176267.957274215295911,1588807.321027507539839 10177375.546461755409837,1588003.260345506481826 10178487.600188666954637,1594218.67279445938766 10196615.145881472155452,1595208.303067610133439 10197651.761069729924202,1597496.475200866349041 10199243.813635053113103,1608380.961052161175758 10203068.070409342646599,1625109.831489592324942 10202429.017835192382336,1633768.038844510214403 10200755.369845353066921,1637045.72993142879568 10199799.426996901631355,1637849.790613427059725 10198683.944978509098291,1638406.276747902156785 10197411.00717942789197,1639303.066565732471645 10194626.036136537790298,1639612.312111158156767 10193113.52628730982542,1639736.09938491974026 10191522.882912252098322,1639612.312111158156767 10189770.848846655339003,1640601.942384311696514 10188739.993031572550535,1641776.919609632343054 10189534.949384592473507,1642580.757652651052922 10190806.153184467926621,1642302.45892566931434 10195662.066919237375259,1641962.489200785057619 10197091.734579531475902,1639581.476612208178267 10200595.654549552127719,1638808.362748648272827 10201711.444749567657709,1637788.00829603895545 10202669.659521425142884,1636087.26911569875665 10203225.547991925850511,1626748.788352541392669 10205935.354765204712749,1625048.0491722014267 10206412.872714685276151,1618709.072088469285518 10205773.511206176131964,1616760.980999588500708 10206176.40538077801466,1615678.510271111736074 10206732.575622634962201,1617657.659497927641496 10208804.114736877381802,1619945.831631183857098 10210398.735295021906495,1622388.626537151634693 10211757.065308041870594,1623873.071946877753362 10212077.01523725874722,1646167.805604483699426 10216623.396219473332167,1647961.273920653155074 10216465.326026191934943,1661752.422996049746871 10215106.071431513875723,1662927.511540864827111 10213909.114006,1662309.131769507424906 10207371.738733757287264,1661969.050725134788081 10205374.944537565112114,1661288.777316895313561 10203943.564972538501024,1658289.273637472651899 10200915.088827012106776,1657608.888909742003307 10199401.204223588109016,1657701.729365065228194 10197809.115459,1658041.921728929271922 10196295.909989010542631,1666205.313947271788493 10183413.249819615855813,1667009.15199029026553 10182222.046244548633695,1668462.539262086851522 10181584.915104642510414,1669946.98467181599699 10181903.473346510902047,1670627.258080052444711 10183334.878628887236118,1670750.822714834474027 10185163.675550665706396,1670657.98225951124914 10186752.858329819515347,1668988.301217103376985 10190648.957904946058989,1667658.701219068374485 10193113.52628730982542,1665401.253265270730481 10194944.908517463132739,1662680.159632321214303 10196457.81863302923739,1662123.562178354943171 10197809.115459,1665494.093720593955368 10204976.68774339184165,1666174.36712883063592 10206412.872714685276151,1671554.883396832738072 10213672.3904,1672698.913803715258837 10214470.503200711682439,1675327.278300835518166 10215588.53313460573554,1676626.042799920542166 10216066.430395815521479,1678264.999662869842723 10216224.204088054597378,1697807.581549593945965 10209202.878973359242082,1709248.776174343423918 10202984.88697599992156,1711969.869807295734063 10201470.836378671228886,1713547.044352853903547 10199164.976343214511871,1713856.178578788414598 10197651.761069729924202,1713917.960896176518872 10196059.788065437227488,1713794.396261397516355 10194306.891965851187706,1713114.122853158041835 10188818.711680822074413,1720318.942936282139271 10176581.984822886064649,1724957.180839674081653 10174681.178687835112214,1722359.763160994974896 10195976.688819231465459,1713608.82667024503462 10209763.599312262609601,1712588.360898141516373 10210797.591443073004484,1712031.874763666419312 10212077.01523725874722,1712341.008989600930363 10213672.3904,1715105.517223958624527 10214742.307784963399172,1715699.18406836129725 10215362.671353057026863,1716496.899539384525269 10215698.018407367169857,1717331.795720335561782 10215652.040129033848643,1723565.79852424794808 10215426.17627421207726,1729224.50219974340871 10213510.365727286785841,1734821.423557847738266 10211196.183406220749021,1736274.699510153150186 10210560.974222658202052,1736831.296964119654149 10209202.878973359242082,1737820.927237273193896 10208247.77797868847847,1739521.666417610365897 10207687.180454749614,1749200.228225143160671 10204740.269479488953948,1750962.749722871463746 10204578.166963728144765,1752137.726948195137084 10205374.944537565112114,1752075.944630804238841 10206973.367007717490196,1751519.235857346560806 10208326.718809962272644,1747282.972635209560394 10215189.400709684938192,1715866.05198506009765 10223415.203058015555143,1700497.951003084890544 10225171.461058916524053,1698890.052278068149462 10225092.327784225344658,1697560.229641050565988 10224534.679686164483428,1696014.113233421929181 10222853.375210428610444,1694715.460053827846423 10222295.907582500949502,1691623.227238573366776 10221896.675611199811101,1678388.564297651639208 10226449.229077503085136,1676904.452846396481618 10227090.504330240190029,1677213.587072328198701 10228689.346155613660812,1678357.728798701893538 10229410.010942904278636,1679996.463022668613121 10229568.089290743693709,1681295.338841245044023 10230130.462868772447109,1684789.54633775446564 10232450.989449791610241,1685778.953971925424412 10233488.378707606345415,1686459.227380164898932 10234930.495942283421755,1687819.774196638260037 10241978.000275678932667,1687943.561470402637497 10243743.307628327980638,1686706.579288705717772 10244623.966096144169569,1685222.467837450327352 10244302.506983438506722,1674059.460620191413909 10240776.383572163060308,1654114.68141323258169 10234451.005409771576524,1651511.36380154080689 10229185.712894171476364,1650342.286509229801595 10227090.504330240190029,1637818.732475497527048 10218140.766401134431362,1635530.560342241311446 10216544.360671374946833,1632902.195845121052116 10215426.17627421207726,1629500.717484440887347 10215426.17627421207726,1627954.712396303424612 10215746.295928481966257,1627305.274487016489729 10216702.145263597369194,1619296.616360876709223 10226769.859271610155702,1617843.229089080123231 10226449.229077503085136,1598733.346063069533557 10223015.906481251120567,1598826.075198901584372 10226849.011741753667593,1610174.429368330631405 10240697.359931740909815,1620842.510129522997886 10256253.866400349885225,1622821.548036844702438 10268230.272134810686111,1622265.061902369605377 10269595.66825601644814,1627336.221305457642302 10275152.703357499092817,1628325.740259120007977 10276196.52225860953331,1631541.537709153490141 10278209.529292913153768,1643199.2487434996292 10276678.627943390980363,1646662.509421567898244 10275634.736195499077439,1648146.843511805636808 10274909.525773076340556,1649167.309283906128258 10273940.958179317414761,1649723.795418384252116 10272574.703085925430059,1648703.440965771907941 10269193.40581463649869,1648023.056238044053316 10267669.133473882451653,1656774.104048285167664 10272331.616232320666313,1661653.571288225473836 10277629.892449731007218,1660317.626079215668142 10280192.086781630292535,1656941.083284475374967 10279709.735819298774004,1651393.587780283065513 10282644.389216888695955,1650125.770099638961256 10283450.215591473504901,1640199.74506407417357 10295469.546540334820747,1639550.529793767025694 10296441.138361152261496,1639457.689338446594775 10298056.108997417613864,1640447.09697261499241 10299103.395752370357513,1649662.013100993121043 10308158.680849127471447,1660020.959636251209304 10315606.108443612232804,1661164.990043133730069 10316335.897901855409145,1666669.070945917628706 10318440.561220278963447,1673781.050573718501255 10320545.866661,1677244.533890769118443 10320465.925084408372641,1678728.645342024508864 10319820.299508025869727,1684603.976746601751074 10315201.448230879381299,1686644.796971314586699 10313177.628666400909424,1687201.283105792477727 10311883.721240865066648,1687294.123561113141477 10310180.737669097259641,1686459.227380164898932 10308967.490745963528752,1685438.761608061613515 10307918.706515904515982,1670565.253123681992292 10296117.25922903418541,1668246.24549147579819 10294502.741989511996508,1665222.028885095845908 10293096.960206197574735,1662253.583343602949753 10292950.498683616518974,1662698.749987283488736 10291403.252730250358582,1668209.064781551016495 10290866.664542313665152,1669192.461163218365982 10290917.794050399214029,1671400.260624121176079 10290866.664542313665152,1673750.326394259696826 10292400.714496670290828,1681913.82993209338747 10297971.774571027606726,1706156.654678580351174 10294986.127342794090509,1713825.343079838668928 10293695.624921096488833,1717505.008848009398207 10292724.419337,1718989.342938246903941 10291997.121727988123894,1721030.274482451146469 10289980.383059598505497,1722143.246751401340589 10287316.994455659762025,1728822.52751848846674 10269759.012607280164957,1735254.345057543832809 10247028.457936910912395,1739397.879143848782405 10232288.236305430531502,1741036.72468730667606 10232371.77283912524581,1742026.243640969041735 10233329.922625130042434,1745613.180273310514167 10238132.17785875312984,1746479.134592190850526 10239333.335063571110368,1747159.408000427531078 10240855.696528205648065,1747684.835996973328292 10242378.681749382987618,1747901.463726058136672 10243501.232772268354893,1747375.701771038817242 10244861.751574484631419,1738253.84873696626164 10256977.121298734098673,1727307.357929300982505 10278373.077450441196561,1728946.092153270496055 10289820.626292414963245,1730028.562881741672754 10293291.956459481269121,1731450.892015608726069 10296276.871013881638646,1735104.842981406487525 10299995.50340747833252,1735501.696966084418818 10300399.564008545130491,1738717.494416120927781 10303227.486492032185197,1747654.111817514523864 10310180.737669097259641,1748829.089042838197201 10310990.075924346223474,1753869.52426646463573 10313662.323562920093536,1755199.012945008464158 10314147.052503088489175,1758198.627943925093859 10314796.520228751003742,1764742.210251736920327 10315170.254228387027979,1768093.594841557554901 10315281.328842740505934,1769423.1948395925574 10315766.171517711132765,1769887.063157729571685 10317145.666741264984012,1769361.412522201659158 10318440.561220278963447,1767629.615203931927681 10319010.216762328520417,1764011.843072640709579 10319330.796294426545501,1762372.886209691409022 10319250.5771,1750251.418176702456549 10316980.905928533524275,1747746.840953343780711 10315686.285293521359563,1743046.59809358115308 10312528.313266254961491,1740820.20827771583572 10310750.003128761425614,1737789.869099340867251 10307674.081074446439743,1731512.67433 10302823.551352,1730337.697107675950974 10302015.46099603548646,1729008.097109640948474 10301447.206352042034268,1709867.267265192000195 10303547.333748552948236,1700838.143366948701441 10305328.44677421823144,1697838.639687523478642 10306701.19831096380949,1696570.822006879374385 10307594.288460398092866,1695797.708143319468945 10308727.488291030749679,1695241.222008844371885 10310100.916071524843574,1689860.705740842269734 10331983.552454851567745,1689520.513376978458837 10333446.385564979165792,1689891.652559283422306 10335395.753001151606441,1691128.523421486373991 10338644.363371511921287,1702724.229499459033832 10362655.67573368921876,1703095.368681763997301 10363390.167396353557706,1704239.510408137692139 10363963.548,1705754.679997325409204 10363309.727642573416233,1709558.133039257721975 10360698.587687887251377,1720411.672072111396119 10354262.431373516097665,1726410.568111470667645 10351413.223151342943311,1742366.32468534167856 10351171.739463938400149,1737016.977874763309956 10355112.438664861023426,1734419.448876593029127 10357506.45113167911768,1732898.156715413089842 10358531.41181187145412,1731989.010434103896841 10358972.36192717589438,1730949.954307038104162 10359315.049225032329559,1728964.79382772394456 10359216.466202149167657,1727165.091620068298653 10358824.788655284792185,1726163.216202927054837 10358777.847521308809519,1724178.055723612895235 10359265.757537370547652,1723547.096849794499576 10359901.588676899671555,1714505.727807566523552 10368202.994665190577507,1714567.510124954627827 10369592.726115956902504,1723324.56918769958429 10367077.899430435150862,1729725.439908314030617 10368301.706300573423505,1733528.892950246110559 10368743.281905949115753,1734512.178012422053143 10368790.290955346077681,1736757.158183252671733 10368252.350306160748005,1738130.061463204678148 10367127.247015092521906,1741692.28516858862713 10363309.727642573416233,1754271.387628231197596 10355322.68429889716208,1755291.853400331921875 10354262.431373516097665,1757580.025533588137478 10352392.432400587946177,1761228.855802808888257 10350031.546639204025269,1762156.481119589181617 10350679.713317103683949,1762744.025391996605322 10355483.671691872179508,1756745.240672128507867 10366571.519631754606962,1745922.314499245025218 10373019.185142543166876,1740139.9348694763612 10376043.514294501394033,1735378.132331302622333 10378004.965312961488962,1712000.92794522526674 10386998.074651019647717,1711289.596399056259543 10385442.841608865186572,1709558.133039257721975 10382908.681817844510078,1690571.925967520102859 10362333.07603570446372,1688531.105742807267234 10360290.979847714304924,1677893.860480564646423 10352880.183834489434958,1669915.926533883670345 10347590.626592438668013,1660732.068543440429494 10343439.941519347950816,1652413.942232892615721 10340434.560480229556561,1648950.792874315520748 10340514.733797015622258,1643261.031060887733474 10341733.834163062274456,1640478.155110547319055 10343279.235069883987308,1639674.09442854905501 10344498.531493078917265,1639797.881702310638502 10346285.856340488418937,1645147.339832380414009 10364125.030942033976316,1646167.805604483699426 10365186.801984200254083,1658567.572364454623312 10366737.469469731673598,1667998.893582932418212 10366652.291177676990628,1673812.108711647801101 10370243.028635334223509,1673533.698665174888447 10380784.251307647675276,1668215.187353543471545 10380945.834546,1655258.93445909768343 10378655.767977844923735,1652259.4307796722278 10378004.965312961488962,1644467.066424143733457 10382500.052643621340394,1643663.005742142675444 10383726.307327248156071,1642580.757652651052922 10387816.185670886188745,1642859.167699123965576 10389371.659986257553101,1645765.830923228757456 10392812.394484434276819,1647775.704329500673339 10394859.729231063276529,1670070.549306597793475 10399365.831948047503829,1675049.090893342159688 10399613.437370628118515,1676595.095981479622424 10398956.225358676165342,1677615.450434091733769 10397888.942804776132107,1678976.108570059062913 10398465.201727896928787,1681388.067977077094838 10402563.843650631606579,1680831.359203619416803 10403874.884949503466487,1676997.181982225738466 10404451.645006131380796,1675327.278300835518166 10404370.724399212747812,1670812.60503222537227 10403383.805784752592444,1663453.162176389945671 10401415.116014676168561,1659402.468545402633026 10399694.59722345136106,1656402.964865980204195 10399037.082366466522217,1654733.172504081157967 10398956.225358676165342,1653218.002914893673733 10399613.437370628118515,1653032.433323740959167 10400924.212222607806325,1656990.397818896453828 10407814.234812436625361,1657949.081273608841002 10408472.588318161666393,1666236.149446221534163 10414138.270769257098436,1668926.51889971527271 10415289.123218569904566,1672265.992304021958262 10415451.518042778596282,1674275.977029785048217 10415040.953464966267347,1690076.999511453555897 10411264.198222270235419,1694870.082826539408416 10409293.254411129280925,1695921.495417083846405 10408224.664146548137069,1698951.834595456253737 10405763.341195547953248,1706620.411677223397419 10413398.348526813089848,1728265.818745031021535 10423427.183884052559733,1748674.577589615248144 10431244.88327344506979,1751704.805448499042541 10431823.941181894391775,1755075.225671246880665 10431986.726603070273995,1756807.02298951940611 10431412.398857483640313,1759373.605169248767197 10429684.367650719359517,1760394.070941349258646 10428612.311130976304412,1761197.908984367968515 10427459.229124192148447,1761754.617757825413719 10426062.216915966942906,1762156.481119589181617 10422853.569963630288839,1766763.994843522552401 10424249.930976767092943,1770721.95933867781423 10431330.864214308559895,1776195.093423020560294 10444929.960251245647669,1776782.749014916364104 10450875.205595089122653,1764166.354525860864669 10458478.897692808881402,1759342.547031316440552 10457320.79939622245729,1754704.309127924498171 10454923.372947704046965,1740356.451279069995508 10456162.8960822802037,1736522.051418696762994 10456744.055258862674236,1727622.726046718889847 10460827.539964128285646,1719020.178437196882442 10455586.249033926054835,1718803.773347094422206 10449142.279763216152787,1718494.416482180356979 10447573.242182729765773,1715866.05198506009765 10443778.596096782013774,1714505.727807566523552 10443198.531274827197194,1706651.358495664317161 10445510.171088699251413,1705599.945905122673139 10446580.109556380659342,1703991.935860611731187 10448974.629196031019092,1702848.016773220617324 10451700.94417455047369,1701394.629501423798501 10455917.711036834865808,1701301.789046103367582 10457570.498780259862542,1702013.120592272374779 10459142.116581970825791,1707980.958493699552491 10468405.584961900487542,1709743.70263041020371 10470975.900997884571552,1717968.877166143618524 10482082.741686895489693,1723967.77320550289005 10486149.330547954887152,1725668.51238584308885 10486231.517715260386467,1726224.998520318185911 10484822.517389636486769,1725606.730068451957777 10481586.048368260264397,1725359.266840420197695 10478351.102575236931443,1727638.867372882552445 10477923.035707259550691,1727972.714525771792978 10477128.167735109105706,1728603.673399590188637 10476479.32751003280282,1729512.708361408207566 10476083.308399587869644,1735736.692411149153486 10480938.877674141898751,1738241.38095 10483477.736884746700525,1738779.276733511826023 10484225.236247651278973,1739076.388454438420013 10485070.8271,1743912.55241246172227 10490715.644636604934931,1749169.281406702240929 10489638.816529678180814,1750684.339676398551092 10488972.649135062471032,1751241.1597693443764 10487563.086774045601487,1752292.349720906466246 10475035.9225,1751550.293995278887451 10473542.70362539216876,1750344.258632025681436 10472714.338274542242289,1748489.007998462766409 10472878.094340894371271,1746726.486500734463334 10473460.668034095317125,1741475.768758998019621 10472566.394435470923781,1740455.414306385675445 10472516.285147247835994,1740158.525224438868463 10471719.9544119797647,1738470.142507577547804 10465508.758497152477503,1738562.982962900772691 10463772.141909595578909,1739119.469097375869751 10462449.640157977119088,1740170.881687917513773 10461372.763558078557253,1741438.69936856161803 10460545.565256113186479,1742644.734731817618012 10460295.75782947614789,1764630.334163489053026 10474207.377166727557778,1766269.068387455772609 10477025.793750105425715,1766980.399933624779806 10478515.291501432657242,1767722.4556592523586 10480091.406169937923551,1769732.551704506622627 10484904.688691893592477,1773752.187197561608627 10501443.196060467511415,1775020.004878205712885 10514852.300358489155769,1775174.627650917274877 10516684.127097925171256,1775916.906015527201816 10518269.323167597874999,1776813.584513869136572 10519520.024865444749594,1778019.508557630935684 10520354.0526775829494,1781761.179282175144181 10520019.768654527142644,1783523.478140923660249 10519437.738810325041413,1784822.465278988704085 10518521.246918566524982,1786399.194546584738418 10516102.37986989878118,1792645.776452958351001 10496536.30751003138721,1792861.95890408102423 10491464.230794722214341,1791408.794271264225245 10467250.284397395327687,1802571.578849540557712 10440561.679530600085855,1803901.178847575793043 10438002.405635314062238,1805045.097934966906905 10433552.509808886796236,1805849.381255950545892 10425483.643577875569463,1805694.869802727596834 10423675.952329779043794,1805261.725664051948115 10421701.452265102416277,1804117.69525716942735 10418164.876932369545102,1804179.700213539879769 10416521.52652632445097,1805292.672482492867857 10413808.815153293311596,1824959.152962467167526 10394121.87549277767539,1828268.013506806455553 10391175.082627376541495,1833308.114771962165833 10387573.423109751194715,1836307.50713189621456 10386099.060006320476532,1836987.780540132895112 10389290.91636311635375,1831576.428773183841258 10401824.868883987888694,1828577.147732740966603 10403302.602442080155015,1822547.082235957961529 10406254.590094234794378,1816795.649424633476883 10409293.254411129280925,1810456.894979883916676 10413727.784500123932958,1809683.558477341430262 10414959.612524580210447,1809126.849703883752227 10416354.372962884604931,1804210.313073510071263 10446498.692115498706698,1804210.313073510071263 10447491.51580167748034,1807828.307843781076372 10449886.352777453139424,1809034.343207034282386 10450625.749158825725317,1819949.887196261435747 10448974.629196031019092,1826536.216188534162939 10444685.175272369757295,1828731.659185961121693 10439238.883276365697384,1830277.886913078138605 10436766.446880415081978,1832349.765275723300874 10434706.613337548449636,1833617.248997896676883 10433801.34794070199132,1835349.046316166175529 10433222.123620243743062,1838874.089311625575647 10433140.567531896755099,1840080.013355390168726 10433882.911860983818769,1841131.425945931812748 10434869.466967122629285,1836678.646314201178029 10450212.783359138295054,1835411.051272539654747 10451124.671078607439995,1833679.253954267129302 10451700.94417455047369,1828174.950412503676489 10453271.221142074093223,1824340.773191109765321 10453933.938007580116391,1822578.140373890288174 10454510.44653263874352,1821557.674601789796725 10455586.249033926054835,1821712.186055009951815 10457402.345039622858167,1822145.330193685600534 10459387.118911219760776,1825113.664415690116584 10465426.818708568811417,1832442.271772573003545 10475368.3234,1833710.312092199455947 10474453.215258678421378,1836864.215905353659764 10469652.013078777119517,1838936.094267998822033 10467495.873843088746071,1841471.618309795856476 10465677.110581362619996,1854767.84092912892811 10460545.565256113186479,1856468.580109466100112 10460627.446899818256497,1857365.481246787589043 10461867.998638704419136,1860735.901469535427168 10466836.617153389379382,1841100.479127490893006 10473711.252548392862082,1838272.296144396765158 10481214.821178335696459,1830709.472578885033727 10480177.999945180490613,1826722.676335613708943 10473756.597388830035925,1819238.666969583602622 10468323.610644405707717,1814507.588610868435353 10476693.312665112316608,1815373.43161025759764 10482748.241552412509918,1826659.780823315959424 10492545.832087609916925,1834637.714769997168332 10499446.243228945881128,1835317.988178236642852 10502691.137030443176627,1832102.19072820013389 10509267.689627930521965,1827989.380821350961924 10509683.918900506570935,1819993.079158690059558 10508517.161247845739126,1816504.99423417286016 10507517.583590302616358,1813666.347218942595646 10505420.562215702608228,1808137.442069715587422 10503358.635857500135899,1806282.191436155233532 10503523.123759988695383,1802262.44462360907346 10504355.211260365322232,1800499.700486898422241 10504935.964377779513597,1799232.10544523387216 10505855.140988891944289,1798922.971219302387908 10507437.539720311760902,1799510.292852727230638 10511267.499950714409351,1800252.571217337390408 10512768.939965048804879,1801767.740806524874642 10513098.670744953677058,1803808.561031237710267 10512681.93448250181973,1805323.730620422400534 10511935.832715578377247,1808879.720434322953224 10511848.837785556912422,1815433.76677426812239 10514900.318418392911553,1816250.183919748058543 10515202.539788665249944,1816695.573202411178499 10516152.808019500225782,1816621.545741032576188 10516904.171272568404675,1816287.364629672607407 10517751.392162337899208,1814858.80160432192497 10519955.496682319790125,1813931.17628754186444 10520404.512056831270456,1812465.209913284052163 10519405.605472553521395,1811316.392768298275769 10520855.959786294028163,1809126.849703883752227 10521023.270308073610067,1793326.049861197825521 10527117.412512024864554,1792274.637270653387532 10528117.742350049316883,1792614.829634517198429 10529787.989574119448662,1795985.249857268063352 10537897.499479815363884,1796882.039675098145381 10539234.605969626456499,1800870.839669200591743 10541077.770423861220479,1802262.44462360907346 10541661.637770963832736,1838008.134992745006457 10523191.767164401710033,1839276.175312371691689 10522274.774154298007488,1841657.187900948338211 10518603.82226868160069,1843852.630898375529796 10513016.161558063700795,1844439.952531800372526 10509935.827829709276557,1844501.957488171057776 10508270.101527601480484,1851551.932159601245075 10498948.29337097145617,1860828.853244350058958 10489387.94968375004828,1862096.44828601158224 10488475.457657558843493,1866641.957053574267775 10486231.517715260386467,1869919.759459981461987 10484904.688691893592477,1870816.660597302950919 10486149.330547954887152,1870043.324094760464504 10487394.496763745322824,1862745.77487580711022 10498281.222879713401198,1853623.810522243380547 10504606.625185126438737,1851551.932159601245075 10506769.944221876561642,1847532.185347054852173 10514600.211051745340228,1847006.534711529733613 10515933.088075719773769,1846697.40048559801653 10517517.810553262010217,1847130.099346308736131 10519520.024865444749594,1832936.975589657202363 10534971.229282572865486,1827185.542778332484886 10535807.136199111118913,1809034.343207034282386 10543840.883718753233552,1807735.690027443226427 10544760.762094372883439,1805540.247030016034842 10550286.846323683857918,1806282.191436155233532 10551796.844923341646791,1813641.745611479273066 10555738.888435278087854,1816424.510242328280583 10556913.699825368821621,1842058.939943220699206 10565807.545611668378115,1846728.347304036375135 10566730.071368776261806,1859746.493835364468396 10567154.638180587440729,1861756.367241638945416 10566647.217377280816436,1863302.483649264788255 10565890.389462240040302,1875949.824956761440262 10558674.028902310878038,1876970.29072886495851 10557665.008236143738031,1878547.019996458198875 10555149.294071100652218,1879103.728769915644079 10553809.083685453981161,1878887.101040833629668 10551879.821509813889861,1877990.645181474275887 10550622.90917463041842,1876908.285772491479293 10549619.294520555064082,1874929.359184660948813 10547272.368498407304287,1874001.511228898307309 10546016.601142950356007,1873228.620004320750013 10544424.98617141507566,1873043.050413168268278 10542585.744000781327486,1874001.511228898307309 10542167.214222984388471,1879876.508675004821271 10543840.883718753233552,1881268.11362941050902 10544424.98617141507566,1890359.465123006841168 10549200.637232901528478,1891596.002026738831773 10549955.324681676924229,1893451.363979790359735 10552551.817958740517497,1895430.624526094645262 10554813.009478017687798,1898398.958748096367344 10555656.167071839794517,1906376.892694777576253 10557245.557826219126582,1908015.960877218050882 10556913.699825368821621,1909283.555918882368132 10555987.662340398877859,1910860.730464440537617 10553472.864765301346779,1928578.78589706029743 10523274.098215594887733,1929104.547852076822892 10521857.480722861364484,1929383.180537532316521 10504519.723026372492313,1929197.499626891454682 10502608.752757739275694,1928733.853947736788541 10500611.461160806939006,1927434.866809669183567 10497783.357445808127522,1927496.871766042429954 10496038.568491635844111,1928857.418582515791059 10495536.376487705856562,1930063.453945771791041 10496367.497211847454309,1931918.704579332144931 10498861.462755480781198,1932660.537665977142751 10500360.193396070972085,1938659.656344318995252 10515433.641566829755902,1938783.2209790982306 10516935.992705335840583,1938721.661300689680502 10518603.82226868160069,1938443.028615234186873 10520189.161220148205757,1936866.29934763815254 10524361.020721832290292,1936093.074164589866996 10525530.473415827378631,1930681.722397637786344 10532464.119059234857559,1928795.41362614533864 10534387.93070138245821,1927527.818584480788559 10535306.543057834729552,1924497.479406108381227 10536895.743737183511257,1923260.497224411461502 10537980.007069865241647,1922240.031452310737222 10539069.260446865111589,1917044.862136478768662 10546182.114113308489323,1916272.082231392618269 10547438.213296376168728,1914787.859460646053776 10556913.699825368821621,1915158.998642951017246 10558503.683964176103473,1919828.072045292938128 10566984.082542907446623,1921219.676999698625877 10567486.991933740675449,1928548.284356584306806 10566984.082542907446623,1930403.534990144427866 10566730.071368776261806,1935474.69439323246479 10564718.574573671445251,1938041.276572961825877 10562869.352409055456519,1940094.898539115441963 10560568.646346436813474,1946204.780110795516521 10555904.937977783381939,1952048.83073846087791 10552634.803674831986427,1953904.0813720212318 10552386.151294354349375,1955295.686326429713517 10552970.981533883139491,1956408.658595379907638 10553974.784707058221102,1956779.909097176045179 10555568.616350131109357,1955728.385187140433118 10556660.363165035843849,1950688.283921984722838 10558674.028902310878038,1946111.828335983678699 10561024.858482277020812,1934917.985619774786755 10567823.898341773077846,1933619.4437596721109 10568746.69532185792923,1933340.811074216617271 10570343.962820325046778,1934268.77034946763888 10571604.493638088926673,1937236.993251980980858 10572444.875350568443537,1946885.053519032197073 10573622.551374269649386,1955110.116735277231783 10574296.681052500382066,1956841.802734055556357 10574296.681052500382066,1956099.524369445396587 10582121.674088453873992,1953966.086328394711018 10604466.274938797578216,1952945.731875782366842 10605565.83468110114336,1951616.131877747364342 10605394.320941545069218,1950224.526923341676593 10604888.623675655573606,1931733.134988179663196 10596027.493760507553816,1929259.170624791178852 10594507.727304391562939,1928331.656627499265596 10593242.979774029925466,1926754.593401432503015 10590121.879476981237531,1926167.271768007427454 10588353.461769381538033,1924621.044040887616575 10585322.51613243855536,1921590.816182003589347 10582375.952863313257694,1917540.011231527896598 10580521.661667441949248,1912870.603870712453499 10579596.976231133565307,1905109.29765311605297 10578164.141894208267331,1898739.151111960411072 10577239.77425417676568,1895152.103160127764568 10577406.345065174624324,1893606.320710972649977 10578164.141894208267331,1892833.095527924364433 10579426.110919514670968,1892926.047302735969424 10580859.208974337205291,1893853.44998053368181 10582204.715226028114557,1896976.852253211895004 10582796.639763792976737,1898677.480114060686901 10582796.639763792976737,1901336.680110130691901 10584142.829410398378968,1902419.150838604895398 10585151.204899104312062,1903191.930743691045791 10586668.89853335916996,1903377.500334843527526 10588607.971748366951942,1903099.42424684157595 10590121.879476981237531,1899481.429476570570841 10593071.77408311329782,1893049.611937515204772 10597714.358345810323954,1891503.495529889361933 10598474.706884033977985,1888874.908393786521628 10597121.144563814625144,1886710.412214803509414 10595012.659284515306354,1885783.009537005797029 10593748.122190026566386,1885009.784353954484686 10592228.860889790579677,1883154.422400903189555 10589617.307557810097933,1882227.019723105477169 10588353.461769381538033,1877805.075590321794152 10582708.741952914744616,1875021.977000998798758 10581617.38746209256351,1854489.653521635569632 10578247.438020259141922,1839801.937267387984321 10577156.793214434757829,1837946.575314336456358 10577323.059153968468308,1836647.588176268851385 10578247.438020259141922,1832565.836407354800031 10598052.753153352066875,1832256.702181420521811 10599652.000942185521126,1832874.970633286517113 10601427.894796719774604,1834699.71972637064755 10603960.646138461306691,1840389.147581324679777 10608777.644288277253509,1841966.322126882849261 10609028.349825128912926,1845307.910601514624432 10606596.223869174718857,1847903.324529360048473 10605816.422754442319274,1849604.063709700014442 10605904.617338586598635,1850686.08916020905599 10606916.50330606661737,1851613.937115971697494 10608267.133938379585743,1852046.635976685211062 10610296.013625679537654,1851490.372481192694977 10611647.310516521334648,1846295.203165360726416 10615368.710535515099764,1845244.235852780984715 10616470.021079137921333,1844470.899350238731131 10617739.062384940683842,1843914.190576783847064 10619091.827985094860196,1843450.544897629180923 10621970.390345484018326,1843326.868943356210366 10625445.781697515398264,1843512.54985 10627307.692041978240013,1844130.818305865861475 10629090.768582826480269,1845645.987895053578541 10632225.092019917443395,1850098.76752678421326 10638927.080673882737756,1851181.238255258183926 10640032.491049649193883,1866951.536557470913976 10648357.373320732265711,1874929.359184660948813 10652439.868297422304749,1888534.716029922710732 10658651.691928224638104,1890297.460166636155918 10658735.972293926402926,1911355.434281524736434 10660522.653709033504128,1921096.112364919390529 10664528.059082863852382,1931238.431171092670411 10661799.884919904172421,1933031.676848282339051 10661205.694428611546755,1934083.200758315157145 10660096.860745389014482,1934887.038801333867013 10658820.253697272390127,1935412.689436858985573 10657459.61898035928607,1935691.32212231727317 10655841.918817646801472,1936773.347572826314718 10653032.992194715887308,1937577.185615845024586 10651757.701557075604796,1939649.063978490186855 10649548.168414195999503,1940948.051116554997861 10648614.427980091422796,1944039.949973338516429 10647082.953163217753172,1946080.770198051352054 10646574.169302294030786,1966737.103590161539614 10643769.041323933750391,1968159.210085046244785 10644277.616799278184772,1967850.075859111966565 10645892.586670201271772,1967077.18463453440927 10647166.785280195996165,1965252.435541450278834 10649464.30713670887053,1963181.002456770045683 10651673.507053013890982,1961634.886049141408876 10652439.868297422304749,1959841.195093989605084 10653117.20341837592423,1957954.886322496924549 10653290.222455380484462,1953100.243329002521932 10652692.176984755322337,1947565.326927271671593 10653117.20341837592423,1945771.635972119867802 10653799.505634197965264,1926012.648995296098292 10667341.400593062862754,1924744.719995157793164 10668278.005914626643062,1918993.175864344928414 10673478.00505006685853,1918715.099776342744008 10675015.397172410041094,1919487.879681428894401 10676553.134761702269316,1940329.337386726867408 10691248.958977736532688,1941751.889159573474899 10691845.764034189283848,1943359.676565102068707 10692104.149350091814995,1945400.496789814671502 10691676.69477734901011,1946946.613197443541139 10690905.927417322993279,1950595.666105646872893 10687829.266172967851162,1956532.668508123839274 10684580.171683851629496,1977899.776848946930841 10675015.397172410041094,1980652.039939319947734 10675699.885837137699127,1980064.273027932969853 10680563.016483040526509,1979786.085620439611375 10682186.571064617484808,1979260.434984914259985 10683552.131124876439571,1977961.447846846655011 10684495.572447882965207,1976075.584353318903595 10684749.065651010721922,1974343.787035046610981 10684749.065651010721922,1971189.549263418652117 10684152.879335140809417,1969427.250404670136049 10684152.879335140809417,1965994.713906060438603 10685176.395236460492015,1962902.481090805726126 10686716.110617579892278,1945060.415745442034677 10696725.320134593173862,1944751.170200016349554 10698267.637454470619559,1947132.182788596022874 10700149.464340411126614,1964417.650679993443191 10711978.224979430437088,1972055.392262810608372 10716702.173935705795884,1973787.078261588932946 10716787.172491924837232,1974343.787035046610981 10715325.344525415450335,1974096.212487523443997 10713439.33742468059063,1974621.974442539969459 10711978.224979430437088,1975673.387033081613481 10710866.07361176982522,1977219.503440710250288 10710093.4495485778898,1982754.419842441333458 10708548.154553912580013,1984640.728613934013993 10708378.36321104504168,1985908.768933560466394 10709151.102243458852172,1986867.118429799331352 10710437.136044023558497,1986867.118429799331352 10712152.738905167207122,1986063.280386780621484 10713439.33742468059063,1972426.531445115571842 10728644.77695638872683,1968777.923814874375239 10728814.76274392940104,1962407.777273718733341 10727699.869279757142067,1956192.587463748408481 10726320.823358952999115,1950162.521966968197376 10724601.971363851800561,1947472.375152459833771 10723312.961251338943839,1945245.985336594516411 10721165.254140168428421,1944287.524520861683413 10719877.201052552089095,1943174.106973949354142 10718848.479187810793519,1941906.511932285036892 10718074.952625546604395,1940422.289161538472399 10718159.659100892022252,1939865.580388081027195 10719617.455045038834214,1939834.63356964266859 10721340.002725888043642,1946730.542065811809152 10747677.845303978770971,1962562.288726941915229 10782093.475326305255294,1963366.126769960392267 10783650.813512980937958,1964634.167089584283531 10784431.800984885543585,1968963.048128062160686 10786080.221294980496168,1972179.402175554772839 10786685.366351060569286,1993051.80669929063879 10790331.423114443197846,2016830.429169172421098 10795887.493127845227718,2019737.203712765593082 10796927.883537355810404,2020696.109806457767263 10798235.554294461384416,2006007.836954756872728 10821648.343919919803739,2003905.457051635719836 10822084.323524612933397,2002575.411775638582185 10823128.402346055954695,2003348.636958686867729 10838407.298337319865823,2004245.538096011150628 10842167.681910343468189,2005575.13809404335916 10845838.79402563162148,2006564.545728214550763 10847150.834736462682486,2007677.629316655918956 10848203.800073623657227,2012223.472042692359537 10849602.964322980493307,2013367.502449574880302 10850651.580359263345599,2018438.661852662917227 10856959.917059557512403,2022922.499622323084623 10871876.016692353412509,2023417.203439410077408 10877585.971582598984241,2023386.256620968924835 10879343.795165061950684,2023077.122395034413785 10886384.698130134493113,2026509.102296190802008 10896071.491107646375895,2032353.598201821325347 10903565.855346573516726,2033683.198199856327847 10904360.700302038341761,2035476.889155008131638 10904360.700302038341761,2036775.431015110807493 10903391.459332110360265,2037857.90174358477816 10902242.590294275432825,2041846.590418198844418 10897480.519550895318389,2043423.764963757013902 10894836.926739117130637,2059101.00017166393809 10867747.497269945219159,2060709.121535666054115 10859767.18059766292572,2063801.465670411707833 10844353.799267657101154,2079386.083061977755278 10832029.963409546762705,2080530.113468860276043 10831329.631439093500376,2081674.143875742796808 10832379.842000115662813,2082199.905830759322271 10834476.345955947414041,2082478.427196726435795 10836396.086340943351388,2082478.427196726435795 10838143.318506632000208,2081952.665241707116365 10839631.681674271821976,2080375.602015640120953 10842254.256838468834758,2079324.078105607070029 10843388.017619784921408,2078551.298200520919636 10844704.625689677894115,2078025.536245504394174 10846189.696867398917675,2078025.536245504394174 10847939.440704131498933,2079014.943879675585777 10849252.200910182669759,2080313.597059266641736 10850040.734814422205091,2089590.518144015455619 10852402.469859475269914,2100536.674993210006505 10850742.991263309493661,2102360.978808329440653 10850127.409771727398038,2103412.391398873645812 10848901.140416037291288,2103309.420869887806475 10847061.9923181142658,2103659.965946396812797 10845487.909242546185851,2109132.877391757443547 10841730.731411337852478,2112256.168344944249839 10839977.544492438435555,2114080.472160063218325 10839367.654442261904478,2115874.163115215022117 10839281.430838337168097,2116709.05929616605863 10840856.284894095733762,2116709.05929616605863 10842691.240888260304928,2111513.889980333857238 10850213.770643319934607,2109442.456895653624088 10852493.904243754222989,2105762.457169009372592 10853893.94933951459825,2096609.545997004723176 10857311.392813665792346,2092898.933410392841324 10857576.115871738642454,2091043.571457341313362 10858274.415647445246577,2087920.280504154507071 10859940.463498679921031,2078891.379244893556461 10864854.820079637691379,2074685.617563232779503 10867747.497269945219159,2072397.668068958912045 10870120.118281064555049,2055081.253359120339155 10890432.900460179895163,2054277.415316101862118 10891753.872811414301395,2054184.463541290024295 10894923.856099270284176,2055204.817993902368471 10909220.103068646043539,2055421.445722984382883 10910893.887952284887433,2056256.230584444012493 10912485.70073302090168,2058884.817720543825999 10914077.885751320049167,2078118.154061842476949 10920974.865910409018397,2097475.388996393885463 10924688.701850512996316,2099052.563541954848915 10923896.25955893099308,2099578.214177479967475 10922389.05760283768177,2105175.135535584297031 10901893.870495822280645,2105175.135535584297031 10896511.939852107316256,2105422.264805145561695 10894836.926739117130637,2105948.026760161854327 10893428.127826618030667,2115595.64174925070256 10875915.604902934283018,2116399.92507023178041 10874597.69964637607336,2117420.390842334832996 10873458.736290952190757,2125768.907373867928982 10864151.108350489288568,2128119.418421965558082 10862045.460770463570952,2131273.322235122788697 10860292.092979207634926,2133097.626050241757184 10859675.648602891713381,2135045.828458613716066 10859328.785060293972492,2141694.162407262716442 10860114.066450837999582,2143487.519403940998018 10860114.066450837999582,2147661.77766970731318 10858977.520862855017185,2151310.830577910877764 10857576.115871738642454,2153908.359576080925763 10855559.242198949679732,2155979.792660761158913 10853282.813212890177965,2156753.129163303878158 10851964.547690620645881,2157526.020387881435454 10848814.481047291308641,2157494.962249949108809 10847064.512654455378652,2155670.658434829674661 10841730.731411337852478,2154650.303982220590115 10840414.697392696514726,2153506.273575334809721 10839454.193827109411359,2150877.686439235229045 10837884.068166168406606,2149393.574987980071455 10837356.159228879958391,2145992.096627299673855 10837096.938811667263508,2138756.441045228391886 10837447.392059769481421,2137272.329593970440328 10836919.202351056039333,2135973.342455905862153 10836132.184352125972509,2134952.876683802343905 10834821.94739892706275,2134117.98050285410136 10833339.349609948694706,2133437.707094617653638 10831506.90795860812068,2133406.760276176501065 10829670.244920225813985,2134179.985459224786609 10828447.648527158424258,2136127.853909126017243 10828102.684099484235048,2149764.714170285034925 10819900.62481896020472,2153351.650802623480558 10819206.243394799530506,2164112.349380156956613 10821298.701505795121193,2165349.331561850849539 10829411.316469773650169,2165627.852927815169096 10848290.45168038085103,2165132.703832768835127 10851526.968899289146066,2161546.212478389497846 10860027.264422060921788,2155609.098756421357393 10867221.69443142414093,2154310.111618353519589 10868186.118653045967221,2148558.678807029034942 10870207.048950435593724,2146703.31685397727415 10870819.388390323147178,2144786.061264046467841 10871171.579620629549026,2143147.327040077187121 10870911.070171810686588,2138725.494226787704974 10869328.942109471186996,2133994.415868072304875 10868364.672185681760311,2132046.102140209171921 10868625.08430852368474,2128923.256464987061918 10870293.664611183106899,2115379.45929813105613 10892547.340367514640093,2114853.80866260593757 10894042.875216022133827,2114575.175977150443941 10895630.753548514097929,2114606.234115079976618 10897480.519550895318389,2115441.018976539373398 10908686.320905772969127,2115719.651661994867027 10910631.854948265478015,2125212.643878372386098 10918764.028296191245317,2133777.899458481464535 10922389.05760283768177,2135416.967640919145197 10922656.640434231609106,2137024.755046447273344 10921859.338329188525677,2139096.633409092668444 10919468.628963915631175,2141446.58785973675549 10915490.645327925682068,2142498.000450281426311 10914340.051411706954241,2144136.734674248378724 10914606.999877879396081,2144167.79281217744574 10916374.405480718240142,2140302.557452854234725 10928409.347522938624024,2138849.058861566707492 10929027.261494578793645,2137210.324637599755079 10928764.529607187956572,2124872.56283 10925398.696334950625896,2122212.917559967376292 10923803.861758761107922,2121037.940334643702954 10922743.92568051815033,2119337.201154303736985 10919648.531919147819281,2118316.735382203012705 10918322.1379,2116678.001158233731985 10918055.043756553903222,2115100.937932166736573 10918851.582025365903974,2114049.85930009605363 10920090.508392235264182,2110122.730303890537471 10926726.151282640174031,2109071.317713348660618 10931421.330971328541636,2108823.743165822699666 10934877.904725268483162,2108329.039348738733679 10941796.004158031195402,2108854.689984263852239 10943926.459176467731595,2110246.294938672333956 10947564.919267233461142,2114513.616298741661012 10955560.830265253782272,2127129.565509832464159 10975689.745346078649163,2134860.258867464028299 10986397.164531614631414,2142529.058588210958987 10994890.904685137793422,2145373.828175433445722 10996143.75893889926374,2193766.971171557437629 11007867.892218882218003,2197415.467482307460159 11007779.185118397697806,2199549.350801323074847 11007242.773761289194226,2200878.950799358543009 11006165.240662848576903,2201930.3633898999542 11005003.72169123776257,2201991.923068311531097 11003567.414611360058188,2201095.578528443351388 10997662.240604858845472,2193828.530849966220558 10973015.603247916325927,2190582.009220471139997 10964994.351622873917222,2190396.439629318658262 10963483.14731509424746,2190365.492810880299658 10961610.553162144497037,2191416.905401421710849 10960456.940623920410872,2194848.885302578099072 10958853.869008727371693,2195622.221805118024349 10957519.812127336859703,2195869.351074678823352 10955829.720666920766234,2195807.791396270506084 10952274.503972692415118,2195158.464806474745274 10944726.350791711360216,2194570.809214576147497 10940821.418761750683188,2193272.15603498229757 10936825.832321180030704,2192560.935808304231614 10935053.109211690723896,2184923.194225487299263 10911335.296444188803434,2173976.480778839439154 10875828.601378532126546,2174224.055326362606138 10874158.349099790677428,2175677.219959179405123 10874684.687455393373966,2190674.62703681178391 10885504.820860369130969,2191540.470036201179028 10887085.956458466127515,2194508.804258205462247 10899069.199618520215154,2194787.325624169781804 10901011.987627370283008,2195096.459850101266056 10909748.839815141633153,2194601.756033017300069 10915490.645327925682068,2207248.76338204042986 10976400.26622718013823,2219679.476960452273488 10999721.991986548528075,2223359.142728625796735 10999004.197311744093895,2231522.534946968313307 11003837.887851767241955,2235078.636080359574407 11017733.861207557842135,2243304.033255072776228 11046957.965609163045883,2243922.301706939004362 11048398.934204442426562,2257775.678377691656351 11060218.559538301080465,2259228.843010505661368 11059588.604564536362886,2260249.308782609179616 11058413.36496639251709,2261826.4833281673491 11055617.138746121898293,2269494.726451460737735 11040203.993857122957706,2272525.510907800868154 11032913.109606588259339,2273514.918541969265789 11029855.840037984773517,2273700.488133121747524 11026350.979545978829265,2273112.832541225943714 11024199.393568944185972,2269958.928728068713099 11012082.652507646009326,2265536.98459528805688 10988811.836021441966295,2263650.787143286317587 10977027.371410915628076,2263341.652917354833335 10975062.763503301888704,2261702.473415423184633 10963390.210396073758602,2259074.331557285506278 10931684.165437407791615,2257930.301150402985513 10902155.567470358684659,2257620.721646506339312 10900217.215888440608978,2256476.691239623818547 10896071.491107646375895,2255023.526606809813529 10892373.226261407136917,2247601.967475112527609 10876886.006774829700589,2245530.53439042950049 10874337.059187199920416,2237459.64866893645376 10866869.707267288118601,2232759.517128662206233 10862748.955114128068089,2227440.783178051467985 10859675.648602891713381,2226265.805952727794647 10858712.427793920040131,2225245.340180627070367 10857398.160263855010271,2224379.497181234881282 10855819.165513943880796,2217391.52746617840603 10837447.392059769481421,2217081.947962281759828 10835522.638103749603033,2217051.335102314129472 10833689.609807586297393,2217298.464371875394136 10832116.095377339050174,2218566.504691502079368 10831070.639984954148531,2220483.315003470517695 10830806.943985264748335,2229017.957723609637469 10846540.617769872769713,2230904.266495102085173 10849429.943996015936136,2246241.754617107100785 10866257.722599636763334,2248467.810474501457065 10868538.173816528171301,2249797.855750498827547 10869328.942109471186996,2260527.496190099511296 10881368.037857849150896,2262413.693642101250589 10887438.989549720659852,2266031.799731863196939 10898802.859562173485756,2277936.862674749922007 10930268.041457494720817,2278678.695761397946626 10932132.02812871709466,2280317.875263329595327 10932394.890042437240481,2281616.417123432271183 10931333.615416945889592,2283688.295486077200621 10928939.576788121834397,2285203.465075261890888 10926196.094406522810459,2288264.751072078477591 10922656.640434231609106,2294448.882744116708636 10917258.280368147417903,2303261.712871748488396 10911602.445166278630495,2304838.887417306657881 10910719.304162228479981,2320176.37553931446746 10903478.497950464487076,2321351.35276463534683 10904452.834614269435406,2321413.357721008826047 10906217.606135940179229,2320671.079356398899108 10907629.053443055599928,2318104.497176669538021 10909661.403063980862498,2301128.274830694776028 10924956.056430887430906,2283224.538487431593239 10945169.958869164809585,2281183.718262718524784 10947564.919267233461142,2280410.381760179065168 10948897.025268193334341,2279915.677943092305213 10950409.790231099352241,2279977.682899462524801 10952186.519199121743441,2289377.723341028671712 10991492.199363304302096,2295438.735656252596527 10993456.732847154140472,2305395.596190764103085 10997932.478943295776844,2312198.441592633258551 11001777.211214371025562,2314826.583450771402568 11003749.233339166268706,2315877.996041312813759 11005092.392570197582245,2316403.757996329572052 11006076.555784722790122,2316898.461813416332006 11007779.185118397697806,2318321.013586263172328 11013604.700089298188686,2318352.071724192705005 11015398.022430939599872,2318166.502133040223271 11017014.48457457870245,2317671.798315955791622 11018542.483657671138644,2315383.292224228847772 11022669.798540225252509,2314888.588407142087817 11024199.393568944185972,2314424.942727987188846 11025724.158318750560284,2314486.502406398765743 11027520.682997832074761,2315537.914996940176934 11028868.550161022692919,2326793.651350028347224 11037593.445695549249649,2344326.582469460554421 11051197.058171024546027,2345841.752058648038656 11051736.9519351311028,2347697.114011699799448 11050924.69270221889019,2347913.185143328271806 11049305.009343648329377,2346985.782465530559421 11047680.845204068347812,2344851.899146514944732 11045067.421789953485131,2343646.309061221312732 11044077.594034891575575,2340894.157290342263877 11042543.840621599927545,2338451.139745391905308 11040475.929653765633702,2337369.114294880069792 11039121.220455469563603,2335389.853748575784266 11036243.846217356622219,2326082.43112335074693 11021412.044696668162942,2325865.803394268732518 11019888.570492358878255,2331617.236205593217164 11007956.60047734156251,2336688.840886643156409 11000080.5955,2337709.306658743880689 10998827.015498414635658,2339842.744699797593057 10998197.896303731948137,2342718.461105461232364 10999451.360316202044487,2343460.739470071624964 11001329.572903431952,2352953.843005940318108 11026173.083226725459099,2363034.15685574291274 11059950.707761954516172,2364642.278219741769135 11066183.274365888908505,2365260.65799109917134 11068258.705872064456344,2366837.721217166166753 11071333.319956647232175,2371908.880620254203677 11075135.136351034045219,2373269.538756221532822 11075950.623727599158883,2376361.771571476012468 11076855.496080089360476,2379732.303113715257496 11077307.814560456201434,2383845.00170107325539 11076313.600881669670343,2386998.905514227226377 11074409.653243301436305,2399491.178771047852933 11063289.533109297975898,2404717.406224811915308 11053629.678668305277824,2404933.5886759320274 11052009.349989620968699,2404562.783452100586146 11050023.270137306302786,2403913.12290383130312 11047859.305781176313758,2402367.006496202666312 11044166.452099723741412,2402831.097453319467604 11042632.678619433194399,2407191.036629729438573 11037865.276981063187122,2413375.6135797300376 11032286.006307287141681,2414952.342847325839102 11031387.054194569587708,2416931.603393630124629 11031026.470899851992726,2420580.211023871321231 11030848.452094215899706,2423981.689384551718831 11029140.032482942566276,2426022.509609264321625 11026622.361268861219287,2436907.106780047528446 11012979.053685963153839,2439844.939461573027074 11007508.554974326863885,2441019.916686896700412 11004556.193237397819757,2445070.610317881219089 10994350.680533040314913,2446554.83308863081038 10985685.919785656034946,2447018.478767782449722 10984076.890603398904204,2452893.921491851098835 10982291.81213984452188,2456666.093756874091923 10981845.455073738470674,2459418.245527755934745 10983360.745935896411538,2460346.093483516015112 10984881.19685204513371,2460438.711299856659025 10986667.27696761675179,2460253.14170870417729 10988365.050701366737485,2450729.091354394331574 11017551.667915841564536,2438422.27636923501268 11049305.009343648329377,2426455.653747939970344 11079660.487168192863464,2426980.970424994360656 11081381.668554494157434,2428063.441153468564153 11082650.581691399216652,2429300.42333516292274 11083646.050495684146881,2432237.699419234879315 11084915.387186497449875,2436845.213143168482929 11086274.698688257485628,2446987.977227306459099 11086727.6455,2450079.764764598570764 11087633.956178830936551,2451471.369719004258513 11088361.180997546762228,2452553.840447478462011 11089631.400169784203172,2459356.685849347617477 11100430.518481185659766,2460129.577073925174773 11104428.30567810125649,2459789.384710058104247 11105701.537182664498687,2458397.891075144056231 11105611.542526669800282,2455367.5518967686221 11101882.559455102309585,2454409.09108103858307 11100974.343366708606482,2447513.182584866415709 11096798.833872025832534,2444730.529273508582264 11095347.880565289407969,2421229.537613669876009 11087001.777827156707644,2419528.79843332991004 11086817.389971479773521,2417395.360392276197672 11087454.773163268342614,2391297.173692737706006 11099886.737191302701831,2390245.761102196294814 11101159.116404896602035,2389503.482737585902214 11102521.359707480296493,2389039.725738940294832 11104063.821311183273792,2385947.492923685815185 11114980.993274517357349,2374351.898165204562247 11120808.75487713329494,2372187.068027747329324 11121444.420176323503256,2370610.338760151527822 11122355.381926,2368507.513579068239778 11124818.57659668289125,2360467.574676013551652 11134851.218007907271385,2360977.195304863154888 11136596.98440008983016,2361426.480769705493003 11137409.37431213632226,2362694.075811369810253 11138508.277542013674974,2365006.62691311025992 11139978.692741697654128,2371105.042577235493809 11149566.408153776079416,2395193.355870502069592 11168349.271118042990565,2402738.145678507629782 11168439.772280419245362,2402645.527862166985869 11166605.543193183839321,2403047.279904439114034 11163124.713821977376938,2403542.428999488241971 11161654.547851493582129,2406015.948084914591163 11155700.915841195732355,2407036.413857018109411 11154418.260231705382466,2408366.013855053111911 11153321.717922914773226,2418972.534937834367156 11146456.131011806428432,2427506.732380011118948 11145998.847999421879649,2427321.05146936699748 11147646.725979257375002,2427506.732380011118948 11151396.029794635251164,2428155.947650318033993 11153502.979582592844963,2429114.853744010441005 11155152.353890301659703,2431310.296741434372962 11157713.239319959655404,2446462.215272289700806 11172755.504663920029998,2447853.374948733486235 11173491.918552033603191,2449430.549494291655719 11173950.730337522923946,2466159.642570705153048 11161473.397959884256124,2474384.705786947160959 11162938.574162218719721,2478095.207054067868739 11162757.389936938881874,2482270.021917290519923 11161745.289599666371942,2483568.563777393195778 11160647.561010390520096,2484310.842142003122717 11159182.880099181085825,2484186.832229259423912 11157351.155056118965149,2480043.520781931001693 11128009.230228086933494,2487341.181320378556848 11115891.087069125846028,2508306.0923409643583 11107974.052547382190824,2510285.464206759817898 11107519.357618857175112,2511120.249068219214678 11108703.461286161094904,2510656.158111099619418 11110247.329608488827944,2509635.6923389993608 11111521.654080778360367,2506791.034071268048137 11113615.917732389643788,2504688.542848655488342 11114675.908142536878586,2503358.497572658117861 11115345.737122235819697,2492195.712994381785393 11120263.337266068905592,2488361.647092479281127 11120718.559520553797483,2486506.285139427520335 11121534.625188875943422,2485485.819367324002087 11122811.072741845622659,2485578.437183665111661 11124633.485986739397049,2491002.479372566565871 11150365.530344313010573,2491855.631950005888939 11151672.459594612941146,2493432.806495566852391 11152130.125613067299128,2495288.057129127439111 11152039.512536257505417,2504688.542848655488342 11151215.153942765668035,2506853.039027641061693 11150481.157228203490376,2514305.21101930597797 11146551.607960447669029,2515603.752879408653826 11145360.876168923452497,2515634.699697849806398 11143989.999538987874985,2523334.557556529063731 11141519.501252338290215,2543310.060942946467549 11137499.79199886508286,2545288.876211288385093 11137133.525622420012951,2552679.488524544518441 11136677.1999,2554843.984703527763486 11135949.706568630412221,2556390.101111156400293 11135036.916467651724815,2557410.566883257124573 11133758.165221184492111,2557843.265743970870972 11132204.006984539330006,2557441.513701698277146 11130198.913574326783419,2555802.445519257802516 11126461.313085665926337,2548133.645798511337489 11114340.690789131447673,2541701.939578947145492 11106066.109569296240807,2540465.291355723515153 11105062.437369156628847,2537651.134628471452743 11103609.715589042752981,2529271.559959006030113 11100884.411408087238669,2512387.844109881203622 11096345.214223841205239,2508986.477068691980094 11095981.163910726085305,2507007.550480861216784 11096434.759215496480465,2503327.99603217933327 11096614.506379479542375,2501627.256851838901639 11096434.759215496480465,2498534.91271709324792 11095527.272168025374413,2495751.814127770252526 11094076.590768840163946,2485609.384002106264234 11086274.698688257485628,2483104.806778747588396 11084188.531570460647345,2481991.389231832232326 11082924.549365637823939,2481063.986554034519941 11081381.668554494157434,2482053.394188205711544 11080112.992654198780656,2483754.133368545677513 11080297.198413677513599,2485145.738322951365262 11081018.746293164789677,2488887.297728004399687 11084099.148060357198119,2491670.062358853407204 11085552.591725025326014,2498967.611577806994319 11088630.156421260908246,2503606.072120181284845 11089995.109898827970028,2504688.542848655488342 11090099.916769778355956,2512047.763065508101135 11090807.160596154630184,2515294.618653477169573 11091444.918727369979024,2521479.195603477302939 11093259.248831629753113,2539599.448356334585696 11099432.584061488509178,2545505.503940370399505 11101792.615454526618123,2546928.055713217239827 11102521.359707480296493,2559420.440289531834424 11097527.041808499023318,2565419.447648379486054 11076129.50322019867599,2578901.239858862012625 11054982.738298190757632,2595073.624161818064749 11049483.188057506456971,2596341.219203482381999 11050473.804159216582775,2612080.904645725153387 11062838.147839616984129,2613193.876914675347507 11064103.598415225744247,2620089.340132882352918 11074230.493334628641605,2619656.64127216860652 11075766.535912223160267,2618110.52486454276368 11076765.883244577795267,2616131.598276709672064 11077128.904007134959102,2612328.033915285952389 11077760.489100936800241,2608648.368147112429142 11078033.933491619303823,2603731.831516738981009 11077307.814560456201434,2601907.527701616752893 11077397.434552414342761,2599928.267155312467366 11077850.115071170032024,2598072.905202260706574 11078665.602824464440346,2596526.788794634863734 11079660.487168192863464,2589322.191350493580103 11084825.667851123958826,2588023.204212425742298 11085911.188333751633763,2586044.277624594978988 11088450.94709544070065,2579890.647493033204228 11097706.491047212854028,2580601.979039201978594 11099158.275913804769516,2590620.733210596255958 11103884.203814083710313,2598605.01236825203523 11106095.891482822597027,2600175.841702838428319 11116526.291515087708831,2596403.224159853067249 11131021.048398088663816,2597207.062202871777117 11140605.960852146148682,2602463.791197112295777 11140791.817035222426057,2616255.162911491468549 11145270.682726513594389,2618172.52982091344893 11146732.359384633600712,2619440.013543086592108 11147737.280338987708092,2618172.52982091344893 11148928.100417142733932,2612049.846507792826742 11150481.157228203490376,2610039.973101520910859 11150848.14564797654748,2608339.23392118094489 11150757.549711233004928,2606916.682148334104568 11150023.931957669556141,2605896.21637623058632 11158448.019864525645971,2612111.40618620114401 11170829.242106752470136,2625531.638718275353312 11194733.943593081086874,2632241.977623295038939 11202753.057331642135978,2632953.309169463813305 11204967.036581248044968,2633819.152168853208423 11206811.686743088066578,2650362.230376151856035 11227604.545933019369841,2651537.207601472735405 11228896.142025206238031,2655433.389779237098992 11231861.480906708166003,2659886.280730458907783 11233713.476851314306259,2669286.766449989750981 11236584.171909537166357,2673027.880577077623457 11236309.258297558873892,2675038.199261314235628 11235845.86731063015759,2699744.781006444245577 11227142.0838468875736,2702868.071959633845836 11225103.695769682526588,2705434.654139363206923 11222791.556534377858043,2706856.871953736059368 11219926.705475483089685,2707846.279587907250971 11218631.828600317239761,2709701.530221467837691 11217707.828679889440536,2711278.704767026007175 11218078.478242272511125,2711742.461765671614558 11220109.425858629867435,2711309.76290495833382 11221684.220723293721676,2700765.246778547763824 11236401.006137320771813,2699744.781006444245577 11237790.721011405810714,2697178.19882671488449 11240107.992091519758105,2695013.813967223279178 11240851.769723454490304,2688953.135610472876579 11256171.80159817636013,2704599.423999941442162 11289805.041028372943401,2708124.800953871570528 11293639.000848211348057,2712082.542810044251382 11296627.822355512529612,2724667.990480661857873 11292981.913329374045134,2727543.706886322703212 11290836.477892687544227,2728966.258659172337502 11287845.172994593158364,2741087.504053178709 11273947.733280839398503,2743654.086232908070087 11271618.84106707945466,2747395.645637961104512 11270498.454417018219829,2749003.767001960426569 11270871.672449627891183,2750456.931634777225554 11271618.84106707945466,2751786.531632809434086 11272642.475379282608628,2752837.944223351310939 11274224.181063793599606,2753425.711134741082788 11275903.575834164395928,2753920.414951825048774 11279350.57767672277987,2753796.850317046046257 11281123.603057811036706,2752992.566996065434068 11284296.396909140050411,2751600.962041656952351 11287286.131422678008676,2749498.470819044392556 11291672.975434610620141,2734254.045791342388839 11313573.068845316767693,2732676.871245781425387 11314608.140113942325115,2730635.939701579976827 11315076.961116617545485,2725101.134619337506592 11315262.270829161629081,2716968.577899944968522 11317137.256410067901015,2715236.891901163384318 11317699.1107038538903,2702002.228960242122412 11322487.234886536374688,2700425.054414683952928 11323611.204659102484584,2699404.699962071608752 11324926.34477218426764,2699002.502641837112606 11326525.746031370013952,2700177.479867160785943 11344860.190653402358294,2701229.003777193371207 11346463.981091493740678,2702558.492455734405667 11347499.018080536276102,2714494.613536553457379 11356551.158979911357164,2716411.869126487057656 11356458.105103727430105,2717123.200672656297684 11354944.97098178230226,2717555.899533369578421 11353344.256821678951383,2717679.4641681490466 11351552.518259746953845,2717493.894576996099204 11349667.955444918945432,2723678.47153 11339968.101434862241149,2724977.124706593342125 11338743.176956156268716,2737531.402919786982238 11328496.867206677794456,2740438.177463380154222 11326241.740983868017793,2742324.486234873067588 11326056.129851542413235,2743221.276052703149617 11328027.113969728350639,2743561.468416567426175 11331784.701465621590614,2743344.952006973791867 11335265.751394903287292,2742912.141826771665365 11336862.185175387188792,2739356.152012871112674 11353344.256821678951383,2735645.094148294534534 11379984.128752863034606,2736789.56983313895762 11388226.202389946207404,2737562.461057716514915 11389647.502708125859499,2745107.584824196062982 11392871.705255836248398,2746869.883682944346219 11393064.625936694443226,2750425.984816336072981 11393252.088661547750235,2758929.56939854240045 11390788.17199083045125,2766660.374075662810355 11379885.298602107912302,2767371.59430234041065 11378372.014888688921928,2767773.346344613004476 11376765.736178187653422,2767309.5893459697254 11374682.061328584328294,2766258.176755425520241 11373169.943771651014686,2769567.037299764808267 11370708.242527645081282,2779740.4142438727431 11371564.90256080776453,2781348.090329910162836 11371944.0867691449821,2781873.852284926455468 11383109.953007258474827,2781904.799103364814073 11384623.958677431568503,2781781.234468585811555 11386331.032371025532484,2781100.961060346104205 11387846.102219168096781,2780080.495288245845586 11389173.816421872004867,2779678.409287499729544 11390783.051859414204955,2780173.113104586489499 11392861.461834093555808,2781657.224555841647089 11393538.926956763491035,2782987.26983183901757 11392934.531916089355946,2785151.766010825056583 11391543.263240097090602,2786450.307870927732438 11390407.927469186484814,2790037.355822760146111 11386617.576577857136726,2800921.952993543352932 11373554.665711333975196,2807106.084665581583977 11362025.934871699661016,2807786.4693933124654 11360511.552408145740628,2809301.527663008775562 11355794.878675879910588,2810786.195711717475206 11351081.158569501712918,2811187.836434498429298 11349382.975528407841921,2812084.737571820151061 11344389.636903120204806,2812177.244068669620901 11342698.219502737745643,2812084.737571820151061 11339027.369450757279992,2811899.167980670463294 11337146.298524109646678,2813909.041386941913515 11335167.573724145069718,2821454.165153418667614 11339027.369450757279992,2826525.324556506238878 11358437.984103439375758,2826896.575058302842081 11362212.537368981167674,2826710.894147658720613 11365708.973892914131284,2825133.830921592190862 11372230.020727587863803,2823031.339698979631066 11376672.403208939358592,2822041.486786843277514 11378091.271802108734846,2821237.648743825033307 11381310.296752056106925,2820742.944926740601659 11384722.858254479244351,2820650.327110399957746 11386424.840146599337459,2820835.451423590071499 11388319.695300094783306,2821639.734744571149349 11390595.316391026601195,2822845.770107823889703 11391830.028892794623971,2824639.127104504965246 11391923.571753988042474,2826803.51196 11391168.437943287193775,2828411.63333 11390121.563560530543327,2832276.868687322363257 11386424.840146599337459,2834565.263459558133036 11383869.6413190420717,2839821.992453798651695 11377244.002741387113929,2841800.919041632208973 11374593.524505376815796,2842481.192449868656695 11373081.767230469733477,2843254.08367444621399 11369768.321937691420317,2853984.058072520885617 11365423.656107123941183,2878226.994138495996594 11366082.72783231921494,2879711.550867716316134 11365989.202384736388922,2883051.024272022768855 11365044.838017228990793,2884040.431906193960458 11363628.709130275994539,2885864.735721313394606 11357302.76887284591794,2886235.874903618358076 11355608.113917475566268,2885741.171086534392089 11353623.972503358498216,2884658.700358060188591 11352023.571472112089396,2878969.272503105923533 11344766.958739280700684,2877763.23713985318318 11343447.949849320575595,2869136.087922864593565 11334888.621510250493884,2859488.472933775745332 11325395.882409919053316,2855870.366844010539353 11312260.136813962832093,2855932.37180038401857 11310484.32220746576786,2855159.146617332939059 11308328.265969626605511,2854231.632620044052601 11306455.38590663485229,2853149.273211061023176 11304861.065432766452432,2841677.354406850412488 11291021.124055407941341,2822660.200516671407968 11268917.619944896548986,2807322.712394666392356 11252083.467177074402571,2805993.112396631389856 11251154.887969613075256,2794181.00122855650261 11238442.46714736148715,2792975.0771847916767 11237144.042662113904953,2791954.611412691418082 11235565.979849522933364,2791181.274910151492804 11233438.679852548986673,2792449.315229778178036 11232232.906506415456533,2794026.044497371185571 11232604.352495785802603,2799994.105037780944258 11235102.973330944776535,2803952.292171918787062 11237979.263746529817581,2811837.163024296984076 11229638.68811666034162,2812888.575614838395268 11203117.909001825377345,2813568.849023078102618 11201734.962893633171916,2813383.279431925620884 11199800.441031845286489,2812610.388207348063588 11197679.374860476702452,2811558.975616803392768 11196115.460281698033214,2810105.810983989387751 11195467.44543918967247,2808405.183123140595853 11196115.460281698033214,2805281.78085046261549 11197496.927188316360116,2803859.229077615775168 11198236.036504343152046,2798757.456814560573548 11193995.216442020609975,2793005.578725270926952 11187462.250084178522229,2792263.745638625696301 11185344.713469365611672,2794490.246773979160935 11173491.918552033603191,2795170.520182218868285 11172019.170824883505702,2796901.760903035290539 11172115.008669793605804,2798200.748041102662683 11173123.701600685715675,2797891.613815168384463 11160280.04149467125535,2785151.766010825056583 11147370.46033662930131,2781657.224555841647089 11143623.382292756810784,2780760.88001597346738 11141795.857499103993177,2778998.135879262816161 11132113.659906422719359,2777019.209291429258883 11118531.935261223465204,2776679.128247056622058 11114890.875400096178055,2776369.548743159975857 11100704.878082199022174,2776586.065152753610164 11097342.694528305903077,2777266.338560993317515 11095891.298123640939593,2781131.573920316528529 11090717.689852258190513,2782987.26983183901757 11088595.228184927254915,2783327.016917740926147 11088271.742502968758345,2785306.277464045211673 11087818.366226943209767,2786852.39387167384848 11088177.082606829702854,2788027.482416485901922 11089447.26731027290225,2789356.971095032524318 11096108.285184379667044,2789227.061249275691807 11098123.263058485463262,2788002.546850548591465 11100684.930228188633919,2786852.39387167384848 11102266.879074603319168,2786388.525553536601365 11104118.787178806960583,2786332.86580814095214 11105157.333176041021943,2786425.706263461150229 11106245.784857166931033,2786703.782351463567466 11107444.396443199366331,2787761.651472471188754 11109192.94246101565659,2790249.864730683621019 11114938.391948267817497,2793284.211410726420581 11116801.303021062165499,2792541.933046116027981 11114705.727888571098447,2792585.236328036058694 11109410.355463396757841,2792306.826281560119241 11108211.396422035992146,2792195.618110259994864 11107117.392096458002925,2793550.042354740668088 11099375.367501314729452,2793772.792655818164349 11098397.529355183243752,2795448.596270220819861 11093712.662173403427005,2798973.639265680219978 11093622.826431185007095,2800550.813811238389462 11093986.75020738504827,2809116.403349818196148 11097981.067376861348748,2811435.41098202439025 11100520.117416713386774,2812486.823572566267103 11102067.357235105708241,2827051.086511522997171 11133667.797427954152226,2840162.184817662462592 11155243.008601555600762,2841429.779859327245504 11159363.968761067837477,2841924.483676411211491 11161286.973711274564266,2842728.321719429921359 11164862.594091029837728,2842543.197406242135912 11168258.440875070169568,2841027.582539089489728 11169357.403435295447707,2837440.979865221772343 11169452.873282125219703,2833513.850869016721845 11171101.509492181241512,2831132.838280439842492 11173214.597102353349328,2830173.93218674743548 11174500.816554317250848,2830978.21550772851333 11178083.089347319677472,2833111.653548781760037 11183228.16976935043931,2834255.683955661486834 11185066.906296962872148,2835554.671093729324639 11185986.46180428750813,2840007.11676698923111 11191602.863958181813359,2847799.926400479860604 11202935.314716352149844,2871826.234737375751138 11239181.055167987942696,2888462.264719483442605 11261003.583382608368993,2889668.300082739442587 11262214.496477067470551,2890874.335445992648602 11263517.742816232144833,2894213.808850302360952 11267889.521518841385841,2895172.15834654122591 11269751.409587219357491,2895666.862163625191897 11271711.069130036979914,2897027.520299592521042 11281220.662757294252515,2897244.036709183361381 11283086.562111204490066,2921301.29186451761052 11330659.370922176167369,2933422.982536489143968 11351459.193894186988473,2935463.802761201746762 11354944.97098178230226,2952563.701061446685344 11376958.196923479437828,2955037.665424838196486 11379417.067836878821254,2957789.371917754877359 11381409.14777478761971,2969942.009408167563379 11386424.840146599337459,2971549.796813696157187 11386049.957971643656492,2974796.652401661965996 11377051.874493379145861,2975167.791583966929466 11375445.909926844760776,2976064.692721288651228 11366840.501787208020687,2971148.044771420769393 11312543.554672207683325,2970591.335997966118157 11310484.32220746576786,2968674.080408032052219 11306830.931765075773001,2966633.148863828275353 11303364.836189908906817,2964190.576596843078732 11300933.15952967479825,2961469.482963890768588 11298965.011413224041462,2957294.668100670911372 11296442.686352498829365,2954326.333878668956459 11295133.078114422038198,2947987.245475445874035 11293356.71118395216763,2945142.475888223387301 11291672.975434610620141,2935587.478715472389013 11285326.993485355749726,2933299.417901707347482 11282522.539302673190832,2932464.521720759104937 11280380.420473234727979,2933422.982536489143968 11278981.591648327186704,2935309.291307981591672 11278792.238120913505554,2939731.124121271539479 11280754.520247295498848,2943905.493706529028714 11283363.383849881589413,2949842.496109005995095 11285978.295948298648,2951450.617473005317152 11286352.705645482987165,2954944.713650026358664 11286537.229363702237606,2966045.938549894373864 11281497.408098274841905,2967004.288046133238822 11280098.683950487524271,2967066.293002503924072 11278418.246913213282824,2966818.718454980757087 11276553.971016556024551,2961809.564008263405412 11246325.122346175834537,2960850.769234062638134 11244561.195884929969907,2956150.637693788390607 11232879.11561162956059,2951543.235289346426725 11210776.695334559306502,2951326.607560261618346 11208930.632275361567736,2950461.209838834125549 11189671.234330033883452,2950522.769517245702446 11187922.009259505197406,2951821.756655310280621 11184975.851598598062992,2953058.40487853391096 11183783.644670778885484,2955161.230059617199004 11182955.414505604654551,2956769.017465145792812 11183319.200973313301802,2957974.941508907359093 11184516.292385049164295,2964128.571640469599515 11191142.523410405963659,2978692.834579426329583 11207364.116774080321193,2982743.52821041084826 11214104.203428687527776,2983578.424391361884773 11216225.433375388383865,2983794.94080095551908 11218078.478242272511125,2983763.993982514366508 11222974.354282230138779,2983176.672349089290947 11225845.825808,2988000.257204651366919 11226953.842840846627951,2997431.801062111742795 11225474.750615622848272,3002719.476874792948365 11219002.528769386932254,3008903.719866322353482 11224824.252274442464113,3004574.838827844709158 11240016.193968443199992,3002874.099647504743189 11254405.640336338430643,3002812.094691134057939 11256074.766180230304599,3006955.85141642158851 11262863.576212793588638,3012119.628635850269347 11270406.242892630398273,3013573.127227135002613 11270314.032625757157803,3015459.435998627915978 11267613.332602897658944,3016696.084221851080656 11266401.117347702383995,3031755.384936365764588 11260911.501241317018867,3035434.939385045319796 11259700.82141119427979,3035527.557201385963708 11261192.774261737242341,3034569.096385655924678 11262490.464974638074636,3031476.863570401445031 11266493.274270087480545,3029003.233165483921766 11268917.619944896548986,3021921.755078159272671 11274690.209042882546782,3015026.291859952267259 11300367.982360478490591,3015583.000633409712464 11302336.53917520865798,3017252.79299530852586 11306640.796423871070147,3020376.083948495797813 11313295.006945511326194,3021179.92199151404202 11314700.956664133816957,3022695.091580701526254 11315355.096366358920932,3034012.387612198479474 11317044.744017586112022,3036857.157199420966208 11323611.204659102484584,3037135.678565385285765 11325488.847295980900526,3039485.744335523806512 11338934.556760780513287,3040042.453108978457749 11341002.143148047849536,3041155.425377931445837 11342506.733008176088333,3042918.169514642097056 11342599.933721076697111,3044804.478286135010421 11342320.674341283738613,3052843.971911224536598 11339404.730530777946115,3062924.731038991827518 11336578.083778562024236,3068583.212075504940003 11335828.777115242555737,3062430.027221905067563 11355229.846218233928084,3056833.105863800738007 11359946.464844956994057,3048236.458187291398644 11360890.116175724193454,3040042.453108978457749 11361647.307404974475503,3036393.400200775358826 11361833.899436039850116,3034383.526794503442943 11362399.145024675875902,3028477.471210467629135 11364479.370853193104267,3025045.046031346078962 11366653.771311722695827,3023808.063849651720375 11367878.667767392471433,3020623.213218056596816 11371850.820455154404044,3019324.67135795392096 11374874.122122252359986,3019262.666401580441743 11376672.403208939358592,3020777.724671276751906 11388038.538049617782235,3030487.344616739079356 11408729.059844404459,3031600.428205180447549 11410348.102480359375477,3034383.526794503442943 11412250.032646058127284,3036022.261018470395356 11412631.167946627363563,3056709.095951059367508 11404547.361796785145998,3058564.791862581856549 11403597.586036579683423,3063481.439812449738383 11426534.548593571409583,3063759.627219940070063 11428440.706759754568338,3064749.034854111261666 11430347.747309688478708,3068552.599215534515679 11434068.286214150488377,3078169.267386185470968 11441038.530036589130759,3086981.986194326076657 11432160.536610379815102,3091063.737963242921978 11419961.167740138247609,3102474.097089045681059 11413294.86734382994473,3104267.342766232322901 11413294.86734382994473,3113142.177850235253572 11417769.864627946168184,3114533.782804640941322 11418721.638370828703046,3117842.198071017861366 11423671.176169142127037,3120377.722112817689776 11426152.283578742295504,3140075.149411233142018 11429677.217743838205934,3141930.51136428443715 11428629.498599080368876,3143167.493545978795737 11427388.031728429719806,3144095.341501741670072 11425958.757310073822737,3145362.936543403193355 11422912.136940557509661,3146012.151813710108399 11419579.275171672925353,3146043.209951642435044 11417769.864627946168184,3155196.12112364731729 11403409.493630580604076,3158999.685485071036965 11402840.802493961527944,3169018.439656464848667 11400180.252140397205949,3171151.877697518561035 11399231.091015277430415,3174553.356058198958635 11397046.511311715468764,3176996.373603146057576 11394487.287511471658945,3177923.776280946563929 11393064.625936694443226,3178263.968644810374826 11391449.72565152682364,3176377.659873317927122 11382163.190122082829475,3174893.548422062769532 11376199.286224393174052,3166327.847563991788775 11354665.200565915554762,3157515.128755850717425 11342506.733008176088333,3146290.784499165602028 11331222.012757116928697,3145022.744179539382458 11329998.673389850184321,3143631.139225133694708 11329059.328924663364887,3142023.463139096274972 11328682.54542119987309,3132282.785055704414845 11327557.3934,3118770.046026780735701 11331129.307269427925348,3117533.063845086377114 11332347.775455880910158,3094712.790871446486562 11331407.765902746468782,3093104.558187955990434 11331129.307269427925348,3091589.499918259680271 11330468.225463045760989,3090475.971051853150129 11328966.314885128289461,3090785.550555749796331 11327273.68311969935894,3097835.636546668130904 11323235.062865756452084,3104329.347722605802119 11322017.899374717846513,3108225.529900370165706 11321172.569503407925367,3129592.638241193257272 11313202.547150064259768,3131107.807830380741507 11312074.909423485398293,3131602.511647465173155 11310855.032188287004828,3130922.238239228259772 11309171.990181932225823,3129901.772467124741524 11307299.213424818590283,3126531.352244379930198 11302711.856190828606486,3125294.370062682777643 11301493.667956655845046,3121151.058615357615054 11298687.549977218732238,3099412.811092229560018 11283829.706293283030391,3078942.047291271854192 11269848.641450356692076,3077705.510387539397925 11268636.025438729673624,3079529.814202661626041 11267705.170869167894125,3084755.596378460992128 11267797.34556576795876,3088095.403741241432726 11268170.749736841768026,3094310.593551211990416 11270032.715254681184888,3098794.097362398169935 11271987.425476431846619,3131200.425646721851081 11289337.969947706907988,3135344.182372008915991 11292145.253786375746131,3136581.164553703274578 11293356.71118395216763,3137725.194960585795343 11294850.726041562855244,3138714.602594756986946 11296725.441562809050083,3139580.445594146382064 11298872.747487064450979,3140600.91136624943465 11300650.565036712214351,3147249.245314895641059 11305894.802869625389576,3148856.921400933060795 11306172.560389645397663,3149784.769356695469469 11304768.720972936600447,3150093.903582626953721 11303179.852478206157684,3150434.095946491230279 11299807.904061483219266,3150496.100902864709496 11294573.433460341766477,3149104.495948456227779 11285229.538761965930462,3148516.729037068784237 11283178.610800303518772,3147651.331315641757101 11281123.603057811036706,3144868.232726318761706 11275063.658533660694957,3143878.713772656861693 11273200.307278364896774,3141744.941773131955415 11269848.641450356692076,3138374.410230893176049 11265378.762437989935279,3133767.007826450746506 11259608.757006224244833,3131416.942056312225759 11256820.301615243777633,3116636.162707765121013 11241962.247030399739742,3114162.532302847132087 11239552.882813438773155,3110482.977854165248573 11236584.171909537166357,3107761.884221215732396 11234731.390152713283896,3103061.41872247075662 11231027.014625381678343,3101020.487178266514093 11228433.258425772190094,3100433.165544838644564 11226399.811646731570363,3103481.761119705159217 11216174.872654687613249,3105968.081946572754532 11214104.203428687527776,3114069.580528035759926 11225566.01856960915029,3124212.344612173736095 11230472.649855490773916,3128695.848423363175243 11232324.265657806769013,3133396.313922108151019 11233621.765447102487087,3136612.11137214442715 11234176.72181361541152,3137230.379824010655284 11232695.716662617400289,3136117.407555060461164 11231215.368976168334484,3131911.645873399451375 11228804.495890107005835,3129190.55224044714123 11226953.842840846627951,3126685.97501709125936 11224549.816020270809531,3123346.50161278154701 11220018.231462426483631,3122357.093978613615036 11218169.979238424450159,3121522.197797662578523 11216042.817816957831383,3121522.197797662578523 11214378.216440565884113,3121862.39016152638942 11212719.343779422342777,3122758.734701394569129 11211425.844879517331719,3130272.911649429704994 11211699.749486312270164,3131510.005150615237653 11212901.869692269712687,3132375.848150007426739 11215027.711490230634809,3133612.607692718971521 11218149.682547062635422,3134132.135756251867861 11219370.586905671283603,3136797.680963296908885 11224549.816020270809531,3142765.296225744299591 11235382.841639183461666,3150805.235128796193749 11236955.856858711689711,3152412.911214833147824 11237235.801822742447257,3153990.085760391317308 11236864.101494666188955,3154299.219986326061189 11235291.107604855671525,3153711.898352900985628 11233250.263602688908577,3152846.055353508796543 11231215.368976168334484,3150990.804719948675483 11227233.374291054904461,3145239.371908624190837 11215860.207185447216034,3138374.410230893176049 11202291.958098378032446,3135777.326510687358677 11195928.08011776022613,3134076.587330347392708 11190035.381745770573616,3134107.088870823848993 11186633.238758435472846,3134663.797644281294197 11143623.382292756810784,3135096.941782956942916 11135217.361083054915071,3136982.8052764874883 11125729.991823811084032,3137570.572187874466181 11124272.836352057754993,3137632.577144247945398 11120808.75487713329494,3137354.055778280831873 11118987.369187640026212,3135375.129190450068563 11111341.511443318799138,3134540.233009502291679 11109247.949911439791322,3131726.07628224696964 11103609.715589042752981,3128819.858336106874049 11098339.994624132290483,3126809.539651870261878 11095253.121888371184468,3121274.623250139411539 11088904.039198763668537,3124428.527063293382525 11089447.26731027290225,3125913.083792513702065 11090084.897617237642407,3128294.096381090581417 11091808.725691832602024,3130705.721829634625465 11094166.432520046830177,3131819.139376549981534 11095617.133132981136441,3134725.802600654773414 11100974.343366708606482,3138993.123960721306503 11111246.529070204123855,3142239.645590216387063 11120898.951433483511209,3142796.354363673832268 11122811.072741845622659,3142796.354363673832268 11124543.239738080650568,3140972.050548554863781 11128921.074505081400275,3139085.741777061950415 11138412.913829166442156,3138219.898777673020959 11160466.438039546832442,3138188.840639740694314 11162203.306498304009438,3141930.51136428443715 11196575.807375472038984,3142796.354363673832268 11200448.538868196308613,3153897.579263541847467 11224824.252274442464113,3170409.599332908634096 11276835.559855794534087,3173625.5081024360843 11292145.253786375746131,3175728.333283519372344 11302429.187308672815561,3175079.118013215251267 11305704.693867133930326,3175079.118013215251267 11307484.309941053390503,3175666.328327149152756 11309449.882450668141246,3177460.130601792130619 11313670.933158850297332,3199569.517307225149125 11352966.11593739874661,3200930.064123701304197 11354380.349153464660048,3206372.362709094304591 11358437.984103439375758,3209186.074158384464681 11360231.551214948296547,3211999.896927166264504 11361553.843390110880136,3215277.699333573225886 11362119.065527921542525,3217040.443470283877105 11362119.065527921542525,3222606.306690458673984 11361553.843390110880136,3232284.979817479848862 11359381.424580143764615,3255321.769200711045414 11349760.915781304240227,3256527.804563967045397 11348440.931097112596035,3257455.207241764292121 11347028.28040880151093,3263763.460146037861705 11331970.808468274772167,3266948.756055595353246 11297192.686811629682779,3266886.751099224667996 11288404.260805774480104,3292706.750391269568354 11302711.856190828606486,3297808.967932289931923 11307484.309941053390503,3301302.952789817005396 11311982.128941813483834,3302354.365380361676216 11313763.736834613606334,3303652.907240464352071 11314979.076434740796685,3305508.269193515647203 11314700.956664133816957,3313455.145002267323434 11312167.691179236397147,3315279.894095348659903 11311138.053772212937474,3315774.597912435885519 11302614.150472482666373,3315712.592956062406301 11299062.664386015385389,3315372.400592198129743 11295507.995282446965575,3314723.185321891214699 11291770.523102283477783,3313486.203140196856111 11287752.724564982578158,3312558.689142907969654 11285695.989962,3311507.276552366092801 11283829.706293283030391,3309868.542328396812081 11281313.021896736696362,3306405.059011346194893 11276835.559855794534087,3305292.086742396000773 11276087.814557500183582,3304147.72237703949213 11274597.9403,3303529.342605682089925 11272642.475379282608628,3305013.565376431681216 11271429.693630017340183,3306621.686740431003273 11271711.069130036979914,3316980.633275688625872 11276461.676869178190827,3321278.456176234409213 11278792.238120913505554,3322546.496495861094445 11280006.341399550437927,3323473.899173661600798 11282056.307018149644136,3323814.091537522617728 11283927.140837751328945,3324741.939493285026401 11285978.295948298648,3325793.352083829697222 11287845.172994593158364,3333369.088710273616016 11300275.362481161952019,3334544.177255088463426 11301776.297708852216601,3337450.840479190461338 11303272.175227764993906,3340604.744292347226292 11304115.605308853089809,3347500.652788516599685 11304300.614638423547149,3349262.951647265348583 11304300.614638423547149,3350933.077967638149858 11303549.824965547770262,3352417.189418893307447 11302336.53917520865798,3361322.526043372228742 11293546.473139677196741,3377247.781076767016202 11268728.212825199589133,3378391.811483649536967 11265654.860099107027054,3377618.474981110077351 11263983.033457800745964,3372732.885169174522161 11258771.195877948775887,3365744.470176155678928 11251618.994447479024529,3346974.890833500307053 11245488.870322870090604,3341316.07583851646632 11246788.89755491912365,3339708.288432987872511 11246508.557010317221284,3339862.911205699667335 11245208.583647551015019,3341037.888431022875011 11243913.870070613920689,3343697.088427093345672 11241498.802588760852814,3345768.855470247101039 11240571.675101073458791,3355478.475415706634521 11237699.288019308820367,3357210.272733978927135 11237699.288019308820367,3358817.948820016346872 11237979.263746529817581,3363363.457587576005608 11239644.340859413146973,3369269.847130085807294 11242242.399232380092144,3370661.006806529592723 11243078.250009249895811,3373227.588986258488148 11245488.870322870090604,3374402.677531073801219 11246972.678948326036334,3377062.211485614534467 11249017.33309138007462,3379968.986029210500419 11250409.976712968200445,3384730.565928401891142 11251522.024324046447873,3387977.421516368165612 11252083.467177074402571,3391347.841739115770906 11252267.058065976947546,3393327.213604911230505 11251618.994447479024529,3404613.562817969825119 11247161.143599,3406067.061409257818013 11246044.80102039501071,3406933.015728137921542 11244653.055701719596982,3406901.957590205594897 11242889.565119748935103,3410581.512038887944072 11230192.984564574435353,3431515.921518997754902 11210964.15455518476665,3443018.898461140692234 11217428.690389493480325,3444657.632685107644647 11216687.482720898464322,3445523.475684496574104 11215301.761891797184944,3451862.67540721129626 11198787.767189644277096,3455449.723359044175595 11182400.007526943460107,3459593.034806369338185 11163487.436822587624192,3459221.784304573200643 11161654.547851493582129,3457954.300582399591804 11160556.833962567150593,3441009.025054866448045 11153502.979582592844963,3439400.903690867125988 11153226.145545471459627,3437700.164510527160019 11153321.717922914773226,3421188.033121671993285 11153045.220839327201247,3399171.264232576824725 11148284.913032837212086,3397810.60609660949558 11147465.950167194008827,3379813.917978534474969 11127463.233106760308146,3378886.515300736762583 11125454.617951132357121,3378546.322936872486025 11123631.984014859423041,3378824.510344366077334 11121994.853441862389445,3379381.21911782072857 11120533.580797277390957,3380123.497482430655509 11119442.505785889923573,3382411.558296195697039 11116891.118491465225816,3382071.365932331886142 11115070.7846386320889,3381143.963254534173757 11113065.836544793099165,3378979.133117074612528 11109882.532403545454144,3377835.102710192091763 11108428.450574239715934,3375206.960852054413408 11106430.701553286984563,3352386.242600452154875 11091714.016435028985143,3350098.181786687113345 11091081.457821356132627,3332194.111484952736646 11089267.709937179461122,3329194.830444510094821 11089178.259491890668869,3325824.410221762023866 11089178.259491890668869,3316980.633275688625872 11090174.360016640275717,3315155.884182604495436 11090538.09885448217392,3313114.95263840071857 11091444.918727369979024,3285594.659443977754563 11100340.593732230365276,3257610.275292440783232 11106700.394410220906138,3232222.974861106835306 11110611.818944064900279,3207856.585479840636253 11123722.218135176226497,3200249.790715461596847 11126461.313085665926337,3198425.041622380260378 11126731.803769210353494,3194899.998626921325922 11127007.229522090405226,3190014.408814982976764 11126366.118689075112343,3185592.576001696288586 11124633.485986739397049,3183149.558456745930016 11122265.165993822738528,3183149.558456745930016 11120533.580797277390957,3185097.87218460906297 11119898.000876788049936,3189983.46199654461816 11120533.580797277390957,3194621.922538918908685 11121719.631223663687706,3196106.033990174531937 11122355.381926,3199383.94771607266739 11122630.62995139695704,3200868.059167330618948 11121534.625188875943422,3200868.059167330618948 11119807.817633969709277,3199755.08689837763086 11118347.016178173944354,3191406.013769391458482 11109517.7548194732517,3188684.920136441942304 11107699.398761540651321,3185443.964481486007571 11106465.721743177622557,3184819.684777115937322 11105426.975404256954789,3185128.819003050215542 11103884.203814083710313,3186891.117861798964441 11102885.761196170002222,3209649.831157027743757 11092984.863544652238488,3228481.415456053800881 11085911.188333751633763,3250652.807117860298604 11073236.404644124209881,3257548.270336067304015 11072873.917703915387392,3272205.485049835871905 11069256.948243875056505,3286676.684894489590079 11064555.067843185737729,3299540.208653106354177 11060129.166083594784141,3303034.638788598123938 11058145.584403710439801,3301828.603425344917923 11055979.030172359198332,3293634.153069070074707 11046779.853145325556397,3290758.4366634064354 11045067.421789953485131,3284141.160852689761668 11040475.929653765633702,3276410.801453534513712 11034445.013203427195549,3269638.902870106510818 11023390.097577592357993,3268958.629461870063096 11021772.117998553439975,3270288.229459905065596 11020963.434284914284945,3273751.156179502606392 11020603.403839679434896,3275328.330725060775876 11020963.434284914284945,3276657.930723095778376 11021772.117998553439975,3280739.682492012623698 11029406.671689443290234,3281914.659717336297035 11033273.793073333799839,3286738.689850860275328 11038132.25894121825695,3287975.672032557427883 11039303.9932,3289521.899759674444795 11039571.031724197790027,3306714.304556768853217 11041193.25712745077908,3308631.560146702453494 11040565.064733725041151,3309775.590553584974259 11039393.112898649647832,3310363.246145480778068 11037954.053798239678144,3314166.476548433769494 11015939.922331815585494,3314135.418410504236817 11014235.247240446507931,3310795.945006197318435 11005540.278799168765545,3305322.699602363165468 10998109.637439014390111,3303281.768058159388602 10995603.435209730640054,3300468.056608868762851 10994262.149680165573955,3299138.456610833760351 10993368.21363621391356,3283337.211490182671696 10961258.457944046705961,3282440.421672352589667 10959210.643872275948524,3282440.421672352589667 10957519.812127336859703,3283894.031583131756634 10958052.314741581678391,3287542.527893881779164 10961522.447553446516395,3289645.46439445624128 10964637.273268718272448,3290325.737802693154663 10966241.708679301664233,3290944.006254558917135 10968203.769558347761631,3291809.849253948312253 10970161.264017887413502,3292799.368207610677928 10971855.241704700514674,3301024.765382326673716 10980771.940108,3302261.413605547044426 10981933.824376666918397,3305044.512194870039821 10983272.679493283852935,3308043.793235312681645 10984165.288914171978831,3333832.845708919223398 10989076.897489430382848,3342491.05306383734569 10982022.194828158244491,3355323.963962486479431 10969358.696914780884981,3358911.011914319358766 10967665.340888483449817,3360580.692956726998091 10967665.340888483449817,3360611.751094659324735 10969358.696914780884981,3360178.606955980882049 10970518.632523795589805,3355509.533553638961166 10979345.24046703800559,3353949.168251188937575 10991632.182553065940738,3360756.132474217098206 10992481.797543875873089,3357411.315734350588173 11004876.037658,3357179.214596046600491 11020697.126265924423933,3358168.733549708966166 11027698.291095746681094,3359405.715731403324753 11028868.550161022692919,3372331.244446393568069 11030038.687245180830359,3373938.920532430522144 11029317.682926528155804,3375392.085165244527161 11028241.49659357778728,3376227.315304666291922 11026799.945880765095353,3384174.302432906348258 11012801.507150871679187,3384421.431702467612922 11011186.36956680752337,3386060.611204399261624 10993549.759732889011502,3386307.740473960060626 10978629.915161924436688,3386153.117701248731464 10971943.160397863015532,3385503.791111450176686 10968468.028883259743452,3384885.522659587208182 10966510.701030880212784,3383741.158294230699539 10965082.18166696280241,3382535.122930975165218 10964016.116996815428138,3378175.183754567522556 10962324.090446358546615,3377123.771164026111364 10961610.553162144497037,3378700.945709584280849 10960901.575658353045583,3380494.191386773716658 10960544.712096286937594,3385380.226476671174169 10960720.899127192795277,3386740.884612635709345 10961610.553162144497037,3387853.856881588697433 10963038.023044599220157,3388874.322653689421713 10964730.227229297161102,3389616.601018299348652 10966329.554832836613059,3389925.735244231298566 10968110.768112471327186,3391812.04401572374627 10984346.589409274980426,3391842.990834164898843 10986039.282083483412862,3391347.841739115770906 10989170.186144407838583,3390173.309791757259518 10992309.935035103932023,3389709.107515149284154 10993549.759732889011502,3389090.839063283056021 11005003.72169123776257,3389121.897201215382665 11006612.875092485919595,3390265.816288603935391 11008050.148622535169125,3391718.980921420734376 11008586.62371608056128,3401583.22363959485665 11008946.018,3404953.643862342461944 11008857.296797934919596,3410210.372856582980603 11008138.536673936992884,3418652.509079872164875 11005987.872063903138041,3420074.615574756637216 11004821.869398953393102,3427304.705182288773358 11000891.953581664711237,3434744.965988439973444 11001452.678556611761451,3440081.17709910357371 10982022.194828158244491,3444596.073006698861718 10968737.109304714947939,3445028.771867412608117 10957163.1259,3445492.417546567041427 10944189.777076482772827,3445368.852911785244942 10940908.937278266996145,3444874.149094698484987 10934079.169841170310974,3443853.794642088934779 10928851.893211267888546,3442029.490826969966292 10924868.424154119566083,3440885.460420087445527 10923448.938422696664929,3439648.478238390292972 10922301.776906613260508,3435752.296060628723353 10919556.191755354404449,3431391.911606253590435 10917967.500270700082183,3428300.124068961013108 10917525.343283776193857,3424991.26352462451905 10917612.881084099411964,3400377.188276341650635 10921946.931876868009567,3398490.87950484873727 10922564.25945839099586,3396512.064236506819725 10923541.331405365839601,3390049.299879013095051 10929294.786543250083923,3383339.406251955777407 10936738.366300590336323,3380834.383750637527555 10940728.790901012718678,3378051.61911978572607 10944633.669759422540665,3376938.201572873163968 10945877.298716388642788,3373567.781350125558674 10949521.59971571341157,3362250.373999134637415 10960187.867255726829171,3360549.746138285845518 10961165.551416976377368,3358787.002001575194299 10961522.447553446516395,3357117.209639676380903 10961522.447553446516395,3353994.363964451476932 10960989.673225246369839,3352479.194375263992697 10960434.837767416611314,3351087.700740346685052 10959923.929435780271888,3348922.759283401537687 10957788.459769431501627,3348087.863102450501174 10956454.931936088949442,3347778.728876519016922 10954671.967042556032538,3347686.22237966908142 10949697.501484785228968,3349386.96156000951305 10948633.525136265903711,3350963.690827605314553 10948897.025268193334341,3354255.519489854108542 10948833.707557430490851,3355478.475415706634521 10948809.084162384271622,3359900.419548490084708 10936294.988328592851758,3360178.606955980882049 10934254.672866435721517,3359869.361410557758063 10931509.047656180337071,3359220.146140250843018 10928939.576788121834397,3350468.987010518554598 10908953.047798382118344,3346572.804832756984979 10904011.872027806937695,3328297.929307185579091 10886558.976107127964497,3302292.360423988196999 10867925.723303090780973,3295427.955343713052571 10863625.898699145764112,3291933.413888730108738 10861607.234392657876015,3288191.854483677074313 10859502.372433889657259,3282100.22930848877877 10857484.613294515758753,3273720.65463902335614 10855034.694138683378696,3264072.594371969345957 10850742.991263309493661,3262774.052511866670102 10849429.943996015936136,3261908.098192986566573 10847939.440704131498933,3261320.887879052665085 10846016.448144428431988,3261042.255193597171456 10844262.473986081779003,3261011.753653118386865 10842604.975247776135802,3261289.82974112033844 10839454.193827109411359,3262124.725922071374953 10834913.146332684904337,3262959.622103019151837 10831943.518185209482908,3263516.330876477062702 10830542.943900877609849,3264072.594371969345957 10827488.828803488984704,3263915.411250971257687 10826403.250692849978805,3263400.781245032791048 10822850.572623856365681,3261475.399332272820175 10811277.799065437167883,3260887.743740374222398 10807797.512606563046575,3256589.809520337264985 10788162.545243635773659,3254889.070339997299016 10784260.425578953698277,3253930.275565793737769 10782526.935187570750713,3251054.55916013289243 10777500.304770391434431,3250096.0983444028534 10775853.954435037449002,3248055.166800198610872 10772733.837792446836829,3242705.486031146720052 10765728.589505210518837,3239304.007670466322452 10762095.642837731167674,3235315.318995855282992 10759850.487642390653491,3233800.149406667798758 10759589.217809244990349,3230491.28886232804507 10760543.21210871078074,3228796.894892963115126 10761744.37061034142971,3227746.150219365954399 10762758.099942928180099,3223516.343527691904455 10766840.054018098860979,3216081.648696083109826 10772995.610971312969923,3212433.041065841913223 10776372.449606316164136,3209062.509523602668196 10779922.533275431022048,3206248.352796350140125 10783650.813512980937958,3204547.724935501348227 10787900.502241112291813,3204269.53752800822258 10789377.944129176437855,3203991.350120514631271 10792586.624724883586168,3203960.403302076272666 10797452.673225985839963,3204238.479390078689903 10800841.947351465001702,3205630.084344484377652 10809537.43394323438406,3208134.66156784305349 10823214.735920120030642,3209000.504567231982946 10825135.70510334149003,3210052.028477265033871 10826616.520486129447818,3217442.195512556470931 10836746.503572719171643,3219576.078831572085619 10839631.681674271821976,3220658.104282083921134 10841029.402551492676139,3227337.385049174074084 10848992.52785274758935,3228543.420412427280098 10850040.734814422205091,3231975.845591545570642 10854245.267041554674506,3235407.825492704752833 10858452.39413345977664,3241870.589850198477507 10866956.596484122797847,3258228.543744304217398 10892634.557667514309287,3260052.847559425979853 10896337.724371735006571,3261630.022104984149337 10901627.102377304807305,3261630.022104984149337 10903304.10417309217155,3261073.313331526704133 10906392.392340136691928,3248735.440208435524255 10948096.962969755753875,3247869.597209046129137 10951029.705250646919012,3242458.356761585455388 10967220.263485653325915,3240139.349129379261285 10973015.603247916325927,3239273.394810498692095 10974352.703340902924538,3229316.20031751319766 10978365.260659074410796,3227399.390005544759333 10978987.407804870977998,3222266.225646086037159 10980953.1501389387995,3218215.420695607550442 10982649.818752901628613,3199785.699758348055184 10990957.071811079978943,3194281.730175055097789 10993815.006009543314576,3162030.024663446005434 11010915.280980853363872,3159215.867936190683395 11012801.507150871679187,3158350.358895272482187 11014146.456979569047689,3157762.703303376678377 11015580.157980903983116,3156834.855347614269704 11018631.331384917721152,3156834.855347614269704 11020337.109932562336326,3155319.685758426319808 11028147.670027088373899,3154701.417306560557336 11029589.183199692517519,3152938.673169849906117 11032196.979814510792494,3151485.50853703264147 11033273.793073333799839,3147681.944175609387457 11035161.380068801343441,3142177.974592316430062 11036965.586173495277762,3138900.172185909468681 11038315.005071271210909,3135406.187328382395208 11040203.993857122957706,3133921.519279670901597 11041282.40162299387157,3129190.55224044714123 11046146.277822652831674,3127428.253381701186299 11048760.441092262044549,3116729.225802067667246 11066635.207517145201564,3115245.003031321335584 11069435.976910838857293,3114626.28930149320513 11070881.39947110041976,3113976.962711694650352 11074051.663887793198228,3113884.456214845180511 11080839.411820029839873,3114162.532302847132087 11082650.581691399216652,3114131.585484406445175 11084372.848000200465322,3113482.258894607890397 11087454.773163268342614,3112554.410938848275691 11090538.09885448217392,3110730.107123726047575 11094894.031190110370517,3109833.317305895965546 11096255.343614088371396,3108769.993529840372503 11097142.990627842023969,3107916.395674435887486 11097527.041808499023318,3106091.64658135175705 11097706.491047212854028,3102814.289452909491956 11097432.252687659114599,3072355.829618487507105 11092352.186435075476766,3069449.055074894335121 11091170.93336259201169,3068799.728485098574311 11089541.944929484277964,3052534.837685293052346 11074141.240890538319945,3039021.987336877733469 11065642.230550229549408,3038527.283519793767482 11063651.833778388798237,3038743.465970913879573 11062024.234267361462116,3039454.686197591479868 11060670.095740623772144,3039794.878561455290765 11059048.086085250601172,3040166.017743760254234 11055795.483187220990658,3039362.179700742010027 11053723.857957107946277,3038125.19751904765144 11052460.340518701821566,3036857.157199420966208 11051558.714069489389658,3028570.089026808273047 11047047.185812700539827,3014624.205859206151217 11039665.016227461397648,3013294.605861173942685 11039032.104323612526059,3011686.818455645348877 11038671.114937523379922,3009769.5628657117486 11038854.199615966528654,2994896.16570082353428 11044077.594034891575575,2992824.28733817813918 11044889.034570695832372,2991401.735565331298858 11045878.98062009178102,2990721.462157094851136 11047408.620739758014679,2990628.844340754207224 11050746.151541486382484,2989732.054522923659533 11052009.349989620968699,2984094.835509151220322 11053129.251326683908701,2962922.536277216393501 11053000.334748359397054,2961314.860191179439425 11052549.6331,2948080.197250257711858 11048398.934204442426562,2946688.592295852024108 11047680.845204068347812,2944400.197523612994701 11045067.421789953485131,2942823.468256017193198 11040926.154808519408107,2941524.481117952149361 11036871.639018604531884,2940628.025258592795581 11033007.00202233158052,2939081.908850964158773 11027160.304880546405911,2938277.625529983546585 11025097.394924078136683,2936391.316758493892848 11021500.929958557710052,2935432.85594276105985 11020065.979166118428111,2913694.608419632539153 10988365.050701366737485,2911653.676875428762287 10985416.167845733463764,2909272.664286851882935 10983002.701887525618076,2905500.492021831683815 10980237.334399770945311,2895419.732894064392895 10976047.404508,2894182.750712370034307 10975151.044700119644403,2893007.77348704636097 10973906.867108706384897,2891894.801218096166849 10972388.867902034893632,2890503.196263687685132 10969001.389354392886162,2889049.586352908518165 10965351.44872473180294,2888276.69512833096087 10963214.274671671912074,2887843.9962676204741 10961258.457944046705961,2887905.5559460259974 10959655.197444805875421,2888493.322857415769249 10958321.303646204993129,2890379.631628908682615 10955653.660274090245366,2891430.598941488191485 10951029.705250646919012,2891492.603897858876735 10949428.85334132425487,2891337.981125147547573 10947477.315098745748401,2891090.406577621586621 10945789.396632052958012,2890255.621716164518148 10940377.774692103266716,2889575.348307928070426 10936650.582191245630383,2888647.834310636390001 10932750.280178872868419,2880298.872501141391695 10903565.855346573516726,2876031.551141071598977 10872841.099872088059783,2875784.421871510799974 10871171.579620629549026,2875351.277732835151255 10869242.338709475472569,2873341.404326563235372 10866257.722599636763334,2868764.948740559630096 10861607.234392657876015,2867033.15142229013145 10857922.890234859660268,2866445.941108353435993 10855997.079904347658157,2865301.465423509012908 10850391.853996580466628,2862395.136157877743244 10830542.943900877609849,2861776.42242804961279 10816851.269852729514241,2861838.42738442029804 10815195.401225965470076,2864497.62738049030304 10784779.559565896168351,2868517.374193036463112 10764864.138384869322181,2867713.424830526579171 10747422.008205072954297,2860044.736429268494248 10730279.788155807182193,2856612.645208620931953 10723398.042040545493364,2855653.850434416905046 10721769.315563512966037,2855066.528800991829485 10719707.128146512433887,2853365.789620654657483 10716357.863321816548705,2852376.38198648346588 10714896.127132585272193,2851139.399804789572954 10714038.082135833799839,2848170.620304822921753 10713265.099587013944983,2846562.944218785502017 10713180.144804762676358,2844707.582265734206885 10713693.905652198940516,2839543.471087834332138 10716183.551094556227326,2837564.544500004034489 10716956.863679338246584,2835678.235728511121124 10717386.210465075448155,2832462.438278474844992 10717216.508621115237474,2830978.21550772851333 10716872.172104880213737,2828288.068693216890097 10715584.618481121957302,2825814.104329828638583 10713783.50109395198524,2823495.096697622444481 10711723.720619,2809054.398393447510898 10696725.320134593173862,2806858.955396020784974 10694327.467040194198489,2803952.292171918787062 10689966.219903571531177,2802251.552991578355432 10686547.16808502189815,2801540.221445409581065 10684580.171683851629496,2800210.621447374578565 10679028.988404842093587,2794799.380999913904816 10651505.42730326578021,2794459.188636050093919 10648016.484764138236642,2794644.758227202575654 10644874.927748087793589,2795386.591313847340643 10641898.065558260306716,2795201.467000660020858 10640200.289421416819096,2794490.246773979160935 10638251.147641163319349,2793655.350593031384051 10636554.275219049304724,2791490.409136083442718 10634177.405457427725196,2775742.263412540778518 10621798.465528704226017,2767313.819486619904637 10623789.277735568583012,2766941.90106787905097 10625213.078481234610081,2765579.573139551561326 10629486.562234662473202,2764557.437575085088611 10632225.092019917443395,2763939.169123222120106 10633581.026732029393315,2762021.913533288054168 10637570.392829304561019,2760475.685806171037257 10640116.236899793148041,2757754.592173218727112 10643769.041323933750391,2755652.100950606167316 10646060.528695072978735,2748509.063184873200953 10650991.4167,2741675.15964507451281 10654308.826699681580067,2736109.296424902509898 10655584.899003637954593,2728811.635886458214372 10656949.757069922983646,2721792.162755506578833 10657884.941498622298241,2718081.661488386336714 10658735.972293926402926,2712113.600947976578027 10660779.85897808521986,2710784.000949941575527 10661458.3263945505023,2709330.83631712757051 10662398.726591669023037,2695663.029237527400255 10672456.544447790831327,2693560.204056444112211 10674077.8694,2685087.566292675677687 10683894.794148065149784,2682582.989069317001849 10687655.371767481788993,2681933.6624795217067 10688937.677575377747416,2681531.576478775590658 10690393.875502567738295,2680882.249888979829848 10691761.074904156848788,2679026.999255419708788 10694158.028368968516588,2677851.910710604861379 10695267.465786362066865,2676645.986666840035468 10696297.268531790003181,2674914.189348570536822 10697153.0903255995363,2669039.191902463790029 10698949.832361182197928,2660473.602363883983344 10699378.050005830824375,2655680.964326763059944 10698949.832361182197928,2652743.242964728735387 10698178.553309708833694,2651784.782148998696357 10696725.320134593173862,2651259.131513473577797 10695098.311938120052218,2649650.898829983081669 10687655.371767481788993,2648970.625421743374318 10685603.443832946941257,2647610.078605267219245 10681674.863803336396813,2645229.066016690805554 10676464.025649635121226,2642817.440568146295846 10671261.758007785305381,2639601.197840148117393 10664354.755788650363684,2638673.683842855971307 10662908.687862211838365,2637467.759799094405025 10661972.816919799894094,2636014.595166277140379 10661547.240348299965262,2634282.797848007641733 10661715.566823510453105,2625253.562630273401737 10659844.279018940404058,2617955.90209182864055 10657800.6716095097363,2612358.980733727104962 10655673.736703932285309,2605741.70492301043123 10652355.665404329076409,2597423.689931956585497 10645808.464253412559628,2592785.229389582294971 10641814.297916254028678,2591734.150757511146367 10640624.846831735223532,2589353.138168934732676 10638759.313493777066469,2583075.943402593489736 10636381.678516829386353,2581344.257403812371194 10637146.330230209976435,2578684.723449268378317 10639099.741534730419517,2575870.900680487044156 10642663.333461897447705,2571387.06291082687676 10650482.342307031154633,2568418.728688822127879 10655673.736703932285309,2567460.37919258326292 10656860.902809953317046,2545165.311576506588608 10656098.948281159624457,2538393.412993081379682 10655584.899003637954593,2510254.406068827491254 10669814.230208704248071,2504688.542848655488342 10667116.781674755737185,2493370.801539193838835 10661631.249765709042549,2490185.839588107075542 10684664.464326627552509,2489536.624317799694836 10690393.875502567738295,2487835.885137462522835 10702036.435463199391961,2487619.257408377714455 10702718.697959048673511,2480074.578919863328338 10714123.047578671947122,2470983.227426267229021 10728474.795396145433187,2470643.035062403418124 10731740.171420980244875,2471014.174244708381593 10733635.573009265586734,2471632.554016065318137 10735617.043355576694012,2472220.209607964381576 10736818.477159475907683,2453635.865897990297526 10767025.627059021964669,2448427.894840717315674 10775173.703587727621198,2413622.742849290836602 10839804.768243979662657,2373424.050209441687912 10852845.149799820035696,2343831.433374411426485 10822170.329991338774562,2342069.134515663143247 10819119.960536185652018,2341326.856151052750647 10817286.629310697317123,2340832.15233396878466 10815721.911325873807073,2342409.326879529748112 10800927.999385366216302,2343676.921921191271394 10794585.274166161194444,2345068.526875596959144 10790159.89954106323421,2346522.025466884952039 10787466.701072754338384,2350294.197731905151159 10784431.800984885543585,2350232.638053496833891 10782612.756638377904892,2349923.503827564883977 10780703.406347746029496,2348995.655871802475303 10776719.797918695956469,2347140.405238242354244 10768840.523182213306427,2345965.316693430300802 10764778.539708355441689,2345223.038328819908202 10762959.743606295436621,2344326.582469460554421 10761492.672923244535923,2341388.861107426229864 10761146.098208907991648,2335544.476521287113428 10764864.138384869322181,2330535.322074572555721 10769016.495348773896694,2319434.097174704540521 10776805.546406429260969,2317918.927585517056286 10777671.510573668405414,2312538.63395649753511 10779922.533275431022048,2308580.446822359692305 10780789.204879384487867,2306972.659416831098497 10780617.608894286677241,2304034.938054799567908 10779665.48553011752665,2301530.360831440892071 10777933.161251408979297,2294232.811612487770617 10772391.677982239052653,2291058.536332516930997 10769544.127573052421212,2285976.356299842242151 10768322.599560625851154,2237181.461261443328112 10763914.20881949365139,2252982.706382093951106 10741038.807793073356152,2261424.286007930058986 10728559.630837701261044,2265382.47314206790179 10684833.668021531775594,2261331.779511080123484 10675015.397172410041094,2252920.701425723731518 10655584.899003637954593,2248931.901431618258357 10646657.995190551504493,2246117.744704365730286 10641986.725857548415661,2233408.843718460761011 10622482.227529825642705,2221534.838913503568619 10610551.339625736698508,2236192.053627272136509 10597714.358345810323954,2249890.362247348297387 10591807.291404481977224,2249612.286159346345812 10589871.86445607803762,2248498.757292942609638 10585910.161343481391668,2245963.233251142781228 10581446.471803678199649,2245004.772435412742198 10580184.130974294617772,2234831.395491307601333 10571355.152793284505606,2231739.162676053121686 10567906.766546748578548,2229760.236088219564408 10565387.597102215513587,2227131.648952116724104 10561191.036002928391099,2223792.175547810271382 10555232.311206378042698,2222400.681912895757705 10551713.869340186938643,2221565.785731944721192 10550203.888996411114931,2220607.324916214682162 10549030.225694166496396,2219462.960550861433148 10548027.145481275394559,2217916.732823741622269 10547774.136676182970405,2215072.074556009843946 10549200.637232901528478,2210866.758152313996106 10551796.844923341646791,2194910.890258948784322 10558674.028902310878038,2175615.660280771087855 10566817.764639638364315,2161082.010201781522483 10572782.025365732610226,2109751.591121585574001 10593497.974899278953671,2071871.906113942386582 10589700.742925452068448,2043609.334554909495637 10609112.021796690300107,2020386.530302561121061 10601850.056347781792283,2014831.68771197879687 10599920.908079521730542,2013862.20626665907912 10599568.74821562319994,2012841.74049455835484 10594424.23341653123498,2010213.153358455747366 10579005.3277981672436,2008852.606541979592294 10569757.649839885532856,2009687.836681401357055 10564211.333921225741506,2011481.193678082199767 10553136.662318205460906,2013305.497493201401085 10542079.835416225716472,2015315.370899473316967 10530958.367054624482989,2021036.190850830404088 10496536.30751003138721,2018840.747853406239301 10491797.42720789462328,1997040.495373907499015 10446335.26585423015058,1990855.918423904338852 10430833.079109659418464,1987949.589158273302019 10431742.401662532240152,1984949.862839868292212 10433222.123620243743062,1983713.325936136301607 10434213.32977818697691,1981703.007251899689436 10436354.312157014384866,1975178.683215997414663 10442455.478212980553508,1968159.210085046244785 10448316.84826416708529,1964665.225227516610175 10451206.44063738361001,1958388.030461175367236 10455831.422262884676456,1922889.358042106265202 10473957.072899190708995,1920548.754428688669577 10469192.588141372427344,1918540.996092741843313 10465476.876354271546006,1913396.365825728746131 10455999.240045517683029,1862034.888607603032142 10417094.908880546689034,1857334.423108858056366 10397317.157492093741894,1850160.772483157692477 10367875.728702127933502,1846573.835850816220045 10353206.445489268749952,1845336.742349630687386 10348319.413820257410407,1844594.463985020527616 10345798.863961422815919,1837699.000766813522205 10331822.820479672402143,1826010.565553008811548 10308727.488291030749679,1823691.557920805411413 10304520.063150664791465,1804055.690300795948133 10300479.273500168696046,1802509.573893170105293 10299995.50340747833252,1790666.515906654065475 10274343.497159838676453,1790790.08054143586196 10272897.480017611756921,1791099.660045329714194 10271447.420106517150998,1792707.3361313669011 10267426.219158504158258,1793480.672633909154683 10266220.17037395387888,1796541.958630722714588 10261557.469290958717465,1799108.095532489940524 10258181.557809881865978,1803901.178847575793043 10252884.877722382545471,1805663.811664798064157 10250716.335187885910273,1810271.325388731434941 10243659.633596742525697,1818681.958196126157418 10230767.471690209582448,1821341.046872704988346 10224135.318481206893921,1825546.808554365765303 10206890.136618362739682,1826288.641641010995954 10202748.536745965480804,1820506.262011245358735 10161124.965442098677158,1782224.824961329810321 10125023.729895340278745,1751179.154812973923981 10066890.268852243199944,1739459.661461239680648 10044656.139119952917099,1728544.22879150393419 10031274.400565611198545,1710176.624130106065422 10009468.932475266978145,1711134.973626344930381 10004354.630934404209256,1714381.940533802146092 9989119.07374539040029,1719535.921638041967526 9965363.689333070069551,1721895.894842857727781 9954975.310001643374562,1672606.073348394827917 9918018.869432816281915,1667720.483536459272727 9917787.888937633484602,1638375.441248952178285 9915419.059805760160089,1614689.102636943338439 9913202.073690462857485,1615152.859635586384684 9908313.27204055339098,1616266.054543519159779 9898470.162153737619519,1617997.740542300278321 9883765.179972006008029,1618647.067132098600268 9878896.677635870873928,1621862.975901623489335 9863019.669896516948938,1623068.899945388315246 9858016.025382481515408,1626254.084535454399884 9843096.557124812155962,1629129.800941118272021 9829639.724744748324156,1628789.608577254228294 9826848.692057153210044,1627645.355531389359385 9821564.030366672202945,1625697.37576 9815082.83799853362143,1623934.854264268651605 9810638.497344335541129,1621399.21890298044309 9805064.284412518143654,1618523.502497316803783 9797619.779561853036284,1618028.798680232604966 9795968.203564759343863,1617719.441815318539739 9794164.469901159405708,1614194.398819856345654 9764401.629861794412136,1613823.259637551382184 9745646.004223981872201,1613606.854547448921949 9726944.724395589902997,1613421.284956299234182 9708219.714100124314427,1613514.125411619897932 9703545.192678760737181,1613359.502638908335939 9691463.880803050473332,1599537.406745070591569 9673644.271262964233756,1598114.854972223751247 9663534.200094819068909,1595115.46261228970252 9647919.103640267625451,1594033.103203306905925 9642695.037557613104582,1592851.892086499603465 9638790.314262561500072,1591472.198317607864738 9635323.765948571264744,1584663.786941199796274 9621256.925141338258982,1568646.248049937654287 9594992.229962659999728,1553556.111836473224685 9565185.014871262013912,1545021.691755316918716 9548335.691195508465171,1539857.691896905656904 9538475.365218427032232,1527923.574566923314705 9517367.507495742291212,1525911.808729306096211 9514102.87008067406714,1524736.720184494042769 9511434.413754407316446,1522510.33036862872541 9505807.431531732901931,1521180.73037059372291 9501122.957005435600877,1520902.320324118016288 9499318.093012718483806,1520995.160779441241175 9497877.489992089569569,1523097.763321544975042 9496295.110394144430757,1538466.086942499969155 9485499.901035340502858,1547433.65116233471781 9479822.407812174409628,1562090.643237120704725 9474796.115555953234434,1571429.124000278068706 9470274.215448152273893,1575139.736586889717728 9437915.323904098942876,1575325.306178042432293 9434989.158109061419964,1575696.445360347395763 9397109.28028049133718,1574799.655542517080903 9394055.549993343651295,1557174.106606744229794 9354349.506570963189006,1556432.050881116418168 9353077.834727058187127,1479590.544095827266574 9371803.447316305711865,1472756.863195008365437 9373432.117426691576838,1468705.835605550091714 9372654.548288013786077,1462243.293887038948014 9371026.056740304455161,1450740.205625407164916 9367843.770361484959722,1445854.615813471842557 9366146.388044336810708,1440257.694455367513001 9363319.422414608299732,1430115.153010211884975 9356183.859554167836905,1424270.879743563942611 9351597.08795028552413,1411747.54834881122224 9341443.920041412115097,1406397.978899250272661 9335246.615873033180833,1394925.837456056848168 9317529.331953763961792,1388494.13123649568297 9307565.32707360573113,1374424.572114622918889 9281248.339790008962154,1352964.734637967776507 9247654.704709874466062,1351356.724593459861353 9244943.282748540863395,1355716.663769870065153 9226963.766190230846405,1357541.190223971614614 9220242.94529127702117,1351109.150045936694369 9208131.043092891573906,1344553.879191593499854 9196109.758789097890258,1335710.102245520334691 9180111.997923541814089,1328752.63407094264403 9167312.527167487889528,1338894.173640679800883 9145128.267384476959705,1339946.36546766012907 9143014.710726240649819,1351882.263909493805841 9111360.566116413101554,1354603.468861937290058 9104133.756767921149731,1352655.37777305371128 9100114.330710548907518,1348450.061369357863441 9092216.706439400091767,1342327.378056237008423 9080321.657282073050737,1339049.798288809601218 9073938.596855945885181,1341430.810877386247739 9060852.977173902094364,1343255.114692508243024 9052121.617796681821346,1345790.638734305277467 9039075.719670344144106,1343935.388100744923577 9030907.958787282928824,1341028.613557151751593 9018642.325547033920884,1341121.454012472182512 9000415.58398000895977,1345264.988098779926077 8985719.722837155684829,1352438.972682951483876 8969115.449207130819559,1355005.554862680612132 8963700.586971076205373,1356366.101679156767204 8960358.975553579628468,1358066.61822051438503 8955751.622298583388329,1359210.871266379486769 8952215.774063680320978,1363145.458668469218537 8939732.274458054453135,1364374.871124787954614 8937151.495386043563485,1366044.552167198387906 8932559.205008920282125,1368302.000120993237942 8924047.790352415293455,1368765.757119639310986 8921456.120236549526453,1368630.503938325913623 8920631.497693592682481,1364622.223033331334591 8893009.791012628003955,1359767.35740085458383 8860590.305183036252856,1358128.623176887864247 8850453.674401260912418,1356056.744814242701977 8838424.357607623562217,1354757.980315157677978 8830416.155273076146841,1353583.003089834004641 8822351.698787517845631,1349686.820912069641054 8795075.728863907977939,1351913.322047426132485 8792465.53589890524745,1379557.513835101854056 8760362.083723049610853,1381103.741562219103798 8758672.335584718734026,1383732.106059339130297 8757764.360903795808554,1385340.004784358898178 8757568.189702777191997,1387968.369281479157507 8757828.427499026060104,1389421.756553275743499 8757764.360903795808554,1394059.994456667685881 8757243.431641850620508,1394833.108320227591321 8756984.851388642564416,1421982.707610307727009 8721676.886687468737364,1431135.618782312376425 8709536.652457354590297,1428352.631512480787933 8697868.156886765733361,1424518.231652107322589 8682295.962165551260114,1421797.138019155012444 8672083.031585583463311,1410448.78384972596541 8646005.784470098093152,1406836.243734502932057 8639047.45408190973103,1405068.378901215270162 8638015.604760028421879,1402872.824584299698472 8637248.827853871509433,1398976.642406535334885 8636864.549795839935541,1391524.470414870651439 8637503.184617269784212,1386824.338874596636742 8638206.736578034237027,1383979.457967882743105 8638334.850602285936475,1381227.306197 8638206.736578034237027,1379031.863199576735497 8637439.939565783366561,1368580.410167469177395 8632586.656510580331087,1363416.187670078361407 8630097.12567900493741,1360602.476220787968487 8628309.434411395341158,1359829.362357228063047 8627417.590429691597819,1359210.871266379486769 8626396.111771453171968,1359520.005492310971022 8625248.726463308557868,1360014.931948380544782 8624227.551538096740842,1361839.235763499746099 8621422.122815005481243,1363168.835761534748599 8619638.391907267272472,1366106.557123569073156 8613458.823192367330194,1370188.308892485918477 8599971.946606159210205,1373249.59488930227235 8588224.599966233596206,1374919.275931709911674 8581120.757526831701398,1375197.685978183057159 8579980.466368062421679,1376434.445520897628739 8575354.722481839358807,1378011.397427473217249 8570985.777144055813551,1378815.458109474275261 8568833.609876537695527,1383144.561786934733391 8559599.131709521636367,1392142.961505716433749 8541355.509303443133831,1401234.090360330184922 8517939.183193419128656,1402007.092904398916289 8515738.547468570992351,1403274.910585043020546 8507387.892394635826349,1403522.262493586633354 8504814.831178223714232,1403460.257537215948105 8503434.817312596365809,1402934.71822117920965 8498982.876565473154187,1402347.285268262960017 8494972.304949184879661,1401481.44226887379773 8489148.169780155643821,1399502.293042060686275 8484392.281522560864687,1395698.951319616753608 8476701.747936096042395,1394585.756411684211344 8474513.675523364916444,1391988.338733005104586 8446764.004795579239726,1392359.255276327487081 8442968.399813197553158,1392421.260232700966299 8440356.252046827226877,1392390.313414259813726 8438926.748295878991485,1392328.531096868915483 8437559.063402319326997,1391802.769141852390021 8432029.371224015951157,1391308.065324768424034 8427557.476363323628902,1391091.437595683382824 8426067.448725873604417,1390844.085687140002847 8424516.290414357557893,1390287.599552664905787 8421662.146963227540255,1388927.052736188750714 8416763.838507022708654,1387257.149054801324382 8413912.699889324605465,1371857.989934893790632 8394482.590844752267003,1370373.655844656052068 8392814.178366977721453,1357200.997860107803717 8379787.753713391721249,1353985.089090580120683 8376828.816756505519152,1351418.506910850759596 8374917.427494057454169,1350274.365184477064759 8374609.228248851373792,1347769.787961118388921 8374362.056881656870246,1339637.23124172585085 8374424.625510917045176,1336761.514836061978713 8374980.000836350023746,1335617.373109691077843 8375410.040511824190617,1333607.499703416600823 8376644.380379218608141,1332277.677066401811317 8377013.479701342061162,1331040.917523687239736 8376828.816756505519152,1322011.570986464386806 8370850.411758496426046,1319445.100126223405823 8368940.571344335563481,1315346.650433689588681 8365553.168395509943366,1321300.462079274933785 8357925.129026426933706,1322599.003939380636439 8356204.102126813493669,1323217.495030226185918 8355159.064688304439187,1323712.198847313178703 8354174.802199393510818,1324299.743119720602408 8351963.567031463608146,1324573.700386561220512 8349253.909844690933824,1325042.02148432796821 8341708.294693175703287,1325072.85698327771388 8337722.014291639439762,1325011.074665889609605 8334961.742044786922634,1324794.6695757873822 8333492.077884848229587,1324299.743119720602408 8332143.818895165808499,1316724.006493274122477 8322650.315984182059765,1315858.163493884727359 8321978.135495819151402,1314868.644540222594514 8321549.434801522642374,1311529.05981642450206 8320631.75523523055017,1309580.968727540923283 8319652.303156823851168,1308715.125728151760995 8319040.514304433017969,1298680.786828047363088 8310221.890652493573725,1298850.883009977871552 8309381.271366118453443,1306797.981457709334791 8273850.847403174266219,1311683.57126964465715 8250903.719964100979269,1312549.525588524993509 8246238.76357180904597,1313229.79899676470086 8240123.970556987449527,1313446.092767375754192 8236311.560649147257209,1313384.31044998485595 8233590.57342291995883,1313044.229405611986294 8232260.3809421248734,1312711.495447629597038 8231710.829193741083145,1311869.140860797138885 8230324.398451366461813,1310179.978907500160858 8227554.271180015057325,1309642.751044931821525 8226276.484207552857697,1309024.259954086272046 8223920.930215204134583,1308498.72063804930076 8221142.976216249167919,1308096.634637305978686 8218185.532240428030491,1306828.816956659080461 8207934.963925297372043,1306828.816956659080461 8206910.641090733930469,1307138.173821573145688 8205825.082415699958801,1307601.819500727811828 8204802.568275529891253,1308220.421911067562178 8202633.95935208722949,1308343.986545846797526 8201429.811207370832562,1308127.581455744337291 8199923.545861738733947,1294274.427423976827413 8160779.588445977307856,1293686.883151569403708 8159820.795442577451468,1291302.530978267081082 8158628.727439641952515,1289729.029975905548781 8158084.590585833415389,1279803.004940340761095 8155512.061863555572927,1276061.445535287726671 8155272.090666252188385,1274700.787399323191494 8155332.836683896370232,1273402.022900237934664 8155632.050360911525786,1272598.184857219457626 8156350.298397602513433,1272134.205219593830407 8157306.921009879559278,1271948.635628441348672 8158204.620526304468513,1271825.070993659552187 8159462.357542122714221,1271577.719085115939379 8163174.739063873887062,1271608.554584065917879 8164553.448047610931098,1272291.833618557313457 8177715.895086596719921,1272659.967174610355869 8178345.738988350145519,1272876.483584201196209 8179784.964916164986789,1272567.126719287130982 8180866.728591240942478,1267465.020497760968283 8196855.609686990268528,1264960.443274402292445 8202873.728426730260253,1264156.382592401234433 8203596.551084148697555,1262022.721912367967889 8204620.417210702784359,1257724.565053348662332 8205042.407319684512913,1247149.324747479520738 8203536.927479106932878,1231657.213852760149166 8205644.641278378665447,1228286.793630012311041 8207572.465052176266909,1217927.847094754455611 8216133.98268860206008,1213413.173826141515747 8211249.253421084955335,1201972.090520880417898 8220781.570806651376188,1198323.260251659667119 8228150.066953111439943,1186572.931400975678116 8259455.322734517976642,1185861.711174297844991 8275006.605679006315768,1186541.984582534525543 8274458.692485944367945,1187778.744125246303156 8274580.617725018411875,1188490.075671415310353 8275432.399209126830101,1188922.997171111172065 8276586.652640288695693,1190005.245260602794588 8280419.836683508008718,1190314.602125516859815 8281698.443937689065933,1190314.602125516859815 8283097.803514971397817,1190168.216995125636458 8284703.032004872336984)) +POLYGON ((1350274.365184477064759 9621627.432495642453432,1337194.213696775492281 9626610.329781411215663,1334411.337746435077861 9627710.342685654759407,1333793.069294569082558 9628520.474195433780551,1346099.995599219342694 9655501.685094490647316,1346811.104506408795714 9656679.428551230579615,1352871.894182647345588 9661545.513653051108122,1353892.359954750863835 9662355.572644393891096,1354943.549906310159713 9663092.722554104402661,1356273.372543327510357 9663461.193776462227106,1357664.754858750849962 9662869.737828720360994,1359210.871266379486769 9660804.280033675953746,1363663.762217601295561 9654469.962635925039649,1364993.362215636530891 9652261.456212926656008,1370930.364618113497272 9637401.849980378523469,1371084.987390825059265 9635860.285462399944663,1370497.443118420429528 9634464.46808592043817,1369322.46589309675619 9632629.095152374356985,1367559.944395365659148 9630649.131976159289479,1365488.066032720496878 9629181.697308303788304,1360200.278900550678372 9625510.224840320646763,1357974.111723667709157 9624193.018761608749628,1353242.810725969960913 9621917.201845798641443,1350274.365184477064759 9621627.432495642453432)) +POLYGON ((1342853.140011253533885 9663902.694472588598728,1344770.172962204786018 9669511.876168416813016,1346532.694459932856262 9675417.257957411929965,1348357.220914034638554 9681624.375568361952901,1349470.415821967180818 9687023.981836896389723,1355221.959952783072367 9715345.388215564191341,1358066.61822051438503 9733721.014352833852172,1360602.476220787968487 9752588.282904785126448,1363075.995306211523712 9759315.681431772187352,1363663.762217601295561 9760736.822963988408446,1364560.440715940436348 9761784.2919229157269,1366075.610305127920583 9761932.096991622820497,1367281.534348892746493 9761184.488424276933074,1368271.0533025523182 9760284.879459911957383,1379928.764336898224428 9742814.418169615790248,1384752.571831442648545 9733721.014352833852172,1385309.057965917745605 9732526.520350566133857,1391802.769141852390021 9712374.965313961729407,1390658.516095987521112 9709552.771690655499697,1389761.948917139554396 9708590.56137702986598,1377423.964474556967616 9697982.132806871086359,1363075.995306211523712 9682290.614535296335816,1362643.296445500804111 9680661.994131591171026,1356768.076360411709175 9673348.108056439086795,1352933.676500038476661 9669880.684247927740216,1351913.322047426132485 9669065.771811535581946,1345388.775372541509569 9664863.047657648101449,1344213.686827726662159 9664271.47368591837585,1342853.140011253533885 9663902.694472588598728)) +POLYGON ((1384659.731376122217625 9839768.169062402099371,1388648.64268971583806 9845062.529256554320455,1389421.756553275743499 9846272.29784850217402,1389421.756553275743499 9847636.263380769640207,1386329.41241852985695 9848617.774726154282689,1384814.354148833546788 9848468.126904606819153,1382031.366879001958296 9847785.893387477844954,1383082.779469543602318 9856121.173847468569875,1386978.961647307965904 9868256.514219172298908,1387566.505919715389609 9869699.966680895537138,1388494.13123649568297 9870688.685078291222453,1392235.690641548484564 9874182.038137258961797,1395296.976638361811638 9876766.526332007721066,1397430.637318398104981 9878366.131992070004344,1399718.920771142700687 9879732.272961664944887,1402192.439856571843848 9880872.753670552745461,1404975.649765383219346 9881558.227036850526929,1406521.54353402950801 9881712.693771917372942,1432372.600964006735012 9882548.626252112910151,1434073.340144346700981 9882473.57448841072619,1435310.099687061272562 9881712.693771917372942,1436083.213550618384033 9880647.107168124988675,1436423.294594994047657 9879201.663815243169665,1435681.238869363674894 9877986.178774433210492,1433702.200962041737512 9876386.660155469551682,1428785.553012176882476 9874106.802679454907775,1426002.565742345061153 9873422.334042947739363,1423559.770836377516389 9872282.79610625654459,1412025.847075792960823 9865295.909934263676405,1410943.487666810164228 9864462.040274240076542,1401357.654995112214237 9855134.242474310100079,1398636.450042671523988 9852104.194832559674978,1396966.769000260857865 9849907.222979608923197,1396224.71327463327907 9848696.824960144236684,1395018.677911380073056 9845819.155035289004445,1390009.300825683167204 9841430.122662622481585,1387566.505919715389609 9840295.79106717929244,1384659.731376122217625 9839768.169062402099371)) +POLYGON ((1369260.683575705857947 9879656.977670777589083,1368394.84057631669566 9880342.33166291564703,1374053.432932317955419 9898164.332833582535386,1389421.756553275743499 9912971.252667993307114,1383732.106059339130297 9921077.673478182405233,1384103.245241644326597 9922380.853969532996416,1389452.814691208070144 9928655.284759363159537,1390380.440007988130674 9929652.393486626446247,1397461.472817347850651 9935861.887003114446998,1398543.720906839473173 9936704.0583555996418,1399966.272679686080664 9936089.326725782826543,1402872.824584299698472 9929883.767362577840686,1403243.963766604894772 9928503.635251875966787,1408995.396577929379418 9905565.925372080877423,1408686.262351995101199 9903733.679695511236787,1407913.148488437989727 9900984.016023462638259,1406985.523171657696366 9899995.116281701251864,1395049.624729821225628 9891837.716752590611577,1386762.445237714331597 9887344.298916537314653,1381196.470698051154613 9885897.468256479129195,1375073.898704421473667 9883004.158465487882495,1369260.683575705857947 9879656.977670777589083)) +POLYGON ((1423281.472109392751008 9935246.953650664538145,1422261.006337292259559 9936164.957598207518458,1415458.160935423104092 9943147.510203581303358,1415519.943252814002335 9944914.417259149253368,1417839.17352 9948596.682788571342826,1420436.479883190477267 9951825.241871073842049,1422292.064475221792236 9953822.370345009490848,1424456.449334716424346 9955439.750072682276368,1429311.314967193175107 9955667.829715630039573,1432217.978191295173019 9954438.945158580318093,1432774.464325770270079 9953210.000632960349321,1433393.066736110020429 9950981.241218423470855,1432527.11241722968407 9945374.041266536340117,1431630.322599396575242 9941996.525858150795102,1430702.697282616514713 9940997.649842681363225,1424518.231652107322589 9935781.843235213309526,1423281.472109392751008 9935246.953650664538145)) +POLYGON ((1439453.633773366454989 9939080.131802428513765,1439608.145226589404047 9940230.634553467854857,1440226.747636926360428 9941613.09081101976335,1440999.750180995091796 9942839.715164288878441,1443473.603224894963205 9946373.544830292463303,1445328.853858455317095 9948369.111022921279073,1449657.957535915775225 9951517.339914852753282,1456058.939576018368825 9954206.477868774905801,1462645.268568293889984 9954286.733556365594268,1464500.519201854243875 9953978.44606402143836,1464778.929248327156529 9953210.000632960349321,1462088.55979483621195 9950905.172763876616955,1456862.777619036845863 9947141.236584667116404,1446936.86390296346508 9940230.634553467854857,1445669.046222319360822 9939619.734263449907303,1439453.633773366454989 9939080.131802428513765)) +POLYGON ((1576778.693449839018285 10155423.993298880755901,1575294.359359601279721 10162787.06454049050808,1574954.166995737235993 10164292.964358385652304,1572882.511272074654698 10169600.44807836599648,1572109.397408514749259 10170711.253969307988882,1568460.678458785172552 10174995.134292142465711,1567409.154548752121627 10175949.658166959881783,1565492.121597800869495 10176267.957274215295911,1562430.835600984515622 10175788.514107249677181,1560637.367284815292805 10175949.658166959881783,1558936.628104475094005 10176425.112138284370303,1557854.380014983704314 10176978.611394403502345,1557483.240832678508013 10178487.600188666954637,1558163.514240915188566 10179918.299456080421805,1564997.417780713876709 10189534.949384592473507,1581633.447762824594975 10195421.668748587369919,1587168.364164555445313 10194066.25438604876399,1581633.447762824594975 10158115.154511539265513,1580798.440262385178357 10156849.936361663043499,1579839.979446655139327 10155897.7556,1578386.592174858553335 10155502.334200410172343,1576778.693449839018285 10155423.993298880755901)) +POLYGON ((1583674.156668046023697 10258344.632559154182673,1582591.908578554634005 10258905.014485811814666,1583024.830078250495717 10260272.907329654321074,1587446.774211031384766 10268150.64442116767168,1588281.559072491014376 10269436.382270961999893,1591095.604480252135545 10272733.771699836477637,1595053.457655916223302 10276921.867815218865871,1597712.880290968809277 10278050.044570725411177,1599166.267562765395269 10278373.077450441196561,1600217.457514327485114 10277404.31407031416893,1600310.297969647916034 10275793.875287417322397,1599258.996698597446084 10269918.306030914187431,1598424.211837137816474 10266220.17037395387888,1597898.449882121291012 10264449.113532921299338,1597063.553701170487329 10263243.873581476509571,1594837.16388530516997 10261958.998121505603194,1586642.713529030326754 10258984.535726642236114,1583674.156668046023697 10258344.632559154182673)) +POLYGON ((1685778.953971925424412 10416851.111991845071316,1671029.121441816212609 10418575.923809131607413,1667194.721581442747265 10419068.087814293801785,1665432.311403203057125 10419646.122103929519653,1662989.51649723527953 10423178.720566095784307,1662185.344495745841414 10424412.537343766540289,1662494.701360659906641 10425976.301773423328996,1665277.688630491495132 10432068.269017525017262,1666143.53162988089025 10433389.687343910336494,1674059.460620191413909 10434543.763562148436904,1679810.893431515898556 10433222.123620243743062,1703590.072498848196119 10423346.0399,1703033.586364373099059 10422604.831238713115454,1699446.538412543246523 10420219.764791900292039,1695148.381553523940966 10418327.339611150324345,1692303.500646810047328 10417424.52179984562099,1685778.953971925424412 10416851.111991845071316)) +POLYGON ((3355633.098188420757651 10997839.069959297776222,3352448.247556825634092 10998379.893566349521279,3351891.538783368188888 10999810.271790826693177,3352509.80723523395136 11001688.583578066900373,3353623.224782146513462 11003119.658377850428224,3354952.824780181515962 11002318.025979872792959,3356096.855187064036727 11001064.03322290815413,3356653.563960521481931 10999628.558406218886375,3356900.693230082746595 10998021.057613966986537,3355633.098188420757651 10997839.069959297776222)) +POLYGON ((3316578.435955451335758 10989258.329015284776688,3309590.020962432492524 10990863.758631829172373,3307982.233556907158345 10991668.868279501795769,3308013.291694836691022 10993279.695577975362539,3313988.031404691748321 11004366.615141848102212,3318271.716729910112917 11010999.188197031617165,3318447.712844853289425 11024961.571471516042948,3319732.339768608566374 11036693.466949382796884,3320752.805540709290653 11038404.1117939427495,3321989.787722403183579 11039571.031724197790027,3325700.400309015065432 11038582.004711631685495,3327710.273715289775282 11037682.218959510326385,3337141.706253258977085 11033273.793073333799839,3339893.858024140354246 11031298.03948331810534,3344934.070608787238598 11012801.507150871679187,3344315.802156921476126 11006612.875092485919595,3335131.832846984267235 11000080.5955,3321618.648540101014078 10990863.758631829172373,3320289.048542066011578 10990063.570266602560878,3316578.435955451335758 10989258.329015284776688)) +POLYGON ((2653856.215233678929508 11237235.801822742447257,2649960.033055914565921 11237790.721011405810714,2646218.473650861531496 11238809.247956773266196,2644641.744383265729994 11239832.9353,2643775.901383876334876 11240851.769723454490304,2641332.883838926441967 11245025.184230230748653,2639879.719206111971289 11247900.684168718755245,2639168.498979434370995 11249389.701790118589997,2638735.688799229450524 11250965.977665144950151,2630788.367712515871972 11297285.264452375471592,2630942.990485227201134 11299247.872175835072994,2637035.060938380658627 11313856.541785130277276,2638055.415390990208834 11315545.477094668895006,2639075.881163093727082 11316385.376686200499535,2642724.488793332129717 11316385.376686200499535,2650300.225419778376818 11315731.137227045372128,2652341.045644491445273 11315355.096366358920932,2653516.134189306292683 11314417.785796517506242,2668730.057676532305777 11301308.398609358817339,2675099.758939723018557 11295785.32621056959033,2676120.224711823742837 11294383.642669284716249,2685242.523023860994726 11273574.009951518848538,2685675.333204065915197 11271987.425476431846619,2685366.198978131171316 11268262.595574129372835,2685180.518067490309477 11266401.117347702383995,2684469.297840809915215 11264259.07413768209517,2683417.885250268038362 11262587.592489195987582,2666410.604766364209354 11240943.245330264791846,2664957.440133546944708 11240199.791460197418928,2660504.549182325135916 11238345.685718040913343,2657319.698550729546696 11237510.753086131066084,2653856.215233678929508 11237235.801822742447257)) +POLYGON ((2676800.498120062984526 11370998.88892942853272,2674605.055122635792941 11371757.21504901535809,2661587.019910799339414 11385477.612077414989471,2658247.546506492421031 11398188.090636108070612,2658402.169279203750193 11400086.594726,2663133.136318427976221 11407590.828289208933711,2664339.171681681182235 11408922.434563044458628,2668761.00449497345835 11411110.864420393481851,2670399.738718939945102 11411487.141870975494385,2678655.860073114745319 11410442.244821835309267,2680418.492890334222466 11409872.960460346192122,2696436.365740069653839 11400467.0433,2698817.378328646533191 11385857.578845718875527,2690344.295286916196346 11376958.196923479437828,2681933.6624795217067 11372416.90553929284215,2678563.242256773635745 11371186.080006416887045,2676800.498120062984526 11370998.88892942853272)) +POLYGON ((2848140.118764343671501 11375726.542986260727048,2844429.060899769887328 11376292.953260505571961,2842975.896266953088343 11377051.874493379145861,2841677.354406850412488 11378283.770354118198156,2840687.501494716852903 11379703.318593572825193,2829370.094143729191273 11396191.393014257773757,2830607.076325423084199 11397427.130182387307286,2832091.299096169881523 11398188.090636108070612,2841058.640677021816373 11402366.188989348709583,2844181.931630209088326 11403409.493630580604076,2845418.913811902981251 11404740.274617558345199,2845294.903899159282446 11406447.314609987661242,2844027.308857497293502 11407684.589954944327474,2842141.000086004845798 11408634.941412,2834503.258503187447786 11410917.769311549142003,2831379.96755 11409872.960460346192122,2826896.575058302842081 11407778.695127060636878,2824175.370105859357864 11405784.288649288937449,2821206.59060589550063 11404359.584935,2817217.901931281201541 11405022.128799406811595,2815949.861611654981971 11406259.484850097447634,2815238.641384976916015 11407778.695127060636878,2814836.889342701993883 11409397.509624755010009,2815764.292020502500236 11416723.993808778002858,2817929.233477450441569 11426152.283578742295504,2818702.013382536824793 11427581.942233502864838,2820186.236153283156455 11428346.656070651486516,2826463.430919624399394 11430536.249195670709014,2839883.552132206968963 11433114.34393410757184,2847933.955067395232618 11433971.408712275326252,2851541.485805532895029 11439029.10665138438344,2857973.303344588261098 11449734.021185971796513,2870342.011966629419476 11455379.412517977878451,2872104.310825378168374 11454711.557405287399888,2872784.695553105790168 11453181.736319568008184,2871918.741234222427011 11445526.823153922334313,2871424.037417138461024 11443426.616597896441817,2875165.70814168266952 11436071.076632166281343,2881164.715500530321151 11433397.386544864624739,2882185.069953142665327 11433497.003882938995957,2883576.674907551147044 11434451.000312399119139,2888307.753266263287514 11438457.403806621208787,2891987.30771494563669 11441610.795755106955767,2893069.778443417046219 11443137.992563340812922,2894708.512667386326939 11443521.221920603886247,2896471.256804096978158 11442854.540700562298298,2897460.664438268169761 11441516.217240286991,2898543.023847251199186 11438362.869522949680686,2899284.968253387603909 11435022.707079326733947,2899377.920028201770037 11433303.26668812148273,2898852.26939267385751 11431206.864202568307519,2897893.363298981916159 11429299.923973079770803,2896811.337848470080644 11427770.366809776052833,2895574.355666775722057 11426435.034070542082191,2890100.998943453188986 11422530.077221,2885864.735721313394606 11419861.750177832320333,2886328.826678432989866 11403790.471696188673377,2887596.421720094513148 11402553.910367770120502,2889482.730491586960852 11401604.415224803611636,2896996.907439622562379 11401035.876238197088242,2900552.897253522649407 11401129.546833153814077,2901913.555389489978552 11402173.00213267840445,2902995.580840002279729 11403696.764144290238619,2904480.137569219339639 11407684.589954944327474,2905438.487065458204597 11409585.76908652856946,2906520.957793932408094 11411110.864420393481851,2910231.570380544289947 11415009.212629625573754,2912952.775332987774163 11416912.115226378664374,2914467.833602684084326 11417576.236072074621916,2916261.19059936190024 11417675.61994612775743,2917683.742372208740562 11416912.115226378664374,2918673.150006379932165 11415485.059241721406579,2918765.767822720576078 11413770.593009259551764,2918085.494414484128356 11407972.04260060749948,2917559.732459464576095 11405972.105176931247115,2916601.271643734537065 11404072.286192780360579,2914003.742645564489067 11401792.115405170246959,2903644.796110306400806 11393538.926956763491035,2902284.249293833039701 11392590.358257975429296,2885370.031904228962958 11389173.816421872004867,2883607.733045480679721 11389079.970420178025961,2876835.389184090308845 11389647.502708125859499,2863198.974200896453112 11386997.2663963008672,2852623.511256044730544 11377717.19297431409359,2851262.964439568575472 11376771.186318466439843,2849778.74166882224381 11376105.961088605225086,2848140.118764343671501 11375726.542986260727048)) +POLYGON ((2757259.888356134761125 11409872.960460346192122,2753765.792179113719612 11411868.576471919193864,2746004.040683552622795 11417293.856781279668212,2744705.49882344994694 11418527.982485892251134,2743685.03305134922266 11419861.750177832320333,2742973.812824668362737 11421389.51423216983676,2742850.136870398186147 11423100.774048302322626,2743035.706461550667882 11425005.961623132228851,2743808.597686128225178 11427293.995721494778991,2752528.809997419361025 11436548.411962674930692,2753889.356813895516098 11437597.362537713721395,2755528.091037862468511 11438074.462209038436413,2757445.45794728724286 11437885.749440986663103,2766134.612120646052063 11434251.738914657384157,2766691.320894103962928 11433109.191569508984685,2766011.047485864255577 11427576.794094938784838,2762361.994577661156654 11413770.593009259551764,2761589.103353083599359 11411586.436054671183228,2760661.255397320725024 11410442.244821835309267,2757259.888356134761125 11409872.960460346192122)) +POLYGON ((1424580.236608478007838 10389862.035747984424233,1423219.689792001852766 10390271.101850865408778,1423281.472109392751008 10392155.831087350845337,1435526.616096652112901 10432728.946462020277977,1440257.694455367513001 10447242.182042604312301,1440907.021045165834948 10448811.441344901919365,1453245.005487745627761 10477358.290916906669736,1454760.175076933111995 10477686.32677242718637,1458718.139572088373825 10475199.733829034492373,1463572.893885073950514 10471968.089527159929276,1464500.519201854243875 10471139.615660976618528,1462428.640839209081605 10434869.466967122629285,1462119.506613277364522 10432896.201621549203992,1448266.352581507293507 10410443.29718542098999,1429558.666875733993948 10390356.572620516642928,1424580.236608478007838 10389862.035747984424233)) +POLYGON ((1738130.061463204678148 10439736.98002047277987,1727183.570655539399013 10441055.418443609029055,1725884.806156454142183 10441961.341871770098805,1725328.320021979045123 10443366.338138582184911,1725884.806156454142183 10445097.809354327619076,1727492.816200962290168 10447904.318256407976151,1728668.01606526831165 10448729.700251799076796,1731574.456650387728587 10449555.181296611204743,1737480.734873409150168 10451124.671078607439995,1738995.904462593840435 10451455.9181346911937,1742366.32468534167856 10451619.4661003947258,1749014.658633990678936 10451537.691631454974413,1752539.701629450079054 10451455.9181346911937,1764537.493708165828139 10451043.199830440804362,1766052.663297353545204 10450380.761416561901569,1769887.063157729571685 10447736.400662133470178,1771958.718881392385811 10445591.873933916911483,1772515.427654847037047 10444272.565939104184508,1772577.20997223793529 10442536.847816679626703,1770350.82015637261793 10440724.671802366152406,1765774.364570371806622 10439818.614332517609,1744531.043503310298547 10440561.679530600085855,1738130.061463204678148 10439736.98002047277987)) +POLYGON ((1473777.217647620476782 10442622.969978429377079,1472231.101239991839975 10452113.99933335185051,1471241.693605820881203 10456412.553429031744599,1470623.202514975098893 10457733.894583595916629,1469015.192470466950908 10457983.906605677679181,1468520.488653379958123 10456244.427997538819909,1468365.754561177454889 10452526.781896026805043,1467716.427971381926909 10448480.321609936654568,1466788.802654601633549 10447822.587941873818636,1465922.959655209677294 10448974.629196031019092,1465304.579883852507919 10450380.761416561901569,1465180.792610090924427 10452032.218984808772802,1465057.005336329340935 10459055.787342699244618,1465366.362201243406162 10461122.628306576982141,1479621.490914268419147 10490300.562887400388718,1480456.387095216661692 10491632.92067595012486,1481631.364320540102199 10492463.569370616227388,1483146.533909727819264 10492879.080950897186995,1486949.875632171519101 10492048.382030932232738,1490073.166585355531424 10490715.644636604934931,1491402.766583390766755 10489885.207185162231326,1493938.401944681769237 10486318.188883678987622,1495762.817079292144626 10482333.640711711719632,1495917.439852003473788 10480592.769394971430302,1489733.085540982894599 10455504.427389269694686,1485063.789499658625573 10451124.671078607439995,1476281.79487097915262 10444023.348819373175502,1475106.817645655712113 10443198.531274827197194,1473777.217647620476782 10442622.969978429377079)) +POLYGON ((1505163.191479328786954 10458728.63912944868207,1503153.095434074755758 10459055.787342699244618,1501637.925844889832661 10459968.848349951207638,1499875.404347158735618 10461867.998638704419136,1498205.723304751096293 10464267.54982702434063,1497587.120894411345944 10465590.699262199923396,1497215.981712106382474 10467082.191823836416006,1498731.373940276214853 10472464.088360397145152,1499380.700530074769631 10474038.816079774871469,1506090.816796111874282 10484571.826287258416414,1506832.872521739453077 10507767.014665029942989,1506647.302930586971343 10515433.641566829755902,1505008.568706617457792 10515768.002578914165497,1504421.024434210034087 10517101.106280397623777,1509894.158518552780151 10524943.167470039799809,1510914.624290656298399 10526030.354230981320143,1520593.186098186299205 10532629.30556415207684,1522448.548051237827167 10532464.119059234857559,1536641.783127380767837 10527365.151199780404568,1546073.104345858562738 10522609.468421224504709,1548484.841113894013688 10520771.254756858572364,1553154.137155218282714 10518686.098332282155752,1554947.605471387505531 10518186.751839395612478,1558843.787649151869118 10517687.441651811823249,1561224.800237731542438 10519355.153432488441467,1561657.721737424610183 10521105.875749235972762,1561750.562192748067901 10523691.477745588868856,1562770.916645357385278 10524778.165780363604426,1563884.222872781334445 10525195.636746468022466,1565584.962053121300414 10525360.648468429222703,1568955.382275869138539 10524108.582130217924714,1572635.15936353104189 10521357.903581213206053,1573253.427815397270024 10520019.768654527142644,1573593.620179261080921 10518521.246918566524982,1573500.779723940650001 10516601.574826499447227,1572789.782136242603883 10515099.59695459716022,1562832.69896274828352 10499862.177296401932836,1561657.721737424610183 10499030.334340045228601,1559616.901512711774558 10499363.897857505828142,1551515.180292269214988 10498281.222879713401198,1542918.977893721777946 10494372.018839253112674,1540290.613396601518616 10487563.086774045601487,1541496.648759854724631 10484822.517389636486769,1541620.213394636753947 10483163.166134567931294,1541527.372939316323027 10481253.34663974493742,1541187.291894940659404 10479262.251356530934572,1540166.826122840167955 10478187.216085337102413,1526004.537865138147026 10466918.275718504562974,1524829.560639814706519 10466090.708070775493979,1523469.013823338551447 10465426.818708568811417,1518923.50505577865988 10466836.617153389379382,1516697.115239913342521 10471968.089527159929276,1509708.588927400298417 10468819.346614981070161,1505163.191479328786954 10458728.63912944868207)) +POLYGON ((1653836.605325230397284 10509848.858226647600532,1651826.509279976366088 10510182.947470139712095,1650775.208008925896138 10511267.499950714409351,1649940.200508486479521 10512434.724919114261866,1649600.008144622668624 10513931.919062197208405,1649507.501647772965953 10515685.761466788128018,1649631.06628255196847 10517517.810553262010217,1650002.20546485716477 10519520.024865444749594,1649909.365009536733851 10521270.789220202714205,1650435.126964553026482 10523026.507084827870131,1651331.80546289216727 10524361.020721832290292,1652506.782688215840608 10525195.636746468022466,1656681.263592961942777 10529457.456480672582984,1659093.334319470915943 10531040.791287431493402,1660453.881135947071016 10530623.265582542866468,1661288.777316895313561 10529370.239300513640046,1662339.967268457170576 10528370.027680912986398,1663174.863449405413121 10527117.412512024864554,1663514.944493780843914 10525612.832513345405459,1662649.324133371468633 10524278.376113491132855,1661288.777316895313561 10523691.477745588868856,1661195.936861574649811 10522274.774154298007488,1661783.481133982073516 10520940.966238575056195,1661659.693860220722854 10519020.617734601721168,1660948.584953031269833 10517517.810553262010217,1660082.741953642107546 10516184.926141126081347,1659031.329363100463524 10515099.59695459716022,1658165.597683199681342 10513849.399864926934242,1657454.377456521848217 10512265.223503597080708,1656588.53445713268593 10511015.842123594135046,1655382.499093876685947 10510182.947470139712095,1653836.605325230397284 10509848.858226647600532)) +POLYGON ((1579437.893445909023285 10518269.323167597874999,1577458.966858078492805 10519103.199089469388127,1576407.554267533821985 10520106.566805360838771,1564595.220460479380563 10532799.31039784103632,1564007.78750756313093 10534217.886523747816682,1563884.222872781334445 10535889.919700844213367,1563976.95200861338526 10537731.88504771515727,1566141.448187596397474 10542834.041545635089278,1571243.554409125586972 10543252.310632359236479,1573253.427815397270024 10542834.041545635089278,1582313.832490552449599 10537061.337997365742922,1583983.513532960088924 10534635.931884823367,1584942.196987672708929 10531793.785474099218845,1585313.113530995324254 10530292.692275058478117,1585653.194575370755047 10528705.019192766398191,1585776.981849132338539 10527034.734720872715116,1585251.331213607219979 10525195.636746468022466,1583179.45285096205771 10520606.353281604126096,1582313.832490552449599 10519272.569047808647156,1581138.521306757815182 10518438.672561338171363,1579437.893445909023285 10518269.323167597874999)) +POLYGON ((1553803.575064504984766 10522526.844890916720033,1546165.833481687819585 10532881.75673570483923,1545485.560073451139033 10537396.753884298726916,1549412.57775016524829 10541997.278531145304441,1550587.554975488921627 10542834.041545635089278,1554174.602927318774164 10542834.041545635089278,1555473.367426406824961 10541997.278531145304441,1556555.615515898447484 10540912.380496598780155,1557421.458515287609771 10539740.304881889373064,1558008.891468203859404 10538398.281606320291758,1558380.030650508822873 10536813.24917826987803,1558503.706604779232293 10535136.476124944165349,1558256.354696238646284 10526365.231608686968684,1557885.104194442275912 10524361.020721832290292,1556864.749741830164567 10523274.098215594887733,1555504.091605865396559 10522691.792491065338254,1553803.575064504984766 10522526.844890916720033)) +POLYGON ((1581385.984534789808095 10491464.230794722214341,1580705.59980706195347 10492381.606770183891058,1580953.174354587914422 10506769.944221876561642,1581478.71367062185891 10508517.161247845739126,1592394.368979337392375 10538232.956227257847786,1593785.751294763293117 10541330.532492619007826,1594806.105747375637293 10542415.496627528220415,1596506.844927712809294 10542498.359865786507726,1598053.072654832853004 10541831.565153019502759,1599135.209424833068624 10540825.017662659287453,1599722.753697240492329 10539404.774464206770062,1600093.892879545688629 10537897.499479815363884,1604515.725692835170776 10534553.163503492251039,1612246.307730975793675 10535471.798,1613606.854547448921949 10536059.704260462895036,1614317.963454638374969 10537649.380439905449748,1614441.750728399958462 10539487.300173494964838,1611380.464731583604589 10548027.145481275394559,1610700.191323346924037 10549030.225694166496396,1606463.816781718749553 10553555.861620835959911,1612493.659639516379684 10561273.824124421924353,1618832.636723251314834 10567154.638180587440729,1625882.945353152230382 10572361.649665651842952,1628325.740259120007977 10574042.701652424409986,1629686.287075593369082 10574633.92210896499455,1642951.896834956016392 10575557.938576832413673,1644745.476470616646111 10575054.437104016542435,1645889.395558007992804 10574379.930220676586032,1648054.114375973585993 10572278.424990544095635,1647868.544784823898226 10566815.647892309352756,1648220.982292675413191 10566010.424115564674139,1648443.73259375244379 10565101.599370280280709,1648499.392339148325846 10564045.385497279465199,1648425.030919298995286 10562936.143,1647367.495756762102246 10561375.346688168123364,1644862.807213915046304 10558807.831172162666917,1643805.383370866533369 10557197.242651278153062,1642209.841109328437597 10552298.64228449575603,1642333.405744107440114 10550539.947784766554832,1646526.365684327669442 10555651.336658073589206,1647342.782829807372764 10556006.079213790595531,1653873.563396175624803 10560485.564620168879628,1654355.910749783739448 10560987.997832218185067,1654430.272169633070007 10562147.692519901320338,1653613.855024153366685 10565825.988864094018936,1653687.882485531736165 10566933.279555626213551,1658196.433182149427012 10575641.203055556863546,1660701.233044490683824 10576652.871528109535575,1685902.741245687007904 10582458.997080186381936,1687448.635014333296567 10582796.639763792976737,1688592.888060198165476 10582204.715226028114557,1687170.558926331112161 10579093.178153246641159,1682501.262885009637102 10570260.762622762471437,1673626.539120495319366 10554647.288213811814785,1672729.860622156411409 10553307.175863390788436,1652259.4307796722278 10530458.127336513251066,1648981.73969275644049 10527452.342913087457418,1645518.479014685377479 10524778.165780363604426,1644343.279150382149965 10523943.600493943318725,1617750.388633756898344 10506852.07865015976131,1615029.295000807382166 10505685.801852939650416,1602196.495421649422497 10501690.010376501828432,1585282.278032045345753 10493458.864797094836831,1581385.984534789808095 10491464.230794722214341)) +POLYGON ((1794593.644902859581634 10559766.572072230279446,1793696.743765537859872 10560517.890845,1791625.310680857859552 10565890.389462240040302,1791810.434994048206136 10567740.728704657405615,1796758.141081845387816 10590714.487900752574205,1797531.366264893906191 10592228.860889790579677,1801148.915757202776149 10597459.510088417679071,1805107.102891340386122 10602100.508605567738414,1807271.599070323631167 10604211.175530070438981,1817506.869651311077178 10607422.35022478736937,1819238.666969583602622 10607506.002591209486127,1822578.140373890288174 10606155.21779901906848,1823876.68223399319686 10605227.068768672645092,1825639.426370703848079 10603538.354578245431185,1827247.547734705964103 10601089.637241508811712,1832504.276728946482763 10588691.394834231585264,1833060.540224438998848 10587344.615277273580432,1832874.970633286517113 10585405.596041567623615,1826257.694822572637349 10570260.762622762471437,1825021.157918840646744 10569503.838453322649002,1823474.930191720603034 10569166.849527774378657,1820042.50501260231249 10569000.781182801350951,1816146.322834837948903 10569674.456753620877862,1814445.583654497750103 10569587.029470294713974,1811353.350839240476489 10569000.781182801350951,1803746.55607486423105 10567154.638180587440729,1802386.009258388075978 10566564.062005147337914,1794593.644902859581634 10559766.572072230279446)) +POLYGON ((1836898.947586482623592 10613161.749215358868241,1821712.186055009951815 10614188.409358249977231,1820011.558194161159918 10614100.108104577288032,1807055.416619203751907 10612409.206383621320128,1805818.434437509393319 10611563.911957617849112,1795985.249857268063352 10602355.529470110312104,1790326.323542790021747 10596449.322844956070185,1789151.34631746634841 10592905.125841313973069,1786677.715912548825145 10585993.248372975736856,1776690.019879087107256 10561107.946739470586181,1775793.118741765618324 10559849.34300678409636,1773659.458061729557812 10557665.008236143738031,1771216.663155764807016 10556075.218409130349755,1768124.541659998707473 10555485.595145925879478,1766578.425252369837835 10556158.246747769415379,1766609.149431828642264 10566730.071368776261806,1765032.308844743994996 10576565.355249226093292,1757580.025533588137478 10563962.261657290160656,1747406.759908971143886 10549117.693035023286939,1735347.074193373089656 10538232.956227257847786,1729069.879427032079548 10546016.601142950356007,1727771.114927946822718 10546853.854353534057736,1717226.598801536252722 10546853.854353534057736,1710331.135583326220512 10544006.645616902038455,1708630.396402986254543 10543840.883718753233552,1707084.279995360411704 10544595.283397143706679,1706280.219313359353691 10545850.790694113820791,1705630.892723563825712 10548864.644022380933166,1705538.163587731774896 10550622.90917463041842,1712959.500080446479842 10560517.890845,1718711.044211262371391 10565138.482129037380219,1725575.671930519631132 10570934.864530785009265,1727338.193428250728175 10573539.311398327350616,1733275.195830727927387 10585322.51613243855536,1735378.132331302622333 10590631.343640085309744,1732997.119742725742981 10597881.427303075790405,1731945.595832692924887 10598979.931154182180762,1730152.127516523469239 10599485.19266365468502,1729811.935152659658343 10597881.427303075790405,1730152.127516523469239 10596361.249833844602108,1730739.671788930892944 10594929.46288151293993,1731543.732470929156989 10593748.122190026566386,1732193.059060727478936 10590631.343640085309744,1732038.436288016149774 10588774.818935122340918,1731481.72751455870457 10586923.345989802852273,1726688.866838455200195 10580859.208974337205291,1718896.613802414853126 10571438.063670266419649,1717845.089892382035032 10570343.962820325046778,1716608.330349667463452 10569503.838453322649002,1708011.905312140472233 10565470.738214641809464,1698395.125821998575702 10556241.276091100648046,1694777.242371218977496 10550539.947784766554832,1695581.414372708415613 10549366.227011807262897,1695426.568961014505476 10547525.6603,1691747.014512334950268 10542498.359865786507726,1682191.906020092777908 10531128.02969204634428,1681140.71606853348203 10530040.336286937817931,1672822.701077476842329 10521522.823104849085212,1671462.042941512307152 10520940.966238575056195,1669915.926533883670345 10520606.353281604126096,1668308.027808866696432 10520940.966238575056195,1668122.458217714214697 10525612.832513345405459,1669235.653125646989793 10535889.919700844213367,1669792.361899104434997 10537649.380439905449748,1679161.678161211777478 10556075.218409130349755,1696910.90305125224404 10589029.34455556049943,1706372.948449191404507 10591895.305930625647306,1707177.120450680842623 10592738.178112609311938,1699013.61691284715198 10603283.289702342823148,1697467.500505218515173 10603960.646138461306691,1694035.18664559116587 10603788.868534544482827,1691097.465283556841314 10602861.039871301501989,1690015.217194062424824 10603960.646138461306691,1690571.925967520102859 10605733.095121055841446,1693540.482828504173085 10614523.050988011062145,1694591.672780066262931 10615624.225613692775369,1708661.231901936000213 10623328.870045825839043,1710052.83685634448193 10623919.783026657998562,1720813.646753366105258 10645043.150679750367999,1719453.099936889950186 10651248.570228541269898,1718463.692302721785381 10656010.105063028633595,1718278.122711569303647 10659418.834753600880504,1719484.046755331102759 10665632.702308379113674,1720071.591027738526464 10667425.788020567968488,1721215.621434621047229 10667851.730261178687215,1735470.638828152092174 10667168.026052156463265,1737356.947599644772708 10666999.56543960608542,1739181.47405374632217 10666489.299303911626339,1740480.015913852024823 10665548.336985182017088,1742397.382823274005204 10663250.318767169490457,1744871.124547682935372 10659503.124564617872238,1747344.754952600458637 10657969.212425077334046,1749231.063724093139172 10657800.6716095097363,1743541.301910665351897 10667936.123981084674597,1742706.517049208516255 10669214.739424267783761,1741655.215778155252337 10670240.321123320609331,1738099.003325272351503 10670750.867002364248037,1732718.709696252830327 10670750.867002364248037,1730987.023697471711785 10670666.745577808469534,1729595.641382048372179 10670067.180116923525929,1728358.659200351452455 10669214.739424267783761,1726472.350428861565888 10669383.25456939637661,1725142.750430826563388 10670324.744301898404956,1721246.568253062199801 10674504.533062869682908,1720411.672072111396119 10675699.885837137699127,1720071.591027738526464 10677317.369865637272596,1720442.730210043722764 10690135.554776590317488,1720937.434027127688751 10691502.702546246349812,1739861.747461986029521 10732690.284969350323081,1740603.803187613608316 10734236.089367624372244,1743108.380410972284153 10735957.366165477782488,1745953.372637174557894 10737078.567653365433216,1766609.149431828642264 10739661.719852697104216,1768526.516341253416613 10739491.464066565036774,1769856.116339288651943 10738540.404583709314466,1770954.617074435111135 10737348.278619984164834,1773102.971927254460752 10717301.204461155459285,1773195.701063086511567 10715584.618481121957302,1767289.534159556496888 10686547.16808502189815,1766701.989887151867151 10684749.065651010721922,1774401.736426339717582 10684495.572447882965207,1776287.822558849817142 10684321.762754512950778,1778916.187055970076472 10682444.5918,1779256.379419836914167 10680905.529836293309927,1779720.247737971134484 10675868.560748780146241,1779782.030055362032726 10674162.339949127286673,1777463.022423155838624 10661715.566823510453105,1777122.941378783201799 10660096.860745389014482,1775947.630194985773414 10656435.643906254321337,1774463.518743730615824 10653290.222455380484462,1773566.617606409126893 10652014.577732982113957,1765959.934161524288356 10641986.725857548415661,1764877.686072032665834 10640965.061937924474478,1760177.443212267244235 10639948.44058738835156,1758940.683669552672654 10639099.741534730419517,1756807.02298951940611 10636978.301160890609026,1755910.344491180265322 10635705.996634459123015,1755168.066126570338383 10634093.426817325875163,1754580.521854162914678 10632309.047756467014551,1752261.514221956720576 10606999.845328686758876,1752106.780129753984511 10605143.748300172388554,1753158.192720295628533 10605143.748300172388554,1759064.24830433470197 10612241.782930504530668,1759806.526668944628909 10613765.487128043547273,1760394.070941349258646 10615624.225613692775369,1760795.934303113026544 10617655.285009821876884,1760950.557075827149674 10619514.774376075714827,1760301.230486028827727 10622649.59652516245842,1759899.255804773885757 10625953.303416864946485,1759837.250848403433338 10627647.551392445340753,1760239.225529658142477 10629682.178798159584403,1760981.503894265508279 10631209.767023976892233,1762960.430482098832726 10633669.274073947221041,1764042.789891081629321 10634685.269138487055898,1778483.265556277008727 10647764.65429756604135,1791223.224680111510679 10668104.607647115364671,1794067.882947843056172 10682787.199381079524755,1793233.09808638622053 10684068.285382458940148,1791841.493131977738813 10686716.110617579892278,1790975.650132588576525 10689707.915325451642275,1790821.027359877014533 10693218.182059152051806,1792181.685495841549709 10696551.199439913034439,1794346.515633298549801 10698695.812388869002461,1801025.351122423540801 10704860.617788573727012,1803839.507849676068872 10705976.42177751660347,1820599.213786059757695 10706574.513349551707506,1829690.120001691160724 10703575.323693323880434,1830772.59073016513139 10702464.537971520796418,1835689.127360541839153 10692188.842727597802877,1841718.747579356888309 10677917.570898750796914,1844347.334715459495783 10657118.276937607675791,1844007.253671086858958 10643512.474284483119845,1843790.625942002050579 10641562.389721475541592,1843357.927081288537011 10639523.925105810165405,1842770.160169901326299 10637738.130888,1840914.909536341205239 10635109.179384211078286,1839832.438807867001742 10634093.426817325875163,1837822.565401592524722 10631717.410709653049707,1835998.261586473323405 10629090.768582826480269,1835411.051272539654747 10627307.692041978240013,1835225.481681387173012 10625445.781697515398264,1836898.947586482623592 10613161.749215358868241)) +POLYGON ((1872981.045456797583029 10664270.406215300783515,1871682.503596692113206 10665206.591368276625872,1871620.498640321427956 10666915.490109354257584,1874558.220002355752513 10678344.474024813622236,1889184.48789768316783 10702549.3597327824682,1891070.796669175848365 10705204.349945763126016,1892492.903164060320705 10705717.511876832693815,1893884.508118466008455 10705204.349945763126016,1908850.857058168854564 10681074.333119096234441,1908881.915196098387241 10679366.813956806436181,1908201.530468370532617 10678259.951852912083268,1905387.373741118237376 10674330.976966388523579,1903037.419290470890701 10672456.544447790831327,1901614.867517624050379 10671945.56424599699676,1895770.816889958688989 10672798.652275109663606,1894039.019571686163545 10672798.652275109663606,1887885.500759618356824 10671345.886746346950531,1885071.677990833995864 10670240.321123320609331,1872981.045456797583029 10664270.406215300783515)) +POLYGON ((1614256.181137247476727 10628243.413730354979634,1608411.90787060232833 10628918.359840285032988,1607082.30787256732583 10629766.103373212739825,1606247.300372125115246 10631037.304940946400166,1605041.487647854490206 10633753.247513817623258,1601114.358651648974046 10645126.957827942445874,1599784.758653613971546 10653206.009103601798415,1600341.244788089068606 10655075.483001183718443,1607731.63446236285381 10678344.474024813622236,1612308.090048363897949 10684749.065651010721922,1616358.894998842384666 10689364.961028676480055,1617410.307589384028688 10690478.547708220779896,1628913.173212033463642 10696983.88984009437263,1630304.778166441945359 10697581.195491963997483,1632221.811117393197492 10697411.676202977076173,1633798.985662951366976 10696725.320134593173862,1634417.254114817362279 10695356.820145102217793,1635221.426116306800395 10690478.547708220779896,1657175.967410048935562 10674846.743288543075323,1658907.764728318434209 10674930.916109926998615,1659804.331907169194892 10676210.839194681495428,1663020.240676693851128 10685265.310218179598451,1663886.083676086040214 10688768.372350199148059,1664288.058357340749353 10690821.557837938889861,1664164.493722558952868 10692616.329305402934551,1663824.30135869490914 10694158.028368968516588,1663236.868405778892338 10695526.288514446467161,1659866.114224557299167 10700492.959789801388979,1659247.845772694097832 10701862.179508050903678,1663360.433040557894856 10706489.950272163376212,1664411.845631102332845 10707606.020163608714938,1675451.065574597101659 10704432.365269400179386,1677275.369389719096944 10703834.461006097495556,1679687.328796736896038 10701862.179508050903678,1681635.419885617680848 10699551.934370407834649,1682810.397110941354185 10696809.762563096359372,1683150.589474805165082 10695183.042395692318678,1683583.510974501259625 10694073.618669930845499,1684665.759063992882147 10692959.446648374199867,1686335.662745383102447 10692701.029024481773376,1687046.771652569528669 10694242.747179949656129,1687201.283105792477727 10696123.15873321890831,1686861.202061417046934 10697750.410754108801484,1685933.576744636986405 10700662.247106853872538,1685346.032472232356668 10702120.943489706143737,1678574.133888804353774 10717386.210465075448155,1673657.485938936471939 10726750.449130762368441,1672853.425256938207895 10728215.032106772065163,1671647.612532664788887 10730964.875022677704692,1671090.903759207110852 10732600.441385932266712,1670379.906171511858702 10735787.202642114832997,1670287.065716188633814 10737508.870205352082849,1671090.903759207110852 10741729.93758574873209,1672204.209986631060019 10745352.067129483446479,1673688.544076868798584 10748625.519573803991079,1674770.792166360421106 10749663.392329409718513,1679563.541522975312546 10753284.759395958855748,1684511.136291281320155 10754323.340267915278673,1685871.794427245855331 10753374.875358186662197,1688252.807015825528651 10747763.229963030666113,1688933.080424062209204 10744575.535347932949662,1688531.105742807267234 10742506.45628197863698,1692798.204463894246146 10719617.455045038834214,1702384.037135594990104 10713439.33742468059063,1711568.006445532198995 10704178.141588946804404,1712402.791306989034638 10702892.975739389657974,1714660.239260786678642 10660606.957112757489085,1714567.510124954627827 10656949.757069922983646,1714258.1532600405626 10653206.009103601798415,1713856.178578788414598 10651080.194776533171535,1713145.069671599194407 10649548.168414195999503,1712248.279853768879548 10648189.374954229220748,1710114.619173735613003 10646060.528695072978735,1705692.675040951929986 10641986.725857548415661,1677615.450434091733769 10620110.234512481838465,1676378.690891377162188 10619263.989611694589257,1674677.951711039990187 10619180.193589376285672,1658814.924272998003289 10621970.390345484018326,1654702.225685640005395 10622733.434990610927343,1653125.273779061390087 10623496.259725598618388,1648023.056238044053316 10631461.294731166213751,1647930.327102212002501 10633156.905716588720679,1649198.144782856106758 10637826.737349506467581,1649940.200508486479521 10639351.559160239994526,1653774.600368859944865 10641646.154282188042998,1660546.498952285153791 10644874.927748087793589,1676285.850436056731269 10652355.665404329076409,1685778.953971925424412 10656351.391855264082551,1687355.90587850403972 10656692.695662047713995,1688098.184243114199489 10658226.321771271526814,1686490.285518094431609 10673309.389050425961614,1684913.110972536262125 10674077.8694,1676378.690891377162188 10676553.134761702269316,1670812.60503222537227 10677833.053999787196517,1669421.222716799471527 10677232.860379474237561,1670503.47080629109405 10676126.343372819945216,1674987.085936971474439 10673820.163945471867919,1677151.804754937067628 10671687.939056137576699,1677275.369389719096944 10669898.341155253350735,1676533.313664091518149 10668362.097983695566654,1674183.247893952997401 10663844.686776522547007,1669390.164578867144883 10657711.806304739788175,1659402.468545402633026 10651248.570228541269898,1658010.863590996945277 10650655.294772205874324,1650063.987782248063013 10648100.634311376139522,1641282.215792548377067 10645724.342870030552149,1639952.393155530793592 10646574.169302294030786,1632345.598391154548153 10648016.484764138236642,1619667.532904199324548 10633497.05540351383388,1614256.181137247476727 10628243.413730354979634)) +POLYGON ((1919333.368228208739311 10685434.528773574158549,1917601.682229427620769 10685434.528773574158549,1915777.378414305625483 10686030.826787853613496,1914478.725234711542726 10686974.609999371692538,1913643.495095289777964 10687998.240369344130158,1901584.254657656652853 10719362.666168740019202,1901274.675153760239482 10720910.407573046162724,1901738.877430368214846 10722968.317541623488069,1902542.715473386691883 10724516.875589072704315,1903625.074882369488478 10725635.89229010604322,1925455.940221838420257 10725890.915088765323162,1929321.175581161631271 10724861.597382973879576,1931949.762717264471576 10722883.242100570350885,1933000.730029843980446 10721854.377142800018191,1940082.208117165835574 10711978.224979430437088,1940886.046160184312612 10710691.592520965263247,1941164.23356767767109 10709061.567479353398085,1940793.428343843435869 10707431.622235659509897,1939370.876570996828377 10704088.671910809352994,1938412.415755266789347 10702803.522872617468238,1926754.593401432503015 10690478.547708220779896,1920755.920001055579633 10686030.826787853613496,1919333.368228208739311 10685434.528773574158549)) +POLYGON ((1663144.027950458228588 10711035.61791012994945,1659495.197681234683841 10711120.546051546931267,1655908.261048896005377 10711549.52649325504899,1654083.957233774010092 10712063.164829397574067,1651888.514236349845305 10714212.648644030094147,1651950.296553740743548 10715754.279824070632458,1653372.625687605002895 10727954.969096,1653681.759913536719978 10729674.974229644984007,1655104.311686386121437 10730279.788155807182193,1657021.455956825753674 10730104.810883115977049,1664350.063313711434603 10727870.141158796846867,1665772.39244757569395 10727355.004323840141296,1666390.883538424270228 10725980.670521734282374,1667040.210128222592175 10719188.277314655482769,1667225.77971937507391 10715669.60314485989511,1666854.64053707011044 10713609.254485880956054,1664720.979857034049928 10711379.660608854144812,1663144.027950458228588 10711035.61791012994945)) +POLYGON ((1839152.165399627527222 10713439.33742468059063,1837668.053948372369632 10713609.254485880956054,1835843.750133253168315 10714212.648644030094147,1827742.25155178993009 10717815.275080926716328,1822980.226374636637047 10721854.377142800018191,1811322.292701310943812 10737594.127889450639486,1810487.396520359907299 10738800.560622414574027,1810178.262294428423047 10740438.003545617684722,1810611.406433104071766 10742506.45628197863698,1812312.145613444037735 10745352.067129483446479,1813239.659610733157024 10746730.302461791783571,1814322.019019715953618 10747763.229963030666113,1815929.806425244314596 10748109.126371489837766,1817847.062015175120905 10747938.34947495162487,1842182.949855967657641 10740783.219148144125938,1843759.679123560898006 10740007.206379260867834,1844842.0385325436946 10738885.834423188120127,1847285.056077493820339 10735181.901172205805779,1848088.894120512530208 10733890.8945,1848707.273891869699582 10730709.662847697734833,1846944.975033121183515 10717386.210465075448155,1846419.213078104658052 10716013.87909909337759,1843759.679123560898006 10714641.514140786603093,1840914.909536341205239 10713524.295427458360791,1839152.165399627527222 10713439.33742468059063)) +POLYGON ((1933928.577985603827983 10746038.977151216939092,1932351.403440045658499 10746815.675280181691051,1932073.327352043474093 10748369.646987298503518,1931980.264257740462199 10749919.313373783603311,1931702.188169738510624 10758293.902486350387335,1932536.973031198140234 10762010.078850565478206,1935721.823662793496624 10768322.599560625851154,1938102.947570861550048 10772995.610971312969923,1939061.742345062317327 10774379.435931613668799,1954924.547144124517217 10780355.855325825512409,1955203.179829580010846 10778713.806823421269655,1951430.562286594882607 10767110.942531559616327,1950626.724243576172739 10765552.70203511044383,1941720.942341132555157 10753374.875358186662197,1938845.225935471476987 10749487.918027132749557,1933928.577985603827983 10746038.977151216939092)) +POLYGON ((1721895.894842857727781 10711808.657307479530573,1720257.160618891008198 10712152.738905167207122,1719174.689890417037532 10713180.144804762676358,1718339.905028957407922 10714467.245665542781353,1716360.978441126877442 10718758.817348159849644,1716020.786077262833714 10720306.422035271301866,1716670.112667058361694 10742421.13728790730238,1716855.682258210843429 10744400.191663905978203,1732162.000922795152292 10780270.062239678576589,1733089.626239575445652 10781569.865053838118911,1738037.221007884247229 10787814.61429201066494,1739119.469097375869751 10788853.774869181215763,1741624.268959714099765 10790593.559452082961798,1746664.481544360984117 10793979.428398033604026,1751797.645903822500259 10794413.331047454848886,1753405.544628839241341 10794756.90898079238832,1754827.873762706294656 10795367.513719541952014,1755910.344491180265322 10796407.824864536523819,1756837.969807960558683 10797801.0958,1757610.861032537883148 10799362.022171689197421,1759961.038122164783999 10806755.463923737406731,1764228.136843251762912 10820163.89951772801578,1765928.876023591961712 10825308.424163909628987,1778297.918604104081169 10838580.353831313550472,1780493.361601531039923 10840765.32119558006525,1793573.179130758857355 10848641.480729265138507,1795181.411814249353483 10847852.793558433651924,1797592.925943302223459 10840328.145817346870899,1798242.697811062680557 10837096.938811667263508,1798366.262445844709873 10833603.143544353544712,1790975.650132588576525 10799973.039062479510903,1790202.75890801101923 10798407.280928855761886,1787574.171771908178926 10794151.047978557646275,1784296.703323972178623 10790851.01900302618742,1783028.774323836900294 10790069.29684297926724,1780833.442645903909579 10787900.502241112291813,1777710.374331699451432 10784346.268823780119419,1774927.275742376456037 10780355.855325825512409,1767073.129069456830621 10767543.452327126637101,1766671.154388201888651 10765467.406025717034936,1766980.399933624779806 10763914.20881949365139,1767073.129069456830621 10762095.642837731167674,1766887.559478304348886 10760196.685565259307623,1765959.934161524288356 10758901.255052601918578,1764877.686072032665834 10757776.467019839212298,1751673.858630060916767 10750440.502616750076413,1748983.711815549526364 10749056.860468503087759,1740820.20827771583572 10745091.661545127630234,1727956.684519099304453 10721679.615408286452293,1721895.894842857727781 10711808.657307479530573)) +POLYGON ((1897502.502888739807531 10751819.76490188203752,1897100.416887993691489 10752943.572488687932491,1896667.606707789003849 10755879.020806476473808,1896605.601751418318599 10757691.268063075840473,1897069.358750061364844 10759764.951775273308158,1901584.254657656652853 10766160.7004,1906778.978695523692295 10770917.906828468665481,1907582.816738542402163 10772477.060519,1907521.257060133852065 10774208.312650492414832,1906469.844469589414075 10775335.498632200062275,1904645.540654470212758 10776025.118962658569217,1887545.308395751519129 10771868.499546017497778,1881361.176723713288084 10767628.774268738925457,1880093.136404086835682 10766764.082617124542594,1871465.987187101272866 10766246.316436298191547,1867415.182236622786149 10770832.232241785153747,1867137.106148620601743 10772477.060519,1866549.339237233623862 10778885.043057724833488,1867013.096235876670107 10780965.173241196200252,1867786.321418927749619 10782612.756638377904892,1869363.050686523783952 10785732.396453958004713,1870321.956780218752101 10787033.239751188084483,1871744.063275100663304 10787643.153945544734597,1873506.807411814108491 10787729.039737422019243,1883433.055086358450353 10789029.951226398348808,1892926.047302735969424 10791285.035301158204675,1907675.879832845414057 10804232.90551626868546,1908634.340648575220257 10805536.966815,1910366.02664735657163 10808495.432802418246865,1911169.864690372254699 10810058.494191521778703,1911788.133142238250002 10811889.883882919326425,1910798.72550806729123 10812325.240294970571995,1909531.130466405535117 10811540.741217510774732,1906160.710243657696992 10808318.440000344067812,1904892.669924031244591 10807534.714660130441189,1901986.006699929246679 10806406.583873249590397,1900223.70784118049778 10806320.775893749669194,1896048.892977960873395 10807276.624978460371494,1885783.009537005797029 10811540.741217510774732,1878609.024952831678092 10819900.62481896020472,1879721.997221781872213 10821035.383008284494281,1882597.71362744551152 10822084.323524612933397,1885813.622396973194554 10822778.684063967317343,1892585.966258363332599 10823478.138558423146605,1896791.171342570800334 10822520.017085257917643,1900470.837110741529614 10821212.39217765070498,1904490.583923285128549 10820599.470435442402959,1905634.94828864117153 10821648.343919919803739,1906407.839513218728825 10823214.735920120030642,1908325.095103152561933 10828711.253324138000607,1900755.369729209691286 10837008.227291215211153,1900050.383394015487283 10837428.201604323461652,1899475.195585086941719 10836643.326790330931544,1896803.527806046884507 10834702.132722370326519,1882814.341356530319899 10842167.681910343468189,1881762.817446497501805 10843214.840070331469178,1880928.032585037639365 10844526.69082291610539,1880866.472906629322097 10846276.007874097675085,1881515.688176933676004 10848203.800073623657227,1882783.283218597993255 10848992.52785274758935,1884422.462720529641956 10849338.550695795565844,1894039.019571686163545 10848901.140416037291288,1901267.216747875791043 10849526.065857788547873,1902213.543739109532908 10849052.403044467791915,1903289.66925660870038 10849052.403044467791915,1903549.488948119571432 10849682.384959833696485,1902350.911990747787058 10858062.362241685390472,1901553.307839215733111 10858645.209404278546572,1900588.279173528309911 10859114.489654680714011,1897360.013940521981567 10860114.066450837999582,1896191.381926175905392 10860222.333803251385689,1895411.922851641196758 10859747.927213925868273,1894744.228545862948522 10859114.489654680714011,1894168.818097951821983 10858274.415647445246577,1889957.379122260725126 10860465.704887578263879,1888349.591716735158116 10860114.066450837999582,1882350.584357884479687 10860995.406365,1880247.759176798164845 10861520.413346344605088,1878639.971771272597834 10862310.683503799140453,1878485.460318052442744 10863625.898699145764112,1884731.596946461359039 10873806.319752441719174,1885690.057762191165239 10875123.755599541589618,1897310.588086612522602 10875809.302565472200513,1915035.100049698259681 10877499.2631791010499,1924837.671769972424954 10878551.863878866657615,1935845.83357553742826 10880136.135084182024002,1945957.205563269555569 10882421.236470056697726,1947008.618153813993558 10883126.837616482749581,1947132.182788596022874 10884625.057217601686716,1946050.268657575361431 10885765.888898871839046,1942864.972748015075922 10887351.838746560737491,1937657.669607689604163 10887612.977578811347485,1935895.370748940855265 10886928.777054443955421,1934837.724266912788153 10886878.074794501066208,1928053.580539497314021 10887878.880437837913632,1921497.753087700810283 10890258.840392500162125,1919333.368228208739311 10892547.340367514640093,1918498.472047257935628 10893781.489772908389568,1913241.743053017416969 10904981.201310561969876,1913179.738096646731719 10906833.509109189733863,1914323.768503529252484 10907895.738923888653517,1916117.459458681056276 10907983.15300508774817,1917447.059456716291606 10907008.311123207211494,1920446.340497158933431 10903391.459332110360265,1921003.049270616611466 10901893.870495822280645,1924033.388448988785967 10896599.207933656871319,1925362.988447024021298 10895630.753548514097929,1927311.302174889948219 10895364.54791684448719,1932419.419648920185864 10900425.505066372454166,1933106.038268131669611 10901062.795207435265183,1932623.579595034942031 10901857.348052678629756,1930681.722397637786344 10908245.084098238497972,1926321.783221227582544 10914519.500717388466001,1926012.648995296098292 10916199.681105718016624,1927002.167948955437168 10917525.343283776193857,1928455.221262281294912 10918055.043756553903222,1930249.023536924272776 10918142.270022071897984,1938535.980390045791864 10914252.555681832134724,1943329.063705134671181 10911777.051602318882942,1952822.167241 10903565.855346573516726,1953471.382511307718232 10902596.409869506955147,1955697.883646664209664 10896691.23730369284749,1956501.721689682686701 10895364.54791684448719,1958109.397775719873607 10893694.257785802707076,1959482.523694654460996 10899265.390016762539744,1960261.760130206821486 10899737.476482063531876,1960354.600585527252406 10900638.881073627620935,1954936.90360760060139 10911444.698939260095358,1953953.618545424658805 10912983.198674464598298,1950317.144739679759368 10918939.136880552396178,1948369.276289781322703 10919113.931577585637569,1946513.914336727000773 10919823.344831669703126,1945153.367520253639668 10920795.246371833607554,1943576.192974692676216 10928497.025398898869753,1943545.246156254550442 10930355.42436233535409,1944658.663703166879714 10939042.545443952083588,1946451.909380356548354 10939042.545443952083588,1951306.997651815647259 10934790.144610647112131,1952389.023102324921638 10933636.28414618037641,1954028.091284765163437 10931066.010220114141703,1955635.878690293524414 10928409.347522938624024,1958604.324231786653399 10924037.088963456451893,1961108.901455145329237 10916869.959659092128277,1963298.444519556825981 10912997.831517186015844,1968808.536674841772765 10910806.436496082693338,1969952.901040198048577 10911956.751425933092833,1969921.954221756896004 10913723.469098750501871,1969612.819995822617784 10915315.943631645292044,1966860.668224940774962 10922656.640434231609106,1965036.364409821573645 10936119.751868080347776,1965005.306271889247 10937892.752883555367589,1966180.283497212920338 10938954.73160682991147,1986403.472750644665211 10936294.988328592851758,1987733.072748679667711 10935320.871230071410537,1988536.910791698144749 10933991.739113885909319,1999792.647144786547869 10915223.662213483825326,2012006.844313607551157 10885944.903712172061205,2013088.869764119386673 10882952.964121570810676,2013367.502449574880302 10881368.037857849150896,2014975.17853560927324 10864676.674335174262524,2014975.17853560927324 10862922.313839143142104,2014573.426493336912245 10861255.537060715258121,2013429.0621279834304 10860205.604333246126771,2010028.029045265400782 10859853.979314360767603,2000287.350961873540655 10858187.637042596936226,1998988.809101770631969 10857398.160263855010271,1994566.976288478355855 10852667.002350330352783,1993577.012056853855029 10851353.899736758321524,1993175.371334072668105 10849689.633714823052287,1989928.515746103832498 10825658.272171031683683,1998432.100328313186765 10813018.608216,2000194.399187061702833 10813104.813944710418582,2001648.009097840869799 10813630.849228646606207,2003595.877547739073634 10813367.826517026871443,2004369.102730790385976 10812062.267909059301019,2004152.586321196751669 10810149.362650955095887,2003163.067367537179962 10808839.407166304066777,1992773.174013835377991 10803186.705651702359319,1988444.292975357500836 10801534.462306145578623,1957429.124367480399087 10799710.542256930842996,1950564.71928720572032 10810149.362650955095887,1937732.142347030108795 10801185.84906723164022,1916024.507683869451284 10778885.043057724833488,1914107.586052409373224 10776287.018348222598433,1911726.573463829932734 10771526.383090253919363,1911107.85973400156945 10769705.789287758991122,1910644.21405484713614 10767628.774268738925457,1910427.586325764888898 10765728.589505210518837,1910984.295099219772965 10764256.255390845239162,1912221.277280916692689 10763999.796664049848914,1913241.743053017416969 10764688.273175280541182,1914416.720278341090307 10765035.02767875418067,1915344.234275629976764 10764170.664332507178187,1916148.517596610588953 10762874.168793652206659,1916426.593684612773359 10761317.205609727650881,1915808.325232746778056 10759503.996239472180605,1914849.419139054603875 10758208.386108890175819,1911046.300055593252182 10755788.871804885566235,1902759.231882980326191 10751905.201341221109033,1897502.502888739807531 10751819.76490188203752)) +POLYGON ((2038760.257535957032815 10972853.859564388170838,2047845.709096537670121 10971767.003283251076937,2069336.382072142791003 10969182.285988515242934,2073077.941477195592597 10967753.526107743382454,2074129.354067740030587 10968468.028883259743452,2073850.832701773149893 10970073.047572972252965,2073077.941477195592597 10971409.569172061979771,2071748.341479160590097 10972388.867902034893632,2061884.210080477874726 10975508.675528416410089,2057616.88872040854767 10976581.359788116067648,2052329.101588238496333 10976311.968810884281993,2044227.60300677549094 10978276.937723085284233,2042898.00300874048844 10979257.226019274443388,2042094.164965721778572 10980595.232849445194006,2039867.775149856461212 10992027.369044261053205,2039589.142464400967583 10993638.281308,2039867.775149856461212 10995603.435209730640054,2040702.671330807497725 10997215.195285804569721,2043052.625781451817602 10999451.360316202044487,2046855.744864916196093 11002136.245536144822836,2048216.40300088073127 11001064.03322290815413,2057400.260991326533258 10991310.386420244351029,2074376.483337298268452 10992115.870796320959926,2075706.083335333270952 10980237.334399770945311,2075984.716020788764581 10978629.915161924436688,2076788.554063810268417 10975420.389688594266772,2078396.675427809590474 10972834.283704943954945,2082756.614604216767475 10966686.722046878188848,2084086.103282760595903 10965708.564576413482428,2086065.029870594153181 10965439.283380344510078,2087395.075146591290832 10966241.708679301664233,2088384.482780762482435 10967577.156812651082873,2089064.75619 10992832.938387040048838,2087611.14627821999602 11004285.691408837214112,2085477.70823716907762 11006612.875092485919595,2080375.602015640120953 11012707.893572989851236,2079849.840060623595491 11014146.456979569047689,2077437.880653605796397 11023656.511182302609086,2077159.693246112437919 11025363.875492909923196,2077685.343881640583277 11027431.718938458710909,2078551.298200520919636 11029051.047213055193424,2080901.252651165472344 11031204.17068786919117,2093301.019411136163399 11030665.906745862215757,2095187.328182628843933 11029949.690202092751861,2096547.986318596173078 11028957.209463987499475,2114606.234115079976618 11011993.890370480716228,2116740.006114607211202 11009659.700977101922035,2119924.968065693508834 11004285.691408837214112,2121502.031291760504246 10999810.271790826693177,2122274.922516338061541 10994797.537489807233214,2122274.922516338061541 10993009.642152119427919,2121718.213742883410305 10990863.758631829172373,2119986.973022064194083 10987736.898975294083357,2117080.198478471022099 10983449.13493587076664,2107679.712758940178901 10973103.857872055843472,2105329.646988804452121 10970964.246671488508582,2102825.069765445776284 10969182.285988515242934,2092157.100323747610673 10962769.16799608618021,2090239.733414322603494 10956899.305446814745665,2089714.082778797484934 10954852.803048079833388,2089188.320823780959472 10952718.924454759806395,2089188.320823780959472 10950854.088914830237627,2089961.212048358516768 10949521.59971571341157,2091661.951228698482737 10949165.3326117079705,2093486.589002291439101 10949165.3326117079705,2095063.318269887473434 10948277.304531125351787,2095867.601590868318453 10946945.63954315520823,2097970.092813480645418 10940996.776337221264839,2097970.092813480645418 10939222.966519648209214,2090920.006822559284046 10929912.780907733365893,2088600.553912391187623 10927879.159559627994895,2085941.465235812123865 10926283.743777563795447,2084302.731011845637113 10926016.33704562112689,2082168.847692829789594 10926551.16101505048573,2071748.341479160590097 10927081.245542803779244,2063553.891122888540849 10925753.721349975094199,2049298.762409863527864 10922476.657966962084174,2047969.273731319699436 10921679.695452082902193,2042063.218147283652797 10919556.191755354404449,2030621.800883548799902 10917612.881084099411964,2028983.06665958208032 10917345.814734613522887,2024962.985888564959168 10917438.124922145158052,2021530.894667917396873 10918939.136880552396178,2008791.046863571042195 10928497.025398898869753,2006626.550684588029981 10930798.415544642135501,2003688.829322553705424 10934434.647941635921597,2003410.641915060346946 10936031.975737955421209,2003905.457051635719836 10938155.837401131168008,2007306.824092824710533 10946852.928276408463717,2020046.337938697310165 10952098.855501854792237,2021871.087031781440601 10952098.855501854792237,2033652.140061924001202 10945877.298716388642788,2034920.180381550453603 10951205.326119776815176,2024653.851662630448118 10972212.378355819731951,2024375.664255140116438 10973813.787638397887349,2025705.264253175118938 10974617.201716162264347,2036961.000606263289228 10973461.060104463249445,2038760.257535957032815 10972853.859564388170838)) +POLYGON ((2293676.102839030325413 11002672.253968672826886,2290212.619521979242563 11003390.436159756034613,2289223.211887808516622 11006435.817315626889467,2289006.584158723708242 11008138.536673936992884,2288295.697890519630164 11018631.331384917721152,2288326.75602844869718 11020425.98113190382719,2288666.837072824593633 11022398.574665322899818,2291697.176251199562103 11032374.710227888077497,2292439.009337844792753 11034172.994946153834462,2293335.910475166514516 11035793.931346436962485,2294418.381203640252352 11037143.441415218636394,2295778.928020116407424 11037865.276981063187122,2307653.04414456197992 11039121.220455469563603,2308673.398597171530128 11037954.053798239678144,2308889.581048293970525 11036243.846217356622219,2308209.307640054728836 11011186.36956680752337,2307591.039188188500702 11009753.272570675238967,2306230.381052223965526 11008946.018,2302117.682464865967631 11006706.40474190376699,2293676.102839030325413 11002672.253968672826886)) +POLYGON ((2167823.295925242360681 11016748.331293642520905,2166215.174561240244657 11017645.34825349971652,2166740.936516256537288 11020425.98113190382719,2173203.70087375305593 11031115.158373242244124,2175275.57923639845103 11033812.587534854188561,2203909.289977733511478 11068894.34828451089561,2205733.593792852479964 11068894.34828451089561,2207867.477111868560314 11068258.705872064456344,2209196.96579041518271 11067265.491391705349088,2211330.40383146610111 11064827.980711685493588,2215010.514877601526678 11059677.990901311859488,2214979.456739669200033 11057872.940046925097704,2214515.365782552398741 11056157.384120341390371,2203167.011613123584539 11027520.682997832074761,2202270.555753767024726 11025901.719451291486621,2201064.520390511024743 11024826.0741,2196054.920665831305087 11024105.622814757749438,2178212.855320467613637 11020603.403839679434896,2167823.295925242360681 11016748.331293642520905)) +POLYGON ((2414983.289665766991675 11044527.733724154531956,2413561.183170882519335 11045245.489342330023646,2412540.717398781795055 11046418.451683597639203,2412076.626441664993763 11047948.213346313685179,2412138.631398035679013 11049844.752677660435438,2412818.904806272126734 11051197.058171024546027,2415571.056577156763524 11052727.896933808922768,2417549.871845496352762 11052366.178754663094878,2419127.046391057316214 11051375.286542983725667,2419590.803389700595289 11049844.752677660435438,2419498.185573362279683 11048042.313862167298794,2419003.036478313151747 11046329.564145602285862,2414983.289665766991675 11044527.733724154531956)) +POLYGON ((2130098.233690307941288 11000528.151603981852531,2128304.988013118039817 11000528.151603981852531,2126171.104694102425128 11001152.652715280652046,2125088.633965628221631 11002318.025979872792959,2122367.540332679171115 11010289.882141789421439,2122089.352925185579807 11011900.287918247282505,2119708.340336608700454 11015939.922331815585494,2118656.927746067289263 11017196.663461849093437,2110091.672165961004794 11026622.361268861219287,2107432.583489382173866 11028690.58789948374033,2102608.553355855401605 11031298.03948331810534,2098248.614179444964975 11033995.217471780255437,2089404.948552862973884 11039571.031724197790027,2088075.348554827971384 11040654.200983604416251,2085910.407097882824019 11042993.878651849925518,2085106.56905486411415 11044344.820337908342481,2084024.098326390143484 11047319.395787136629224,2084024.098326390143484 11049210.89132734015584,2084457.242465065792203 11050924.69270221889019,2096764.057450224878266 11070702.658246321603656,2098990.558585581369698 11073147.165272122249007,2101371.571174161043018 11075314.320143092423677,2109102.264531789813191 11077760.489100936800241,2116183.297341149765998 11077581.566613329574466,2121130.892109455540776 11075314.320143092423677,2127439.14501372911036 11088271.742502968758345,2132139.165234511718154 11095801.760305196046829,2133066.567912312224507 11096709.284074548631907,2139467.772591397631913 11100156.169976592063904,2140828.319407873786986 11099068.368028789758682,2148651.630581840872765 11088271.742502968758345,2147507.26621648715809 11084009.439516926184297,2147229.078808994032443 11082018.867439804598689,2147754.840764010325074 11078665.602824464440346,2148527.620669099502265 11077218.521636426448822,2152269.291393640916795 11072148.350616896525025,2155485.088843677192926 11068531.767694959416986,2158948.572160727810115 11065096.025007931515574,2160556.248246765229851 11064192.718963978812099,2162226.485886629205197 11064465.617264343425632,2161978.911339103244245 11066183.274365888908505,2160927.498748561367393 11069167.761179273948073,2160958.445567002519965 11071065.029237864539027,2161236.632974492851645 11073052.716120049357414,2162133.422792326193303 11074682.962650928646326,2165102.202292290050536 11078939.083689145743847,2169276.460558056365699 11084283.135838197544217,2170637.118694023694843 11085099.723361730575562,2172152.176963720005006 11085642.320672811940312,2173821.969325616490096 11085821.455830369144678,2175986.799463076051325 11085278.844194751232862,2177594.586868601385504 11084372.848000200465322,2187644.287858436815441 11075314.320143092423677,2188695.700448978226632 11074051.663887793198228,2190551.062402032781392 11071517.287561716511846,2191849.604262135457247 11068621.271874828264117,2192097.178809658624232 11066997.361413447186351,2191509.523217762820423 11063021.560135906562209,2190922.201584334950894 11060853.449467837810516,2171781.037781415041536 11036965.586173495277762,2160834.88093222072348 11015398.022430939599872,2159041.189977068919688 11012890.279838532209396,2153970.030573980882764 11009211.865811217576265,2147105.514174215029925 11005540.278799168765545,2135076.886596546042711 11001329.572903431952,2130098.233690307941288 11000528.151603981852531)) +POLYGON ((2323484.790805689059198 11047770.074906332418323,2319805.23635700950399 11047859.305781176313758,2318104.497176669538021 11048398.934204442426562,2315754.431406533811241 11050657.207333395257592,2315136.162954667583108 11051736.9519351311028,2312415.069321715738624 11059226.520680380985141,2310961.459410936571658 11063830.389426024630666,2310744.831681854557246 11065458.422110926359892,2310775.889819784089923 11067354.978875301778316,2311115.970864159520715 11069346.461987087503076,2312940.274679278489202 11075766.535912223160267,2314331.879633684176952 11079750.138235753402114,2315228.780771008692682 11081381.668554494157434,2316311.140179988462478 11082650.581691399216652,2317826.309769176412374 11083103.612787237390876,2319681.671722227707505 11083103.612787237390876,2325749.919804350938648 11078752.633084027096629,2331864.810753116384149 11069314.2369035333395,2342548.810201493091881 11070493.969985710456967,2348624.516689497511834 11071785.59615895524621,2349119.220506584271789 11070250.454199543222785,2332452.132386541459709 11051013.640414355322719,2329731.372712062671781 11049483.188057506456971,2325154.47184809949249 11047948.213346313685179,2323484.790805689059198 11047770.074906332418323)) +POLYGON ((2220174.180777539033443 11070250.454199543222785,2217020.38828387344256 11071333.319956647232175,2215659.730147908907384 11072421.568974221125245,2215165.026330821681768 11073957.202147476375103,2216215.993643401190639 11075224.7276556994766,2221411.16295923339203 11075677.263265201821923,2223544.71231977827847 11075135.136351034045219,2225152.833683777600527 11074230.493334628641605,2225956.671726795844734 11072873.917703915387392,2221843.973139438312501 11070523.596165446564555,2220174.180777539033443 11070250.454199543222785)) +POLYGON ((2336101.185294744558632 11074861.808733452111483,2334122.258706914260983 11075224.7276556994766,2332545.084161356091499 11076129.50322019867599,2332359.514570203609765 11077128.904007134959102,2332699.706934067420661 11079118.367948312312365,2339038.906656778883189 11089083.586947536095977,2340894.157290342263877 11089083.586947536095977,2342192.810469936113805 11087997.558844974264503,2343182.218104107305408 11084915.387186497449875,2343398.734513698145747 11083282.680934248492122,2343306.228016848210245 11081381.668554494157434,2342687.514287020079792 11079297.330959878861904,2341790.61314969882369 11077670.864314381033182,2340554.076245966833085 11076671.383718084543943,2337801.924475084990263 11075135.136351034045219,2336101.185294744558632 11074861.808733452111483)) +POLYGON ((2082633.049969437764958 11065547.885773820802569,2080746.741197945084423 11066272.747582886368036,2079942.791835435433313 11067628.004343258216977,2079540.705834689317271 11069798.280279,2077097.688289741752669 11083013.917404340580106,2082818.619560590246692 11109702.433298649266362,2083282.265239742118865 11111431.582163920626044,2084797.4348289296031 11111976.289867686107755,2086529.120827710954472 11111521.654080778360367,2087611.14627821999602 11110337.058319140225649,2091136.634551644325256 11105062.437369156628847,2092497.181368120247498 11102156.977794358506799,2108019.905122807249427 11107974.052547382190824,2108916.694940637331456 11107065.020492637529969,2114853.80866260593757 11097706.491047212854028,2115379.45929813105613 11096160.57226082496345,2115100.937932166736573 11094166.432520046830177,2114390.051663959864527 11092262.368706030771136,2111792.411346298176795 11087365.020243894308805,2110431.864529824815691 11086638.228518651798368,2108762.183487417176366 11086364.110861966386437,2104927.560988058336079 11086638.228518651798368,2101711.652218533679843 11085821.455830369144678,2097166.254770462401211 11084188.531570460647345,2095991.166225647320971 11083103.612787237390876,2092033.090411 11077397.434552414342761,2091167.247411611722782 11075861.022839736193419,2089745.029597238637507 11072058.799913326278329,2088879.18659784947522 11070429.183515792712569,2086838.255053642438725 11067717.496606355533004,2085632.331009880639613 11066635.207517145201564,2082633.049969437764958 11065547.885773820802569)) +POLYGON ((2325865.803394268732518 11093348.753099417313933,2322742.957719043828547 11093802.499105244874954,2318722.765628535766155 11098434.796430012211204,2317949.874403958208859 11099796.819650748744607,2317176.649220907129347 11101248.724964952096343,2316960.466769787017256 11102885.761196170002222,2317084.031404568813741 11106610.386499928310513,2317424.22376842983067 11108608.515851428732276,2318661.205950126983225 11112885.980487633496523,2320176.37553931446746 11116616.103343054652214,2321103.778217112179846 11118256.853560473769903,2322278.755442435853183 11117436.59273830242455,2323052.091944975778461 11116071.022845691069961,2323546.795762062538415 11114525.828334519639611,2326113.377941791899502 11110522.086598159745336,2328215.869164404459298 11108063.75118712708354,2329545.803120910190046 11106975.007743395864964,2330566.268893013708293 11105791.533032774925232,2331339.160117591265589 11104338.327914,2331555.676527184899896 11102700.941118441522121,2330782.451344133820385 11100794.807660581544042,2329545.803120910190046 11096524.632202154025435,2328772.577937861904502 11094619.906498856842518,2325865.803394268732518 11093348.753099417313933)) +POLYGON ((2179820.976684466935694 11100704.878082199022174,2174286.060282736085355 11100794.807660581544042,2170946.252919955644757 11102067.357235105708241,2155609.098756421357393 11108883.2065,2154526.739347438327968 11110067.220816167071462,2154000.977392422035336 11111611.399653173983097,2154310.111618353519589 11113615.917732389643788,2155021.443164522759616 11115525.986158678308129,2155763.721529132686555 11117436.59273830242455,2158825.007525948807597 11124728.65605934523046,2159690.850525338202715 11126366.118689075112343,2161082.010201781522483 11127097.508574351668358,2163092.328886018134654 11126822.07915398851037,2164421.928884053137153 11125820.253870256245136,2181274.141317283734679 11111431.582163920626044,2182325.553907825611532 11110157.274614440277219,2183129.3919508443214 11108793.169573271647096,2183655.153905860614032 11107339.648589830845594,2183902.728453383781016 11105611.542526669800282,2183593.594227452296764 11103609.715589042752981,2182696.693090130575001 11101977.410784097388387,2179820.976684466935694 11100704.878082199022174)) +POLYGON ((2294232.811612487770617 11082471.5302241332829,2289037.642296656034887 11093622.826431185007095,2285048.842302550561726 11088450.94709544070065,2283811.860120856203139 11087454.773163268342614,2281987.556305737234652 11087454.773163268342614,2278431.566491836681962 11087997.558844974264503,2276545.257720344234258 11088724.822638770565391,2274937.136356344912201 11089631.400169784203172,2273638.483176751062274 11090717.689852258190513,2270731.819952646270394 11094530.385459089651704,2269742.300998986698687 11097616.929267302155495,2269278.655319832265377 11100974.343366708606482,2269340.214998240582645 11102790.897164396941662,2271040.954178580548614 11116526.291515087708831,2271690.614726849831641 11120533.580797277390957,2273514.918541969265789 11127007.229522090405226,2274256.751628617290407 11128921.074505081400275,2288079.181480925995857 11142528.58509,2290707.323339063674212 11144356.636617459356785,2302612.38628195039928 11145908.646066572517157,2306137.874555374495685 11146089.380343526601791,2310157.621367920655757 11145360.876168923452497,2311765.297453954815865 11144446.817896716296673,2313095.342729954980314 11143442.713763017207384,2316249.13522361824289 11139692.543561415746808,2317300.659133650828153 11138412.913829166442156,2318073.439038737211376 11137043.441592760384083,2319062.957992399577051 11133938.575800597667694,2319001.398313991259784 11132113.659906422719359,2314857.641588703729212 11088177.082606829702854,2313651.60622544772923 11087091.199582692235708,2308580.446822359692305 11086458.745467964559793,2298809.267198488581926 11083919.732159499078989,2294232.811612487770617 11082471.5302241332829)) +POLYGON ((926116.15844366454985 9264013.449728954583406,924724.776128238532692 9264153.198622258380055,921199.510493796784431 9267568.741824625059962,920612.077540880534798 9268685.360105672851205,921044.999040576629341 9270011.069724455475807,922158.19394850928802 9270637.603678392246366,926827.37867034226656 9272660.969402087852359,929331.955893700942397 9273498.513806719332933,930754.618986038956791 9273707.538461375981569,935114.446842957870103 9274196.459050375968218,941144.289700755500235 9275452.078649202361703,949431.580512353684753 9278875.062662964686751,950513.717282354016788 9279502.377750024199486,965572.684038394829258 9288309.232941456139088,966840.501719038933516 9291106.238900659605861,965603.742176327155903 9290687.423736309632659,965510.901721006724983 9291805.662334172055125,966098.445993411354721 9292576.442668590694666,971757.149668906698935 9299227.263533426448703,972715.721804127912037 9299996.579483827576041,978127.073571079876274 9301957.438320659101009,979364.055752774118446 9302378.935977151617408,980539.032978097675368 9301747.581662598997355,982672.693658130941913 9281179.177157256752253,982703.529157080803998 9279642.431197402998805,982579.964522301685065 9278246.043123302981257,982147.043022605706938 9277198.80624471232295,981497.71643280738499 9276080.851177964359522,979951.600025181542151 9274127.364945009350777,978992.916570469038561 9273358.832484602928162,976797.473573044757359 9272172.405496282503009,974292.896349686081521 9271335.017171649262309,963655.651087443577126 9268825.200774434953928,943339.732698179781437 9264501.453764460980892,941793.838929536403157 9264780.973461419343948,941577.211200451594777 9266174.72113549336791,941051.449245435069315 9268336.90016183257103,931712.968482277705334 9266871.697345668449998,930476.208939565927722 9266454.3065619263798,928311.824080071179196 9265269.281068107113242,926116.15844366454985 9264013.449728954583406)) +POLYGON ((1228379.522765841567889 9285023.627658732235432,1226988.029130927054211 9285232.739617105573416,1226431.431676960783079 9286350.372390126809478,1226091.350632588146254 9287610.153319535776973,1226091.350632588146254 9289148.622065303847194,1226462.489814890315756 9290687.423736309632659,1226988.029130927054211 9292015.225710006430745,1227637.467040213989094 9293204.715639868751168,1230606.02390119805932 9298596.189079638570547,1231719.218809130834416 9299155.908718474209309,1240933.912298526614904 9301328.139146316796541,1247582.246247172821313 9302729.067936910316348,1249313.70960697135888 9302519.440750708803535,1249870.418380429036915 9301397.498046774417162,1250055.876652090344578 9299927.486414980143309,1249530.33733605640009 9298596.189079638570547,1248602.71201927610673 9298246.260632261633873,1247180.048926938092336 9298036.51350867934525,1241057.699572288198397 9296705.822279341518879,1237161.294755541253835 9293766.026500685140491,1232306.76308153825812 9289988.110284514725208,1231502.702399539994076 9289008.381295373663306,1228379.522765841567889 9285023.627658732235432)) +POLYGON ((1271052.068449590820819 9470632.740627013146877,1269846.033086337614805 9472209.640723349526525,1255992.87905456754379 9480323.681740842759609,1254632.443557582562789 9480828.871476575732231,1252993.598014124669135 9480900.009645165875554,1250395.957696462981403 9480110.545446189120412,1248076.9500642567873 9478962.203233003616333,1246623.562792460201308 9478816.087483955547214,1245232.069157545920461 9478962.203233003616333,1244056.980612731073052 9479680.41252807714045,1229461.770855335984379 9502203.554100498557091,1228905.284720858093351 9503355.940791863948107,1228719.715129708405584 9504868.522913251072168,1228750.661948146531358 9508041.8975815102458,1228812.444265537662432 9511287.884461160749197,1229338.206220553955063 9512659.507271992042661,1232739.684581234352663 9516558.356424037367105,1234192.84921404835768 9516776.495667450129986,1252344.271424329141155 9503645.040054131299257,1274484.493628712138161 9484350.682641576975584,1275040.979763187235221 9483201.651152085512877,1275009.921625254908577 9481547.270540598779917,1271052.068449590820819 9470632.740627013146877)) +POLYGON ((1259116.170007754350081 9502924.13054533675313,1259147.005506704095751 9504508.256043568253517,1258775.977643890306354 9505878.562127290293574,1253766.600558193400502 9513167.015501081943512,1252776.970285039860755 9514031.656567430123687,1250488.79815178620629 9512877.785909235477448,1249004.575381039874628 9512730.966796956956387,1247242.053883308777586 9512948.987781872972846,1244273.608341815881431 9513817.500550236552954,1244118.762930121971294 9515332.586069025099277,1246036.129839543951675 9521904.05938340164721,1246530.833656630944461 9522988.102922696620226,1248850.06392781669274 9524147.532052246853709,1252808.0284229721874 9525231.920336943119764,1255590.90437331260182 9525736.428529826924205,1257353.425871043698862 9525521.91702613979578,1261311.613005181308836 9522483.791189001873136,1262826.782594365999103 9520459.1004245467484,1263414.215547282248735 9519304.178552623838186,1263630.620637384708971 9516776.495667450129986,1262702.995320604648441 9509702.237167282029986,1262362.802956740604714 9508473.761261345818639,1260724.068732773885131 9504365.763630280271173,1260012.848506093258038 9502995.491595136001706,1259116.170007754350081 9502924.13054533675313)) +POLYGON ((1238862.033935881452635 9563587.205652138218284,1231502.702399539994076 9568533.369706314057112,1219102.82432007510215 9574138.556955654174089,1214062.723054919624701 9570208.012987587600946,1212918.470009054522961 9569624.344271223992109,1206641.275242713512853 9567294.342727608978748,1205033.376517696771771 9567658.092799441888928,1205002.318379764445126 9568968.953458333387971,1206857.902971798321232 9570715.749784510582685,1214433.639598242240027 9577631.214355556294322,1236326.509894084418193 9595285.1112947370857,1237408.869303067214787 9595136.565828956663609,1253952.170149345882237 9580400.9287926312536,1254106.792922057211399 9578943.932152401655912,1253642.81328443181701 9578071.557354055345058,1249128.140015818877146 9571371.303108425810933,1248293.355154359247535 9570423.888351650908589,1245232.069157545920461 9567877.818462470546365,1240191.856572899036109 9564022.483761169016361,1238862.033935881452635 9563587.205652138218284)) +POLYGON ((1195540.272981827845797 9568825.152838202193379,1194612.647665047785267 9571663.203790688887239,1194488.860391283407807 9573482.746107032522559,1196004.252619453473017 9581494.005290567874908,1196375.169162776088342 9583099.818222595378757,1197055.442571015562862 9584265.239410664886236,1199776.647523456253111 9587037.564404597505927,1201075.412022541277111 9587474.293928675353527,1202126.601974100572988 9586965.610365051776171,1209702.561239529633895 9589297.925777228549123,1221205.538181670242921 9595357.150401378050447,1224545.234224959509447 9597255.146850727498531,1226369.649359569884837 9598719.883201979100704,1227235.381039470667019 9599739.513294732198119,1227441.544736419105902 9601397.648259464651346,1227173.598722079768777 9603542.068037442862988,1227853.872130316216499 9604710.878178231418133,1229183.472128351451829 9605152.918000280857086,1230636.748080656863749 9604931.762981111183763,1234842.287123338086531 9603686.57931637018919,1236048.322486591059715 9602955.630129244178534,1236821.21371116861701 9601935.534104144200683,1237408.869303067214787 9600763.237894419580698,1236852.160529609769583 9599374.102558823302388,1203981.96392715210095 9572535.047397734597325,1198199.695616877637804 9569624.344271223992109,1195540.272981827845797 9568825.152838202193379)) +POLYGON ((1289327.055294650606811 9618692.409269304946065,1287749.880749092437327 9619135.328297652304173,1283977.485845089657232 9621256.925141338258982,1283668.128980175592005 9624410.555937642231584,1283884.756709257606417 9625876.995389822870493,1284657.759253326337785 9630354.775014474987984,1287719.156569633632898 9632701.78193099796772,1296037.171560687711462 9638358.588622152805328,1296779.227286315290257 9638580.532500008121133,1309519.186410152819008 9638875.234006671234965,1310539.652182253310457 9638358.588622152805328,1310044.725726186763495 9637329.379092229530215,1307911.176365641877055 9633803.012460554018617,1304200.452459538821131 9631016.170617243275046,1302005.009462114656344 9629621.050116194412112,1299654.943691978929564 9628520.474195433780551,1295387.622331909602508 9625586.798825362697244,1289327.055294650606811 9618692.409269304946065)) +POLYGON ((1324763.722757346229628 9763653.757693560793996,1325072.85698327771388 9767167.861770948395133,1324269.018940259236842 9768216.292962547391653,1320589.130533105926588 9771362.528568848967552,1314559.287675308529288 9771062.209995137527585,1313508.097723746439442 9770313.626309633255005,1312611.307905916124582 9769264.881124824285507,1311157.92063411953859 9769491.004367087036371,1309921.049771916354075 9770239.500122345983982,1309148.047227847855538 9771284.347448851913214,1308962.477636695140973 9772785.847119115293026,1310199.45981838949956 9777655.196084225550294,1311188.867452560458332 9780727.389861831441522,1312735.095179677708074 9785230.833835879340768,1313879.014267071848735 9788079.622950388118625,1315208.836904086405411 9790706.810328414663672,1316971.358401817502454 9792736.528226103633642,1324083.449349109549075 9796418.127398708835244,1325598.507618805859238 9796566.935994632542133,1335122.557973112910986 9794841.221291676163673,1335926.507335622794926 9793788.795638898387551,1336668.785700232721865 9791082.319189136847854,1336823.297153452876955 9789506.61473711207509,1336421.433791689341888 9787931.264932019636035,1332957.950474638491869 9775481.481394587084651,1324763.722757346229628 9763653.757693560793996)) +POLYGON ((2218844.580779504030943 11085821.455830369144678,2216958.383327502757311 11086638.228518651798368,2207929.03679027967155 11089083.586947536095977,2204403.993794817477465 11088814.593547947704792,2202394.120388546027243 11089083.586947536095977,2200785.999024546705186 11089995.109898827970028,2199209.269756950438023 11092715.715425936505198,2198683.507801934145391 11094255.948757287114859,2198435.933254410978407 11095981.163910726085305,2198219.750803288072348 11099522.49677399918437,2198312.368619629181921 11105062.437369156628847,2198343.426757561508566 11106884.996188746765256,2198652.560983492992818 11108883.2065,2198683.507801934145391 11110701.87997405230999,2198435.933254410978407 11112431.283714758232236,2193766.971171557437629 11126185.909508755430579,2190860.196627964265645 11131842.954415773972869,2188448.125901455059648 11135949.706568630412221,2186314.687860401812941 11138322.812795203179121,2184954.141043925657868 11139421.535246418789029,2178460.429867993574589 11142985.634015236049891,2175770.283053482417017 11145084.70368742197752,2174718.759143449366093 11148194.351355511695147,2174749.81728137889877 11150023.931957669556141,2179635.407093314453959 11156158.524326516315341,2180841.442456570453942 11157255.525830212980509,2190056.358584945555776 11163029.333109242841601,2191138.384035457856953 11161745.289599666371942,2202765.259570850990713 11137228.871337478980422,2203291.021525867283344 11135673.917271206155419,2203754.667205022182316 11132299.283389499410987,2209289.583606753032655 11125274.432996194809675,2224658.129866690374911 11115070.7846386320889,2234058.170308256521821 11109517.7548194732517,2239716.985303243156523 11107244.722245058044791,2238944.205398156773299 11102885.761196170002222,2227997.491951508913189 11088904.039198763668537,2225090.82872740412131 11087633.956178830936551,2218844.580779504030943 11085821.455830369144678)) +POLYGON ((2130809.565236476715654 11107699.398761540651321,2119615.833839759230614 11119988.185319041833282,2118811.439199287444353 11121354.216363802552223,2119522.770745456218719 11123266.466081321239471,2130129.291828240267932 11149295.004741368815303,2137581.463819905184209 11152954.595525471493602,2139436.714453465305269 11152954.595525471493602,2141075.448677431792021 11152039.512536257505417,2142683.68136092228815 11149295.004741368815303,2144105.787855807226151 11126917.279952876269817,2143796.653629875276238 11124908.826510289683938,2141539.650954039767385 11114340.690789131447673,2140982.942180585116148 11112251.116913797333837,2139931.418270552065223 11110886.918206710368395,2138725.494226787704974 11109792.482253275811672,2135695.155048412270844 11108703.461286161094904,2130809.565236476715654 11107699.398761540651321)) +POLYGON ((2557688.75429075025022 11149199.489135853946209,2551690.080890373792499 11150481.157228203490376,2545845.584984745830297 11151396.029794635251164,2542722.294031556230038 11150481.157228203490376,2537589.574950062669814 11150023.931957669556141,2535734.324316502548754 11150114.188681164756417,2520149.150327480398118 11154599.221601387485862,2512851.601108526811004 11156893.136287726461887,2501194.11271316325292 11162661.684378355741501,2497761.687534044962376 11164404.067286694422364,2495690.254449364729226 11166973.406009458005428,2490495.085133532527834 11176887.134344639256597,2490062.274953328073025 11178451.57600249350071,2491268.310316581279039 11182308.988676983863115,2501596.198713909368962 11191875.967741213738918,2503172.927981505636126 11192341.330143973231316,2522994.365192664787173 11197314.816141977906227,2524849.615826225373894 11197127.402784094214439,2525591.560232361778617 11195746.011261984705925,2526210.273962189909071 11192432.152462402358651,2526735.924597717821598 11187275.10921429656446,2541949.514126470312476 11177714.622737934812903,2548257.655711252242327 11174500.816554317250848,2549989.341710033360869 11174682.315137200057507,2554565.797296037431806 11173396.061224680393934,2561863.457834478933364 11158538.718679053708911,2562728.8555559059605 11155423.992,2562883.923606582451612 11153683.916511088609695,2562481.726286345161498 11151672.459594612941146,2561368.308739429805428 11150390.566197425127029,2557688.75429075025022 11149199.489135853946209)) +POLYGON ((2421229.537613669876009 11153960.439657110720873,2419219.664207395166159 11154327.616553461179137,2417209.790801123715937 11157074.163763903081417,2415323.482029630802572 11163306.2379,2414643.20862139435485 11166515.066530585289001,2413870.317396816797554 11173396.061224680393934,2414117.446666378062218 11178911.054681373760104,2415385.486986004281789 11194182.543123573064804,2416343.947801734320819 11195746.011261984705925,2417890.064209360163659 11196206.333237254992127,2419621.750208141282201 11195746.011261984705925,2420951.350206176750362 11194642.758817162364721,2430320.889107263181359 11184975.851598598062992,2431372.301697807852179 11183687.97262305021286,2431742.99560214811936 11180289.016016928479075,2431372.301697807852179 11178265.014723669737577,2430073.314559740014374 11173950.730337522923946,2424538.398158009164035 11157899.565265396609902,2423734.560114990454167 11156068.187062069773674,2421229.537613669876009 11153960.439657110720873)) +POLYGON ((2577757.20945197949186 11158629.088887196034193,2573737.462639436125755 11160098.928347960114479,2570583.224867808166891 11162112.558615727350116,2569562.759095704648644 11163396.67173870652914,2543773.817941592074931 11202104.738864352926612,2548783.417666271794587 11216225.433375388383865,2549927.336753659881651 11217519.849900173023343,2580230.839856897015125 11248364.567414542660117,2581498.880176523700356 11249389.701790118589997,2583106.556262560654432 11249854.021459540352225,2585271.386400017887354 11249201.175039598718286,2586570.039579611737281 11247997.602390894666314,2588610.859804324340075 11245397.333230540156364,2589353.138168934732676 11244005.721097776666284,2605618.140288231428713 11251894.530937012284994,2604968.813698432873935 11267423.962013417854905,2603515.203787653706968 11270314.032625757157803,2603360.692334433551878 11272084.689499199390411,2603638.768422435969114 11273666.264687933027744,2605247.001105926465243 11274131.918714497238398,2612482.545368506107479 11274131.918714497238398,2614647.486825454048812 11273481.756473870947957,2620305.967861967161298 11270871.672449627891183,2626242.970264444127679 11261192.774261737242341,2626676.114403119776398 11259517.028627341613173,2633045.815666310489178 11233901.906000701710582,2633757.147212482523173 11220942.546884968876839,2633478.959804988931865 11217154.553857503458858,2632025.461213701404631 11212901.869692269712687,2620429.532496746163815 11196667.018187534064054,2598784.236748429946601 11170002.594355851411819,2586013.330806154292077 11159912.541912944987416,2584591.112991778180003 11159182.880099181085825,2577757.20945197949186 11158629.088887196034193)) +POLYGON ((2467272.614839655347168 11221313.373644189909101,2465664.493475656025112 11221587.678683381527662,2464644.027703555300832 11222791.556534377858043,2464458.903390365187079 11224549.816020270809531,2464427.845252435654402 11226028.706076376140118,2466314.154023925308138 11237607.522572563961148,2466963.480613723862916 11239736.133937019854784,2467798.3767946716398 11241590.286944825202227,2474168.07805786235258 11246788.89755491912365,2477105.799419899471104 11251618.994447479024529,2478021.179592692293227 11263758.256227698177099,2478522.005981768947095 11264875.181294422596693,2478837.485418677795678 11265935.995392948389053,2474755.84496925259009 11266608.220846213400364,2473698.198487224057317 11266493.274270087480545,2464885.479679086245596 11264483.868015471845865,2459696.878213211428374 11266585.432448433712125,2458428.837893584743142 11265562.714602103456855,2450667.531675986014307 11268354.777869578450918,2443617.000407105311751 11280564.78123970888555,2443431.430815952830017 11282338.125138709321618,2443802.68131774617359 11284393.838180530816317,2444637.46617920557037 11286260.277625450864434,2446523.774950698483735 11286162.809446116909385,2465516.104594428092241 11284557.811490485444665,2467223.188985743094236 11282151.028842056170106,2468447.592064979020506 11281927.998011570423841,2472436.392059084028006 11282319.986312367022038,2479356.902162719517946 11284614.2622388638556,2491113.353585398755968 11292145.253786375746131,2490557.090089903213084 11297377.506708426401019,2491360.928132921922952 11301401.032648101449013,2492195.712994381785393 11303364.836189908906817,2493463.753314005210996 11304393.2897,2507007.550480861216784 11304485.629033412784338,2508460.715113675687462 11304485.629033412784338,2510347.023885168135166 11303647.544213494285941,2517799.195876833051443 11298220.201370380818844,2522066.5172369023785 11294948.319583809003234,2522654.172828800976276 11293731.52982347086072,2522963.307054732460529 11292514.622673694044352,2522252.086828054860234 11291021.124055407941341,2517118.92246859613806 11286911.670021733269095,2515139.995880763046443 11283645.256466927006841,2515016.431245983578265 11281779.538796940818429,2515480.188244629651308 11280190.69196479767561,2516500.654016730375588 11278884.228356581181288,2518541.474241442978382 11278515.603494280949235,2527817.950048226863146 11278884.228356581181288,2538671.600400571711361 11280472.76813398860395,2540248.774946129880846 11280938.891216207295656,2541238.182580301072448 11282522.539302673190832,2538022.273810773622245 11297377.506708426401019,2537249.493905687239021 11298780.14809775352478,2533878.517085486091673 11302521.499803146347404,2530601.159957041032612 11308137.751301895827055,2529827.823454501572996 11309547.687060423195362,2528931.367595142219216 11312728.794911148026586,2528745.798003989737481 11314510.26222413033247,2529457.129550158511847 11315262.270829161629081,2536259.529674062971026 11319105.639590360224247,2545257.929392847232521 11310201.328004954382777,2548752.359528339467943 11298497.643619289621711,2548906.982301050797105 11296725.441562809050083,2554225.716251662001014 11289245.50109894387424,2556297.149336345028132 11286629.661170732229948,2558183.458107837475836 11286537.229363702237606,2559482.445245902054012 11287563.125195924192667,2572191.346231807488948 11311982.128941813483834,2578159.406772216781974 11330375.530320858582854,2591826.76857385225594 11324740.769780449569225,2593589.512710562907159 11324173.597674366086721,2598227.527974975295365 11328682.54542119987309,2599093.370974364224821 11330561.26018781401217,2598660.672113650944084 11332161.658065838739276,2597640.206341547425836 11333478.464218402281404,2596279.659525074064732 11338272.710543941706419,2596125.036752362735569 11340061.267117250710726,2595320.753431379329413 11352494.996962506324053,2595753.8975700577721 11354566.74043489806354,2597083.4975680927746 11355608.113917475566268,2598536.662200906779617 11355608.113917475566268,2600021.218930124305189 11354851.939241368323565,2601319.760790229775012 11353722.418886246159673,2602371.284700262825936 11352401.659568784758449,2609452.317509622313082 11338365.852839905768633,2610627.29473494598642 11328682.54542119987309,2604875.861923621501774 11312728.794911148026586,2603422.697290804237127 11311982.128941813483834,2601938.140561587177217 11312636.005449879914522,2593836.641980123706162 11303457.498422654345632,2580478.414404420182109 11283927.140837751328945,2570243.032503944355994 11260538.49768421985209,2549092.55189220327884 11245488.870322870090604,2536321.534630435984582 11240016.193968443199992,2534435.33717843471095 11240107.992091519758105,2534002.52699823025614 11241687.114800680428743,2533816.957407077308744 11243450.291917540132999,2534218.70944934990257 11245488.870322870090604,2535054.050908262841403 11247344.600935250520706,2535332.12699626525864 11248925.748239934444427,2534311.66122416453436 11250226.436221936717629,2532116.218226737342775 11252359.022588513791561,2530508.096862738020718 11253379.745533183217049,2520365.77805656241253 11255334.665968952700496,2519067.236196459271014 11254308.630253819748759,2518974.173102156724781 11252450.988361448049545,2519190.800831238739192 11247069.583875318989158,2519716.45146676665172 11241962.247030399739742,2519314.365466020535678 11239924.73089550063014,2518170.335059138014913 11238534.243919584900141,2500853.920349299442023 11232044.523829262703657,2499276.745803741272539 11231581.75820985622704,2486938.984000141266733 11230192.984564574435353,2485207.298001360148191 11230101.320863962173462,2483475.945961052551866 11230564.318586461246014,2482146.012004543561488 11231678.109537653625011,2481404.178917898330837 11233158.891947662457824,2476858.670150338672101 11235474.576917251572013,2467272.614839655347168 11221313.373644189909101)) diff --git a/src/boost/libs/geometry/test/algorithms/buffer/data/uk.wkt b/src/boost/libs/geometry/test/algorithms/buffer/data/uk.wkt new file mode 100644 index 000000000..6aef5f452 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/data/uk.wkt @@ -0,0 +1,48 @@ +POLYGON ((-702580.609678269247524 6430990.768781933002174,-703230.047587556065992 6431039.689706697128713,-703260.883086505928077 6431616.044759067706764,-702209.581815455458127 6433969.24533439334482,-701931.283088470925577 6434497.034421884454787,-701467.526089824968949 6434786.018295114859939,-700756.194543655961752 6434833.57794185820967,-699921.298362707952037 6434065.56607898324728,-699643.11095521459356 6433585.356836878694594,-699086.513501248206012 6432576.264011836610734,-698993.673045927775092 6432239.811620931141078,-699797.622408437659033 6431375.920790256001055,-700292.326225521741435 6431087.055115864612162,-702580.609678269247524 6430990.768781933002174)) +POLYGON ((-735358.077144894748926 7178577.384160616435111,-735605.429053435451351 7178156.504514626227319,-736935.140370961744338 7177207.711922005750239,-737491.626505436841398 7177576.599523988552392,-738326.634005878935568 7178735.125026864930987,-740893.104866117006168 7182528.682258407585323,-749705.934993749135174 7205006.614720835350454,-762724.081525077228434 7224794.096369032748044,-762600.405570804025047 7225641.074151545763016,-764765.013069281238131 7234599.530509736388922,-765445.286477517918684 7235820.532933908514678,-770021.742063518846408 7241232.352442853152752,-771103.990153013262898 7242295.362922673113644,-776391.665965692023747 7246596.846274865791202,-782050.369641187484376 7249518.358906683512032,-782668.860732035944238 7249677.338468996807933,-783287.240503390436061 7249572.308288598433137,-785730.03540935809724 7248190.211547926999629,-797140.283215669333003 7234175.642269320785999,-798779.240078618517146 7225111.440101872198284,-795377.761717938352376 7219339.847829,-795099.574310447787866 7218756.899979280307889,-794975.787036686204374 7218121.595145341940224,-795470.602173261577263 7212936.272668306715786,-810498.733430352644064 7193863.911592195741832,-811179.006838592118584 7193284.368466717191041,-814116.616881135152653 7191490.353688426315784,-816002.8143331365427 7191596.129582037217915,-841513.568079758668318 7194233.580200714059174,-847141.43625630135648 7197189.273813962936401,-848254.631164236925542 7197876.675367269665003,-848656.494526000577025 7198404.477830711752176,-848718.388162879971787 7199670.435727526433766,-848594.712208609562367 7201097.638806481845677,-848749.334981321007945 7201730.238547168672085,-849120.362844134797342 7202364.220307854004204,-856819.998063834267668 7208600.843717868439853,-857438.377835188759491 7208600.843717868439853,-862478.701739326817915 7208177.02362107951194,-870023.714186314842664 7207966.359085638076067,-870580.311640281230211 7207966.359085638076067,-874012.625499908346683 7210450.923199803568423,-875187.714044723310508 7211560.60871528275311,-875806.093816080596298 7212724.147678012028337,-875991.663407233078033 7214047.832645014859736,-876022.610225674230605 7218227.729782055132091,-876610.043178590363823 7223839.853871395811439,-876702.883633910794742 7224475.621257141232491,-876981.182360892533325 7225111.440101872198284,-879454.924085301463492 7226066.027831118553877,-884031.379671305185184 7227071.474335627630353,-893926.569207917316817 7238101.111762473359704,-895596.361569816246629 7238896.987277653068304,-896771.338795139919966 7239853.061600086279213,-897853.586884631542489 7241073.352828699164093,-907996.128329789848067 7253664.551400667987764,-908305.262555721448734 7254302.739608785137534,-909665.698052706429735 7258503.559282522648573,-895781.931160968844779 7266808.423884701915085,-885082.792261846945621 7271603.566779747605324,-872033.587592586525716 7275761.46482103690505,-862973.516875904984772 7283550.487191719934344,-865787.339644686551765 7289796.44511900562793,-873796.220409806002863 7290971.651573035866022,-874445.546999604441226 7291293.032340248115361,-880135.197493540938012 7297012.009956564754248,-880970.093674488947727 7298293.985694441013038,-882485.374583167838864 7303643.401859720237553,-882238.022674624342471 7304285.678086150437593,-873085.000183128286153 7310334.795314759016037,-871600.666092890547588 7310709.995978504419327,-871013.233139974297956 7310496.750225250609219,-870425.688867569784634 7309853.963256160728633,-861520.129604105604813 7305890.828869744203985,-840833.294671519193798 7315960.453899467363954,-832985.827168048126623 7328929.289326399564743,-830226.99622771772556 7334311.537675649859011,-828650.044321142020635 7339095.072544374503195,-824475.452096901950426 7352813.874814124777913,-815569.892833440564573 7370657.641546722501516,-807345.386214651749469 7375579.235195306129754,-807622.905705200508237 7371088.997127560898662,-807190.095524995704181 7370819.105633105151355,-789811.787178274942562 7369039.105478069745004,-787430.774589698179625 7369200.535986931994557,-786379.473318647709675 7369740.021799798123538,-785389.954364985460415 7370495.986515521071851,-784524.2226850874722 7371413.695412076078355,-782483.291140883462504 7373897.27900336496532,-781431.989869830082171 7375516.826025347225368,-778587.108963119098917 7383297.723296964541078,-775556.769784743897617 7392222.044764839112759,-766960.456066705519333 7394495.167811283841729,-759724.57784565188922 7394550.323422431945801,-749211.119857170968316 7396932.717854937538505,-736192.973325842875056 7402187.990906184539199,-725308.376155059668235 7407229.349494850263,-709816.487899322877638 7408422.401526880450547,-707249.794400102342479 7408151.405853908509016,-696303.414911925327033 7403107.887909795157611,-686655.799922836362384 7404409.001458238810301,-684553.08606124133803 7404897.267981527373195,-683749.0253792431904 7404735.094520182348788,-679481.815338665037416 7402783.423994276672602,-678894.382385748787783 7402458.973633683286607,-675338.392571848467924 7399695.354303826577961,-674688.954662558855489 7398557.071201404556632,-672091.425664388458245 7393304.252914915792644,-671658.504164695274085 7392006.556416805833578,-671627.668665745412 7391194.924285786226392,-672648.023118354729377 7381838.443037242628634,-673421.136981914751232 7378811.975986515171826,-671936.914211168303154 7373087.534717652946711,-650600.641369295073673 7341729.426462116651237,-644694.474465764942579 7333076.617546134628356,-643643.173194714472629 7333774.499370026402175,-642931.952968036755919 7333882.213487460277975,-639746.991016950109042 7333505.897395013831556,-638571.902472135261633 7332861.213045955635607,-638077.19865505117923 7332485.139554671943188,-635696.186066474416293 7329532.480891049839556,-635417.887339489767328 7328995.578204441815615,-633717.259478640975431 7325506.417759177275002,-633191.497523624449968 7324326.005681159906089,-633021.401341693941504 7317593.093180313706398,-633005.927932471968234 7316390.143963797017932,-633129.603886742261238 7315639.40769452508539,-633469.796250609098934 7314674.033359771594405,-633779.041796031873673 7313870.417450193315744,-634119.122840404626913 7313281.743146340362728,-635758.079703353811055 7311407.230682726949453,-639258.409771858365275 7308761.115459430031478,-639592.36824423877988 7308568.547962940298021,-640019.055852448334917 7308503.78158331848681,-641985.737296294188127 7308503.78158331848681,-644075.983374919276685 7307658.20552833750844,-647477.461735596647486 7305890.828869744203985,-648065.006008004071191 7305570.388923220336437,-652610.514775566756725 7302306.041605127975345,-653569.198230279260315 7301449.388351605273783,-654342.2007743450813 7300487.11356435995549,-655486.342500718892552 7298990.305958847515285,-655826.42354509443976 7298348.464695187285542,-659444.306995874154381 7291133.013455408625305,-659567.982950147357769 7290330.468121011741459,-657712.732316584209912 7285525.380799518898129,-657310.757635332178324 7285044.534679209813476,-656599.537408651551232 7284830.450430164113641,-655362.55522695730906 7285258.624785932712257,-654898.798228314262815 7285685.285017566755414,-654558.605864447541535 7286271.692514781840146,-653971.061592042911798 7288408.578886755742133,-651868.45904993917793 7291827.15753585472703,-647477.461735596647486 7295299.956990664824843,-645993.238964850082994 7296423.257006233558059,-639042.004681756021455 7298690.555295042693615,-638763.594635282992385 7298819.155970427207649,-638318.427991599426605 7298883.072063163854182,-626636.115349790081382 7299899.446665154770017,-623296.419306500814855 7299845.149397530592978,-620822.677582092001103 7299632.199924216605723,-620235.133309687371366 7299310.476234449073672,-616586.303040463710204 7295087.131279540248215,-616184.328359208768234 7294605.504606320522726,-615967.923269106424414 7293964.023176178336143,-615349.543497751932591 7290384.699359583668411,-609969.027229749946855 7272402.850899826735258,-605052.379279882181436 7263400.942685867659748,-604526.728644356946461 7262975.494991698302329,-604433.99950852477923 7262282.371353711932898,-605052.379279882181436 7257865.603547422215343,-605176.055234152474441 7257067.992521191947162,-607928.20700503711123 7243515.842901426367462,-612356.273709810222499 7239513.531062413938344,-612690.232182190637104 7239353.802024363540113,-613153.989180836477317 7239322.468001203611493,-613821.906125594396144 7239736.507536829449236,-614230.114698332850821 7240372.799149225465953,-617291.400695149088278 7246553.817851796746254,-617421.310540905804373 7246936.109753286466002,-617476.970286301686428 7247351.125055524520576,-617514.039676735061221 7248306.891271497122943,-617347.060440544853918 7249136.706325385719538,-617198.560239828657359 7249550.498919304460287,-617031.692323126830161 7249900.795335852541029,-615844.247314836131409 7251400.684768149629235,-617359.416904023615643 7254250.289068546146154,-616895.548585889395326 7255631.92278547026217,-616771.872631616191939 7256376.922925828024745,-617112.064995480119251 7261006.27972043864429,-617823.173902669572271 7265263.98572336230427,-618039.690312260296196 7265903.119205271825194,-618905.533311652368866 7268460.174703576602042,-619121.938401754712686 7269045.485060340724885,-619833.158628432429396 7270110.739406228065491,-623358.312943383003585 7273468.562051032669842,-627780.145756672602147 7276775.031683855690062,-629975.588754096766934 7278160.643995403312147,-632356.601342676440254 7279441.070262845605612,-633717.259478640975431 7279867.605481947772205,-634366.474748948123306 7279655.007129641249776,-634582.991158541757613 7278960.597823172807693,-635046.748157184803858 7271869.857851793058217,-631830.950707148294896 7269844.31633363571018,-631336.246890064212494 7269578.094122973270714,-628400.863237337209284 7264020.949493289925158,-620421.148178801988252 7241887.68653959594667,-619846.071689364616759 7239944.968565747141838,-619066.835253812256269 7235710.531812792643905,-619252.293525473563932 7235360.104490867815912,-618843.639674770180136 7225430.131716476753354,-619183.720719142816961 7223946.065778506919742,-621904.925671586417593 7220504.539058900438249,-624316.885078604216687 7217592.467723579145968,-628738.717891893815249 7213306.838673415593803,-629326.262164301238954 7212989.971284665167332,-629913.695117217488587 7213148.40338253416121,-630315.781117960694246 7213623.528398230671883,-630841.431753488839604 7214787.372753542847931,-632789.522842369507998 7216322.097633068449795,-633408.013933218084276 7216640.242434814572334,-634181.016477286815643 7216798.748124402947724,-637922.575882339733653 7217169.496270720846951,-639654.261881118058227 7217275.618050076067448,-648157.735143836122006 7215793.09134410135448,-648714.332597802393138 7215528.506309328600764,-651837.512231498025358 7213465.086724683642387,-652765.248867769376375 7212671.974185792729259,-653785.603320378810167 7210662.986864631064236,-653878.332456210860983 7209075.693994278088212,-653661.927366108517163 7207648.565089578740299,-652981.65395787183661 7205799.144700707867742,-652888.924822039785795 7205058.927608329802752,-652765.248867769376375 7202681.991035751067102,-652919.76032098964788 7200991.735133954323828,-655115.203318413812667 7192229.295435792766511,-656383.020999060827307 7189011.958430443890393,-657186.970361567800865 7188009.65743596944958,-659042.443634110502899 7186428.44533262681216,-664391.901764183072373 7182265.403044558130205,-672802.645891066174954 7176102.858493013307452,-675462.068526118760929 7175417.544330146163702,-676266.017888628528453 7175365.428019927814603,-677038.909113206085749 7175523.104603540152311,-679976.630475240410306 7177050.191182835027575,-686934.09864982101135 7183318.952110709622502,-687645.207557007553987 7184372.642110075801611,-688603.891011719941162 7186744.055035966448486,-689315.111238397774287 7187851.730732556432486,-689809.815055481856689 7188221.117140376009047,-690490.088463721331209 7188484.595525707118213,-697636.465814174502157 7189085.807243238203228,-697695.01986633380875 7189486.956981653347611,-698251.50600080890581 7190066.410480657592416,-698931.779409045586362 7190487.927040966227651,-700044.974316978245042 7190751.481293486431241,-705641.895675082691014 7192071.473987069912255,-706847.931038338690996 7192071.473987069912255,-707435.363991254824214 7191807.685633002780378,-707992.072764709591866 7191332.547052661888301,-708393.936126473243348 7190751.481293486431241,-708579.505717625725083 7190172.167244667187333,-708672.346172949066386 7189591.187116243876517,-708641.399354508030228 7189011.958430443890393,-717732.416889630607329 7181210.477632988244295,-731090.75578482542187 7179788.202057422138751,-735358.077144894748926 7178577.384160616435111)) +POLYGON ((-688882.189738701679744 7412436.509964105673134,-694015.242778671905398 7418624.028414089232683,-697169.257911317399703 7418407.806155252270401,-698839.161592707620002 7418516.698528823442757,-699364.70090874156449 7418788.056371249258518,-699241.024954471271485 7419602.577901406213641,-697169.257911317399703 7421068.971302789635956,-696025.227504434878938 7421829.946886125952005,-694510.057915247278288 7421992.673532713204622,-689191.435284124570899 7420797.533670457080007,-687768.994830769021064 7420254.491353197954595,-687367.020149514195509 7419818.833460438996553,-687150.503739920561202 7418950.719224117696285,-688078.129056703532115 7413467.81125176884234,-688480.215057446854189 7412761.377551549114287,-688882.189738701679744 7412436.509964105673134)) +POLYGON ((-698468.022410402540118 7473833.514653102494776,-701374.685634504538029 7474653.648916405625641,-703230.047587556065992 7475583.764775579795241,-704157.672904336242937 7476567.962184702046216,-704374.077994438586757 7477114.967761962674558,-703755.698223081300966 7482205.531554742716253,-703632.022268811007962 7482918.328284627757967,-699735.728771555353887 7500351.250473250634968,-696087.009821822983213 7511500.496498202905059,-695870.604731720522977 7512214.61759833805263,-695901.55155016167555 7513038.83786569070071,-696241.632594537222758 7513698.673329569399357,-696767.283230062457733 7514083.834334052167833,-697447.556638299138285 7514302.74736132659018,-704126.726085895090364 7515018.513606816530228,-704837.946312575717457 7515018.513606816530228,-705518.219720812398009 7514797.99668319709599,-706384.062720201560296 7513753.101390008814633,-706693.196946135954931 7513038.83786569070071,-707157.176583761465736 7511719.336227979511023,-707589.986763966269791 7510400.060231103561819,-708053.855082100490108 7508862.244868799112737,-708826.857626169221476 7506994.094842792488635,-710187.515762136667036 7504467.491784112527966,-711671.738532883115113 7502326.092530774883926,-713650.665120713762008 7499692.555206660181284,-717948.933299224241637 7495028.964548327960074,-719402.320571020827629 7493766.825120431371033,-720608.133295294363052 7493000.126278794370592,-721907.009113870793954 7492726.154522690922022,-722618.118021057220176 7492890.181114114820957,-723731.424248481169343 7493658.250885146670043,-724133.287610244820826 7494316.431577333249152,-724597.155928379157558 7495412.997528378851712,-724689.885064211208373 7497058.335962226614356,-723576.690156278549694 7503149.454878541640937,-723051.039520753314719 7505565.500604602508247,-717979.768798174103722 7528337.029204244725406,-717083.201619326253422 7529327.976146135479212,-709074.209534712717868 7532468.237580842338502,-702395.151406607939862 7531311.839350585825741,-689315.111238397774287 7541787.653664988465607,-686068.255650428938679 7543996.076252364553511,-683718.189880293328315 7545210.422262988984585,-683130.64560788590461 7545375.767772215418518,-682326.69624537602067 7545210.422262988984585,-681491.800064428010955 7544271.875555530190468,-681120.660882122931071 7542836.356887289322913,-681584.529200257151388 7537540.862735974602401,-681460.853245986858383 7534342.371975722722709,-679389.086202832986601 7520903.339064310304821,-679265.410248562693596 7520133.939571330323815,-678770.706431475700811 7518042.646464759483933,-678306.838113341364078 7516722.28863972146064,-677750.240659375092946 7515512.423126570880413,-676327.800206019543111 7514248.315422492101789,-674534.331889847409911 7513203.494580280035734,-673730.271207849145867 7512214.61759833805263,-673482.919299305649474 7511609.124123423360288,-671287.476301881484687 7502985.210201594978571,-670669.096530524198897 7495138.94016498234123,-670978.230756455799565 7494534.982082433998585,-672184.266119711683132 7493000.126278794370592,-676451.476160289836116 7489052.555783456191421,-693396.751687823329121 7477662.012045311741531,-698468.022410402540118 7473833.514653102494776)) +POLYGON ((-142767.246942374389619 6547139.234569259919226,-152229.403659802046604 6554104.99633458070457,-163979.843829977238784 6561516.002191687934101,-166268.015963233541697 6562638.73916320502758,-166886.507054079236696 6562882.695191740058362,-168339.783006384619512 6562930.819839452393353,-169576.765188081684755 6562687.038019890896976,-171215.61073153957841 6562003.67942014709115,-174678.871409607905662 6560930.546629772521555,-174771.600545439956477 6561467.710193186067045,-172637.939865403866861 6564053.925138529390097,-169576.765188081684755 6567567.207730176858604,-145704.856984917481896 6580905.342729836702347,-144375.256986882421188 6581051.617871415801346,-143756.765896033903118 6580953.572754107415676,-124461.424598364756093 6574990.329746156930923,-123997.556280227654497 6574599.851886772550642,-121771.166464362308034 6572010.502197095192969,-117967.713422430038918 6566199.738046816550195,-130058.345956469187513 6551181.989213441498578,-132624.816816707229009 6549719.558585209771991,-135284.128132268582704 6548599.805448189377785,-138221.738174811645877 6547771.924045508727431,-142767.246942374389619 6547139.234569259919226)) +POLYGON ((-106928.604798423839384 6581490.810956662520766,-108289.151614899994456 6581784.96900472138077,-113824.179336122222594 6583496.258340136148036,-113731.450200290171779 6584132.97693841997534,-113422.204654867309728 6584572.334444087930024,-108629.232659272704041 6591326.246577495709062,-108072.635205306374701 6591423.18161381687969,-107361.526298119846615 6591228.255228956229985,-105660.787117779749678 6589955.002541372552514,-105351.541572354064556 6589417.211600774899125,-104207.399845983134583 6582566.624939186498523,-104454.751754523793352 6582029.316535127349198,-106928.604798423839384 6581490.810956662520766)) +POLYGON ((-519150.801777908636723 6649348.930204601027071,-519769.404188248387072 6649545.241816986352205,-520233.161186891433317 6649890.662282161414623,-520356.837141164578497 6650581.369407772086561,-520016.75609678903129 6654131.859586838632822,-519800.239687198249158 6655514.048042042180896,-519367.31818750227103 6655859.720446646213531,-518625.262461874634027 6655859.720446646213531,-518346.852415401663166 6655365.019068235531449,-517233.657507469004486 6650433.672830066643655,-517295.55114434834104 6649791.791729428805411,-517821.313099364808295 6649545.241816986352205,-519150.801777908636723 6649348.930204601027071)) +POLYGON ((100094.812578116412624 6684726.008760557509959,98548.696170487746713 6684924.597660858184099,87664.098999701731373 6686905.046361476182938,86952.878773023971007 6687103.68826603423804,85283.086411124968436 6688045.252445382066071,84540.919366006113705 6688936.450240269303322,82963.96745943040878 6691364.418921520002186,82469.152322852212819 6692405.682379041798413,81819.825733056655736 6693843.436656802892685,82438.316823902350734 6697660.772802976891398,83365.942140682484023 6700140.454425781965256,84633.759821329411352 6700339.240169217810035,88066.073680956644239 6699495.907561649568379,99321.698714556463528 6696173.432659012265503,100651.410032082756516 6695726.623017131350935,101177.060667607991491 6695379.438650756143034,103588.908755134601961 6692158.022346547804773,104269.293482862500241 6691215.983681936748326,105073.242845372311422 6689679.516413123346865,105475.217526627224288 6688540.508851628750563,105506.164345068318653 6687846.587631016969681,105413.323889745035558 6687203.011030683293939,104918.620072660894948 6686856.18903929926455,100713.192349470875342 6684875.573919639922678,100094.812578116412624 6684726.008760557509959)) +POLYGON ((-484394.407723452488426 7006049.762103352695704,-490053.222718436270952 7006307.436954452656209,-498587.642799595370889 7015743.440835641697049,-500319.328798373753671 7018115.986201459541917,-508451.774198277969845 7033717.665927033871412,-508637.343789430509787 7055102.47952401265502,-508389.991880887013394 7055724.81108265183866,-507616.878017327049747 7056708.993350408039987,-498123.885800949530676 7060807.952524495311081,-493052.615078370319679 7061896.63299054838717,-492372.341670133697335 7062000.689365667290986,-491599.339126064965967 7062000.689365667290986,-480220.038138194824569 7059562.541611047461629,-477838.914230126829352 7058731.87816125806421,-476849.395276464463677 7057953.956942255608737,-476107.339550836826675 7057020.962758803740144,-475334.225687276921235 7055206.446941974572837,-470015.603056157066021 7042719.929438506253064,-459409.415931846830063 7040650.064133018255234,-458883.765296321595088 7040908.674678429029882,-458172.545069641026203 7041010.966040506958961,-457523.218479845440015 7040959.913356561213732,-451957.132620690914337 7039717.608172768726945,-450472.909849944408052 7039303.86003131698817,-450442.074350994545966 7038631.774748852476478,-455296.717344488890376 7030305.458701467141509,-456564.535025132994633 7028961.189470266923308,-462347.025974389922339 7024828.95993609726429,-469551.846057511167601 7020129.07989423815161,-481518.691317788732704 7009863.606724730692804,-484394.407723452488426 7006049.762103352695704)) +POLYGON ((-509564.969106210628524 7027153.06351625919342,-512842.771512617648114 7030511.444993272423744,-519243.642233231919818 7034647.929492488503456,-520635.13586814631708 7035010.048678809776902,-521315.409276385849807 7035993.159698629751801,-522521.444639638939407 7038941.54536,-522304.928230045363307 7039458.850060502067208,-521129.951004724542145 7041994.818992805667222,-520820.705459298857022 7042564.875849957577884,-520140.43205106217647 7042668.679420317523181,-515038.214510041929316 7042978.607297976501286,-514481.617056075599976 7042668.679420317523181,-511049.303196448367089 7038165.558255122974515,-507678.771654209238477 7030925.85271664056927,-507555.095699936093297 7030201.816304904408753,-507555.095699936093297 7029477.84574724920094,-507709.718472650332842 7028702.966924164444208,-508018.964018073223997 7028135.204441647976637,-508884.695697971154004 7027256.666226947680116,-509564.969106210628524 7027153.06351625919342)) +POLYGON ((-296666.442964075424243 6730809.290560748428106,-297748.802373058220837 6729365.000025758519769,-300438.949187566584442 6726228.490211070515215,-302201.582004788913764 6724685.40973533783108,-317013.196852286288049 6718269.704293522052467,-322022.573937983252108 6717125.443592190742493,-324929.237162088102195 6716976.538643929176033,-328918.148475681664422 6717324.822989739477634,-330216.912974766863044 6717672.943242379464209,-336308.538149958243594 6714740.249320256523788,-346822.107457927602809 6708430.698932969942689,-347533.327684605377726 6707535.938862201757729,-348182.654274403757881 6706443.588736304081976,-350841.965589965111576 6701827.518808003515005,-351800.537725186382886 6698999.985834660939872,-351614.968134033842944 6698355.529079964384437,-351553.185816642886493 6697709.87339807394892,-351614.968134033842944 6696173.432659012265503,-351955.160497897770256 6694735.267822206951678,-352202.512406438414473 6694091.147844122722745,-352480.811133423005231 6693545.229489304125309,-353624.952859796758275 6692206.911411782726645,-354614.471813456271775 6691563.169370898976922,-363829.165302852052264 6688887.402404529042542,-364416.820894750708248 6688737.763737605884671,-372487.372657772735693 6688540.508851628750563,-373971.706748007622082 6688540.508851628750563,-378857.407879434293136 6688737.763737605884671,-380310.683831742499024 6688887.402404529042542,-384175.919191065768246 6689630.464112524874508,-388350.400095811812207 6690572.141398129984736,-394349.296135171141941 6691959.257410963997245,-396328.334042495873291 6693346.430764924734831,-408759.047620907716919 6705550.476493304595351,-417386.196837896073703 6714740.249320256523788,-417866.317801685247105 6716183.200352197512984,-418684.961336981214117 6718170.002419413998723,-420973.244789725926239 6722298.000576066784561,-426972.140829085255973 6731556.184511872939765,-427497.791464610490948 6731854.351677265018225,-439681.041814990458079 6730411.309781678020954,-441443.674632209935226 6729862.773584743030369,-467572.808150189346634 6717821.860922322608531,-467789.324559782922734 6716430.338509323075414,-468160.352422596770339 6715982.596253319643438,-468809.790331883530598 6715882.922369535081089,-469459.116921681968961 6716082.271356697194278,-472303.886508904572111 6717524.207267745397985,-476200.180006160167977 6720358.175246710889041,-477900.807867009018082 6728567.765374079346657,-477900.807867009018082 6729315.887540238909423,-477684.402776906616054 6729962.618760659359396,-473169.729508293734398 6733249.768629260361195,-471097.962465139862616 6734046.027415570802987,-468809.790331883530598 6732900.802292080596089,-465377.365152765123639 6732153.964206924661994,-464697.091744525590912 6732103.221153242513537,-463367.3804270021501 6732302.967723667621613,-458234.327387031982653 6734245.821693606674671,-453967.117346453829668 6736388.986721459776163,-453627.036302081134636 6736836.417660769075155,-452575.623711539432406 6739229.532591589726508,-452390.165439875330776 6739927.844081154093146,-452513.841394148475956 6740624.779615554958582,-453085.466979371849447 6741509.361731187440455,-453595.978164148807991 6741971.077149564400315,-467263.562604766455479 6742320.253384324721992,-474468.38268788770074 6741921.708969135768712,-493825.617622439051047 6752750.391719499602914,-509224.888061835081317 6752200.346325456164777,-515223.784101194411051 6751251.51568235643208,-517171.875190077989828 6750852.533052319660783,-519552.887778654752765 6750103.864474670961499,-520511.459913876024075 6749455.349691575393081,-521253.626958994893357 6748506.839547562412918,-521655.49032075854484 6747159.459139152429998,-521717.383957637881394 6744165.481415218673646,-522119.358638892823365 6740076.990081829950213,-524160.178863605600782 6737136.213749676011503,-524685.940818622126244 6736887.190248610451818,-532478.305174153647386 6733847.67278004810214,-533189.414081340073608 6733996.707321142777801,-533746.122854797635227 6734295.143298409879208,-535137.505170220858417 6735391.23619968444109,-537425.788622968364507 6736189.139795588329434,-538167.955668087233789 6736338.217243597842753,-538817.393577374052256 6736238.293790582567453,-541229.241664903471246 6735441.820389812812209,-541723.945481987670064 6735192.669388093985617,-544383.256797548965551 6732950.115742954425514,-550072.90729148266837 6727074.773598824627697,-557185.109558265889063 6729265.162182052619755,-561328.532325082458556 6731107.430356651544571,-562318.162598233204335 6731755.738356730900705,-558966.110091468086466 6740426.264465735293925,-553325.996770935016684 6741712.211698781698942,-546022.213660498149693 6745512.365510255098343,-544816.178297242149711 6745961.735697395168245,-541136.512529071420431 6748457.431653422303498,-541816.785937308100984 6750153.282381390221417,-543733.930207750527188 6754448.397497565485537,-544352.309979107929394 6751950.860888539813459,-544414.203615990118124 6750502.810339243151248,-544630.720025580842048 6749854.263713461346924,-545403.722569649573416 6748905.707004135474563,-545929.37320517480839 6748556.068075421266258,-546949.838977278210223 6748057.148954421281815,-557048.965821025543846 6746779.897497278638184,-557791.132866144413128 6746600.27204352337867,-563839.454759415937588 6746959.347289913333952,-577871.944490852300078 6747658.323146688751876,-582046.425395598402247 6750203.958510612137616,-584087.245620314031839 6751500.979642672464252,-574532.359767054324038 6757244.543339472264051,-573419.164859121548943 6757745.286177275702357,-572769.726949831936508 6757844.215318964794278,-570419.661179696326144 6757794.750597458332777,-569090.061181661207229 6758044.595491731539369,-568595.357364577124827 6758343.735956214368343,-568224.218182272044942 6758793.81651755515486,-567945.919455287512392 6760243.346220543608069,-567945.919455287512392 6760992.950126864016056,-569368.248589154565707 6769694.571471702307463,-569492.035862916149199 6770395.507345334626734,-569955.904181050485931 6772247.126824827864766,-570172.309271152829751 6772847.908439286984503,-570759.853543560253456 6773848.829427449032664,-571749.261177731328644 6774550.124403815716505,-576820.53190031053964 6776503.111625352874398,-577562.698945429408923 6776652.930974679067731,-580345.68621526111383 6776753.352954571135342,-585416.845618349034339 6776753.352954571135342,-583221.402620921959169 6785020.345681723207235,-567945.919455287512392 6792845.046045511029661,-567389.322001321124844 6793146.918330696411431,-565688.58282098104246 6795655.729907976463437,-565472.066411390318535 6796258.249533679336309,-565131.985367014771327 6799421.942266858182847,-539281.150576019892469 6802636.429947007447481,-537920.603759543737397 6802887.660793989896774,-537487.682259850553237 6803239.650319085456431,-530746.619175372412428 6811785.067673795856535,-529788.047040151199326 6813344.804950259625912,-528334.771087845787406 6816464.09535648021847,-527314.305315742385574 6818880.651822560466826,-525737.242089675390162 6820592.574866738170385,-519800.239687198249158 6823714.664112947881222,-517295.55114434834104 6824420.292861871421337,-516646.113235061522573 6824521.309267468750477,-515038.214510041929316 6824420.292861871421337,-511018.356378007272724 6823966.369379263371229,-503968.159067597414833 6823815.671696427278221,-500937.708569731039461 6824822.915135419927537,-500412.057934205804486 6825074.83630333095789,-477777.131912735872902 6840455.998603926971555,-471067.12696619000053 6845252.946398593485355,-466830.641105070477352 6850253.969652257859707,-461202.884248016169295 6858243.560979214496911,-459842.337431542866398 6860874.330186579376459,-456224.342661269067321 6869482.472113816998899,-455853.314798455219716 6870900.36407633498311,-455513.233754082524683 6872370.135668253526092,-451926.297121741052251 6888451.348726056516171,-452080.808574961207341 6892157.992620870471001,-454245.416073438420426 6900799.506056198850274,-459069.22356798290275 6909094.032988433726132,-459347.633614455873612 6909653.403511005453765,-459471.309568726224825 6910314.727980232797563,-459316.686796014779247 6911079.864781765267253,-457121.132479099323973 6918670.84101480524987,-451215.076895063277334 6930758.700262603349984,-452328.271802995936014 6932136.903940637595952,-459811.390613101772033 6941996.895645508542657,-461542.965292391716503 6945218.38596916012466,-461790.428520423593 6945781.571193949319422,-461914.104474693944212 6946446.066549073904753,-461914.104474693944212 6947213.186286772601306,-460460.828522388532292 6960216.419862363487482,-460306.094430185912643 6961035.588551932945848,-460089.689340083510615 6961599.887974053621292,-459378.469113405735698 6962727.314738386310637,-458450.84379662561696 6963495.996900076977909,-460151.582976965699345 6967188.029320708476007,-471252.585237851249985 6967289.37938430160284,-479725.223001619451679 6965545.931195291690528,-480498.225545688124839 6965341.800027283839881,-491382.82271647133166 6961702.643085150048137,-494320.432759014423937 6959448.237225143238902,-498402.073208442889154 6956221.01618991792202,-500968.655388172133826 6951510.48938547167927,-505328.705884070775937 6944809.691843104548752,-526293.839543641777709 6942662.365329,-527747.226815438363701 6942559.854366502724588,-528489.282541065942496 6942712.97714975848794,-529447.854676287155598 6943429.122681488282979,-529976.844896538066678 6944058.264551734551787,-529015.044496082467958 6947366.213923020288348,-527778.173633879399858 6949669.347660939209163,-525644.512953843339346 6952739.135313027538359,-517759.41946248547174 6962112.20080938283354,-514172.482830143941101 6966213.362056158483028,-510523.652560920279939 6968930.54312835726887,-506812.928654817224015 6969854.57294652517885,-505421.435019902826753 6970161.867919016629457,-503906.376750206458382 6971136.832027266733348,-501587.146479017857928 6973035.204306980594993,-496763.338984473375604 6977501.6763582713902,-485847.794995249074418 6987879.368051594123244,-485074.681131689168978 6988805.777477576397359,-484765.546905757510103 6989370.745646540075541,-484301.678587620437611 6990708.354260675609112,-483683.187496774713509 6994618.048265744000673,-483590.458360942662694 6995492.810724900104105,-482044.341953313967679 7003782.804947496391833,-467139.886650493310299 7021213.69309792201966,-462347.025974389922339 7024828.95993609726429,-460646.286794049839955 7025603.647743077017367,-459873.172930489876308 7025603.647743077017367,-456997.456524828972761 7025189.331014082767069,-452668.352847368631046 7024983.668328705243766,-447349.84153574006632 7027049.4621537392959,-445618.155536958831362 7027876.822669266723096,-429074.854690680280328 7035785.728058224543929,-415530.946204332925845 7036872.662893095985055,-414943.401931928354315 7036561.483064823783934,-411047.219754163990729 7035993.159698629751801,-402203.554127581999637 7034802.828844710253179,-401492.333900904282928 7034906.344996532425284,-399575.189630461798515 7035372.370537872426212,-385351.00773587776348 7042512.322314796037972,-377156.668699094210751 7046810.186741053126752,-374342.734610824263655 7047276.723829239606857,-371405.124568278319202 7047484.455386277288198,-369889.95497909077676 7047484.455386277288198,-369024.111979701614473 7047380.588929277844727,-357521.135037561121862 7038216.779266598634422,-348491.899819826649036 7030771.214890957809985,-347471.434047726041172 7030047.192544949240983,-345337.773367689922452 7028961.189470266923308,-343821.267944613180589 7031238.301005117595196,-343266.006324535992462 7031959.453915113583207,-343049.60123443644261 7032631.161942451260984,-343142.330370265699457 7033355.419401423074305,-347997.196002742508426 7043341.292298357002437,-351120.264316946850158 7047690.887005303986371,-352264.294723829370923 7049142.213438191451132,-352821.003497286932543 7049504.993189883418381,-353594.006041355663911 7050385.992069826461375,-354799.930085120431613 7052562.326731893233955,-355171.069267422601115 7053805.33436681702733,-355356.638858575141057 7054635.296230061911047,-354799.930085120431613 7055672.170473443344235,-354026.927541051700246 7056606.499790882691741,-352975.62626999837812 7057384.102363989688456,-342389.476654030906502 7058931.31910511571914,-341664.230171511531807 7059230.489909846335649,-340829.445310054696165 7059355.054359903559089,-340031.618519537209067 7059106.487659787759185,-339345.1112198169576 7058732.438381616957486,-338899.833256642217748 7058203.234492429532111,-338510.215038866095711 7057549.341046640649438,-337285.700640141847543 7054780.693120626732707,-337063.061658553022426 7053131.835597528144717,-332783.495154498959891 7051214.290956061333418,-327557.601659208361525 7040650.064133018255234,-325975.974334017839283 7039086.469249466434121,-322795.687801543215755 7036665.208321936428547,-320878.432211612351239 7035940.649562117643654,-318621.206896797171794 7035476.080294112674892,-309066.209724046173505 7037286.098368016071618,-306685.197135469410568 7039252.818302919156849,-306283.222454214526806 7039717.608172768726945,-300840.923868821526412 7047328.003556433133781,-300655.465597160218749 7048053.600529603660107,-301057.440278415160719 7048467.617682208307087,-301892.336459363228641 7048624.278444014489651,-302510.716230720514432 7048467.617682208307087,-307829.338861843221821 7046344.982172607444227,-308757.075498114572838 7045670.810151531361043,-309097.15654248726787 7045101.835548265837133,-309344.508451027912088 7044480.335113095119596,-317662.523442084668204 7042512.322314796037972,-318497.419623032736126 7042616.125199204310775,-319888.913257949985564 7043186.226594678126276,-320940.325848491687793 7043755.064142570830882,-328825.419339852407575 7049919.08594308141619,-329938.614247785124462 7051318.207518306560814,-334712.995888417353854 7060579.139386664144695,-335436.572578573890496 7062011.524757786653936,-345925.317640097346157 7085700.327330800704658,-345832.588504268089309 7087313.046944672241807,-345554.289777283556759 7087990.95184326544404,-344379.201232468651142 7090333.421698123216629,-342091.029099215229508 7094396.894094210118055,-331979.545791989134159 7111767.019433310255408,-331577.459791243018117 7112340.795769130811095,-331082.755974158877507 7112706.477685352787375,-327526.76616025849944 7115057.962217671796679,-323073.986528527806513 7117408.640704437159002,-322702.847346222784836 7117879.349377910606563,-322548.224573511339258 7118558.370577606372535,-322888.416937375266571 7119133.956766422837973,-323290.391618630208541 7119500.140942992642522,-323970.665026866889093 7119761.33508057333529,-325547.728252933826298 7120022.726032071746886,-327217.520614832814317 7120074.290133906528354,-330185.966156328562647 7119864.648398477584124,-333154.523017312749289 7119708.267562028951943,-334669.692606500349939 7120126.042763856239617,-336370.431786837638356 7121014.923506615683436,-337700.031784872640856 7122374.880389341153204,-338473.145648432604503 7123315.599142143502831,-339679.069692197372206 7125721.840681636705995,-339988.315237620205153 7126716.260237291455269,-340421.23673731618328 7128756.906976815313101,-340606.695008977490943 7130274.97137585375458,-340606.695008977490943 7131896.797997823916376,-339864.63928334985394 7152341.757566204294562,-339771.798828026570845 7153023.746627560816705,-339215.312693551473785 7154335.924033833667636,-338380.305193112173583 7155228.472964587621391,-336741.459649651427753 7156174.62456120364368,-326444.406751275702845 7160797.369542037136853,-322486.442256120382808 7169945.318556828424335,-315436.133626219350845 7186270.550336133688688,-313642.665310047159437 7197242.865030996501446,-313209.855129845265765 7212459.856326746754348,-325795.080161477264483 7199618.158659620210528,-326753.652296698535793 7198878.522894452326,-350903.859226844448131 7185690.047750042751431,-357861.327401425049175 7188273.31856971886009,-359129.033762577921152 7188854.0116235781461,-359994.876761969935615 7189750.667588521726429,-376321.772518146142829 7216586.518875956535339,-379506.734469232673291 7222728.433353583328426,-379815.980014655564446 7224052.08843213878572,-379846.815513605426531 7225482.389983559027314,-382258.774920623283833 7236350.889832640998065,-385845.711552964756265 7242188.90248944144696,-388845.215232390037272 7246914.881450270302594,-392370.369547340553254 7251272.860581652261317,-395957.306179679173511 7255525.281166699714959,-402203.554127581999637 7263241.492915647104383,-404058.916080633527599 7266542.304833572357893,-404553.619897717668209 7267714.024951515719295,-404460.890761888469569 7268406.095154429785907,-397317.852996155328583 7292788.367029984481633,-381733.124285098048858 7326150.494656078517437,-377558.643380349094514 7337912.602693426422775,-376383.554835537099279 7339470.110255235806108,-366457.641119463543873 7349637.640190618112683,-365870.096847056120168 7350014.735777411609888,-364014.734894004592206 7350498.04940487537533,-357180.942673697136343 7352059.624750796705484,-355634.937585559731815 7352167.591818587854505,-355047.39331315230811 7351898.355364228598773,-354552.578176576935221 7351413.404316099360585,-354367.008585424395278 7350659.289809929206967,-353872.304768337402493 7350337.006128925830126,-349141.226409625029191 7348561.487261900678277,-348368.223865556297824 7348561.487261900678277,-345461.449321963067632 7349044.904518704861403,-336896.082422365667298 7351305.447698870673776,-336741.459649651427753 7352059.624750796705484,-336525.054559549025726 7356152.75904381647706,-337421.733057890902273 7357068.584705134853721,-338565.874784264655318 7357768.618098892271519,-339638.660717038204893 7357959.494313507340848,-341070.563327111769468 7357068.584705134853721,-341627.160781078098807 7356852.516171094961464,-349945.175772134854924 7355075.51196498516947,-350687.342817253665999 7355075.51196498516947,-374095.382702280767262 7356313.922588279470801,-375857.904200009012129 7356529.976181550882757,-377434.967426078801509 7356852.516171094961464,-383526.592601267329883 7359223.585368466563523,-397534.258086257730611 7360086.412351745180786,-398554.723858361190651 7356368.614224010147154,-398647.45299419038929 7355506.005076677538455,-402512.799673004890792 7337697.064591591246426,-403966.07562531309668 7338126.59883894212544,-410645.245072909106966 7338824.932717261835933,-411449.194435416080523 7338824.932717261835933,-424374.611830914916936 7332592.835868971422315,-430775.482551529130433 7324165.308827341534197,-440113.963314686494414 7316871.571559986099601,-441381.780995330598671 7316443.205670266412199,-442989.79103983863024 7316443.205670266412199,-455915.208435337408446 7316925.987287605181336,-460398.934885509195738 7318265.85299488902092,-484054.215359588561114 7334311.537675649859011,-484549.030496163934004 7334795.425965294241905,-487146.55949433427304 7338449.926035395823419,-487672.210129859508015 7339524.683809448964894,-487795.886084132653195 7340277.721741324290633,-487517.587357148120645 7342051.354405701160431,-487548.53417558921501 7342804.636432931758463,-487734.103766741696745 7343450.14339907374233,-488135.967128505406436 7343933.243720452301204,-489032.756946335663088 7344041.098261154256761,-489589.354400301992428 7343718.894512126222253,-492403.2884885747917 7339201.312046130187809,-492650.640397115435917 7338610.723905532620847,-493052.615078370319679 7337105.042650741524994,-493021.668259929225314 7335440.270208503119648,-492928.939124100026675 7334795.425965294241905,-491042.741672098636627 7328136.185612527653575,-485322.144359723839443 7317569.549566496163607,-483806.863451045064721 7305998.158957391045988,-483714.134315213013906 7305249.962116615846753,-484023.379860638699029 7303697.725519826635718,-484889.222860027861316 7301556.657458799891174,-485909.688632131321356 7300059.645056885667145,-487115.612675893178675 7299364.769788400270045,-488383.319037046050653 7299150.293194669298828,-490053.222718436270952 7299417.715993182733655,-500535.733888476155698 7303643.401859720237553,-501617.981977967720013 7304392.986129264347255,-507276.796972954354715 7311085.021844476461411,-507493.202063056756742 7311675.073280113749206,-507616.878017327049747 7313174.312944632023573,-507802.44760847958969 7313817.373221859335899,-511915.146195837529376 7319337.83392327837646,-521068.057367842353415 7323092.664823008701205,-527716.279996997211128 7327331.18275245372206,-534024.421581779490225 7333398.188474038615823,-534921.100080121308565 7334366.07514248136431,-535910.619033780880272 7335064.072351925075054,-537178.436714424868114 7335601.199460263364017,-540146.882255920674652 7336407.056212125346065,-544785.231478803907521 7333184.322026850655675,-547722.952840838232078 7330766.646752540022135,-548619.63133917725645 7329853.905758455395699,-549423.580701687023975 7328888.124796369113028,-552268.461608398123644 7323628.96839880105108,-552361.19074423017446 7322716.868718331679702,-552144.674334636540152 7321912.617706686258316,-550444.04647378763184 7316871.571559986099601,-546795.216204566881061 7307068.650113546289504,-545465.616206531762145 7304072.607596145011485,-544445.150434428360313 7303268.732998014427722,-543795.712525141541846 7302948.207929764874279,-542868.087208361364901 7302145.98976656422019,-542156.866981683648191 7301021.867218040861189,-541940.461891581304371 7300487.11356435995549,-540548.968256663996726 7290651.822543200105429,-540858.213802089681849 7289957.78275859169662,-541476.593573444173671 7289850.67265519592911,-547970.304749378818087 7292414.218013309873641,-549083.499657311476767 7293162.726325718685985,-550042.071792532806285 7294018.472015681676567,-550846.02115504257381 7294872.771997364237905,-551247.99583629751578 7295514.327984113246202,-552206.567971518728882 7298722.897780749946833,-552515.813516941620037 7300059.645056885667145,-552546.760335382656194 7300754.582100824452937,-552330.243925789021887 7301449.388351605273783,-551526.294563279254362 7302520.604807495139539,-551124.319882027222775 7303910.978432006202638,-551804.48197077261284 7308246.456182963214815,-552144.674334636540152 7308783.090430431999266,-557154.051420333562419 7316067.922434697858989,-560524.582962572691031 7319713.467393285594881,-564915.468957423930988 7324272.890369415283203,-568007.813092169701122 7327331.18275245372206,-569213.737135931616649 7328780.479610544629395,-569955.904181050485931 7329800.752807031385601,-571285.504179085488431 7331895.059750298969448,-572429.534585968009196 7334203.817629324272275,-575521.767401225399226 7340760.625508707948029,-576233.098947394406423 7342588.963054939173162,-576573.179991767043248 7344041.098261154256761,-577129.777445733430795 7346676.930690856650472,-577268.815489734522998 7349194.101471481844783,-577253.4534000037238 7349798.862792021594942,-576449.504037496750243 7359709.022922759875655,-575985.635719359619543 7361972.663485009223223,-574656.035721324617043 7363591.283731928095222,-573542.840813391958363 7364130.380906693637371,-568286.0004996630596 7366503.667702360078692,-562627.29682416759897 7370927.33313555829227,-562503.620869894511998 7371845.092905859462917,-558112.734875046066009 7387460.677369177341461,-557865.382966502569616 7388165.008409182541072,-556504.724830538034439 7389462.063602016307414,-553690.790742265176959 7392006.556416805833578,-549361.687064804835245 7396606.952183855697513,-541940.461891581304371 7404517.697624060325325,-541631.216346158413216 7405114.675504365935922,-541445.758074494311586 7405872.722054904326797,-539652.178438833681867 7414335.507664976641536,-538693.717623103759252 7422426.888743844814599,-538600.877167783211917 7424111.952176474034786,-538291.631622357526794 7424709.06969010643661,-528798.528086488833651 7441684.904928776435554,-528396.553405236685649 7442229.646578715182841,-526417.515497912070714 7443863.51296469476074,-524716.887637063162401 7444789.739348181523383,-521253.626958994893357 7446533.628684123046696,-518377.799233839905355 7447078.515201458707452,-517728.472644044319168 7447297.108467092737556,-516677.060053502616938 7448005.126135634258389,-516275.085372247733176 7448496.341611038893461,-513615.885376177611761 7456840.970185435377061,-513553.991739295423031 7458533.338777900673449,-514512.563874516694341 7461918.006979351863265,-514728.968964619038161 7462573.490716668777168,-518687.044779265590478 7471700.588330790400505,-521624.654821808682755 7478374.586902238428593,-521933.900367231515702 7479029.890653658658266,-522645.120593909290619 7480070.294541446492076,-523046.983955672942102 7480563.353016829118133,-524067.449727776402142 7481384.398671555332839,-526479.409134794259444 7482698.726267375051975,-530901.241948083858006 7484834.689691386185586,-535848.836716389865614 7488176.643866263329983,-541105.565710630384274 7493438.34338332246989,-542775.358072529314086 7495357.316498689353466,-545898.537706224946305 7496894.023328824900091,-547228.026384771568701 7498319.630848780274391,-547351.813658533152193 7499856.927407381124794,-543362.791025445563719 7544934.390616884455085,-543208.279572225292213 7545706.270700325258076,-542806.304890970466658 7546259.790543609298766,-537011.457478237571195 7548368.499267051927745,-534043.011936741764657 7549030.57165377959609,-533504.893518249387853 7548932.151884951628745,-533152.456010397872888 7548733.327907914295793,-532354.629219880443998 7547871.882943076081574,-528953.150859203073196 7547694.357338692061603,-524685.940818622126244 7545375.767772215418518,-523881.991456115094479 7545210.422262988984585,-508761.019743700802792 7542725.698945729993284,-503504.29074946034234 7542230.241054864600301,-498896.999664509494323 7542725.698945729993284,-499731.784525966329966 7543720.08813545666635,-501061.495843492622953 7544326.519961761310697,-515100.108146924118046 7547583.62955547682941,-531727.900486714672297 7554389.687835521064699,-535463.448639263631776 7553722.578452091664076,-540412.935838914941996 7555725.672143717296422,-541720.383258282323368 7564745.555126459337771,-540973.318155569024384 7572438.501751570031047,-539479.076630651252344 7575617.754917521029711,-537517.961161344312131 7580976.269996969029307,-541813.780311058973894 7579468.410673319362104,-543401.418888750602491 7572606.029016052372754,-545269.137305280892178 7554723.562679801136255,-546950.172935749171302 7550718.417979738675058,-548631.208566220244393 7545214.993064677342772,-552361.19074423017446 7534563.448695320636034,-554247.388196231564507 7531806.793846441432834,-554927.772923959419131 7531531.440487891435623,-555638.881831145961769 7531476.886775597929955,-557958.000782843329944 7531973.240597685799003,-559473.281691522221081 7532524.187135871499777,-568842.709273117827252 7539140.407703982666135,-575892.906583530362695 7544326.519961761310697,-579542.738728169584647 7542881.05758389737457,-581597.251250250265002 7538882.067436678335071,-582157.633566901553422 7533387.091829580254853,-579758.141942853690125 7527510.973899577744305,-579170.59767044626642 7525363.366828439757228,-579356.167261598748155 7524481.738518790341914,-579758.141942853690125 7523931.168386836536229,-580500.308987972559407 7523820.979806956835091,-589158.405023399158381 7528116.131043621338904,-590364.440386655041948 7528722.723845549859107,-590797.250566859846003 7529382.514647976495326,-594291.569382860558107 7537981.617792900651693,-594477.138974013039842 7538699.586336087435484,-594507.974472962901928 7539526.842141421511769,-594538.921291401144117 7543720.08813545666635,-591075.549293841584586 7558912.356045866385102,-591038.479903408209793 7559476.582404192537069,-590945.750767576158978 7559908.838847606442869,-587884.464770762715489 7565285.901066017337143,-587049.568589811795391 7566713.457715893164277,-579170.59767044626642 7581785.920701346360147,-578706.729352311929688 7582340.445887309499085,-564637.28154993057251 7595721.087023308500648,-553721.737560706329532 7605005.976090668700635,-550726.797980401781388 7608345.41353698913008,-548032.087066769832745 7611351.348925784230232,-547475.489612803445198 7612576.586978422477841,-547753.788339788094163 7613243.413629404269159,-548526.902203345205635 7613133.3411337248981,-560184.501918199937791 7604839.342786311171949,-579510.678714818903245 7585779.915176596492529,-583190.567121972097084 7582119.58950481005013,-585416.845618349034339 7579734.106230428442359,-588595.684997440432198 7575166.459459184668958,-590655.095577115542255 7572207.958295061253011,-591861.019620880368166 7569449.352184385992587,-594328.527453802758828 7565297.457551669329405,-596239.660471741226502 7563371.549912866204977,-600104.895831067347899 7558415.656081087887287,-600878.009694624459371 7558304.773934399709105,-601589.118601813795976 7558359.518062030896544,-603722.779281847062521 7559077.797101472504437,-604341.159053204348311 7559410.481763506308198,-604650.404598627239466 7559963.395279230549932,-603227.964145271689631 7539857.094129826873541,-598898.860467811347917 7508862.244868799112737,-601589.118601813795976 7506114.761325518600643,-606072.845051985583268 7500569.774275177158415,-606412.926096358336508 7499966.774242323823273,-607062.36400564503856 7496345.615726223215461,-607464.227367408806458 7495851.549033195711672,-608793.938684935099445 7492726.154522690922022,-610742.029773818678223 7487682.902154895476997,-618401.701296320999973 7442711.278729816898704,-616184.328359208768234 7439561.013606991618872,-615906.029632227029651 7439016.655554126948118,-614019.832180225639604 7433083.339628231711686,-613896.156225955346599 7432376.488223062828183,-614823.781542735523544 7430526.91470696311444,-616184.328359208768234 7428243.021260535344481,-619709.482674159342423 7423568.67778710462153,-622925.391443687025458 7421449.547549922950566,-638726.636564337997697 7418788.056371249258518,-640365.482107795891352 7418732.92382235173136,-641849.704878545133397 7419059.619217731058598,-643148.358058139099739 7419656.152405872009695,-644075.983374919276685 7420579.686417700722814,-644292.499784512910992 7421285.463312054984272,-644539.963012544787489 7422752.174891752190888,-645127.507284952211194 7432104.458681508898735,-645189.289602343109436 7434661.403974262997508,-645096.449147019884549 7437165.301079350523651,-644941.937693799613044 7437981.755427746102214,-644292.499784512910992 7439179.547310555353761,-641107.537833426264115 7443318.85254780575633,-637582.494837964186445 7446044.107228214852512,-636871.163291795179248 7447078.515201458707452,-636623.811383254476823 7447788.08279784116894,-636345.62397576123476 7449477.099506616592407,-636531.082247422426008 7462465.353702132590115,-634706.667112812050618 7476951.275682856328785,-631088.894981520716101 7491354.270671325735748,-624255.102761213318445 7510510.255065249279141,-624718.859759859158657 7510785.056579646654427,-628676.824255011626519 7515018.513606816530228,-631428.976025893469341 7519417.698436729609966,-631645.381115995813161 7520078.079878558404744,-631929.913734463974833 7536007.350790955126286,-631985.573479859740473 7536470.64765390008688,-632059.712260729516856 7538423.192292927764356,-631837.073279143543914 7540872.365110436454415,-631391.795315968687646 7541567.958599822595716,-630557.010454511852004 7542361.949484528973699,-629499.363972483784892 7543488.218076884746552,-627130.819166874163784 7551672.07160775270313,-621348.328217620030046 7560738.178193661384284,-621008.135853756102733 7561345.952535333111882,-620111.457355414284393 7565827.87908373773098,-620729.948446262744255 7565995.063099895603955,-621472.00417189032305 7565884.071637166664004,-623110.961034839507192 7564832.223102402873337,-626234.029349043848924 7562508.464686173014343,-630018.892036016681232 7555141.822048941627145,-630204.461627169162966 7554776.68951238039881,-630965.107707759132609 7553317.924112414941192,-631206.225724816205911 7552986.298489877022803,-631651.615007482236251 7552921.049299996346235,-632022.642870296025649 7553119.185745740309358,-632226.691496919607744 7553450.817094803787768,-632282.351242315489799 7556269.962215968407691,-632263.872206844273023 7556701.04339393414557,-631837.073279143543914 7557961.586897023953497,-628089.279982606996782 7566991.068953487090766,-627007.143212603870779 7568762.596210335381329,-623543.771215044311248 7573636.800906362012029,-619307.507992907194421 7581009.013770660385489,-614607.265133141889237 7590887.631769153289497,-614359.913224598392844 7591720.520872043445706,-613555.963862088508904 7594665.146241501905024,-613586.910680529661477 7595498.245223373174667,-614112.561316054896452 7595830.910002659074962,-614792.946043785661459 7595553.254940694198012,-615844.247314836131409 7594831.358770885504782,-618812.692856329027563 7592220.777580857276917,-620482.596537719247863 7590332.48918600846082,-623141.796533789369278 7590277.516861313022673,-623018.120579519076273 7608901.860625194385648,-622987.285080569214188 7610571.444131291471422,-620451.538399786921218 7623330.674066665582359,-619956.834582702838816 7624781.315124277025461,-615163.973906599450856 7633152.0074393870309,-615102.080269717262127 7634828.490606474690139,-614978.404315446852706 7635609.259099802933633,-614607.265133141889237 7636336.412542313337326,-605268.895689475699328 7642952.94020386505872,-604267.020272334688343 7644261.350667661055923,-603413.533736424287781 7645100.864074998535216,-593506.099055821774527 7645737.506128554232419,-592634.133484440273605 7645569.984806464985013,-590945.750767576158978 7644428.843352621421218,-583499.701347906608135 7645782.810000526718795,-582850.374758108169772 7645615.489033673889935,-581180.582396209123544 7645670.658238304778934,-580036.440669835428707 7646286.808491548523307,-579046.921716175857 7647125.537155777215958,-578119.29639939579647 7648187.320239240303636,-571687.478860340430401 7655576.148319902829826,-570017.686498441384174 7657705.23395178001374,-568595.357364577124827 7660170.382207037881017,-564235.195549184456468 7670151.641469822265208,-563987.843640643754043 7670825.319961459375918,-564328.03600450779777 7671273.798534438945353,-565070.203049626550637 7671161.272383457049727,-565595.74236566061154 7670655.632228289730847,-566338.020730270654894 7669590.725700140930712,-567265.646047050831839 7667626.330121235921979,-568162.324545389856212 7664542.720214109867811,-569461.089044475113042 7661178.695830713957548,-577871.944490852300078 7650929.26284159347415,-579201.544488887302577 7649363.066427187994123,-580469.362169531406835 7648915.669382249936461,-582077.260894548264332 7648691.47709843236953,-582788.48112122877501 7648748.279913015663624,-597600.207288217381574 7653426.895149675197899,-600976.861402448848821 7654300.271392790600657,-598584.71686479402706 7662862.74284540489316,-597063.424703611293808 7661618.941670041531324,-594855.513923219870776 7661719.624733040109277,-594336.097179178264923 7661786.612996293231845,-593593.930134059395641 7662122.975586210377514,-584767.519028550595976 7668749.530191938392818,-584334.597528854617849 7669253.428508706390858,-584025.351983431843109 7669871.2794329514727,-583932.622847599792294 7670768.150935323908925,-584767.519028550595976 7670768.150935323908925,-591372.438375788507983 7670610.988819666206837,-591724.98720313119702 7670342.123850058764219,-592504.22363868355751 7669466.711709210649133,-593747.217072881758213 7668557.673832669854164,-594396.654982168460265 7668120.865157462656498,-595157.301062758429907 7667784.238607918843627,-595713.898516724817455 7667784.238607918843627,-596530.315662204637192 7668120.865157462656498,-598478.406751085305586 7669938.339157398790121,-597995.948077988694422 7671183.494651835411787,-599239.052831675275229 7675371.727534723468125,-591632.258067299146205 7690264.742666048929095,-583561.594984785886481 7701524.789759248495102,-576233.098947394406423 7711221.124667644500732,-571501.909269187832251 7717824.38875053729862,-571161.828224815195426 7718446.183743549510837,-570141.362452711677179 7721947.395225546322763,-569955.904181050485931 7722738.745450126938522,-573790.192721935454756 7719179.841034766286612,-577624.592582308803685 7714549.774756929837167,-582664.805166955688037 7707837.900584533810616,-597043.609834251110442 7691334.155714453198016,-619369.401629786589183 7666785.148829350247979,-622585.199079823098145 7663477.050243326462805,-623605.66485192370601 7662524.128000586293638,-631954.626661421498284 7657369.872215985320508,-633377.067114777048118 7660450.590481691993773,-634242.798794674919918 7661347.971594003029168,-644601.745329935685731 7666281.413177256472409,-648621.603461970342323 7667122.539042044430971,-655022.474182584672235 7669365.724603548645973,-656290.291863228776492 7670094.6794743090868,-660186.474040993023664 7672676.37298505473882,-661547.132176960469224 7674079.406983571127057,-667453.076441505225375 7681099.8598617259413,-668721.00544164062012 7682729.627684254199266,-669184.873759777634405 7683966.144569303840399,-669153.81562184530776 7684753.564749932847917,-668844.681395913707092 7686384.314906713552773,-668009.785214962786995 7687508.656512294895947,-667112.99539713258855 7688409.22089565731585,-666525.45112472504843 7688801.631315667182207,-665103.121990860789083 7689195.479388226754963,-654849.372374399215914 7690264.742666048929095,-634428.368385827518068 7695555.546441029757261,-628800.611528776003979 7695048.491497926414013,-624780.642077247262932 7695385.511073506437242,-618503.447310906136408 7696118.57496915012598,-617266.576448703184724 7696681.442337614484131,-617483.092858294025064 7697412.806278294883668,-617977.907994872191921 7697862.848856411874294,-638912.094835999188945 7701411.816976265050471,-641447.618877799017355 7701467.593275864608586,-642282.626378238317557 7701243.273617564700544,-643364.874467729940079 7700622.676736250519753,-644849.097238479182124 7699327.69822081644088,-648572.177608058205806 7697333.950198668986559,-650334.699105789186433 7695340.722888273186982,-651076.754831416881643 7695002.894682557322085,-658918.767679840209894 7693753.04005048237741,-689222.270783074432984 7694935.614545814692974,-691201.308690399164334 7695837.055513458326459,-692932.994689177488908 7697920.221056290902197,-693613.268097416963428 7699046.263123655691743,-694077.136415551300161 7701130.305002639070153,-694107.971914501162246 7702088.056045098230243,-694077.136415551300161 7702933.134881153702736,-693829.784507007803768 7703609.508809051476419,-689500.680829550256021 7708739.24314549472183,-689098.594828804139979 7709191.578606426715851,-683501.673470699694008 7710770.0903161438182,-664237.278991468832828 7715340.35732904728502,-662752.944901231094263 7715622.597487321123481,-662196.347447264823131 7715284.682678516954184,-661268.722130484646186 7714380.940836710855365,-657341.704453770420514 7710543.872415549121797,-653167.112229533144273 7707724.834273269400001,-651590.049003463354893 7707555.948398451320827,-650755.264142006519251 7708570.537820348516107,-645498.535147766000591 7717146.752978748641908,-646271.537691834731959 7718219.737981867045164,-650044.043915328686126 7720082.525444759055972,-651188.18564169970341 7720931.024272168986499,-651930.241367330076173 7722003.118560726754367,-652177.70459536195267 7722567.899587706662714,-652208.651413803105243 7723528.550565794110298,-652115.81095847976394 7724376.009126185439527,-651713.836277227732353 7724998.338880441151559,-651219.021140649565496 7725336.68462157715112,-644076.094694410450757 7727395.363105571828783,-640458.211243627942167 7727994.737010321579874,-639530.585926847765222 7727881.371335107833147,-638200.874609321472235 7727316.196359654888511,-636531.082247422426008 7727371.958969076164067,-630593.968525454052724 7732517.917875823564827,-630161.047025758074597 7733367.802751677110791,-630408.510253792861477 7733933.426913038827479,-631459.922844334505498 7734837.861071958206594,-638850.31251861108467 7738404.089353817515075,-639716.044198509072885 7738460.137009683065116,-642035.274469694821164 7738177.049615713767707,-647663.031326749129221 7736762.178020962513983,-652919.76032098964788 7735517.072111464105546,-654404.094411227386445 7735347.772990231402218,-655331.719728007446975 7735517.072111464105546,-658702.251270246575586 7736875.67595265712589,-659227.901905771810561 7737272.218810765072703,-648961.684506343095563 7760288.728380650281906,-648095.952826445107348 7761366.379861513152719,-646333.320009225630201 7762445.615256890654564,-645003.831330679007806 7762901.152126068249345,-641583.762615039362572 7762207.839122603647411,-640210.859335084445775 7762514.312067833729088,-638745.115599809098057 7762616.336155550554395,-638411.15712743147742 7762377.736874705180526,-638207.108500805101357 7762072.087209036573768,-637743.240182670764625 7760845.318755277432501,-637001.073137551895343 7759448.09454869478941,-634211.963295725057833 7757904.619656637310982,-631367.082389014074579 7755974.950343560427427,-630192.105163690401241 7755236.309738078154624,-628831.558347214246169 7754555.33683823607862,-628212.955936877289787 7754329.244438827037811,-626697.897667180979624 7754612.933265920728445,-621070.029490635497496 7756031.127550091594458,-619616.753538330085576 7756484.646011273376644,-616493.573904634453356 7757960.811116668395698,-614916.621998055954464 7758869.740106554701924,-614514.535997309838422 7759379.629802050068974,-614731.052406903472729 7760061.034768319688737,-615565.948587854276411 7760004.827789269387722,-617544.986495176213793 7759153.393962802365422,-618534.505448838579468 7758300.625046527944505,-619956.834582702838816 7758017.002991831861436,-625182.728077993378974 7756995.805986277759075,-626883.467258333577774 7757051.990732721053064,-629388.155801180633716 7758472.070307844318449,-642715.547877934295684 7769435.424946879036725,-643890.525103257969022 7770230.091105907224119,-644230.717467121896334 7770742.380678739398718,-644447.122557224240154 7771481.096311684697866,-644385.228920342051424 7772277.614141278900206,-644075.983374919276685 7774041.05891159363091,-643272.034012409392744 7776087.970547989942133,-642529.978286781813949 7777169.298320417292416,-637273.24929254129529 7783260.710006340406835,-633587.349632884259336 7782827.526457522064447,-629282.958882381441072 7783853.635443524457514,-628874.750309642869979 7783920.885787840001285,-626110.35339477355592 7783169.274034139700234,-625219.797468426870182 7782349.679653075523674,-624681.790369422873482 7781290.160054587759078,-620884.459899482899345 7780072.171837758272886,-618874.586493211216293 7779048.212711897678673,-616802.708130566054024 7778250.984888242557645,-615967.923269106424414 7778080.527085988782346,-614267.184088769135997 7778136.867883553728461,-601094.414784726803191 7781779.623754463158548,-601218.090739 7782577.222001235932112,-601558.283102863933891 7783146.517718847841024,-601991.093283068737946 7783545.480658304877579,-603444.480554865323938 7784229.055805050767958,-605980.004596662241966 7784343.264369696378708,-607495.285505341133103 7784000.643827837891877,-610216.490457781823352 7783090.344763967208564,-617854.232040598988533 7783944.259522567503154,-627798.736111634876579 7792058.676603360101581,-628522.201482300180942 7792469.808084421791136,-628763.430818848544732 7792811.168813141062856,-628911.819700076361187 7793222.341050314716995,-628856.271274171769619 7793804.137522666715086,-628522.201482300180942 7808301.650428098626435,-624799.23243220965378 7809284.922472046688199,-624298.294723641942255 7809867.951911521144211,-619010.618910960271023 7812371.126348681747913,-617841.764257631846704 7812783.359992402605712,-617470.736394818057306 7812645.260254616849124,-616802.708130566054024 7811067.273704010993242,-616542.999758546706289 7810690.523438804782927,-611669.655090598738752 7809102.040678926743567,-610154.59682090242859 7807559.343907156959176,-609196.024685681215487 7806817.315674694254994,-606660.278004901716486 7805502.49158538132906,-604279.376735813450068 7804816.998059210367501,-603568.156509135616943 7805160.559507402591407,-601805.635011404636316 7807159.322441205382347,-601589.118601813795976 7807788.465960723347962,-613667.283352882950567 7817038.311246092431247,-620179.473564288811758 7818410.747884599491954,-623260.574430465232581 7827969.293726892210543,-620922.865123808383942 7828243.992341386154294,-620440.517770200152881 7828381.551621166989207,-614545.482815750874579 7833885.146406440995634,-611422.30318205524236 7836293.246456510387361,-608113.665276698418893 7839620.557572393678129,-607680.74377700232435 7840252.401793340221047,-607000.470368765760213 7841515.008862649090588,-606536.602050628629513 7844958.087682005949318,-606505.766551678767428 7845934.345557653345168,-606722.171641781111248 7846508.418343406170607,-607557.067822732031345 7846795.367694462649524,-608051.882959307404235 7846451.567277518101037,-612628.338545308448374 7842547.43750178348273,-627013.265784599003382 7836236.472041836939752,-640210.859335084445775 7830618.52940653078258,-642251.56824030878488 7829930.761168906465173,-643210.251695018494502 7829987.48834,-644385.228920342051424 7830733.438585777767003,-647539.355372478836216 7834286.78724660910666,-647786.707281022332609 7834859.977581156417727,-652332.327368073398247 7852827.956705703400075,-653105.329912142129615 7856334.561169553548098,-653600.0337292291224 7858692.871928527019918,-653507.304593397071585 7861281.007063504308462,-653352.681820685626008 7862202.403903632424772,-651342.697094922652468 7872913.17629714589566,-651188.18564169970341 7873720.426309539936483,-650074.99073376704473 7878101.743621313013136,-648281.411098106415011 7879254.827275008894503,-647601.137689869734459 7879543.22950364369899,-646859.081964242155664 7879484.468473402783275,-643086.575740748201497 7877525.267772515304387,-640118.018879764014855 7873893.049169539473951,-640056.12524288170971 7872164.716177927330136,-629573.614072841941379 7864964.159620930440724,-629017.016618875553831 7864676.313102686777711,-628151.173619486391544 7864791.740520105697215,-625615.649577689473517 7868131.609398076310754,-615689.624542124685831 7868879.877630474977195,-613555.963862088508904 7869571.194842795841396,-613215.882817715872079 7870205.545405966229737,-614236.237270328099839 7872854.674249721691012,-614669.158770024077967 7873258.18162261787802,-616184.328359208768234 7873834.539537319913507,-628244.014074806822464 7873834.539537319913507,-629357.097663251101039 7873028.72954398393631,-629666.343208673992194 7872509.687341340817511,-630346.616616910556331 7872278.598483220674098,-631088.894981520716101 7872509.687341340817511,-631645.381115995813161 7872970.226602180860937,-634026.393704575370066 7875333.732390355318785,-646797.188327359966934 7891606.597063598223031,-646920.864281630259939 7892358.649822859093547,-647601.137689869734459 7929017.73373890016228,-647508.519873528974131 7929947.43554084841162,-646055.132601732388139 7936453.750260568223894,-645560.317465157015249 7936918.208939758129418,-641973.380832815426402 7938952.122039064764977,-640643.66951528924983 7939533.311057654209435,-636407.406293152133003 7939940.400292767211795,-634143.835767362150364 7936511.073791701346636,-633494.509177563712001 7936057.727708416059613,-632919.321368635050021 7935500.026021576486528,-632659.724316104082391 7935117.022257612086833,-632566.883860783651471 7934663.760055215097964,-630563.133026504190639 7923679.39423421677202,-630253.887481081415899 7922519.503797773271799,-627965.60402833390981 7919967.704824518412352,-625027.993985790759325 7918112.336429358460009,-624193.209124331129715 7918169.729328504763544,-623667.55848880589474 7918575.874836660921574,-621410.221854499424808 7929076.672759066335857,-621255.487762296805158 7929889.952898746356368,-621224.652263346943073 7931689.053946394473314,-621472.00417189032305 7932386.14859145693481,-623110.961034839507192 7934535.337236318737268,-623574.718033485347405 7935058.663480984047055,-626234.029349043848924 7936337.221653243526816,-627248.26122966373805 7938883.478980027139187,-628287.317356726736762 7941184.408787708729506,-628361.456137596396729 7941673.234974321909249,-628324.275427668937482 7942860.157449363730848,-628231.546291839680634 7943383.224831480532885,-628336.631891147699207 7946281.064851129427552,-627347.224256976507604 7948200.796302387490869,-626512.32807602849789 7949307.226450100541115,-624626.130624027107842 7951286.842921422794461,-607526.121004290995188 7937732.33601164072752,-604959.650144052924588 7945990.308970609679818,-604526.728644356946461 7946514.431799842976034,-603908.237553508370183 7946862.819797440432012,-594291.569382860558107 7950704.746014703065157,-580809.554533395334147 7946514.431799842976034,-570790.800362001406029 7939940.400292767211795,-569059.114363220171072 7937848.886202761903405,-568038.648591119563207 7936046.640213362872601,-567543.833454544190317 7939649.889119885861874,-577686.374899699701928 7956470.265770964324474,-578552.21789908898063 7957461.056297087110579,-579201.544488887302577 7957811.629775521345437,-585849.767118042218499 7961250.465410741046071,-600908.845193574321456 7973854.564676746726036,-603011.559055169345811 7976307.548231040127575,-606474.819733237614855 7981392.704365523532033,-607155.093141477089375 7982621.27393816690892,-607278.769095747498795 7983380.784882804378867,-607124.146323036053218 7984257.854495175182819,-606598.495687510818243 7985779.179341798648238,-605918.222279271343723 7987066.176389486528933,-605423.518462187144905 7987591.695122256875038,-604093.807144660851918 7988061.007049136795104,-603259.022283204016276 7987884.274385861121118,-602052.986919948132709 7987124.097493473440409,-599362.728785948478617 7984902.142712042666972,-598002.181969472323544 7983323.103143072687089,-592157.90870282438118 7980866.145831926725805,-591199.336567603168078 7980750.610945212654769,-589715.113796856720001 7981335.0378831140697,-588787.377160585368983 7982094.418839399702847,-588323.620161942322738 7982736.83758675865829,-587921.534161196090281 7983323.103143072687089,-587736.075889534782618 7984082.895566093735397,-587086.749299736460671 7991981.79173366446048,-587148.531617127358913 7998599.807165185920894,-588972.835432246560231 7998659.504852728918195,-589715.113796856720001 7999069.807454286143184,-600723.275602421839722 8018431.190336863510311,-601001.685648897662759 8019841.626250470988452,-601032.521147847524844 8020722.754477177746594,-600692.328783983481117 8021546.010058880783617,-600259.407284287502989 8022015.968499384820461,-599641.027512930217199 8022369.356017152778804,-597909.452833640272729 8022133.833024359308183,-597352.855379673885182 8021781.726189978420734,-579263.326806278317235 8020195.122884506359696,-564575.38791304838378 8023133.11083422973752,-565008.309412744361907 8023662.854025566019118,-565750.47645786323119 8024014.837532888166606,-570667.124407730996609 8027955.937233332544565,-574934.223128817975521 8035959.68358915951103,-576047.529356241808273 8041203.385971928946674,-575398.091446952195838 8044386.261420330032706,-568780.815636238432489 8074868.760789718478918,-557123.215921383700334 8099415.407776706852019,-556411.995694705867209 8099770.971848774701357,-531241.434311947785318 8095199.95998945645988,-530777.565993813448586 8094784.357843668200076,-523387.176319536927622 8085590.826406757347286,-520604.189049705222715 8078301.782386076636612,-523418.123137978021987 8075223.372269520536065,-525180.644635709119029 8071908.709219836629927,-530004.452130253543146 8062743.239921129308641,-530282.862176726572216 8061797.166084506548941,-530375.591312558623031 8061029.459855251014233,-529509.748313169460744 8060852.488041212782264,-527809.009132829261944 8062092.442314919084311,-519645.61691448680358 8070607.066419521346688,-512502.579148753720801 8078065.986186530441046,-511915.146195837529376 8079487.698417447507381,-511729.576604684989434 8080315.733670183457434,-511853.252558955340646 8082983.001542908139527,-512224.280421769130044 8084522.79272423312068,-512038.822150107880589 8085471.958768862299621,-511513.060195091413334 8086953.777882027439773,-510801.951287904870696 8088199.561293347738683,-509657.809561531117652 8088970.061423582956195,-508173.586790784611367 8089326.836931832134724,-507183.95651763107162 8089207.909870199859142,-501679.875614849908743 8087546.545090313069522,-498278.397254169743974 8086123.299794014543295,-494351.379577455518302 8084049.108346101827919,-493392.696122745866887 8083041.455331252887845,-493021.668259929225314 8081560.624665834009647,-476138.28636927792104 8080257.087929943576455,-454245.416073438420426 8084879.356033937074244,-434517.153276070428547 8085530.645427478477359,-428394.469962949573528 8085887.256811025552452,-421375.219470980868209 8087310.45716312341392,-420787.675198573386297 8087665.445721377618611,-415252.647477351187263 8092885.275407262146473,-413459.179161181848031 8095022.391411495395005,-412902.581707215518691 8095438.006797193549573,-407460.283121822518297 8098643.829944353550673,-398090.855540224059951 8099118.654087081551552,-395555.331498427141923 8096386.850399338640273,-375548.658654586179182 8093538.971891729161143,-374590.086519364907872 8093419.977784346789122,-374126.329520721861627 8093953.009243484586477,-373848.030793737270869 8094725.598479961045086,-373105.863748618459795 8097099.417133331298828,-373013.023293297970667 8097870.835473631508648,-373445.944792991154827 8098405.894752212800086,-375517.711836145084817 8100306.16723853815347,-373353.21565716189798 8107378.280827051028609,-353594.006041355663911 8104999.482320887967944,-336803.353286533616483 8104584.832319096662104,-336153.915377246856224 8104168.707757766358554,-335720.993877550819889 8103633.235558656044304,-335473.641969007323496 8101554.178867178969085,-340142.93801033165073 8063392.604688522405922,-340668.588645856885705 8061857.156421818770468,-346172.780868132074829 8047923.385589182376862,-347533.327684605377726 8045328.65198933146894,-356500.669265457661822 8032309.962860098108649,-357180.942673697136343 8031545.272726823575795,-371528.80052255152259 8025720.170140256173909,-373291.32202027970925 8025720.170140256173909,-374002.653566448716447 8025486.023802507668734,-374497.357383535709232 8025074.274242480285466,-376476.395290857530199 8023133.11083422973752,-380743.605331435683183 8018666.808598809875548,-383186.51155689463485 8015143.24778114259243,-383650.268555540533271 8013498.231480834074318,-384701.569826591003221 8010739.590764750726521,-385443.736871709814295 8009448.530157785862684,-387762.967142895620782 8005811.684202768839896,-390855.088638661720324 8002057.570771335624158,-391318.956956795998849 8001531.038887433707714,-396977.77195178263355 7996607.69540289323777,-410150.541255822114181 7986188.989530861377716,-428023.442100135725923 7971519.453974159434438,-444937.882128722209018 7956937.639161167666316,-446576.727672180102672 7951985.754060111939907,-444412.120173702889588 7948491.847107759676874,-444288.444219432538375 7946746.13001958001405,-446947.75553499389207 7939592.332400450482965,-457152.190617031650618 7936279.690240683965385,-458636.413387778156903 7936046.640213362872601,-472334.833327345666476 7940116.01010284665972,-485198.468405450694263 7945349.345031703822315,-486064.200085351476446 7946397.747421329841018,-487362.964584436675068 7947096.204778944142163,-488939.916491012379993 7947444.619698722846806,-488816.24053674202878 7945816.028407109901309,-484703.653268875321373 7938487.328670262359083,-483745.081133654108271 7937615.787623856216669,-478395.623003584390972 7935116.185569444671273,-476818.559777514601592 7934651.837974960915744,-461945.051293135038577 7930701.857473563402891,-450089.525523651856929 7928426.070037759840488,-437083.624136311351322 7926986.500280544161797,-431332.080005495459773 7928612.697196708060801,-428641.933190984243993 7929599.82901843637228,-427652.414237321936525 7930585.417793459258974,-426879.411693253205158 7931805.510682204738259,-425982.621875422948506 7934884.844857013784349,-425271.401648745173588 7936163.164325813762844,-424281.882695082807913 7937208.614772326312959,-423261.416922982200049 7937963.764188178814948,-421715.300515353563242 7938196.873535867780447,-420231.077744607056957 7937673.119998597539961,-420014.672654504713137 7936104.169846131466329,-420540.323290032742079 7934535.337236318737268,-424776.697831661032978 7926986.500280544161797,-425580.647194168006536 7925768.64966340828687,-430311.72555288329022 7918865.57472250238061,-439062.662043633172289 7908146.58032916020602,-439928.505043022334576 7907162.461284330114722,-441783.755676585482433 7905079.811781695112586,-442804.221448686090298 7904210.457456498406827,-444041.09231088910019 7903574.702651378698647,-445401.750446856487542 7903112.293419815599918,-446613.797062613535672 7904153.170669857412577,-447615.672479751810897 7904430.651081283576787,-447819.832425866683479 7905264.19527112878859,-447560.012734356045257 7906271.404502338729799,-447077.665380747814197 7906966.153020571917295,-447102.378307705337647 7909014.929189451038837,-447442.45935207803268 7910404.995669922791421,-448741.335170654463582 7911100.124978921376169,-454771.178028454887681 7909999.498406771570444,-456162.560343878110871 7909536.69526182487607,-478302.782548263901845 7899235.835779253393412,-491630.174625014828052 7884100.57384237088263,-493794.782123489188962 7878562.623791472055018,-492836.098668779537547 7877639.230882221832871,-491444.60503386228811 7878101.743621313013136,-487393.911402877769433 7881620.299819244071841,-483528.676043551706243 7885370.315649603493512,-482044.341953313967679 7887680.542311573401093,-480065.304045992146712 7889585.410506851039827,-474159.248461956100073 7895247.137175536714494,-473046.053554023441393 7896114.002969663590193,-470634.094147005584091 7897269.840144312009215,-466583.289196526980959 7898600.708038398995996,-454270.129000393091701 7897339.77043295931071,-450472.909849944408052 7892647.344837240874767,-457677.729933065653313 7883407.926264720968902,-465253.689198494772427 7875966.906469878740609,-468747.896695004194044 7870493.602512794546783,-470757.770101275877096 7866230.690129267051816,-472056.534600361075718 7863008.511050662957132,-471438.154829003789928 7861627.139160297811031,-470355.795420020993333 7860764.220518350601196,-468995.248603544838261 7860130.661469206213951,-467170.833468934404664 7860073.707959663122892,-465222.742380053678062 7860821.179227720014751,-462965.517065238498617 7862317.793566293083131,-449885.365577536984347 7874238.099226651713252,-449545.284533164289314 7874872.841586108319461,-417908.619208186864853 7888958.786186242476106,-405141.164170125091914 7892877.601583448238671,-405419.462897109682672 7892242.800532267428935,-405481.245214497845154 7891317.733876523561776,-405048.323714804660995 7890856.074836248531938,-403471.260488734871615 7890510.264954649843276,-400533.761765683011618 7891260.54485116712749,-399946.217493275587913 7891490.759310797788203,-392092.070820355962496 7896923.736378288827837,-390329.438003136485349 7899062.84092173166573,-389989.356958760938141 7899583.711087840609252,-389278.136732083221432 7900972.041050185449421,-388906.997549778141547 7902475.17324258107692,-389030.673504051344935 7903226.851625133305788,-389308.972231033083517 7903921.319862603209913,-389463.595003744470887 7904731.891367718577385,-389339.919049474177882 7905542.549955304712057,-388288.617778423707932 7906526.457714224234223,-371776.263750583399087 7909420.581991241313517,-366179.231072987720836 7909942.167647610418499,-365468.122165801178198 7909593.814474460668862,-365127.929801937250886 7908957.605912234634161,-364695.008302241272759 7907683.890837426297367,-363025.215940342226531 7905542.549955304712057,-361355.423578443238512 7904210.457456498406827,-358819.788217155088205 7902823.19789909478277,-347687.839137828384992 7898657.744530385360122,-342956.760779113159515 7897385.76660100184381,-338627.76842114405008 7896691.899435234256089,-337854.654557584086433 7896807.817016750574112,-336463.160922669689171 7897328.739719396457076,-332783.495154498959891 7899178.794918777421117,-330340.588929040008225 7900451.075067641213536,-327557.601659208361525 7902359.168590290471911,-325454.88779761333717 7903921.319862603209913,-322610.118210390734021 7906005.108143300749362,-317569.794306252617389 7905772.992066564969718,-310643.27295011311071 7905079.811781695112586,-309715.536313844611868 7904963.767082164995372,-294532.782284039305523 7902069.893661243841052,-286091.091338712256402 7900335.101523214951158,-279411.921891116246115 7898657.744530385360122,-272114.372672162950039 7897963.760438520461321,-267197.724722298036795 7897558.931159135885537,-266300.934904467780143 7897558.931159135885537,-243356.7633375749283 7898022.66542839538306,-241872.540566828451119 7898311.577123300172389,-241254.04947597993305 7898716.65493624471128,-238254.657116045884322 7902591.179678102955222,-237265.138162383547751 7903574.702651378698647,-235997.320481739443494 7904037.348531575873494,-231049.837032924639061 7904442.525470707565546,-225112.834630444674985 7903285.589415747672319,-214815.670412577688694 7899930.14504277240485,-213547.964051424816716 7898427.519579872488976,-207054.252875490114093 7888199.172672216780484,-202817.878333859000122 7879311.92547438852489,-198303.316384740202921 7864159.294496933929622,-197499.367022230406292 7861108.671914548613131,-197406.637886398326373 7854322.990328399464488,-206590.495876844244776 7842088.746601978316903,-218062.526000543613918 7828384.026473658159375,-219515.913272343081189 7825863.601808241568506,-220165.239862138638273 7824547.326105579733849,-228668.824444345053053 7804931.516813184134662,-229503.72062529597315 7801962.811673324555159,-229967.588943430251675 7799165.990141354501247,-230987.943396042450331 7791122.989050498232245,-230833.320623331033858 7789584.147735708393157,-230122.21171614449122 7787646.418826683424413,-233028.874940246489132 7774495.652985092252493,-241223.213977030070964 7760230.884563897736371,-243820.631655709206825 7754952.597663755528629,-244500.905063948710449 7752400.481745673343539,-244624.581018219032558 7748997.49494818225503,-244531.851882386981742 7748317.080172518268228,-243758.849338318250375 7746333.734569543972611,-243264.034201742877485 7744237.296253849752247,-243387.710156016051769 7743387.828892803750932,-244253.553155405214056 7740215.758440879173577,-247098.32274262784631 7733140.913110285066068,-257766.514823308651103 7719122.511986598372459,-258725.086958529893309 7718106.517623537220061,-261384.3982740912179 7716186.905936138704419,-266053.58299592428375 7713590.457735167816281,-268867.517084197024815 7710939.047380668111145,-275855.932077215868048 7702143.837288377806544,-274155.192896875785664 7698314.539894165471196,-272519.464299161103554 7698975.094941437244415,-272516.347353417892009 7697357.262322466820478,-272609.076489249942824 7696455.641799354925752,-277030.909302539541386 7681663.037227843888104,-281329.177481049962807 7674472.698798686265945,-282225.855979389045388 7673462.630366805009544,-284019.32429555838462 7671498.855806524865329,-293976.184830072976183 7663141.435322283767164,-302881.855413025536109 7656360.649141668342054,-322300.872664967842866 7651321.164282594807446,-329351.06997537764255 7649754.887664054520428,-338009.277330298325978 7649418.262652226723731,-338937.013966566883028 7649530.469344235025346,-339740.96332907670876 7649530.469344235025346,-341781.783553789544385 7648915.669382249936461,-342956.760779113159515 7648244.119312001392245,-364911.524711834848858 7629915.075025547295809,-363427.190621597168501 7627626.573646485805511,-362066.643805121013429 7628017.48509035166353,-355449.367994407191873 7630194.177923261187971,-354861.823721999768168 7630473.090040261857212,-333463.768562735640444 7641309.289712944999337,-326413.45993283460848 7647068.746383736841381,-324960.18398052919656 7648411.699174717068672,-324372.639708121772856 7648691.47709843236953,-322919.363755816419143 7648971.06381553504616,-321094.948621203133371 7648803.471704076044261,-319486.938576695101801 7648411.699174717068672,-313395.31340150651522 7646566.307377055287361,-312684.09317482879851 7646286.808491548523307,-312158.44253930071136 7645056.168235054239631,-311601.84508533438202 7642204.428688069805503,-311478.169131064030807 7641421.377597996033728,-311663.73872221657075 7640638.40658716391772,-312034.766585030360147 7639912.252921585924923,-312745.986811708135065 7637788.110612540505826,-313395.31340150651522 7633152.0074393870309,-313178.9083114041714 7630976.081866908818483,-312158.44253930071136 7627793.702922924421728,-311756.46785804576939 7627292.526894922368228,-308509.612270079844166 7624893.161413862369955,-307891.121179231326096 7624614.251534318551421,-303995.050320958252996 7623330.674066665582359,-303160.042820518894587 7623163.642095295712352,-301026.493459974066354 7623330.674066665582359,-297810.58469044638332 7623051.821042924188077,-297099.364463768608402 7622829.789821380749345,-294285.430375495867338 7621714.912913407199085,-293759.779739970632363 7621379.5180489635095,-293172.235467563150451 7620933.953315561637282,-287853.724155934585724 7615137.349097966216505,-287451.638155188411474 7614636.999875476583838,-286956.934338104270864 7613355.091710519976914,-287513.531792070600204 7611963.141626984812319,-287946.453291763784364 7611461.596299202181399,-297594.179600343981292 7601724.446844118647277,-298119.830235872068442 7601334.873461414128542,-298676.427689838397782 7601001.970049493946135,-310364.974223131372128 7595830.910002659074962,-313920.964037031750195 7595165.594859323464334,-315528.974081539781764 7595054.181212953291833,-316920.467716457031202 7595609.665314739570022,-318126.391760218946729 7596388.050776469521224,-320043.536030661431141 7598054.913334996439517,-320631.080303068854846 7598444.320255909115076,-321465.976484016922768 7598722.07991551514715,-324681.885253544605803 7599332.866336463950574,-326351.677615443593822 7599389.304494322277606,-329165.500384225160815 7598777.112741439603269,-331299.161064261279535 7597276.358836718834937,-349048.497273792978376 7581065.317415105178952,-349821.499817861651536 7579956.491092479787767,-350780.071953082922846 7577017.498022471554577,-350965.641544235462788 7576297.541288631036878,-351120.264316946850158 7575464.726476661860943,-371961.722022244648542 7563227.131259656511247,-372549.266294652130455 7562895.874992564320564,-377651.372516181145329 7560627.262566416524351,-378393.539561300014611 7560516.348538427613676,-379537.681287673767656 7560903.85765680577606,-383062.835602624283638 7562231.811890984885395,-389339.919049474177882 7565274.543847040273249,-397565.204904698824976 7569094.105296235531569,-398802.075766901834868 7569371.005079376511276,-414077.558932536339853 7569704.135312742553651,-416025.76134091115091 7569482.046886702999473,-414881.508295046107378 7564555.486709290184081,-414696.050023384857923 7563891.280305773951113,-414263.128523688821588 7563503.819858563132584,-408140.556530059140641 7559852.490822587162256,-407645.852712975058239 7559576.132633647881448,-405883.219895752728917 7559410.481763506308198,-384577.893872320652008 7556811.902430122718215,-362314.107033155742101 7552776.826681492850184,-343760.821461114217527 7548081.022501940838993,-341472.53800836665323 7547363.769054974429309,-339864.63928334985394 7547196.98937339708209,-335968.457105585548561 7548357.166992150247097,-326722.705478257441428 7552335.223885111510754,-325547.728252933826298 7552942.334798093885183,-323970.665026866889093 7554047.272246405482292,-323537.743527170852758 7554434.455671532079577,-322331.819483408937231 7556148.364274887368083,-319023.181578049203381 7562673.983103074133396,-319301.368985542561859 7564057.027702260762453,-318961.287941169866826 7564777.432889114134014,-315467.08044466044521 7568596.747359578497708,-313951.91085547284456 7569758.761276684701443,-311045.24763136805268 7570423.474722015671432,-309715.536313844611868 7570645.590345293283463,-295800.59996468340978 7570312.419316792860627,-292893.936740581411868 7569316.182516302913427,-289492.569699392479379 7567045.675645722076297,-278546.190211218316108 7558968.498099136166275,-264414.737452466390096 7549848.399131523445249,-251612.996011237875791 7542230.241054864600301,-237141.462208113225643 7535720.335092523135245,-231513.594031567685306 7532027.797824158333242,-230740.591487498953938 7529327.976146135479212,-230245.887670414813329 7528116.131043621338904,-229441.82698841378442 7526629.099938415922225,-225050.940993565309327 7519913.474413640797138,-224154.151175735023571 7517713.327905870974064,-222731.822041867912048 7514797.99668319709599,-220412.591770682105562 7510125.272428570315242,-219701.371544004359748 7509136.78989080619067,-206095.680740268871887 7490478.097748532891273,-202570.526425318355905 7485929.910419275052845,-202106.769426672486588 7485492.119016253389418,-201302.708744671428576 7485272.44384728372097,-200560.653019043820677 7485382.280651124194264,-199787.539155486680102 7486477.579002642072737,-194469.027843855234096 7484121.519027896225452,-188129.939440631947946 7480289.821888767182827,-182347.559810866252519 7475857.32638812251389,-181883.691492731973995 7475418.529584723524749,-176039.418226084060734 7456677.510080561973155,-175946.689090251980815 7455914.676412967033684,-175142.739727745007258 7443754.263998881913722,-175390.091636285651475 7442011.196263050660491,-175853.848634931520792 7440540.640794043429196,-176472.339725780067965 7439233.453278854489326,-177338.182725169230253 7438253.991325831972063,-178049.40295184700517 7437110.037714576348662,-177956.562496526545146 7436349.128685318864882,-174307.84354679408716 7417809.609601859934628,-169267.519642655999633 7393792.016803870908916,-168649.028551810304634 7390977.905956174246967,-165309.443828012299491 7379298.831445632502437,-164845.686829366430175 7377946.876151707023382,-157269.727563940134132 7361758.011458271183074,-153775.520067430712515 7357284.659233413636684,-151951.104932817455847 7347860.924530738964677,-149786.608753834327217 7336944.275824505835772,-145210.153167830518214 7317622.426306694746017,-144437.039304273377638 7316122.332562279887497,-129718.153592605231097 7294178.357548218220472,-118153.283013582564308 7287927.555536055937409,-116205.191924698985531 7287126.684592095203698,-97497.283579946044483 7278907.789901481941342,-62864.565479760218295 7261591.033455641940236,-58040.757985212912899 7255897.863052013330162,-57391.43139541734854 7254834.347549501806498,-50928.667037923740281 7241869.529856295324862,-48547.654449344146997 7236774.895556156523526,-46939.755724327347707 7233327.934445875696838,-43785.629272190635675 7221986.62048604991287,-43878.469727511095698 7221298.633067520335317,-43723.846954799671948 7220663.122711667791009,-42517.811591546545969 7218704.495867410674691,-29221.366333233909245 7203262.226720285601914,-22322.786169283550407 7198941.059439612552524,-16883.493210142518365 7196979.093343337997794,-13018.146531328051424 7195236.483973870053887,-9183.857990445914766 7192704.678075519390404,-8719.989672308809531 7192281.523447135463357,-8348.961809494998306 7191384.579215992242098,-9060.182036172755033 7190277.925429258495569,-12523.442714243914452 7188800.477487282827497,-15151.807211364155592 7188273.31856971886009,-15739.351483768754406 7188009.65743596944958,-17934.7944811958223 7186849.767187124118209,-19357.234934551335755 7185637.863441759720445,-22573.143704079011513 7180526.04657600261271,-23222.470293874572235 7179315.115291157737374,-23748.120929402637557 7176944.610452360473573,-24026.419656384390692 7175207.944100338965654,-24057.366474825488694 7174418.487306429073215,-23933.69052055515931 7172997.436967807821929,-23624.444975129481463 7171734.243582827039063,-19047.989389128488256 7155333.763346898369491,-18615.067889432481024 7154126.883325332775712,-14193.235076142913385 7144419.583237870596349,-12554.389532685012455 7141903.851127652451396,-11070.055442447301175 7139859.807250598445535,-5998.896039359338829 7132945.150711892172694,-1453.387271796612822 7126454.647970298305154,6802.845401866325119 7114535.516876447014511,7143.037765733103697 7114013.294071231037378,14069.559121869755472 7103259.068428840488195,15708.404665330488569 7099869.971333506517112,16636.029982110634592 7097523.180019559338689,17099.89830024490584 7095647.785760648548603,17161.791937127101846 7094917.824832899495959,16914.328709092384088 7093250.666907691396773,16357.73125512605111 7091948.584406548179686,15986.703392312239885 7091374.970827462151647,15646.622347939526662 7090854.272903649136424,13141.933805089611269 7088093.851516155526042,12554.389532685012455 7087833.512305855751038,12678.065486955338201 7088511.461712021380663,13296.445258312633086 7089708.370436475612223,13729.366758005808151 7090177.622965916991234,15120.860392923057589 7092416.469308666884899,15337.376802516677344 7093146.199853925034404,15461.05275678700491 7093980.474272617138922,15399.159119904808904 7094708.848143745213747,14533.427440006860706 7096324.902930244803429,12152.414851430103226 7098357.915437852032483,9926.025035564769496 7099765.416969142854214,7514.065628546914922 7101017.156620991416276,4916.647949867770876 7102111.558406238444149,3308.637905356901229 7102269.094118965789676,1886.197452001386409 7102164.508081651292741,1236.870862202992612 7102008.476542888209224,0.0 7101431.130250592716038,-3865.235359323234661 7099556.312380300834775,-5751.54413081585426 7099088.193391886539757,-7946.987128240089078 7098983.6493452610448,-8781.883309191005537 7099139.62131068110466,-9524.050354309860268 7099348.714900440536439,-11781.275669125057902 7100703.452239817008376,-14440.586984686398864 7102529.90804523229599,-15801.133801159716313 7103780.582278254441917,-19109.883026007850276 7108896.130520159378648,-25758.105655165585631 7117618.029234312474728,-27767.979061437297787 7119133.956766422837973,-30334.561241166575201 7120230.866400840692222,-32715.5738297433345 7120440.517842062748969,-39772.005031639557274 7119290.514422331005335,-42406.492100752147962 7118537.485432622022927,-47044.8413236353299 7116844.466846497729421,-61132.990800470259273 7114691.983569264411926,-62431.643980064211064 7115265.972014978528023,-63359.380616335591185 7116102.580198654904962,-64317.952751556833391 7117618.029234312474728,-65245.578068336981232 7118558.370577606372535,-67441.021065761218779 7119133.956766422837973,-68987.13747338988469 7119185.703244997188449,-70378.631108304296504 7119029.147663258016109,-72852.372832713124808 7118297.028005286119878,-75047.927149628594634 7117147.336107071489096,-76068.281602240793291 7116520.165038150735199,-80026.357416884493432 7113489.789485096000135,-79500.706781359258457 7112237.39263603463769,-77150.641011223589885 7110930.869420263916254,-57855.188394060387509 7110774.477065208368003,-56203.986387123732129 7110994.028747262433171,-50971.970319840766024 7112811.203073807060719,-43439.314336331510276 7115037.086310275830328,-34014.338328828525846 7116102.580198654904962,-33148.495329439341731 7115946.085611619055271,-32035.300421506675775 7115162.718728709965944,-29437.771423336296721 7111818.529763979837298,-26891.22675194972544 7107538.487896650098264,-25665.376519333523902 7104772.2481803689152,-24799.533519944343425 7103103.015324712730944,-23067.847521163148485 7100547.449480059556663,-13049.093349769149427 7091374.970827462151647,-11224.678215158724925 7089708.370436475612223,2999.39235993405282 7077844.556699980981648,9493.103535868762265 7073477.113162075169384,13667.58444061767841 7071294.85356701631099,14316.911030413239132 7071190.675311959348619,15584.728711057330656 7071503.21417944226414,16357.73125512605111 7071294.85356701631099,18769.690662143904774 7068542.72491695266217,24150.095610654716438 7060495.834362633526325,26221.97397329985688 7057227.455532013438642,27551.573971334910311 7053702.691632498055696,28386.470152285826771 7051318.207518306560814,30056.262514184825704 7047328.003556433133781,37724.950915440334938 7026842.449465845711529,37879.573688154589036 7026223.675435506738722,39394.743277342167858 7017703.54502615891397,39673.042004323913716 7015691.064074957743287,39827.664777035337465 7012802.331687585450709,39703.988822765015357 7010533.268185496330261,39425.690095780431875 7008832.683048966340721,38034.196460866012785 7000744.142090866342187,37477.599006899683445 6999455.637281239032745,36642.702825948763348 6998529.473448576405644,36086.105371982434008 6998272.235094723291695,30798.429559303680435 6995389.620075249113142,22696.81965834933726 6988188.652830772101879,19295.341297669139749 6984693.007271611131728,3586.936632341484255 6967700.700297676026821,204.827863059429347 6961354.904452924616635,4.118821158642184 6960748.381152370944619,730.478498584664521 6960382.423402433283627,3123.179633695612665 6960984.860740495845675,6431.817539052513894 6962521.779506586492062,7668.688401258338672 6962830.084335071034729,8379.908627936096309 6962880.823850900866091,9616.77949013908983 6962624.546462242491543,13605.690803735482405 6960369.880792428739369,16419.624892008247116 6958730.657132527790964,17501.872981499815069 6958013.141398175619543,18398.662799330093549 6957194.282124228775501,19109.883026007850276 6956221.01618991792202,19604.586843094821234 6955145.012053399346769,20810.510886856714933 6953047.063392200507224,24242.936065978010447 6947366.213923020288348,26036.404382147335127 6945729.651186262257397,26562.055017672570102 6945371.375487064942718,27149.599290080001083 6945218.38596916012466,40446.044548392637807 6942457.344716001302004,42177.730547173829109 6942662.365329,47589.082314125742414 6950231.556555071845651,47929.274677989684278 6950795.094542960636318,48207.573404971437412 6951409.339027897454798,48640.383585176212364 6952892.452899684198201,48795.006357887636113 6954479.978540019132197,49351.603811853965453 6957809.017993129789829,49568.120221447585209 6958577.227644670754671,54391.927715992067533 6970264.733117944560945,55010.418806840592879 6971443.991594145074487,60205.254164198879153 6976475.109277882613242,60761.851618165215768 6976731.646268778480589,61473.071844842968858 6976885.424551932141185,74274.813286068630987 6978579.214623173698783,97713.799989536826615 6977039.020959897898138,98270.397443503155955 6976936.068528628908098,98981.617670183753944 6976576.57717508263886,100032.918941234223894 6975190.51514136698097,101022.437894896560465 6974317.973807644098997,101486.30621303083899 6974164.244926761835814,104887.673254219800583 6973907.790346711874008,107948.95925103603804 6973754.069356176070869,110731.946520867713843 6973959.893564954400063,111968.817383070709184 6974267.161650827154517,131789.920635759131983 6971702.029529605060816,142736.300123933295254 6969598.25660895742476,145364.66462105352548 6968520.451404427178204,150559.611297903058585 6966316.176463145762682,152816.947932209470309 6964982.645179284736514,155105.120065462950151 6963342.475979395210743,159434.223742923291866 6959857.679534072056413,163485.028693399042822 6956118.331462082453072,167381.210871166200377 6952995.096242647618055,168896.380460350948852 6951869.039928879588842,170411.550049538520398 6950743.142012432217598,183151.509173376049148 6940771.368832439184189,184450.16235297001549 6939492.494155977852643,186491.093897174054291 6936530.21165746729821,187727.964759377064183 6934435.662508975714445,189521.433075549197383 6930605.805748995393515,190047.083711074432358 6928819.802187663502991,191593.200118703127373 6923412.401603175327182,194128.835479991306784 6914339.203927177004516,194407.134206973045366 6913066.004571549594402,194437.969705922907451 6912402.986624144017696,194695.785646599862957 6896365.875638592988253,194747.215251348592574 6882968.021011236123741,192613.665890803735238 6874853.687078119255602,192922.800116735335905 6871508.525462773628533,192211.579890057590092 6869430.860741080716252,187656.942924250528449 6859341.447053607553244,181450.769993035966763 6835510.802980235777795,181203.418084492470371 6833190.392235824838281,180894.172539069637423 6831576.90237505082041,176843.367588593857363 6815608.435005615465343,176565.068861609295709 6815005.921839358285069,175853.848634931520792 6813948.643314179964364,154765.039021090226015 6794701.802072428166866,148487.844254749128595 6787326.975443679839373,147900.29998234170489 6787176.778137777000666,146694.375938579818467 6789934.75064180791378,142581.677351221849676 6797011.191011169925332,141839.621625594241777 6798015.10141293797642,140788.209035049716476 6798768.206314632669091,130274.751046571574989 6804797.740561540238559,129656.259955723042367 6804746.722058184444904,129161.556138638901757 6804345.098265840671957,128975.986547486376367 6803692.230778751894832,134511.014268708619056 6791239.58527840860188,142272.431805796193657 6778656.016567568294704,142921.869715085806092 6778606.424803573638201,143478.467169052135432 6778355.945947512984276,144004.117804577370407 6778005.216421492397785,144189.687395729910349 6776603.351461161859334,143200.168442067573778 6773949.216687950305641,142519.895033830893226 6772997.660275300033391,140942.83180776113295 6771096.503788461908698,136211.753449048701441 6765642.724229828454554,134511.014268708619056 6764042.46069797873497,133552.44213348737685 6763342.073372521437705,131511.621908774570329 6762192.892293113283813,126038.376504940461018 6759893.218902990221977,123750.093052195763448 6759244.10193270817399,121152.675373516613035 6758744.525903027504683,116885.465332938474603 6758744.525903027504683,115463.024879580130801 6759143.896425941959023,115122.943835207406664 6759643.497030454687774,111041.192066290561343 6765992.919597920030355,109835.268022525837296 6768744.954912657849491,108969.425023136645905 6768443.990007927641273,104269.293482862500241 6765443.416698913089931,103310.721347641258035 6764742.90846889000386,95969.757527279711212 6759293.39558017347008,80613.901689291917137 6750852.533052319660783,78387.511873426585225 6750054.446868528611958,77892.696736851212336 6749555.435738545842469,77954.590373733415618 6748956.375352870672941,84448.190230176885962 6744514.751922972500324,85068.573752367883571 6744607.953119589947164,96074.843126587686129 6748157.217780648730695,97157.202535570497275 6748706.989508566446602,97961.151898080308456 6749504.763654035516083,100125.648077066274709 6752040.73228117916733,100366.877413614580291 6752250.495980084873736,100700.835885994951241 6752430.785646853037179,102290.25557554065017 6753349.73194455076009,103094.204938050475903 6753299.036188274621964,103712.696028896170901 6752999.901713343337178,104609.374527238047449 6752251.214973798021674,105413.323889745035558 6750653.588224049657583,106310.113707575306762 6730660.135123359039426,106186.437753304984653 6729912.068626205436885,105815.29857 6729265.162182052619755,101300.736621878313599 6724785.191418238915503,97435.501262555073481 6721153.173774464055896,91374.711586316378089 6716579.233473189175129,89952.382452449266566 6715585.339555939659476,87880.504089804118848 6714540.933169429190457,86736.473682921583531 6714143.74676304589957,85375.815546957033803 6714044.09537436068058,75759.036056815108168 6715982.596253319643438,72914.266469595313538 6716827.815385054796934,72233.993061355824466 6716777.167771108448505,51763.563218871822755 6710764.867113076150417,50279.340448125345574 6709871.281293085776269,42610.652046867005993 6701381.828390020877123,43064.278971850289963 6701007.074296130798757,43754.682453749534034 6700735.933119462803006,45888.343133785638202 6700735.933119462803006,49413.497448736161459 6701579.393962631002069,50372.069583957403665 6702225.356040216982365,50774.044265209478908 6702671.092562440782785,51639.887264601493371 6704409.251106985844672,52103.755582735771895 6705749.394165238365531,52443.836627111311827 6706294.878847929649055,53309.679626500495942 6707039.527933859266341,54453.821352874263539 6707437.798330205492675,59679.603528673644178 6708082.794535982422531,61102.043982029157632 6708082.794535982422531,65492.929976877632726 6708082.794535982422531,66296.990658878683462 6707983.21723379381001,77645.344828307730495 6705005.041613248176873,78789.486554681498092 6704409.251106985844672,79717.111871461645933 6703664.842208075337112,80150.033371157653164 6703266.756073389202356,80737.577643565076869 6702225.356040216982365,80892.200416276507895 6701629.768590470775962,80923.03591522636998 6700983.853684328496456,80737.577643565076869 6700239.757390116341412,80459.278916580500663 6699644.314919441007078,80057.304235325587797 6699198.922365704551339,78913.1625089518202 6698801.054155276156962,76903.177783188875765 6698652.483570178970695,76161.122057561253314 6698703.018693890422583,74120.190513357214513 6699347.324320028536022,71770.124743221545941 6699694.856188350357115,71244.474107696310966 6699446.796214780770242,62122.509754129765497 6694339.045025696977973,61936.94016298007773 6693793.110086791217327,62184.292071520729223 6693248.460823108442128,62864.565479760218295 6692306.296290267258883,64379.73506894496677 6690572.141398129984736,64812.656568640974001 6690174.87198137678206,65431.147659489499347 6689927.101250694133341,68987.13747338988469 6689332.410833866335452,78387.511873426585225 6688341.831985123455524,100744.139167911984259 6681805.134995616972446,101424.412576151473331 6681756.129975977353752,109247.723750121236662 6682646.819823981262743,111226.761657443086733 6683042.475522280670702,112680.037609748454997 6683786.25318344309926,115030.103379886946641 6685567.816408730112016,117194.710878361322102 6686509.203476384282112,118307.905786293995334 6686807.153699684888124,119080.90833036271215 6686905.046361476182938,132686.599134098185459 6688540.508851628750563,154239.38838556499104 6690174.87198137678206,158908.573107398056891 6680073.208728693425655,157084.157972787623294 6656945.326190340332687,156836.806064244126901 6654675.329130974598229,156558.507337262388319 6653096.703205969184637,155661.717519429279491 6650334.795720547437668,154765.039021090226015 6648608.277859691530466,152384.026432513463078 6645355.028546360321343,151177.991069260344375 6644074.773070210590959,150683.287252173380693 6643729.597788617014885,140540.857126509043155 6639296.293064828030765,137139.378765828849282 6639148.799814297817647,135871.672404676006408 6638951.319017413072288,122482.386691042906023 6634324.468487959355116,120998.052600805196562 6633437.959523135796189,116390.65019636026409 6630043.396006690338254,114659.075517073142692 6628519.788483358919621,111443.166747545474209 6625126.020648063160479,110700.999702426619479 6624193.082307723350823,109773.374385646471637 6622570.42577913403511,108969.425023136645905 6620703.997927704825997,108289.151614899994456 6618689.453932738862932,107948.95925103603804 6617216.396156779490411,107763.389659883527202 6615693.577202288433909,107979.906069474309334 6611619.030075713992119,108536.503523440638673 6609263.162053998559713,95363.734219401172595 6608135.283868036232889,90632.655860685918014 6609705.27744260802865,88313.42558950012608 6609999.033264809288085,86983.825591465065372 6609902.055587112903595,79748.058689902740298 6604506.318826136179268,78572.970145087878336 6603231.008653108030558,75975.552466408727923 6599947.355887860059738,75171.603103898916743 6599114.122373814694583,73718.215832102301647 6598231.230456918478012,63142.864206741971429 6594410.221807206049562,55505.122623924733489 6592696.661564954556525,50403.016402395667683 6591962.337504526600242,47960.110176939553639 6591472.883293562568724,44589.689954191686411 6590297.748069609515369,41404.616683613880014 6588878.046271258033812,38899.92814076396462 6587508.443277961574495,34199.796600489811681 6582566.624939186498523,32993.872556727917981 6581296.119668211787939,31942.459966186212114 6579829.569777340628207,30829.265058253546158 6577482.788523527793586,30179.938468455151451 6576456.018076159991324,29345.042287504234992 6575674.765999062918127,28262.794198012667039 6575186.27921399101615,26964.02969892747933 6575088.303897446021438,25356.130973910676403 6575332.628715308383107,23964.637338993426965 6575723.14131180755794,13729.366758005808151 6578850.900411964394152,10946.379488174141443 6580318.332049430347979,6338.977083732052051 6582616.273160476237535,-10513.457988480968197 6587801.407104633748531,-15368.323620954943181 6589220.923139488324523,-17470.926163058717066 6589759.934726714156568,-21243.432386552722164 6590542.524695279076695,-22944.171566892819101 6590688.971212308853865,-28386.470152285826771 6590640.507876573130488,-64256.059114674637385 6585159.472424866631627,-70966.175380711734761 6583740.656668508425355,-75171.603103898916743 6582664.689267466776073,-79191.461235936410958 6581394.168864630162716,-83056.696595259636524 6579976.001811065711081,-85499.602820718588191 6577678.79729484859854,-85344.980048007171717 6576603.621645564213395,-85344.980048007171717 6575967.484960181638598,-85623.278774988924852 6574550.251970016397536,-86427.228137498736032 6573525.078012904152274,-86891.096455635837629 6573231.214819570071995,-87416.747091161072603 6572987.128166943788528,-88653.617953364067944 6572840.820325620472431,-89333.891361600733944 6573183.029993968084455,-100558.569576759458869 6580366.734645404852927,-101331.683440319407964 6581100.024778145365417,-101393.465757710378966 6581784.96900472138077,-101146.113849166882574 6582371.908209331333637,-99569.050623099945369 6584132.97693841997534,-99136.240442895170418 6584474.247388496994972,-96755.227854318422033 6585159.472424866631627,-96384.088672013371252 6585600.117579888552427,-96136.736763469889411 6586137.659118901006877,-96260.412717740211519 6586823.022658423520625,-97064.473399741269532 6587556.888169984333217,-103186.934073879703647 6592941.333300057798624,-103515.660530191918951 6593018.015060679987073,-104547.592209847076447 6593186.188597305677831,-121833.060101244511316 6594068.539018400013447,-128543.065047790369135 6593773.941569223999977,-129068.82700280683639 6593529.068775586783886,-129377.961228741289233 6592991.220433191396296,-129037.880184365742025 6592451.820838483050466,-127646.386549451330211 6591472.883293562568724,-124461.424598364756093 6588095.790763569064438,-124275.855007212230703 6587556.888169984333217,-124214.072689821274253 6586921.13770925719291,-124399.530961482552812 6586285.436356180347502,-125481.779050974131678 6583740.656668508425355,-125729.242279008845799 6583203.271636382676661,-126100.270141822649748 6582762.754763870500028,-126564.138459959765896 6582371.908209331333637,-127089.789095485000871 6582175.787695457227528,-127677.333367892424576 6582029.316535127349198,-148209.545527764566941 6584474.247388496994972,-156744.076928414899157 6580855.528804268687963,-177307.235906728135888 6572644.92663501854986,-179688.248495304898825 6573623.034739969298244,-185192.329398088855669 6574990.329746156930923,-186166.374942529248074 6575124.538797938264906,-187511.559669274662156 6575234.651658130809665,-189397.757121276052203 6574892.356760084629059,-202199.498562504537404 6572450.444328652694821,-215310.485549153061584 6570643.525758612900972,-223690.394177089154255 6571033.816158330067992,-224927.265039294987218 6571522.056796542368829,-225700.267583360866411 6572304.146016950719059,-225947.730811395595083 6572890.409951932728291,-226195.082719939062372 6574111.428835805505514,-226658.839718582108617 6574403.916367212310433,-227308.277627871750155 6574355.724682384170592,-229936.642124991980381 6571131.743272102437913,-230214.940851973718964 6570691.871539294719696,-231482.758532617823221 6568495.149817634373903,-231699.163622720196145 6567957.528215826489031,-231513.594031567685306 6567371.439354351721704,-219825.047498274681857 6563174.784509535878897,-218544.873354151844978 6562004.381892841309309,-218081.116355505975662 6562530.902009578421712,-217765.636918599542696 6562735.864060744643211,-217394.609055785724195 6562619.244068468920887,-217227.629819595545996 6562325.945052730850875,-217134.900683763495181 6561975.580561363138258,-215465.108321864478057 6557761.308958495035768,-218000.632363664277364 6550597.266470135189593,-218464.500681798526784 6550255.992734760046005,-219113.827271596936043 6550110.262977248989046,-228359.578898922220105 6548356.446687645278871,-229039.852307161694625 6548306.829031156376004,-236213.836891333077801 6552106.686331101693213,-237543.436889368109405 6553178.671854855492711,-238749.360933130024932 6553813.052549709565938,-244593.634199777938193 6555420.801462697796524,-265837.177905821881723 6558151.165546091273427,-266486.504495620261878 6558151.165546091273427,-270630.038581925269682 6556980.773494964465499,-272361.724580706446432 6555470.461906002834439,-274340.762488028325606 6550547.810717513784766,-274680.843532403872814 6549086.719835380092263,-274495.385260739712976 6548015.2655762238428,-273691.324578741507139 6546457.162318707443774,-269918.929674738727044 6543828.441959716379642,-271001.84568117489107 6540638.437151100486517,-273315.064699859532993 6541884.123367630876601,-273649.913728166953661 6544135.278570587746799,-277698.158330352860503 6550078.872668306343257,-285318.088794643525034 6556493.217642557807267,-296326.361919699877035 6563712.094287780113518,-300624.518778719124384 6566103.275158314965665,-302912.690911975398194 6567225.406906048767269,-308509.612270079844166 6569911.341610219329596,-314261.156400895735715 6571962.148679352365434,-318806.665168458421249 6573378.936479141935706,-320909.379030050593428 6573867.316104344092309,-323599.637164053041488 6574257.759243193082511,-325578.675071374920662 6574013.466301584616303,-326197.054842732206453 6573769.356472769752145,-327774.118068799143657 6572498.800712015479803,-329443.910430698131677 6570643.525758612900972,-331515.677473852061667 6569519.6981390863657,-344472.041687791934237 6567029.646647682413459,-352944.679451557283755 6566395.478597483597696,-353594.006041355663911 6566297.607741178944707,-361139.018488340836484 6563906.37051494885236,-362252.213396273553371 6563468.289369233883917,-379754.086377776169684 6553665.856445043347776,-382629.802783437073231 6551717.29062276519835,-385010.815372013836168 6549184.386712061241269,-385722.035598694405053 6548258.789605474099517,-388968.891186660330277 6541443.706014295108616,-389649.164594897010829 6539594.174469995312393,-395338.815088833507616 6522536.142785780131817,-395555.331498427141923 6520302.74285436514765,-406532.657805042341352 6486396.640423788689077,-409099.128665280411951 6484511.518305367790163,-412624.282980230927933 6482674.6582738365978,-413737.477888163586613 6482143.803335079923272,-415098.024704639741685 6482094.75488692894578,-421838.976469626708422 6483109.873329615220428,-423354.257378302689176 6483448.389705893583596,-424498.399104676442221 6483979.154119905084372,-426724.677601050527301 6485719.5549450898543,-427436.009147219534498 6486589.109140458516777,-428023.442100135725923 6487604.777498853392899,-428796.44464420445729 6489974.051361822523177,-431517.649596647999715 6494908.685639568604529,-431795.948323629738297 6495392.450353795662522,-438691.634180819382891 6500570.866543103009462,-439371.907589056005236 6500910.096333913505077,-439928.505043022334576 6501104.296821221709251,-440670.560768652823754 6501104.296821221709251,-442587.705039092455991 6500814.392381578683853,-443670.064448075252585 6500378.073065644130111,-445834.56062706123339 6499457.920769358985126,-446576.727672180102672 6498586.842099643312395,-446855.026399161841255 6498102.890965644270182,-447813.709853874344844 6497424.849231803789735,-448401.14280679053627 6497182.991171022877097,-449019.52257814782206 6497133.679478456266224,-451153.183258181088604 6497666.888605514541268,-452111.755393402301706 6498392.700584619306028,-457677.729933065653313 6503671.518000974319875,-463707.572790866077412 6510649.960448033176363,-464758.874061916547362 6511959.040496470406651,-487579.369674539077096 6509534.263965385966003,-492650.640397115435917 6507693.248393725603819,-493578.26571389840683 6507014.421545167453587,-494368.077501075400505 6506141.327188813127577,-495464.574485388176981 6504833.166214169934392,-495742.873212372767739 6504348.850203542038798,-497196.260484169353731 6503477.431723578833044,-499020.675618779787328 6502896.072000314481556,-502112.797114545945078 6502314.753060123883188,-505761.627383766754065 6502266.805657866410911,-517109.981553195801098 6502508.812107167206705,-520820.705459298857022 6502896.072000314481556,-530159.186222456162795 6500378.073065644130111,-540734.426528325304389 6486493.570313513278961,-551340.724972126772627 6479824.581098446622491,-561947.02341592812445 6475960.939383733086288,-563214.841096575022675 6470410.872026983648539,-564977.36259430332575 6460960.280055090785027,-564513.605595660279505 6460575.144991718232632,-564235.195549184456468 6460093.404303290881217,-562689.190461046993732 6457010.196175523102283,-562565.514506776700728 6456383.184055890887976,-562781.919596879044548 6454891.099132287316024,-563214.841096575022675 6453638.654831061139703,-563895.114504811703227 6452772.368365535512567,-566183.397957559325732 6450220.831181560643017,-574315.843357460689731 6447044.806310250423849,-574656.035721324617043 6446611.475240719504654,-576263.934446344268508 6443292.96242091152817,-576758.638263428350911 6442187.489177686162293,-578088.349580954643898 6438534.031668087467551,-578737.787490241462365 6438581.612711491063237,-579170.59767044626642 6438965.731449774466455,-582046.425395598402247 6441658.001116638071835,-583035.833029769477434 6443005.068239631131291,-585076.764573973487131 6446419.93000566214323,-585231.387346684932709 6446997.350089381448925,-585200.440528246690519 6447622.269735558889806,-584551.113938448252156 6449450.186481491662562,-584520.167120007215999 6450268.305782625451684,-584798.465846991748549 6451472.761152523569763,-587395.994845162145793 6456623.856791905127466,-588849.159477976267226 6458310.842138711363077,-593734.860609402996488 6462117.180380930192769,-608979.50827608758118 6467950.458242789842188,-610309.10827412258368 6468288.357299313880503,-611082.222137682605535 6468337.324283802881837,-612380.986636767745949 6468143.889012212865055,-613525.128363141557202 6467758.421016779728234,-615689.624542124685831 6466745.176903058774769,-616431.680267752264626 6465925.26185052189976,-616864.601767448242754 6464672.543397068046033,-616926.495404327637516 6463900.558754676952958,-616493.573904634453356 6461297.721606427803636,-616462.627086193417199 6460575.144991718232632,-616648.196677345898934 6459080.920400035567582,-617142.900494430097751 6457924.442343212664127,-618039.690312260296196 6456576.3459163447842,-618843.639674770180136 6455757.432849951088428,-619740.42949260037858 6455131.728706897236407,-621472.00417189032305 6454553.744026034139097,-629388.155801180633716 6452626.956167940981686,-630037.371071487781592 6452482.933003719896078,-630810.484935047687031 6452579.468110309913754,-632047.355797250755131 6452964.2331628119573,-633129.603886742261238 6453542.107436168007553,-635912.702476065140218 6455564.290002561174333,-636469.299930031527765 6456576.3459163447842,-636592.975884304614738 6457201.985316739417613,-636592.975884304614738 6457924.442343212664127,-635634.292429592227563 6468675.239070485346019,-634057.340523013612255 6472824.237013892270625,-633191.497523624449968 6473548.053110894747078,-617421.310540905804373 6481902.216440097428858,-613555.963862088508904 6483448.389705893583596,-611793.331044869148172 6483931.486574206501245,-610432.895547884167172 6483592.950494696386158,-609907.133592867758125 6483303.657479334622622,-609350.536138901370578 6482288.515339105390012,-609041.290593478479423 6481080.97792842425406,-608793.938684935099445 6480598.046920829452574,-608144.612095136661083 6480356.505004351958632,-605516.247598019195721 6479679.912037490867078,-604774.080552900326438 6479727.729056387208402,-604217.483098934055306 6479921.434270321391523,-586437.311390449642204 6493844.223917995579541,-573728.410404544440098 6505803.2786012487486,-573326.324403798324056 6506238.488184252753854,-562379.944915624218993 6519720.20072169881314,-562039.752551760175265 6520205.416675212793052,-561514.213235726230778 6521322.727169477380812,-559318.658918810775504 6527488.821786097250879,-559256.876601419760846 6528121.232661748304963,-559627.904464233550243 6529287.541945499368012,-560988.451280709705316 6532591.287030537612736,-560926.557643827516586 6533369.695484756492078,-558947.519736505695619 6540373.242878972552717,-558143.570373995928094 6541200.382869425229728,-547228.026384771568701 6546846.309976635500789,-545187.206160055939108 6547139.234569259919226,-542558.841662938590162 6547139.234569259919226,-534488.28989991650451 6548989.05411418620497,-532756.49258164409548 6549573.662943896837533,-532261.788764560013078 6549866.684325145557523,-531179.540675068390556 6551181.989213441498578,-530066.345767135731876 6553422.348272529430687,-528953.150859203073196 6558102.893244729377329,-528056.361041369964369 6562687.038019890896976,-523294.447183707670774 6566347.333722244016826,-517790.254961435333826 6571082.164228837937117,-508142.639972343517002 6581344.351981580257416,-507400.472927224647719 6582273.847368408925831,-506905.769110140507109 6583398.184105781838298,-506441.900792003434617 6586431.983269018121064,-506225.495701901032589 6588878.046271258033812,-506194.5488834627904 6590395.904560370370746,-506101.819747630739585 6595635.671564204618335,-506132.65524658060167 6596370.323665414005518,-506318.224837733083405 6596958.304241854697466,-505761.627383766754065 6608380.592144640162587,-503968.159067597414833 6623061.912984350696206,-503566.18438634253107 6623995.961339443922043,-502854.852840173523873 6624094.521231640130281,-498092.938982508436311 6623798.845106573775411,-493207.237851081765257 6623061.912984350696206,-492496.017624403990339 6622914.71142462734133,-491135.470807930687442 6621784.956587082706392,-487177.506312775367405 6619720.274169931188226,-485105.739269621495623 6619426.170381085947156,-483064.807725417427719 6619623.181615645065904,-481425.850862468301784 6620458.321240372024477,-479075.896411821013317 6622030.672990291379392,-472149.263736193126533 6629011.455181543715298,-471809.182691817637533 6629355.834175770170987,-471345.314373683359008 6629896.246198322623968,-468840.625830833392683 6633782.524461566470563,-468531.380285410559736 6634423.152573098428547,-469799.197966054663993 6640872.083747855387628,-470850.610556596366223 6654329.706740721128881,-470479.471374291344546 6654822.924639468081295,-468500.433466969465371 6656007.337314459495246,-467387.238559036806691 6656450.559190977364779,-458265.274205473077018 6658919.006890014745295,-453255.897119776112959 6659214.531389106996357,-443577.335312246053945 6659758.338574352674186,-432352.545777596067637 6661041.049209226854146,-422179.168833490635734 6663708.956490409560502,-411913.062753553153016 6662078.633214847184718,-404337.214807615324389 6659954.899998827837408,-402821.933898939343635 6659708.221498278900981,-400410.085811412718613 6660350.880751021206379,-399358.673220868164208 6660893.341508268378675,-397936.232767512672581 6661880.598626159131527,-396915.878314900444821 6662375.694086921401322,-390793.306321270763874 6660992.346255023963749,-390051.139276151894592 6660794.337959580123425,-383217.347055844496936 6658277.881592976860702,-382691.696420319261961 6657980.969461834058166,-382320.668557505472563 6657635.207451573573053,-381083.797695299610496 6655514.048042042180896,-380341.630650180799421 6654625.065564101561904,-379444.840832350484561 6653984.276538440957665,-378177.134471197612584 6653491.109167017042637,-377373.073789196612779 6653392.195125944912434,-375177.630791772331577 6653392.195125944912434,-367508.942390514013823 6653392.195125944912434,-337112.59883195644943 6657833.139312,-335009.884970364277251 6665585.386076213791966,-335442.806470057461411 6666721.197891489602625,-335535.535605889512226 6667364.408397262915969,-335442.806470057461411 6669686.862135104835033,-334731.586243379686493 6675818.363256754353642,-329505.692748089088127 6687895.450880325399339,-317569.794306252617389 6700339.240169217810035,-308416.88313424779335 6708281.95278984028846,-295367.789784478663933 6721651.878005367703736,-293821.673376852821093 6724338.243499989621341,-284204.893886710866354 6738381.983970346860588,-275144.711850538151339 6750453.570015172474086,-273753.218215620901901 6751500.979642672464252,-272794.646080402482767 6752001.548231741413474,-270382.686673384625465 6752699.519945209845901,-267877.998130534717347 6753198.904010671190917,-267321.400676568388008 6753448.427781913429499,-266270.099405517918058 6753998.557699146680534,-265466.038723516860045 6754897.003562491387129,-264940.388087991625071 6756046.59104261547327,-264816.712133718421683 6756895.984118143096566,-264909.552589041762985 6757544.913390408270061,-265095.01086070301244 6758144.787432497367263,-265713.501951551588718 6759143.896425941959023,-266146.31213175348239 6759543.286594247445464,-266795.750041043153033 6759793.005384449847043,-273907.840988335141446 6754448.397497565485537,-287080.610292374622077 6742071.071073559112847,-292677.531650479068048 6736039.885689629241824,-296666.442964075424243 6730809.290560748428106)) +POLYGON ((-575738.28381081612315 7445662.321586835198104,-581489.827941632014699 7445770.224151289090514,-582386.617759465123527 7445825.54932180698961,-582974.05071238137316 7446151.818913825787604,-588138.050570789724588 7449095.340874903835356,-589189.351841840194538 7449914.427637465298176,-594477.138974013039842 7454604.695301557891071,-594693.544064115383662 7455040.93819628842175,-596363.33642601442989 7460335.755689153447747,-601156.197102117817849 7479304.95351888705045,-601218.090739 7480946.864688076078892,-601156.197102117817849 7482698.726267375051975,-600723.275602421839722 7484888.717466448433697,-599022.536422084551305 7492726.154522690922022,-598682.455377709004097 7493328.391980407759547,-597878.394695710740052 7494370.723130863159895,-593332.99724763922859 7498868.178677287884057,-592838.1821110638557 7499308.111776672303677,-589467.761888316017576 7502216.212119600735605,-586159.012663467903621 7502326.092530774883926,-584643.843074280302972 7502107.519007111899555,-583221.402620921959169 7501613.083473240025342,-582015.36725766886957 7500954.280538686551154,-578675.893853362067603 7498759.532692191191018,-577222.506581565481611 7497496.783418680541217,-575305.362311122938991 7495797.247068158350885,-574439.519311730982736 7494809.018013304099441,-573821.139540376490913 7493658.250885146670043,-566090.668821727158502 7470661.506818084046245,-565935.934729524538852 7469951.216784494929016,-564915.468957423930988 7452313.89062871504575,-564884.633458474068902 7451494.550029558129609,-565039.25623118551448 7450732.030537662096322,-565379.33727555826772 7450131.530577892437577,-566987.347320066299289 7448060.663518562912941,-568131.489046439994127 7447460.174427123740315,-575738.28381081612315 7445662.321586835198104)) +POLYGON ((-559164.036146096535958 7503149.454878541640937,-559967.985508606303483 7503315.284277251921594,-560462.689325693296269 7503698.346019476652145,-569832.228226780076511 7514194.081799991428852,-570172.309271152829751 7514797.99668319709599,-578706.729352311929688 7533405.347008114680648,-578923.245761902770028 7534066.927990833297372,-579510.678714818903245 7536933.376830915920436,-579603.519170142244548 7537705.845121550373733,-579572.572351701091975 7538422.398071464151144,-576820.53190031053964 7542119.591822707094252,-576294.881264782510698 7542505.977118122391403,-575583.661038104793988 7542284.672319809906185,-574470.466130172018893 7541567.958599822595716,-565533.960048269596882 7533956.395961574278772,-560648.258916842984036 7526188.99375263042748,-557586.972920029540546 7515347.915080394595861,-557215.945057215751149 7513973.58844377938658,-557185.109558265889063 7512324.640469043515623,-557370.567829927196726 7504962.307895975187421,-557617.919738470693119 7504248.857614567503333,-558421.869100977666676 7503259.546227278187871,-559164.036146096535958 7503149.454878541640937)) +POLYGON ((-664793.87644543510396 7516393.02645455300808,-670947.395257505937479 7517053.148927037604153,-671534.828210422070697 7517328.183631667867303,-673823.111663169576786 7518758.957939099520445,-674936.306571102351882 7519473.553345865570009,-675771.202752050361596 7520353.222490240819752,-676111.283796425908804 7521013.684060758911073,-676327.800206019543111 7521784.558238158933818,-676729.774887271574698 7523985.668716213665903,-677719.293840933940373 7534066.927990833297372,-677688.347022492904216 7534893.487954364158213,-677317.319159678998403 7537375.685355544090271,-676698.828068833332509 7539635.865435314364731,-664360.954945741919801 7563116.179736332036555,-663000.296809774590656 7564499.303862821310759,-657496.215906993485987 7570035.684999170713127,-656970.676590956631117 7570534.531731500290334,-646673.512373089673929 7580288.483343239873648,-640643.66951528924983 7585004.002570849843323,-639530.585926847765222 7585836.253798919729888,-635789.026521794847213 7588389.706200616434216,-635139.588612508028746 7588501.023185903206468,-633902.717750302283093 7587778.390872075222433,-632851.305159760522656 7583506.137607280164957,-632789.522842369507998 7582729.056708644144237,-632789.522842369507998 7581840.832285015843809,-632974.981114030815661 7580954.108131773769855,-633500.743069047341123 7579679.409324179403484,-634799.396248641307466 7578126.099876169115305,-635417.887339489767328 7577571.679174290038645,-636407.406293152133003 7576241.073033682070673,-637891.62906389858108 7573968.719727909192443,-639654.261881118058227 7571088.245644428767264,-640303.58847091649659 7569758.761276684701443,-650755.264142006519251 7548357.166992150247097,-657248.863998449989595 7535060.199869861826301,-662010.889175603515469 7524646.441544584929943,-664793.87644543510396 7516393.02645455300808)) +POLYGON ((-638417.391018915106542 7589943.693376872688532,-639252.175880374736153 7589943.693376872688532,-639870.666971220518462 7590277.516861313022673,-640087.072061322862282 7590887.631769153289497,-639437.745471527334303 7592165.991683764383197,-638479.173336306004785 7593886.935443675145507,-633562.525386438239366 7597221.53684947360307,-632913.198796642711386 7597442.828000511974096,-632263.872206844273023 7597276.358836718834937,-631769.168389760190621 7596720.754119501449168,-631614.434297557570972 7596165.18961454834789,-631583.598798607708886 7595332.018254687078297,-631583.598798607708886 7592942.428311008028686,-631830.950707148294896 7592220.777580857276917,-632882.251978201675229 7591442.814489816315472,-634799.396248641307466 7590610.155414490960538,-636005.431611897191033 7590221.145649764686823,-638417.391018915106542 7589943.693376872688532)) +POLYGON ((-627625.522983961156569 7595664.675830494612455,-628305.796392197837122 7595887.522461829707026,-628738.717891893815249 7596276.619386740028858,-630439.457072233897634 7600834.022455751895905,-630655.862162336241454 7601501.43067863676697,-628305.796392197837122 7609568.56824900303036,-628058.444483657134697 7610404.890315341763198,-624440.561032874509692 7609848.334184383042157,-624100.36866901058238 7609235.106996960937977,-624155.360497461864725 7608345.41353698913008,-626728.73316613084171 7597720.751512590795755,-627625.522983961156569 7595664.675830494612455)) +POLYGON ((-625924.783803621074185 7611796.557586587965488,-626821.573621451272629 7611963.141626984812319,-627347.224256976507604 7612353.255114740692079,-628738.717891893815249 7616976.789130751043558,-628460.419164909282699 7618592.956253753043711,-628212.955936877289787 7619261.911602725274861,-626821.573621451272629 7621603.112994614057243,-625832.054667791817337 7622550.955020278692245,-624997.15848684089724 7622606.159089151769876,-622245.118035450344905 7622662.768765424378216,-621595.68012616073247 7622327.332423388957977,-621564.733307722490281 7621491.314706487581134,-621750.41421836335212 7620655.187471191398799,-623729.340806196792983 7614190.423153964802623,-624347.831897042458877 7613021.666281838901341,-625244.510395384393632 7612129.92975448910147,-625924.783803621074185 7611796.557586587965488)) +POLYGON ((-618132.419448092347011 7634046.193353893235326,-621657.5737630429212 7634883.582142086699605,-621904.925671586417593 7635442.160307153128088,-622028.601625856710598 7636279.701744047924876,-621781.249717313214205 7636895.096681935712695,-619802.32312948256731 7639688.122972250916064,-617359.416904023615643 7640358.922834793105721,-613370.394270936027169 7640695.149674772284925,-616308.004313481971622 7636000.578119388781488,-617112.064995480119251 7634995.576010872609913,-618132.419448092347011 7634046.193353893235326)) +POLYGON ((-680904.255792020587251 7688971.52010066434741,-675585.744480389053933 7686665.283573543652892,-674256.033162865671329 7686046.073114143684506,-672307.942073982092552 7683404.213783069513738,-667484.13457943755202 7675427.111810288392007,-667143.942215573624708 7674753.22968621738255,-665072.175172419752926 7668860.405167629942298,-664701.035990114673041 7667570.80041837412864,-651930.241367330076173 7662468.635341,-645714.940237868344411 7661347.971594003029168,-644972.773192749475129 7661178.695830713957548,-643828.631466375780292 7660395.112866367213428,-636160.05438460863661 7654344.214950532652438,-629078.910255757742561 7648748.279913015663624,-628831.558347214246169 7647293.092527548782527,-628769.664710334851407 7645670.658238304778934,-629913.695117217488587 7639074.112946587614715,-630408.510253792861477 7637565.651907510124147,-634737.613931253203191 7630249.236139095388353,-636160.05438460863661 7628799.166909535415471,-646611.730055698659271 7621881.71259197127074,-650136.88437064923346 7620153.073275551199913,-650878.940096276812255 7619986.11053389403969,-652332.327368073398247 7620488.414480175822973,-653661.927366108517163 7621212.528591925278306,-654342.2007743450813 7622215.523571524769068,-653600.0337292291224 7623442.499187578447163,-652981.65395787183661 7623832.996472912840545,-652301.38054963236209 7624893.161413862369955,-651651.942640345543623 7626232.230825208127499,-651466.373049193061888 7626956.887851038016379,-651497.431187125388533 7627960.83584485668689,-651744.783095665974542 7628351.563449664972723,-652363.162867023260333 7628799.166909535415471,-653198.05904797418043 7628909.464596371166408,-654837.015910923364572 7628799.166909535415471,-655981.046317805885337 7628239.666670273989439,-666092.64094452036079 7622103.917080283164978,-669710.413075811695307 7619317.091989553533494,-697385.774320908123627 7610126.506993626244366,-703662.969087252044119 7611183.174621448852122,-704095.890586945228279 7611684.902198633179069,-705703.789311964879744 7613633.391742840409279,-706445.845037592458539 7614692.146986456587911,-706693.196946135954931 7615249.054765250533819,-708672.346172949066386 7620153.073275551199913,-708703.181671898928471 7620988.945039283484221,-708393.936126473243348 7624390.568728152662516,-706909.713355726795271 7625784.77728309109807,-705703.789311964879744 7626232.230825208127499,-701065.440089081646875 7626566.231356265954673,-700261.49072657187935 7626399.128849901258945,-699271.971772909513675 7625617.691816330887377,-698869.997091657482088 7625060.030277065001428,-698189.723683418007568 7623889.61521156784147,-693736.944051687256433 7622048.71662861853838,-675245.552116525126621 7629412.353772726841271,-670947.395257505937479 7631477.498917982913554,-670390.797803539549932 7631923.67715513985604,-669988.823122284607962 7632371.288372591137886,-669895.982666964177042 7633375.946182304993272,-670050.60543967562262 7634101.279262903146446,-670359.850985101307742 7634659.800376047380269,-670978.230756455799565 7634995.576010872609913,-671751.344620015705004 7634883.582142086699605,-676698.828068833332509 7632650.480773424729705,-679574.655793985468335 7630976.081866908818483,-680811.526656188536435 7630416.422635478898883,-686748.640378156909719 7629636.183222243562341,-688511.050556396716274 7629748.100399234332144,-689469.622691617929377 7630695.543798666447401,-690026.220145584200509 7631980.355710376054049,-690521.035282159573399 7634046.193353893235326,-690211.789736736798659 7635777.970243732444942,-683841.86583456362132 7644105.537445853464305,-677162.696386967669241 7647068.746383736841381,-675894.878706323564984 7647740.193323238752782,-671473.045893033966422 7650426.570327147841454,-670297.957348219119012 7651210.543282280676067,-669339.38521299790591 7652050.01329306140542,-668690.058623199467547 7653392.22822152543813,-668535.43585048802197 7654121.274554605595767,-668164.407987674232572 7656585.267892703413963,-668226.19030506524723 7657425.327892462722957,-668628.276305811363272 7657817.562246053479612,-669886.297871266491711 7657906.90172603353858,-678925.217884698649868 7654793.340646311640739,-681058.878564731916413 7653224.740798816084862,-681986.615201003383845 7653337.003323202952743,-682604.994972360669635 7653616.759832798503339,-704126.726085895090364 7666561.845482900738716,-705518.219720812398009 7668019.088080644607544,-703879.374177354504354 7678797.414198820479214,-703539.293132978957146 7679414.6216089874506,-688696.620147549198009 7687508.656512294895947,-683563.567107581882738 7689476.754019965417683,-682821.400062463013455 7689589.550285588949919,-680904.255792020587251 7688971.52010066434741)) +POLYGON ((-690180.954237786936574 7564002.243011335842311,-694695.516186908585951 7564777.432889114134014,-697200.204729755641893 7565607.496649332344532,-693984.295960230752826 7573802.75852550752461,-693365.916188873467036 7574910.697228500619531,-691355.931463110493496 7577516.997658062726259,-690459.141645280295052 7578459.410190676338971,-687799.941649210173637 7580954.108131773769855,-687243.344195243786089 7581397.55724972859025,-683377.997516429401003 7582674.138776040636003,-682481.319018087466247 7582506.591582118533552,-682357.643063817173243 7581785.920701346360147,-687738.048012327984907 7566215.65591540466994,-689036.812511413125321 7564555.486709290184081,-689500.680829550256021 7564222.778670887462795,-690180.954237786936574 7564002.243011335842311)) +POLYGON ((-713558.047304375795648 7618759.888655462302268,-714485.672621155856177 7618815.065428871661425,-716124.518164613749832 7620041.296133899129927,-716495.546027427655645 7620488.414480175822973,-714269.15621156222187 7624669.470467002131045,-711764.46766871237196 7626622.870292268693447,-711084.194260475691408 7626845.011436712928116,-710434.867670677253045 7626566.231356265954673,-710311.19171640696004 7625896.638219223357737,-711238.817033187136985 7622941.607634420506656,-711702.574031832977198 7621546.310429006814957,-712568.528350713429973 7619595.809176803566515,-712970.503031968255527 7619093.563713281415403,-713558.047304375795648 7618759.888655462302268)) +POLYGON ((-690057.278283516643569 7650259.147806471213698,-693829.784507007803768 7651545.635125349275768,-694478.999777314951643 7651770.112553313374519,-696736.33641162130516 7654121.274554605595767,-696860.01236589171458 7654960.862412493675947,-696705.500912671443075 7655688.445354070514441,-694819.192141178878956 7657537.450415632687509,-694262.594687212491408 7657929.892189925536513,-692932.994689177488908 7658433.07798280287534,-691912.528917076881044 7658152.943611161783338,-690737.551691753207706 7657537.450415632687509,-686037.308831987902522 7653616.759832798503339,-685697.11646812397521 7653112.479921605437994,-685480.711378021514975 7652441.972141639329493,-685789.956923447200097 7651713.287303596735001,-686377.38987636344973 7651490.423553385771811,-690057.278283516643569 7650259.147806471213698)) +POLYGON ((-767300.537111078156158 7646229.822579452767968,-770887.47374341962859 7646509.52075425721705,-776144.20273766014725 7648356.308790065348148,-778216.081100305309519 7657480.582311796024442,-777968.617872270522639 7658210.018392446450889,-776267.878691930440255 7660225.858192201703787,-774567.250831081648357 7661235.591437997296453,-752952.679262223886326 7668356.532756946980953,-752303.352672428241931 7668524.553853807039559,-751684.972901070956141 7668187.10176074039191,-750819.018582190619782 7667122.539042044430971,-749551.312221034895629 7664822.886900007724762,-749087.443902900558896 7663532.550221493467689,-749056.497084459522739 7662691.819175361655653,-750200.638810833217576 7661795.894548932090402,-752365.246309307636693 7661458.739288401789963,-754096.820988597581163 7661795.894548932090402,-755797.560168937663548 7661683.507810477167368,-756508.780395615496673 7661571.122723654843867,-757158.10698541381862 7661235.591437997296453,-757652.810802498017438 7660898.460878128185868,-765476.233295958954841 7653561.331757863052189,-766094.613067316240631 7652329.722748726606369,-767300.537111078156158 7646229.822579452767968)) +POLYGON ((-743428.740227405214682 7669814.319526683539152,-744263.63640835613478 7670039.333828528411686,-745222.208543577347882 7672621.008641519583762,-745717.023680152720772 7674753.22968621738255,-745407.778134729946032 7675427.111810288392007,-736254.866962725063786 7685765.127228019759059,-731802.087330994429067 7689589.550285588949919,-728678.90769729600288 7692177.84197452198714,-724659.049565261346288 7695442.661990146152675,-724102.45211129495874 7695779.901643632911146,-722834.634430650854483 7696455.641799354925752,-719742.401615393580869 7696794.345111946575344,-718814.776298613403924 7696849.88497109990567,-718505.530753190512769 7696229.847941231913865,-718350.907980479067191 7695498.394679141230881,-718505.530753190512769 7694767.011507160961628,-721907.009113870793954 7686609.817758411169052,-722834.634430650854483 7684866.291269586421549,-723731.424248481169343 7683853.431334646418691,-731863.869648382533342 7675875.860524530522525,-732358.573465469526127 7675427.111810288392007,-733502.826511331717484 7674753.22968621738255,-743428.740227405214682 7669814.319526683539152)) +POLYGON ((-685635.33415073575452 7733423.813353266566992,-687738.048012327984907 7734216.356595419347286,-691448.771918431040831 7737101.250472726300359,-691696.123826974537224 7737780.663427847437561,-691788.852962806588039 7739480.276437060907483,-691819.799781244830228 7740329.307864059694111,-691634.230190092348494 7741122.570195219479501,-691015.739099246566184 7742424.670022281818092,-685573.44051385356579 7748033.625981344841421,-684584.032879682490602 7748885.448858785443008,-683223.48606320633553 7748488.300597940571606,-680564.063428156543523 7746333.734569543972611,-679883.790019917069003 7745200.684522153809667,-679945.683656799257733 7744010.082491448149085,-680687.739382426952943 7738800.711817772127688,-681244.336836393224075 7736423.324422373436391,-681646.422837139340118 7735856.089126838371158,-683377.997516429401003 7733875.986749175935984,-684027.435425716103055 7733593.069710533134639,-685635.33415073575452 7733423.813353266566992)) +POLYGON ((-703260.883086505928077 7746674.661824574694037,-704157.672904336242937 7746674.661824574694037,-704714.270358302514069 7746958.065403786487877,-708208.477854811935686 7749168.730683658272028,-717825.257344953832217 7759890.98438083473593,-718258.178844647016376 7760572.435167161747813,-718196.285207767738029 7761366.379861513152719,-714176.427075730171055 7766820.755435311235487,-711702.574031832977198 7769093.47597080655396,-710682.219579220749438 7769946.023715472780168,-706600.579129795194604 7770970.394413308240473,-704219.566541218431666 7771196.777473411522806,-698777.267955825431272 7768979.49639711342752,-698035.10091070656199 7768639.204893971793354,-697045.581957044196315 7767843.06823284458369,-696210.797095587360673 7766650.553806650452316,-695715.870639517903328 7765400.547789968550205,-695654.088322129799053 7764660.991190864704549,-695468.518730977317318 7759209.594649636186659,-696303.414911925327033 7752797.834257248789072,-696519.93132151896134 7752059.297870209440589,-697602.179411010583863 7750244.807902731001377,-698900.943910095724277 7748771.77172545157373,-701158.280544402194209 7747297.388250662945211,-702487.880542437196709 7746730.770406653173268,-703260.883086505928077 7746674.661824574694037)) +POLYGON ((-831216.515181380091235 7748033.625981344841421,-832144.14049816026818 7748033.625981344841421,-836596.920129890902899 7748488.300597940571606,-838297.659310230985284 7748714.01541240233928,-840493.213627146440558 7749394.669785051606596,-841513.568079758668318 7750188.673405687324703,-841637.244034028961323 7751039.104390075430274,-841575.350397146772593 7752003.354158555157483,-840864.241489960346371 7753251.15999866835773,-828835.502592803328298 7771481.096311684697866,-828186.176003005006351 7771254.500091983936727,-825836.110232869279571 7769093.47597080655396,-825403.077413682010956 7768581.502132853493094,-821321.436964256456122 7756484.646011273376644,-821105.031874153995886 7755747.385831134393811,-827629.578549038618803 7748885.448858785443008,-828124.282366125611588 7748430.750513812527061,-831216.515181380091235 7748033.625981344841421)) +POLYGON ((-732606.036693501402624 7769093.47597080655396,-734987.049282080959529 7769605.688940900377929,-734863.262008316582069 7770572.091220494359732,-733966.583509977557696 7771367.080928524024785,-729761.15578679041937 7773698.902661285363138,-729080.882378550828435 7774041.05891159363091,-728431.555788755300455 7773927.005116423591971,-723545.743337837397121 7772846.138599321246147,-722927.363566480111331 7772505.673939668573439,-722680.011657939408906 7771822.948017750866711,-723020.204021803452633 7771196.777473411522806,-723483.961020446498878 7770798.667095833458006,-732606.036693501402624 7769093.47597080655396)) +POLYGON ((-803139.290574520011432 7783545.480658304877579,-803201.184211399289779 7782691.405730057507753,-804376.161436722963117 7779958.027473634108901,-804870.865253809955902 7779503.106472705490887,-808797.994250012561679 7781324.593655386008322,-811209.953657030360773 7781837.631802590563893,-813003.421973202493973 7781837.631802590563893,-816373.842195950448513 7780584.920460755936801,-818878.642058288678527 7780412.975718623958528,-819651.644602357409894 7780584.920460755936801,-821692.576146561536007 7782348.859692977741361,-822280.009099477669224 7783601.862003199756145,-822929.447008764487691 7785708.979185012169182,-823331.310370530933142 7787134.629106932319701,-825712.322959107696079 7797510.903650563210249,-825866.945731819141656 7798366.647378453053534,-826083.462141412775964 7804874.976817335933447,-826547.219140055822209 7838645.113456720486283,-826238.084914124221541 7839277.082819285802543,-825124.890006191562861 7840194.151770661585033,-820208.242056323797442 7842604.052629641257226,-816590.358605543966405 7841456.542531560175121,-811055.219564827741124 7838415.263170612044632,-809509.214476693072356 7837211.605928865261376,-808983.452521676663309 7836579.80890685506165,-804221.53866401151754 7830274.01861528493464,-804066.915891300071962 7829414.666563527658582,-804963.705709130386822 7828440.53582550957799,-806633.498071029433049 7827410.028228163719177,-807313.771479265997186 7827180.312398761510849,-808055.827204893692397 7827295.169442917220294,-810993.437247439636849 7829128.168786775320768,-811302.682792862411588 7826321.517327931709588,-808086.774023334728554 7791351.615371270105243,-803139.290574520011432 7783545.480658304877579)) +POLYGON ((-661918.160039774258621 7817105.856335839256644,-664453.684081571176648 7817564.684641906991601,-665721.501762215280905 7818136.611405530944467,-667514.970078387414105 7819280.594395046122372,-668844.681395913707092 7820710.918969230726361,-669926.929485405329615 7822370.870562356896698,-670050.60543967562262 7823287.54382988344878,-669895.982666964177042 7824088.074933858588338,-669586.737121541402303 7824660.494155706837773,-668566.382668929174542 7825519.307147990912199,-666556.50926265749149 7825920.298536827787757,-663093.137265097931959 7825519.307147990912199,-662381.917038417304866 7825232.95661870483309,-660557.501903806813061 7824088.074933858588338,-660124.580404110834934 7823686.974371951073408,-659104.225951501517557 7821913.399748372845352,-658856.874042958021164 7821226.421123342588544,-658764.033587637590244 7820483.054290824569762,-658825.927224516868591 7819510.070899597369134,-659382.524678483256139 7818251.331475670449436,-659908.175314011285082 7817735.82564936298877,-661145.046176214236766 7817163.929119725711644,-661918.160039774258621 7817105.856335839256644)) +POLYGON ((-664732.094128046999685 7866173.690661360509694,-665504.985352624556981 7866289.140938958153129,-666680.185216927784495 7868016.130983558483422,-666834.696670147939585 7868764.387786168605089,-666896.590307030128315 7871473.161756099201739,-665938.018171808915213 7875966.906469878740609,-664175.496674080728553 7878101.743621313013136,-663649.734719064203091 7878562.623791472055018,-663000.296809774590656 7878331.34977791365236,-662783.891719672246836 7877639.230882221832871,-662722.109402281232178 7876947.175373092293739,-664330.008127300883643 7867728.37557050678879,-664732.094128046999685 7866173.690661360509694)) +POLYGON ((-327217.520614832814317 8122256.104975343681872,-328176.09275005402742 8122375.559478169307113,-329258.34083954844391 8123268.848108878359199,-330680.781292903935537 8124818.684129827655852,-331732.082563954405487 8126606.382706038653851,-338071.17096717772074 8141164.861373074352741,-337700.031784872640856 8141761.94906612765044,-337174.381149347405881 8142239.309600191190839,-335071.667287752439734 8144091.843954086303711,-334453.287516397947911 8144390.606614335440099,-331144.538291549833957 8144868.135515400208533,-324619.991616662417073 8145644.292800644412637,-322733.794164663879201 8145526.186049027368426,-322177.196710697549861 8145225.872028060257435,-321311.353711305535398 8144150.993278105743229,-320352.781576084264088 8142478.861494575627148,-320229.105621813971084 8141642.183674630708992,-324372.639708121772856 8123090.61079301033169,-324867.454844697145745 8122673.238983020186424,-327217.520614832814317 8122256.104975343681872)) +POLYGON ((-359716.578034985344857 8132032.177192375063896,-366117.448755599616561 8132032.177192375063896,-366890.562619156728033 8132151.788332994095981,-367447.160073123057373 8132569.476031895726919,-381949.529375200392678 8152639.808204475790262,-382166.045784794026986 8153357.767818887718022,-382166.045784794026986 8154254.776183974929154,-380496.253422892186791 8159700.954994794912636,-379846.815513605426531 8161079.020994499325752,-378269.863607026869431 8162516.637322222813964,-372827.565021636663005 8164612.760042008012533,-371312.395432449120563 8164732.89523814432323,-359902.147626137884799 8156049.54784101806581,-359376.385671121417545 8155571.301903489977121,-357861.327401425049175 8153237.815943096764386,-349141.226409625029191 8138178.420643689110875,-348955.656818472489249 8137461.921593451872468,-349203.120046504365746 8134417.890667257830501,-349728.770682032452896 8134001.603015621192753,-351800.537725186382886 8133224.938536697998643,-354088.70985843980452 8132807.21412938926369,-359716.578034985344857 8132032.177192375063896)) +POLYGON ((-650940.833733159000985 7781665.453731082379818,-652239.486912752967328 7779104.355783727020025,-655579.071636550943367 7773188.256456230767071,-656011.993136246921495 7772618.068583996966481,-659908.175314011285082 7768013.29656311031431,-661175.992994655389339 7767388.871871560811996,-665690.554943777038716 7765626.765033165924251,-667731.486487981048413 7764944.861157269217074,-669246.656077168649063 7764660.991190864704549,-669772.306712693884037 7765172.701059639453888,-671503.992711472208612 7769889.743612143211067,-671782.18011896556709 7771310.79030179977417,-671627.668665745412 7772049.561186333186924,-666896.590307030128315 7782976.155037766322494,-665041.228353978600353 7786791.882612229324877,-671318.423120319726877 7796484.590345002710819,-676111.283796425908804 7785995.482360418885946,-676513.369797169230878 7785538.559015703387558,-677440.995113952201791 7785708.979185012169182,-678677.865976155153476 7786392.749099911190569,-687583.425239616539329 7795058.826424144208431,-702920.802042133174837 7792377.440111016854644,-703353.723541826358996 7792776.683087596669793,-717670.634572242503054 7814132.382998635061085,-718289.014343596878462 7815390.438682325184345,-721257.571204581065103 7821627.391483799554408,-721504.923113124561496 7822314.40645466465503,-721443.140795733663253 7823229.424112285487354,-715351.404301053844392 7828440.53582550957799,-714856.700483969645575 7828841.888093684799969,-713898.128348748432472 7828900.050874734297395,-712259.282805290538818 7827581.597915019840002,-709538.077852847054601 7824660.494155706837773,-706415.009538642596453 7822141.513500046916306,-705240.032313319039531 7821341.187965145334601,-704590.594404032221064 7821111.656019261106849,-702889.855223692138679 7821168.31720894947648,-702456.933723996160552 7821683.850473574362695,-702395.151406607939862 7822542.32619730103761,-726576.193835703772493 7843695.11297158524394,-727287.414062381605618 7844040.441532347351313,-731771.029193062102422 7839047.006821622140706,-731771.029193062102422 7837326.615175051614642,-730750.674740449874662 7832795.704828672111034,-730626.998786179581657 7832050.995856597088277,-730657.945604620617814 7831076.732404205016792,-731059.920285875559784 7829414.666563527658582,-731369.165831298450939 7828900.050874734297395,-731987.54560265573673 7828555.411975079216063,-732791.494965162710287 7828670.289866426959634,-737491.626505436841398 7830790.171767604537308,-744634.664271169924177 7834230.027870612218976,-745840.699634423013777 7834859.977581156417727,-746922.947723914636299 7835719.947644979692996,-748159.818586120498367 7837383.19128,-748376.223676222842187 7838071.636581358499825,-748592.740085816476494 7839677.357364155352116,-748561.793267375323921 7843064.42785513214767,-753942.309535377426073 7848059.06660985108465,-754375.231035070610233 7848576.433548144996166,-754622.582943614106625 7849150.70677210111171,-755395.474168191547506 7851850.809246600605547,-755271.798213921254501 7852655.814013954252005,-751128.264127613394521 7861511.760034578852355,-738883.231459845323116 7884909.020008309744298,-737244.274596896138974 7884965.953171662986279,-736471.272052827524021 7884736.14529530890286,-735512.699917606194504 7883870.58453534077853,-733193.580965908826329 7881388.932194164954126,-732296.791148078511469 7880235.522831921465695,-731616.517739841947332 7879139.178789542987943,-730874.35069472307805 7877178.407025982625782,-730750.674740449874662 7874584.825043288059533,-730626.998786179581657 7873834.539537319913507,-729946.614058451610617 7872625.23441983666271,-719495.049706852878444 7864850.180207592435181,-715784.32580074982252 7864043.876732889562845,-709723.647443999536335 7868016.130983558483422,-711980.984078306006268 7884332.024532061070204,-714702.189030746696517 7890971.902852981351316,-714825.864985019783489 7891549.405850444920361,-714578.513076476403512 7892472.836949214339256,-713248.801758950110525 7893918.732610004022717,-706384.062720201560296 7901375.595772541128099,-701776.66031575948 7901664.844089404679835,-698746.3211373842787 7898773.692304376512766,-688109.187194633064792 7886756.034312906675041,-687336.073331073042937 7885542.997075439430773,-686068.255650428938679 7883177.958044371567667,-685511.658196462667547 7881908.584656063467264,-684181.94687893637456 7878562.623791472055018,-683934.594970395672135 7877121.324945847503841,-683130.64560788590461 7859786.254608792252839,-684243.84051581856329 7846279.776287614367902,-684367.627789580146782 7843178.079548854380846,-682914.240517783444375 7824374.176075815223157,-682079.34433683543466 7822943.366182137280703,-656692.266544483602047 7809731.345368997193873,-655300.772909566410817 7809160.052198750898242,-654558.605864447541535 7809331.209339445456862,-649363.770507089211605 7812131.781799998134375,-642189.785922917886637 7815962.201442593708634,-640148.965698205051012 7816763.400702674873173,-639314.069517254130915 7816706.772428193129599,-628862.393846164108254 7813446.109080039896071,-628522.201482300180942 7812759.69145339448005,-630222.940662640263326 7802989.866206160746515,-630501.239389624912292 7802133.600978786125779,-631212.570935793803073 7801048.712367656640708,-646055.132601732388139 7784000.643827837891877,-647477.461735596647486 7782691.405730057507753,-648652.550280411494896 7781951.804413926787674,-649332.823688648175448 7781723.46090732794255,-650940.833733159000985 7781665.453731082379818)) +POLYGON ((-673606.595253576058894 7826722.551171703264117,-674627.061025679460727 7826779.254327571950853,-675276.498934966279194 7827123.606241562403738,-675523.850843509775586 7827696.46104231197387,-676760.721705712727271 7831764.604693802073598,-676791.557204662589356 7832624.017020202241838,-676637.045751442434266 7841112.98448468837887,-676049.501479035010561 7848633.300576750189066,-675183.658479645731859 7852886.304035558365285,-674998.200207984540612 7853633.065442417748272,-671442.099074592930265 7861339.419627644121647,-671009.288894388126209 7861856.245478595606983,-668257.137123506283388 7864791.740520105697215,-665690.554943777038716 7862143.984673917293549,-665350.473899401491508 7861453.346139384433627,-665319.527080963249318 7860590.447324733249843,-666803.861171200871468 7831994.253231534734368,-667298.564988285070285 7830503.621970213018358,-667607.81053370796144 7829874.240700871683657,-668628.276305811363272 7828900.050874734297395,-670916.44843906769529 7827581.597915019840002,-673606.595253576058894 7826722.551171703264117)) +POLYGON ((-810777.032157337176614 7841801.768995887599885,-814147.563699576305225 7842260.442508837208152,-814889.61942520388402 7842604.052629641257226,-821321.436964256456122 7846508.418343406170607,-822434.631872189114802 7847254.550635058432817,-824289.993825240642764 7850989.004948856309056,-824815.644460765877739 7852310.092145320028067,-824877.538097648066469 7853115.145778425037861,-824475.452096901950426 7855587.740068238228559,-824228.100188361248001 7856334.561169553548098,-823795.178688665269874 7856852.701275755651295,-819064.211649441276677 7860590.447324733249843,-818321.933284831116907 7860821.179227720014751,-812694.176427779719234 7859612.296791811473668,-809973.082794827409089 7858980.49080272577703,-806416.981661435798742 7858117.874036064371467,-802025.984347096062265 7854897.69984695315361,-801778.632438552565873 7854207.722555309534073,-801747.796939602703787 7846221.273146128281951,-801995.14884814620018 7845416.95247514732182,-805891.331025910563767 7843064.42785513214767,-806478.763978826696984 7842777.619893736205995,-809169.022112829145044 7842088.746601978316903,-810777.032157337176614 7841801.768995887599885)) +POLYGON ((-805242.004436112125404 7863756.272446325048804,-814271.23965384659823 7863871.68582081887871,-815013.295379474293441 7864100.860148473642766,-815539.057334490702488 7864619.325350591912866,-815693.568787710857578 7868707.369213744997978,-815446.216879170271568 7872164.716177927330136,-817950.90542201732751 7873546.355086141265929,-825062.996369309374131 7877121.324945847503841,-829948.697500735986978 7876256.843609771691263,-831309.24431721214205 7875852.96857688203454,-832329.710089312749915 7875966.906469878740609,-833350.175861416268162 7876717.61126986797899,-838946.985900029423647 7880869.107799214310944,-839379.907399722607806 7881273.251038626767695,-839720.099763586535119 7881850.012926995754242,-839720.099763586535119 7882831.045429597608745,-833937.60881433240138 7893398.045141905546188,-833102.82395287277177 7894553.466540277004242,-831865.841771178529598 7895190.126447139307857,-827382.226640497916378 7894842.453549714758992,-809849.406840556999668 7895478.929752987809479,-809416.374021369847469 7896114.002969663590193,-806478.763978826696984 7899756.926077665761113,-801191.199485636432655 7901839.564606086350977,-800232.627350415103137 7901896.833832059055567,-787616.344180850777775 7892531.699111446738243,-786750.501181461615488 7891549.405850444920361,-786565.042909800307825 7890683.063944215886295,-795656.060444922884926 7866116.691623137332499,-796367.391991091892123 7864964.159620930440724,-797975.290716108749621 7864676.313102686777711,-805242.004436112125404 7863756.272446325048804)) +POLYGON ((-801995.14884814620018 7904963.767082164995372,-803695.888028486282565 7905253.152969223447144,-803633.994391604093835 7906178.26221879106015,-802922.774164926377125 7907394.620111919008195,-801345.710938856587745 7909709.930411484092474,-800356.303304688306525 7910578.459253448061645,-798593.670487466035411 7911563.024056881666183,-797789.721124959061854 7911795.318352640606463,-797047.665399328572676 7911679.170310529880226,-795346.926218991284259 7909479.368019768036902,-795408.708536379388534 7908494.866679089143872,-795934.470491395913996 7908030.69687404949218,-796491.067945362185128 7907683.890837426297367,-801129.305848757037893 7905021.060023155994713,-801995.14884814620018 7904963.767082164995372)) +POLYGON ((-954626.527189203188755 7925129.612749701365829,-955399.529733271920122 7925187.059095432050526,-958028.005549880559556 7926406.278248388320208,-958677.443459170171991 7926755.409019802697003,-959728.633410729351453 7930180.296984306536615,-959419.499184797750786 7930877.252057735808194,-955523.317007033387199 7930411.493291924707592,-953513.332281270530075 7929540.676889182068408,-952307.519556996994652 7928786.58018687646836,-952029.109510521171615 7928322.622483660466969,-952369.30187438800931 7927683.16003187559545,-954626.527189203188755 7925129.612749701365829)) +POLYGON ((-787430.774589698179625 7941686.005591202527285,-787894.642907835310325 7942150.787039836868644,-787770.966953562223352 7944826.769387821666896,-787430.774589698179625 7945525.290483676828444,-782885.265822138288058 7949598.110461056232452,-782297.721549730864353 7949889.215295192785561,-780040.496234915684909 7950471.249138521961868,-779174.653235523728654 7950530.356280679814517,-778525.215326236910187 7950239.4362448817119,-778587.108963119098917 7949249.595865544863045,-778958.136825932888314 7944419.415934576652944,-779112.759598644333892 7943662.15311617590487,-779947.767099083634093 7942441.604075786657631,-787430.774589698179625 7941686.005591202527285)) +POLYGON ((-720670.026932173641399 7956470.265770964324474,-720546.350977903348394 7955596.430923961102962,-720670.026932173641399 7954782.047788507305086,-727813.064697906840593 7949772.478599350899458,-728493.449425634695217 7949481.378279329277575,-731430.948148689349182 7948725.282594923861325,-732203.95069275808055 7948608.563946551643312,-737058.816325232037343 7949366.324453175999224,-737831.818869300768711 7949540.687222653068602,-740614.806139132473618 7950530.356280679814517,-741635.27191123587545 7951403.6031045736745,-742099.028909878921695 7951985.754060111939907,-744943.909816592815332 7958511.147151741199195,-745685.965542220394127 7960493.18645220156759,-746366.238950459868647 7964516.579434587620199,-746613.590859000571072 7967083.522040518932045,-746520.973042662604712 7968893.21587913390249,-745562.289587950101122 7971811.198058685287833,-745222.208543577347882 7972452.738553089089692,-741697.054228626890108 7976659.00130844861269,-741295.079547371948138 7977125.948228902183473,-740583.970640182611533 7977477.439571955241263,-737986.441642012214288 7977477.439571955241263,-737151.545461064088158 7977360.273964766412973,-736378.542916995356791 7977008.788100087083876,-734554.127782384981401 7976833.997837174683809,-733997.530328418593854 7977068.314472352154553,-733626.502465604804456 7977827.264450271613896,-734182.988600079901516 7978353.820502681657672,-734739.586054046289064 7978645.829930229112506,-735574.593554485589266 7978820.872719798237085,-742501.003591133863665 7979522.3471052441746,-743428.740227405214682 7979580.210092795081437,-744109.013635644689202 7979405.149618921801448,-744634.664271169924177 7978878.730307421647012,-752674.491854733321816 7966966.518283449113369,-748716.416040086769499 7957752.255619846284389,-748376.223676222842187 7957054.487044485285878,-747943.302176526864059 7956646.261589108034968,-746428.132587339263409 7956179.11605285666883,-745438.613633679808117 7955247.638482778333127,-744170.795953032793477 7953558.226918069645762,-743583.36300011666026 7952276.741598320193589,-743336.011091575957835 7951694.568137818016112,-741913.459318729233928 7946455.356179324910045,-741449.702320083393715 7943139.694544673897326,-741635.27191123587545 7942267.405625551939011,-749767.717311137239449 7930818.29895297344774,-774876.496376504423097 7910288.869033571332693,-775402.147012032568455 7909884.837324154563248,-776175.260875589679927 7909709.930411484092474,-776824.476145896827802 7909942.167647610418499,-777443.078556236578152 7910463.99785946123302,-792594.885767597937956 7928379.884186631068587,-792934.966811973485164 7929076.672759066335857,-793089.589584684814326 7929773.525763470679522,-793336.941493225516751 7932386.14859145693481,-793182.318720514071174 7933316.266112501733005,-792409.316176445339806 7933373.774899192154408,-790801.306131937308237 7933083.307736311107874,-789502.652952343341894 7932269.682881154119968,-788543.96949763095472 7930585.417793459258974,-786565.042909800307825 7929773.525763470679522,-782452.455641933600418 7932154.891689515672624,-760343.068936500465497 7946514.431799842976034,-760775.990436193649657 7947096.204778944142163,-765816.314340331708081 7953150.191064227372408,-772000.66865135228727 7956761.636528299190104,-773237.650833046529442 7957403.363244276493788,-777566.754510506871156 7958802.387116521596909,-778432.486190404859371 7958743.214971978217363,-781679.341778373578563 7957228.818228890188038,-782545.18477776274085 7957286.509943476878107,-783194.511367561179213 7957520.218359707854688,-787616.344180850777775 7959442.81896430067718,-791790.936405090964399 7963933.458247418515384,-791914.612359361257404 7964633.545086824335158,-788605.86313451314345 7969008.568686692044139,-785420.901183426496573 7971577.045209413394332,-785668.253091969992965 7974964.774416473694146,-789688.111224004649557 7982152.301632676273584,-793336.941493225516751 7993269.851930724456906,-793522.511084377998486 7994733.546959539875388,-793491.564265939756297 7995671.406169408001006,-789750.004860886838287 8005634.533295917324722,-785822.875864681438543 8013733.69486178830266,-785420.901183426496573 8014378.826290462166071,-783751.108821527566761 8016493.436841917224228,-782792.536686306237243 8017491.963440832681954,-780133.225370744941756 8016904.715584196150303,-779360.222826676210389 8016728.994247060269117,-770300.040790503495373 8012853.175760389305651,-769001.276291418238543 8012148.581277636811137,-768753.92438287474215 8011502.162412295117974,-769001.276291418238543 8010739.590764750726521,-770361.934427385684103 8010210.970614022575319,-772124.34460562269669 8006924.937914559617639,-765228.770067924284376 7990693.95237694773823,-764548.496659687603824 7989641.042755587026477,-763868.223251450923271 7989171.632117640227079,-763651.818161348579451 7990050.852953216060996,-765129.918360099894926 8004928.293826419860125,-757549.506315041217022 8008575.906596840359271,-751448.196344152209349 8006331.336906312033534,-750819.686499135103077 8008857.053096966817975,-755478.852466796874069 8015665.872785707935691,-757869.327212091651745 8022075.64115125965327,-758951.68662107444834 8026368.027222967706621,-758704.22339303966146 8027367.869473671540618,-756725.185485717840493 8031073.445495535619557,-742841.195954997790977 8041025.397063363343477,-741202.350411539897323 8041085.433374018408358,-740522.07700330321677 8040908.93223531730473,-739934.532730895793065 8039494.5276033077389,-730286.806422315654345 8043265.735036773607135,-729173.722833874169737 8044031.622158442623913,-707466.310809693066403 8064043.728160938248038,-702487.880542437196709 8068655.771978686563671,-700508.842635115375742 8070607.066419521346688,-698746.3211373842787 8074868.760789718478918,-698220.670501859043725 8075341.863987285643816,-697633.12622945162002 8075756.599782660603523,-696829.176866941852495 8075815.210241419263184,-696087.009821822983213 8075579.279300500638783,-695128.437686604564078 8074927.364291729405522,-694046.189597110147588 8073981.240246860310435,-692778.260596974869259 8072323.254703578539193,-686408.448014292865992 8057190.833712695166469,-686377.38987636344973 8056186.791365466080606,-690644.711236432776786 8042500.138387988321483,-693798.726369078271091 8034369.865505123510957,-699055.566682807169855 8028014.174757380969822,-703972.214632674935274 8022899.045259419828653,-704460.684558275504969 8017467.855133843608201,-704479.274913237779401 8016939.395131032913923,-704386.434457917348482 8016516.696220668964088,-704126.726085895090364 8016164.218642277643085,-703737.107868118910119 8015952.993764191865921,-699655.356099202064797 8014296.596428068354726,-699228.779810483800247 8014156.236996962688863,-698746.3211373842787 8014261.929095481522381,-698375.293274570489302 8014437.592656895518303,-697466.146993261412717 8015248.953785048797727,-692500.073189484304748 8016551.373973814770579,-691139.415053516975604 8018079.257272890768945,-687119.668240970699117 8021781.726189978420734,-686593.906285954173654 8022251.487790729850531,-685728.174606056301855 8022075.64115125965327,-684398.463288530008867 8021310.512920229695737,-684274.787334259599447 8020606.604641424492002,-685542.605014903703704 8013322.378551498055458,-686222.878423140384257 8012030.873532271012664,-687088.721422532456927 8010915.383174180053174,-692932.994689177488908 8005987.361221398226917,-697280.577402108930983 8004509.437592294067144,-704553.413694107555784 8005811.050759417004883,-708734.128490340081044 8000709.976081981323659,-709630.806988679105416 7995846.635207596234977,-709878.270216710981913 7995085.862977590411901,-710465.814489118405618 7994616.111959553323686,-723267.555930344038643 7987826.347421145066619,-728926.259605839499272 7986656.528964450582862,-734832.315189878339879 7985194.406691531650722,-736965.975869911606424 7984550.303966554813087,-736842.299915641313419 7983790.464284654706717,-734121.206282689003274 7983790.464284654706717,-723236.609111905796453 7985719.794519029557705,-714702.189030746696517 7988821.278751101344824,-713588.88280332274735 7989523.687346274964511,-712723.039803933585063 7989581.416708113625646,-712011.819577255868353 7989348.395068431273103,-711393.439805898582563 7988061.007049136795104,-707311.688036981737241 7974263.725174709223211,-707621.044901895802468 7973622.030144688673317,-710898.624669323209673 7969242.641570223495364,-718876.558616004302166 7960608.410512333735824,-720670.026932173641399 7956470.265770964324474)) +POLYGON ((-761301.641071718884632 8009859.422913095913827,-764672.172613957896829 8010270.549440519884229,-765105.094113653991371 8010797.694771369919181,-766867.615611384971999 8018842.575335687957704,-766991.291565655381419 8019723.797741235233843,-766960.456066705519333 8020546.943676398135722,-766063.666248875204474 8020900.473554437980056,-763682.653660298441537 8020253.088614289648831,-763002.380252058967017 8020019.112902864813805,-758054.89680324413348 8015494.831711333245039,-756354.157622904051095 8013262.775489021092653,-756013.965259040123783 8010915.383174180053174,-756354.157622904051095 8010152.8711501006037,-757219.88930280203931 8010093.293257866054773,-761301.641071718884632 8009859.422913095913827)) +POLYGON ((-314415.779173607123084 8154254.776183974929154,-319394.209440863050986 8157366.175324442796409,-330618.887656021746807 8167308.611422369256616,-334886.209016091132071 8167428.790121263824403,-340328.396281992900185 8166529.978125414811075,-346265.510003961273469 8164853.03237243834883,-347285.864456573501229 8163834.408574537374079,-347285.864456573501229 8162936.245934132486582,-353130.249042709823698 8161138.305324117653072,-354923.717358881956898 8160958.944725437089801,-355665.7730845095939 8161199.099199467338622,-367725.458800107648131 8168688.086103021167219,-368838.65370804030681 8169587.158679810352623,-372425.590340381779242 8173004.668251732364297,-374157.165019671723712 8178705.087196281179786,-374373.681429262505844 8179425.564558159559965,-374930.278883228893392 8182547.502626540139318,-374930.278883228893392 8183448.034887365996838,-373074.91693017736543 8203416.164042715914547,-372951.240975907014217 8204198.667891797609627,-369302.410706686147023 8208416.587627800181508,-364880.577893393754493 8210707.764916642569005,-364262.198122039320879 8211009.213968108408153,-360551.474215936264955 8212034.319061543792486,-358325.084400070947595 8212575.68718305695802,-356500.669265457661822 8212575.68718305695802,-355758.61353983002482 8212274.391636410728097,-342523.95059890835546 8206730.173594324849546,-342091.029099215229508 8206187.496060908772051,-333772.902788667241111 8195470.686623989604414,-333432.821744294546079 8194809.939196091145277,-333494.604061685502529 8192464.12124982662499,-328083.2522947335965 8180025.7274808306247,-317507.900669373222627 8175105.258190833032131,-310921.571677097701468 8169886.72977898735553,-306778.037590789899696 8162635.013719491660595,-314415.779173607123084 8154254.776183974929154)) +POLYGON ((-298985.56191576999845 8220299.14481211733073,-299418.594734957208857 8220841.332964950241148,-299634.999825059610885 8221565.905902008526027,-299851.404915159160737 8223196.127464422956109,-299727.728960888867732 8225974.632351393811405,-299511.323870786465704 8226880.442233521491289,-298831.050462549785152 8228271.233170941472054,-288626.726700003258884 8243452.663167920894921,-284483.192613695457112 8246179.014622961170971,-282133.126843556994572 8246601.628839157521725,-268774.67662887374172 8248480.132924028672278,-267970.727266366768163 8248541.863586600869894,-267414.241131888818927 8248298.870237618684769,-267166.77790385694243 8247752.927683857269585,-266857.643677922489587 8246238.76357180904597,-266084.529814365378115 8241818.204846530221403,-266053.58299592428375 8241091.434458050876856,-277804.023166099446826 8233529.18472315184772,-286183.931794035539497 8232924.685531720519066,-286895.040701222082134 8232924.685531720519066,-291718.959515257796738 8231594.612372771836817,-292213.663332341937348 8231049.89748075325042,-298490.85809868585784 8222834.404745955951512,-298985.56191576999845 8220299.14481211733073)) +POLYGON ((-320321.834757646021899 8229962.545864972285926,-319827.130940559029114 8235040.757009834051132,-319827.130940559029114 8235947.891733531840146,-320260.052440255065449 8236492.748460903763771,-326908.275069409923162 8241939.376489288173616,-329351.06997537764255 8242847.355046395212412,-330124.183838937606197 8242908.820884956978261,-330835.404065615381114 8242725.9506133524701,-331330.107882699521724 8242182.161599178798497,-331082.755974158877507 8241455.573480682447553,-331391.890200090478174 8239578.847143176943064,-332628.872381784720346 8237702.377562815323472,-333092.629380430560559 8237158.95658874604851,-333865.743243990524206 8237037.645195649936795,-334329.611562124802731 8237582.799753148108721,-337112.59883195644943 8242242.096309587359428,-342152.811416603333782 8250783.710969890467823,-342369.32782619696809 8251511.213470349088311,-342462.056962029018905 8252358.819893697276711,-341936.406326500931755 8252358.819893697276711,-339400.770965212781448 8251874.336800827644765,-322517.389074561477173 8245452.034945490770042,-321713.328392560419161 8244482.258162569254637,-317229.601942388690077 8238549.932351528666914,-317600.741124693711754 8234497.530896421521902,-320321.834757646021899 8229962.545864972285926)) +POLYGON ((-131418.89277294249041 8450002.481263803318143,-128852.310593213216634 8443217.661461865529418,-125358.103096703795018 8433582.114983903244138,-125296.320779312838567 8432711.885061690583825,-125636.401823688385775 8431904.8170470520854,-127646.386549451330211 8429172.311698196455836,-128357.606776129090576 8429419.541313821449876,-129470.801684061749256 8430413.908540507778525,-130305.69786500983173 8430350.862382085993886,-132160.948498572950484 8428116.649800969287753,-134943.935768404626288 8422655.466061240062118,-135871.672404676006408 8404748.748640930280089,-140293.505217965575866 8369126.588859099894762,-140540.857126509043155 8368263.941721391864121,-141221.130534745723708 8366662.403692265972495,-145488.451894815079868 8368079.497755216434598,-152724.218796377419494 8375657.247014,-153404.492204614070943 8378000.7946866620332,-153373.545386175828753 8378925.412534387782216,-148240.492346205661306 8399056.868660798296332,-148059.152895703009563 8399737.889818059280515,-147652.948073798237601 8400726.473243188112974,-147220.026574105053442 8401407.871505113318563,-146539.753165865549818 8401716.970980113372207,-145983.155711899220478 8401220.814723692834377,-145612.127849085401976 8401716.970980113372207,-145364.66462105352548 8402581.983998501673341,-141190.183716304600239 8420607.562152832746506,-140602.750763388408814 8423585.707723587751389,-140386.23435379480361 8425571.212279742583632,-140293.505217965575866 8427432.997893655672669,-140448.12799067699234 8428923.302203591912985,-143045.545669356128201 8448880.843163417652249,-143756.765896033903118 8453677.022626042366028,-156218.314973395608831 8456916.977484256029129,-156991.428836955572478 8456730.298629367724061,-157424.35033665157971 8456043.980496479198337,-156991.428836955572478 8455484.249040206894279,-154455.793475667393068 8452742.966040745377541,-151796.482160106039373 8451061.290770500898361,-150621.504934782424243 8446391.391411019489169,-151208.937887698615668 8442720.490277199074626,-161258.638877533696359 8433457.534505328163505,-161815.236331500054803 8433767.983140118420124,-165927.934918857994489 8437185.126110808923841,-169236.572824217728339 8440233.347677124664187,-170009.575368283607531 8441476.813789892941713,-170071.469005165825365 8442346.29036302678287,-169947.793050895474153 8443156.297073118388653,-169174.679187335539609 8444649.791990645229816,-176874.314407034980832 8447947.171916756778955,-183429.807900357816834 8449939.266890352591872,-184233.757262867613463 8450250.636561812832952,-185316.005352359206881 8451309.257624221965671,-186398.364761342003476 8453240.815756382420659,-186800.339442596916342 8454798.047301702201366,-188470.131804495904362 8462278.614673022180796,-188439.184986054809997 8463214.10922740213573,-188284.562213343393523 8464213.059742107987404,-185563.46858039390645 8466771.918129950761795,-184264.704081308736932 8467521.031971013173461,-181265.311721374659101 8468456.969938527792692,-177740.157406424143119 8468643.947114547714591,-176967.043542864208575 8468270.222247546538711,-164165.302101638546446 8470204.448353536427021,-160949.393332110863412 8471015.734361508861184,-158846.679470515839057 8471641.625559883192182,-149817.555572275421582 8475826.395704654976726,-146972.674665561557049 8479513.884976591914892,-160949.393332110863412 8502995.417254917323589,-167226.588098451960832 8505066.42773274704814,-172947.185410829551984 8506384.627661500126123,-173472.836046354786959 8505819.462198864668608,-174215.003091473627137 8505819.462198864668608,-179193.433358729525935 8506069.286162300035357,-179409.949768323160242 8506634.696790041401982,-179224.3801771706203 8507701.483150579035282,-177338.182725169230253 8513666.328474128618836,-172205.129685201914981 8520012.611221171915531,-157640.755426753952634 8535683.09802039526403,-157022.375655396666843 8536124.236317778006196,-144931.743121357518248 8542869.137217245995998,-144251.4697131208668 8542427.592235755175352,-144066.011441459588241 8541606.775290558114648,-143323.844396340718959 8537572.808449609205127,-144282.416531561961165 8509897.898213734850287,-143231.115260508668143 8505379.919185351580381,-129563.530819893814623 8501615.745808402076364,-115926.893197717232397 8499923.062358222901821,-115463.024879580130801 8499296.107984103262424,-115524.918516462319531 8498356.228221153840423,-118678.933649107799283 8479889.983387826010585,-122575.115826872133766 8461406.776358135044575,-129594.477638332071365 8457478.388876119628549,-129779.935909993364476 8458288.270106678828597,-132130.001680131856119 8460034.90146853774786,-133026.791497962141875 8460283.171404166147113,-133459.712997658149106 8459598.092459613457322,-133645.282588810659945 8458599.993829596787691,-133366.983861826098291 8456916.977484256029129,-131975.490226911671925 8451247.825634768232703,-131418.89277294249041 8450002.481263803318143)) +POLYGON ((-122977.090508127046633 8508642.787855675444007,-125512.725869415226043 8508830.792141057550907,-126904.219504332475481 8509522.065707895904779,-127213.46504975532298 8510211.822397004812956,-130274.751046571574989 8518065.205885538831353,-131635.297863044892438 8533415.00091053172946,-131758.973817318037618 8535179.620468446984887,-131511.621908774570329 8539904.59993626922369,-131295.216818672168301 8541923.650568814948201,-131047.753590640291804 8542869.137217245995998,-123564.634780534470337 8563139.632408041507006,-122296.817099890380632 8564088.093076413497329,-121616.54369165089156 8564404.122180635109544,-120750.700692261714721 8564468.559186037629843,-117658.579196495600627 8564277.299062002450228,-110948.462930458495975 8562886.03223080560565,-110329.971839612800977 8561811.174725892022252,-109371.399704391558771 8547157.254736468195915,-109402.346522832653136 8546210.98679587058723,-113298.528700596987619 8516304.704630665481091,-113453.151473308418645 8515300.218514567241073,-113917.019791442682617 8512598.673570608720183,-114164.371699986164458 8511656.860667657107115,-114597.18188019093941 8510965.385719021782279,-122977.090508127046633 8508642.787855675444007)) +POLYGON ((-92951.774812383315293 8551198.100884104147553,-104145.617528592178132 8551449.477800389751792,-106712.088388830219628 8553280.971615452319384,-107485.202252390168724 8554543.757799495011568,-106835.76434310337936 8559852.617919530719519,-104516.645391405982082 8578775.789309298619628,-98301.344261944264872 8589683.303010007366538,-97775.582306927783065 8590192.375558510422707,-89735.86604285564681 8589303.349632600322366,-86025.253456243823166 8587145.781196678057313,-85468.656002277493826 8586638.748019121587276,-84386.407912785929511 8584100.457003850489855,-84293.567457465469488 8583213.998386295512319,-85004.787684143229853 8578521.646073216572404,-91251.035632043218357 8554734.763527067378163,-92951.774812383315293 8551198.100884104147553)) diff --git a/src/boost/libs/geometry/test/algorithms/buffer/test_buffer.hpp b/src/boost/libs/geometry/test/algorithms/buffer/test_buffer.hpp new file mode 100644 index 000000000..3b745996e --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/test_buffer.hpp @@ -0,0 +1,550 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test Helper + +// Copyright (c) 2010-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2016-2017. +// Modifications copyright (c) 2016-2017, 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) + + +#ifndef BOOST_GEOMETRY_TEST_BUFFER_HPP +#define BOOST_GEOMETRY_TEST_BUFFER_HPP + +#if defined(TEST_WITH_SVG) + // Define before including any buffer headerfile + #define BOOST_GEOMETRY_BUFFER_USE_HELPER_POINTS +#endif + +#include +#include +#include + +#include +#include "geometry_test_common.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include + +#include + +#include + +const double same_distance = -999; + +#if defined(TEST_WITH_SVG) +# include "test_buffer_svg.hpp" +# include "test_buffer_svg_per_turn.hpp" +#endif + +//----------------------------------------------------------------------------- +template +struct JoinTestProperties +{ + static std::string name() { return "joinunknown"; } +}; + +template<> struct JoinTestProperties +{ + static std::string name() { return "round"; } +}; + +template<> struct JoinTestProperties +{ + static std::string name() { return "miter"; } +}; + +template<> struct JoinTestProperties +{ + static std::string name() { return "divide"; } +}; + + +//----------------------------------------------------------------------------- +template +struct EndTestProperties { }; + +template<> struct EndTestProperties +{ + static std::string name() { return "round"; } +}; + +template<> struct EndTestProperties +{ + static std::string name() { return "flat"; } +}; + +struct ut_settings +{ + double tolerance; + bool test_validity; + bool test_area; + bool use_ln_area; + int points_per_circle; + + explicit ut_settings(double tol = 0.01, bool val = true, int points = 88) + : tolerance(tol) + , test_validity(val) + , test_area(true) + , use_ln_area(false) + , points_per_circle(points) + {} + + static inline ut_settings ignore_validity() + { + ut_settings result; + result.test_validity = false; + return result; + } + + static inline ut_settings assertions_only() + { + ut_settings result; + result.test_validity = false; + result.test_area = false; + return result; + } + + static inline double ignore_area() { return 9999.9; } +}; + +template +< + typename GeometryOut, + typename JoinStrategy, + typename EndStrategy, + typename DistanceStrategy, + typename SideStrategy, + typename PointStrategy, + typename AreaStrategy, + typename Geometry +> +void test_buffer(std::string const& caseid, + bg::model::multi_polygon& buffered, + Geometry const& geometry, + JoinStrategy const& join_strategy, + EndStrategy const& end_strategy, + DistanceStrategy const& distance_strategy, + SideStrategy const& side_strategy, + PointStrategy const& point_strategy, + AreaStrategy const& area_strategy, + int expected_count, + int expected_holes_count, + double expected_area, + ut_settings const& settings) +{ + namespace bg = boost::geometry; + + typedef typename bg::coordinate_type::type coordinate_type; + typedef typename bg::point_type::type point_type; + + typedef typename bg::tag::type tag; + // TODO use something different here: + std::string type = boost::is_same::value ? "poly" + : boost::is_same::value ? "line" + : boost::is_same::value ? "point" + : boost::is_same::value ? "multipoly" + : boost::is_same::value ? "multiline" + : boost::is_same::value ? "multipoint" + : "" + ; + + bg::model::box envelope; + if (bg::is_empty(geometry)) + { + bg::assign_values(envelope, 0, 0, 1, 1); + } + else + { + bg::envelope(geometry, envelope); + } + + std::string join_name = JoinTestProperties::name(); + std::string end_name = EndTestProperties::name(); + + if ( BOOST_GEOMETRY_CONDITION(( + boost::is_same::value + || boost::is_same::value )) ) + { + join_name.clear(); + } + + std::ostringstream complete; + complete + << type << "_" + << caseid << "_" + << string_from_type::name() + << "_" << join_name + << (end_name.empty() ? "" : "_") << end_name + << (distance_strategy.negative() ? "_deflate" : "") + << (bg::point_order::value == bg::counterclockwise ? "_ccw" : "") +#if defined(BOOST_GEOMETRY_USE_RESCALING) + << "_rescaled" +#endif + // << "_" << point_buffer_count + ; + + //std::cout << complete.str() << std::endl; + +#if defined(TEST_WITH_SVG_PER_TURN) + save_turns_visitor visitor; +#elif defined(TEST_WITH_SVG) + + buffer_svg_mapper buffer_mapper(complete.str()); + + std::ostringstream filename; + filename << "buffer_" << complete.str() << ".svg"; + std::ofstream svg(filename.str().c_str()); + typedef bg::svg_mapper mapper_type; + mapper_type mapper(svg, 1000, 800); + + svg_visitor > visitor(mapper); + + buffer_mapper.prepare(mapper, visitor, envelope, + distance_strategy.negative() + ? 1.0 + : 1.1 * distance_strategy.max_distance(join_strategy, end_strategy) + ); +#else + bg::detail::buffer::visit_pieces_default_policy visitor; +#endif + + typedef typename bg::point_type::type point_type; + typedef typename bg::rescale_policy_type::type + rescale_policy_type; + typedef typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy_type; + typedef typename strategy_type::envelope_strategy_type envelope_strategy_type; + + // Enlarge the box to get a proper rescale policy + bg::buffer(envelope, envelope, distance_strategy.max_distance(join_strategy, end_strategy)); + + strategy_type strategy; + rescale_policy_type rescale_policy + = bg::get_rescale_policy(envelope); + + envelope_strategy_type envelope_strategy; + + buffered.clear(); + bg::detail::buffer::buffer_inserter(geometry, + std::back_inserter(buffered), + distance_strategy, + side_strategy, + join_strategy, + end_strategy, + point_strategy, + strategy, + rescale_policy, + visitor); + +#if defined(TEST_WITH_SVG) + buffer_mapper.map_input_output(mapper, geometry, buffered, distance_strategy.negative()); +#endif + + //Uncomment to create simple CSV to compare/use in tests - adapt precision if necessary + //std::cout << complete.str() << "," << std::fixed << std::setprecision(0) << area << std::endl; + //return; + + if (bg::is_empty(buffered) && bg::math::equals(expected_area, 0.0)) + { + // As expected - don't get rescale policy for output (will be invalid) + return; + } + + if (settings.test_area) + { + BOOST_CHECK_MESSAGE + ( + ! bg::is_empty(buffered), + complete.str() << " output is empty (unexpected)." + ); + } + + bg::model::box envelope_output; + bg::assign_values(envelope_output, 0, 0, 1, 1); + bg::envelope(buffered, envelope_output, envelope_strategy); + + // std::cout << caseid << std::endl; + // std::cout << "INPUT: " << bg::wkt(geometry) << std::endl; + // std::cout << "OUTPUT: " << area << std::endl; + // std::cout << "OUTPUT env: " << bg::wkt(envelope_output) << std::endl; + // std::cout << bg::wkt(buffered) << std::endl; + + if (expected_count >= 0) + { + BOOST_CHECK_MESSAGE + ( + int(buffered.size()) == expected_count, + "#outputs not as expected." + << " Expected: " << expected_count + << " Detected: " << buffered.size() + ); + } + + if (expected_holes_count >= 0) + { + std::size_t nholes = bg::num_interior_rings(buffered); + BOOST_CHECK_MESSAGE + ( + int(nholes) == expected_holes_count, + complete.str() << " #holes not as expected." + << " Expected: " << expected_holes_count + << " Detected: " << nholes + ); + } + + if (settings.test_area) + { + // Because areas vary hugely in buffer, the Boost.Test methods are not convenient. + // Use just the abs - but if areas are really small that is not convenient neither. + // Therefore there is a logarithmic option too. + typename bg::default_area_result::type area = bg::area(buffered, area_strategy); + double const difference = settings.use_ln_area + ? std::log(area) - std::log(expected_area) + : area - expected_area; + BOOST_CHECK_MESSAGE + ( + bg::math::abs(difference) < settings.tolerance, + complete.str() << " not as expected. " + << std::setprecision(18) + << " Expected: " << expected_area + << " Detected: " << area + << " Diff: " << difference + << " Tol: " << settings.tolerance + << std::setprecision(3) + << " , " << 100.0 * (difference / expected_area) << "%" + ); +// if (settings.use_ln_area) +// { +// std::cout << complete.str() +// << std::setprecision(6) +// << " ln(detected)=" << std::log(area) +// << " ln(expected)=" << std::log(expected_area) +// << " diff=" << difference +// << " detected=" << area +// << std::endl; +// } + } + +#if ! defined(BOOST_GEOMETRY_TEST_ALWAYS_CHECK_VALIDITY) + if (settings.test_validity) +#endif + { + if (! bg::is_valid(buffered)) + { + BOOST_CHECK_MESSAGE(bg::is_valid(buffered), complete.str() << " is not valid"); + } + } + +#if defined(TEST_WITH_SVG_PER_TURN) + { + // Create a per turn visitor to map per turn, and buffer again with it + per_turn_visitor ptv(complete.str(), visitor.get_points()); + bg::detail::buffer::buffer_inserter(geometry, + std::back_inserter(buffered), + distance_strategy, + side_strategy, + join_strategy, + end_strategy, + point_strategy, + rescale_policy, + ptv); + ptv.map_input_output(geometry, buffered, distance_strategy.negative()); + // self_ips NYI here + } +#elif defined(TEST_WITH_SVG) + rescale_policy_type rescale_policy_output + = bg::get_rescale_policy(envelope_output); + buffer_mapper.map_self_ips(mapper, buffered, strategy, rescale_policy_output); +#endif + +} + +template +< + typename GeometryOut, + typename JoinStrategy, + typename EndStrategy, + typename DistanceStrategy, + typename SideStrategy, + typename PointStrategy, + typename Geometry +> +void test_buffer(std::string const& caseid, bg::model::multi_polygon& buffered, Geometry const& geometry, + JoinStrategy const& join_strategy, + EndStrategy const& end_strategy, + DistanceStrategy const& distance_strategy, + SideStrategy const& side_strategy, + PointStrategy const& point_strategy, + double expected_area, + ut_settings const& settings = ut_settings()) +{ + typename bg::strategy::area::services::default_strategy + < + typename bg::cs_tag::type + >::type area_strategy; + + test_buffer(caseid, buffered, geometry, + join_strategy, end_strategy, distance_strategy, side_strategy, point_strategy, + area_strategy, + -1, -1, expected_area, settings); +} + +#ifdef BOOST_GEOMETRY_CHECK_WITH_POSTGIS +static int counter = 0; +#endif + +template +< + typename Geometry, + typename GeometryOut, + typename JoinStrategy, + typename EndStrategy +> +void test_one(std::string const& caseid, std::string const& wkt, + JoinStrategy const& join_strategy, EndStrategy const& end_strategy, + int expected_count, int expected_holes_count, double expected_area, + double distance_left, ut_settings const& settings = ut_settings(), + double distance_right = same_distance) +{ + namespace bg = boost::geometry; + Geometry g; + bg::read_wkt(wkt, g); + bg::correct(g); + +#ifdef BOOST_GEOMETRY_CHECK_WITH_POSTGIS + std::cout + << (counter > 0 ? "union " : "") + << "select " << counter++ + << ", '" << caseid << "' as caseid" + << ", ST_Area(ST_Buffer(ST_GeomFromText('" << wkt << "'), " + << distance_left + << ", 'endcap=" << end_name << " join=" << join_name << "'))" + << ", " << expected_area + << std::endl; +#endif + + + bg::strategy::buffer::side_straight side_strategy; + bg::strategy::buffer::point_circle circle_strategy(settings.points_per_circle); + + bg::strategy::buffer::distance_asymmetric + < + typename bg::coordinate_type::type + > distance_strategy(distance_left, + bg::math::equals(distance_right, same_distance) + ? distance_left : distance_right); + + typename bg::strategy::area::services::default_strategy + < + typename bg::cs_tag::type + >::type area_strategy; + + bg::model::multi_polygon buffered; + test_buffer + (caseid, buffered, g, + join_strategy, end_strategy, + distance_strategy, side_strategy, circle_strategy, + area_strategy, + expected_count, expected_holes_count, expected_area, + settings); + +#if !defined(BOOST_GEOMETRY_COMPILER_MODE_DEBUG) && defined(BOOST_GEOMETRY_COMPILER_MODE_RELEASE) + + // Also test symmetric distance strategy if right-distance is not specified + // (only in release mode) + if (bg::math::equals(distance_right, same_distance)) + { + bg::strategy::buffer::distance_symmetric + < + typename bg::coordinate_type::type + > sym_distance_strategy(distance_left); + + test_buffer + (caseid + "_sym", buffered, g, + join_strategy, end_strategy, + sym_distance_strategy, side_strategy, circle_strategy, + area_strategy, + expected_count, expected_holes_count, expected_area, + settings); + + } +#endif +} + +template +< + typename Geometry, + typename GeometryOut, + typename JoinStrategy, + typename EndStrategy +> +void test_one(std::string const& caseid, std::string const& wkt, + JoinStrategy const& join_strategy, EndStrategy const& end_strategy, + double expected_area, + double distance_left, ut_settings const& settings = ut_settings(), + double distance_right = same_distance) +{ + test_one(caseid, wkt, join_strategy, end_strategy, + -1 ,-1, expected_area, + distance_left, settings, distance_right); +} + +template +< + typename Geometry, + typename GeometryOut, + typename JoinStrategy, + typename EndStrategy, + typename DistanceStrategy, + typename SideStrategy, + typename PointStrategy +> +void test_with_custom_strategies(std::string const& caseid, + std::string const& wkt, + JoinStrategy const& join_strategy, + EndStrategy const& end_strategy, + DistanceStrategy const& distance_strategy, + SideStrategy const& side_strategy, + PointStrategy const& point_strategy, + double expected_area, + ut_settings const& settings = ut_settings()) +{ + namespace bg = boost::geometry; + Geometry g; + bg::read_wkt(wkt, g); + bg::correct(g); + + bg::model::multi_polygon buffered; + + test_buffer + (caseid, buffered, g, + join_strategy, end_strategy, + distance_strategy, side_strategy, point_strategy, + expected_area, settings); +} + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/buffer/test_buffer_geo.hpp b/src/boost/libs/geometry/test/algorithms/buffer/test_buffer_geo.hpp new file mode 100644 index 000000000..efeeee1e2 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/test_buffer_geo.hpp @@ -0,0 +1,83 @@ +// Boost.Geometry +// Unit Test Helper + +// Copyright (c) 2018-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#ifndef BOOST_GEOMETRY_TEST_BUFFER_GEO_HPP +#define BOOST_GEOMETRY_TEST_BUFFER_GEO_HPP + +#include "test_buffer.hpp" + +template +< + typename Geometry, + typename GeometryOut, + typename JoinStrategy, + typename EndStrategy +> +void test_one_geo(std::string const& caseid, + std::string const& wkt, + JoinStrategy const& join_strategy, EndStrategy const& end_strategy, + int expected_count, int expected_holes_count, double expected_area, + double distance_left, ut_settings settings = ut_settings(), + double distance_right = same_distance) +{ + Geometry input_geometry; + bg::read_wkt(wkt, input_geometry); + bg::correct(input_geometry); + + bg::strategy::buffer::side_straight side_strategy; + bg::strategy::buffer::distance_asymmetric + < + typename bg::coordinate_type::type + > distance_strategy(distance_left, + bg::math::equals(distance_right, same_distance) + ? distance_left : distance_right); + + // Use the appropriate strategy for geographic points + bg::strategy::buffer::geographic_point_circle<> circle_strategy(settings.points_per_circle); + + // Use Thomas strategy to calculate geographic area, because it is + // the most precise (unless scale of buffer is only around 1 meter) + bg::strategy::area::geographic + < + bg::strategy::thomas, 5, + bg::srs::spheroid, long double + > area_strategy; + + bg::model::multi_polygon buffer; + + test_buffer + (caseid, buffer, input_geometry, + join_strategy, end_strategy, + distance_strategy, side_strategy, circle_strategy, + area_strategy, + expected_count, expected_holes_count, expected_area, + settings); +} + +template +< + typename Geometry, + typename GeometryOut, + typename JoinStrategy, + typename EndStrategy +> +void test_one_geo(std::string const& caseid, std::string const& wkt, + JoinStrategy const& join_strategy, EndStrategy const& end_strategy, + double expected_area, + double distance_left, ut_settings const& settings = ut_settings(), + double distance_right = same_distance) +{ + test_one_geo(caseid, wkt, join_strategy, end_strategy, + -1 ,-1, expected_area, + distance_left, settings, distance_right); +} + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/buffer/test_buffer_svg.hpp b/src/boost/libs/geometry/test/algorithms/buffer/test_buffer_svg.hpp new file mode 100644 index 000000000..85e2cc614 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/test_buffer_svg.hpp @@ -0,0 +1,480 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test Helper + +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + + +#ifndef BOOST_GEOMETRY_TEST_BUFFER_SVG_HPP +#define BOOST_GEOMETRY_TEST_BUFFER_SVG_HPP + +#include +#include + +// Uncomment next lines if you want to have a zoomed view +//#define BOOST_GEOMETRY_BUFFER_TEST_SVG_USE_ALTERNATE_BOX + +// If possible define box before including this unit with the right view +#ifdef BOOST_GEOMETRY_BUFFER_TEST_SVG_USE_ALTERNATE_BOX +# ifndef BOOST_GEOMETRY_BUFFER_TEST_SVG_ALTERNATE_BOX +# define BOOST_GEOMETRY_BUFFER_TEST_SVG_ALTERNATE_BOX "BOX(0 0,100 100)" +# endif +#endif + +#include +#include +#include + + +inline char piece_type_char(bg::strategy::buffer::piece_type const& type) +{ + using namespace bg::strategy::buffer; + switch(type) + { + case buffered_segment : return 's'; + case buffered_join : return 'j'; + case buffered_round_end : return 'r'; + case buffered_flat_end : return 'f'; + case buffered_point : return 'p'; + case buffered_concave : return 'c'; + default : return '?'; + } +} + +template +class svg_visitor +{ +public : + svg_visitor(SvgMapper& mapper) + : m_mapper(mapper) + , m_zoom(false) + { + bg::assign_inverse(m_alternate_box); + } + + void set_alternate_box(Box const& box) + { + m_alternate_box = box; + m_zoom = true; + } + + template + inline void apply(PieceCollection const& collection, int phase) + { + // Comment next return if you want to see pieces, turns, etc. + return; + + if(phase == 0) + { + map_pieces(collection.m_pieces, collection.offsetted_rings, true, true); + } + if (phase == 1) + { + map_turns(collection.m_turns, true, false); + } + if (phase == 2 && ! m_zoom) + { +// map_traversed_rings(collection.traversed_rings); +// map_offsetted_rings(collection.offsetted_rings); + } + } + +private : + class si + { + private : + bg::segment_identifier m_id; + + public : + inline si(bg::segment_identifier const& id) + : m_id(id) + {} + + template + inline friend std::basic_ostream& operator<<( + std::basic_ostream& os, + si const& s) + { + os << s.m_id.multi_index << "." << s.m_id.segment_index; + return os; + } + }; + + template + inline void map_turns(Turns const& turns, bool label_good_turns, bool label_wrong_turns) + { + namespace bgdb = boost::geometry::detail::buffer; + typedef typename boost::range_value::type turn_type; + typedef typename turn_type::point_type point_type; + typedef typename turn_type::robust_point_type robust_point_type; + + std::map > offsets; + + for (typename boost::range_iterator::type it = + boost::begin(turns); it != boost::end(turns); ++it) + { + if (m_zoom && bg::disjoint(it->point, m_alternate_box)) + { + continue; + } + + bool is_good = true; + char color = 'g'; + std::string fill = "fill:rgb(0,255,0);"; + switch(it->location) + { + case bgdb::inside_buffer : + fill = "fill:rgb(255,0,0);"; + color = 'r'; + is_good = false; + break; + case bgdb::location_discard : + fill = "fill:rgb(0,0,255);"; + color = 'b'; + is_good = false; + break; + default: + ; // to avoid "enumeration value not handled" warning + } + if (it->blocked()) + { + fill = "fill:rgb(128,128,128);"; + color = '-'; + is_good = false; + } + + fill += "fill-opacity:0.7;"; + + m_mapper.map(it->point, fill, 4); + + if ((label_good_turns && is_good) || (label_wrong_turns && ! is_good)) + { + std::ostringstream out; + out << it->turn_index; + if (it->cluster_id >= 0) + { + out << " (" << it->cluster_id << ")"; + } + out + << " " << it->operations[0].piece_index << "/" << it->operations[1].piece_index + << " " << si(it->operations[0].seg_id) << "/" << si(it->operations[1].seg_id) + + // If you want to see travel information + << std::endl + << " nxt " << it->operations[0].enriched.get_next_turn_index() + << "/" << it->operations[1].enriched.get_next_turn_index() + //<< " frac " << it->operations[0].fraction + + // If you want to see (robust)point coordinates (e.g. to find duplicates) + << std::endl << std::setprecision(16) << bg::wkt(it->point) + << std::endl << bg::wkt(it->robust_point) + + << std::endl; + out << " " << bg::method_char(it->method) + << ":" << bg::operation_char(it->operations[0].operation) + << "/" << bg::operation_char(it->operations[1].operation); + out << " " + << (it->count_within_near_offsetted > 0 ? "n" : "") + << (it->count_within > 0 ? "w" : "") + << (it->count_on_helper > 0 ? "h" : "") + ; + + offsets[it->get_robust_point()] += 10; + int offset = offsets[it->get_robust_point()]; + + m_mapper.text(it->point, out.str(), "fill:rgb(0,0,0);font-family='Arial';font-size:9px;", 5, offset); + + offsets[it->get_robust_point()] += 25; + } + } + } + + template + inline void map_pieces(Pieces const& pieces, + OffsettedRings const& offsetted_rings, + bool do_pieces, bool do_indices) + { + typedef typename boost::range_value::type piece_type; + typedef typename boost::range_value::type ring_type; + + for(typename boost::range_iterator::type it = boost::begin(pieces); + it != boost::end(pieces); + ++it) + { + const piece_type& piece = *it; + bg::segment_identifier seg_id = piece.first_seg_id; + if (seg_id.segment_index < 0) + { + continue; + } + + ring_type corner; + + + ring_type const& ring = offsetted_rings[seg_id.multi_index]; + + std::copy(boost::begin(ring) + seg_id.segment_index, + boost::begin(ring) + piece.last_segment_index, + std::back_inserter(corner)); + std::copy(boost::begin(piece.helper_points), + boost::end(piece.helper_points), + std::back_inserter(corner)); + + if (corner.empty()) + { + continue; + } +#if 0 // Does not compile (SVG is not enabled by default) + if (m_zoom && bg::disjoint(corner, m_alternate_box)) + { + continue; + } +#endif + + if (m_zoom && do_pieces) + { + try + { + std::string style = "opacity:0.3;stroke:rgb(0,0,0);stroke-width:1;"; + typedef typename bg::point_type::type point_type; + bg::model::multi_polygon > clipped; + bg::intersection(ring, m_alternate_box, clipped); + m_mapper.map(clipped, + piece.type == bg::strategy::buffer::buffered_segment + ? style + "fill:rgb(255,128,0);" + : style + "fill:rgb(255,0,0);"); + } + catch (...) + { + std::cerr << "Error for piece " << piece.index << std::endl; + } + } + else if (do_pieces) + { + std::string style = "opacity:0.3;stroke:rgb(0,0,0);stroke-width:1;"; + m_mapper.map(corner, + piece.type == bg::strategy::buffer::buffered_segment + ? style + "fill:rgb(255,128,0);" + : style + "fill:rgb(255,0,0);"); + } + + if (do_indices) + { + // Label starting piece_index / segment_index + typedef typename bg::point_type::type point_type; + + std::ostringstream out; + out << piece.index + << (piece.is_flat_start ? " FS" : "") + << (piece.is_flat_end ? " FE" : "") + << " (" << piece_type_char(piece.type) << ") " + << piece.first_seg_id.segment_index + << ".." << piece.last_segment_index - 1; + point_type label_point = bg::return_centroid(corner); + + if ((piece.type == bg::strategy::buffer::buffered_concave + || piece.type == bg::strategy::buffer::buffered_flat_end) + && corner.size() >= 2u) + { + bg::set<0>(label_point, (bg::get<0>(corner[0]) + bg::get<0>(corner[1])) / 2.0); + bg::set<1>(label_point, (bg::get<1>(corner[0]) + bg::get<1>(corner[1])) / 2.0); + } + m_mapper.text(label_point, out.str(), "fill:rgb(255,0,0);font-family='Arial';font-size:10px;", 5, 5); + } + } + } + + template + inline void map_traversed_rings(TraversedRings const& traversed_rings) + { + for(typename boost::range_iterator::type it + = boost::begin(traversed_rings); it != boost::end(traversed_rings); ++it) + { + m_mapper.map(*it, "opacity:0.4;fill:none;stroke:rgb(0,255,0);stroke-width:2"); + } + } + + template + inline void map_offsetted_rings(OffsettedRings const& offsetted_rings) + { + for(typename boost::range_iterator::type it + = boost::begin(offsetted_rings); it != boost::end(offsetted_rings); ++it) + { + if (it->discarded()) + { + m_mapper.map(*it, "opacity:0.4;fill:none;stroke:rgb(255,0,0);stroke-width:2"); + } + else + { + m_mapper.map(*it, "opacity:0.4;fill:none;stroke:rgb(0,0,255);stroke-width:2"); + } + } + } + + + SvgMapper& m_mapper; + Box m_alternate_box; + bool m_zoom; + +}; + +template +class buffer_svg_mapper +{ +public : + + buffer_svg_mapper(std::string const& casename) + : m_casename(casename) + , m_zoom(false) + { + bg::assign_inverse(m_alternate_box); + } + + template + void prepare(Mapper& mapper, Visitor& visitor, Envelope const& envelope, double box_buffer_distance) + { +#ifdef BOOST_GEOMETRY_BUFFER_TEST_SVG_USE_ALTERNATE_BOX + // Create a zoomed-in view + bg::model::box alternate_box; + bg::read_wkt(BOOST_GEOMETRY_BUFFER_TEST_SVG_ALTERNATE_BOX, alternate_box); + mapper.add(alternate_box); + + // Take care non-visible elements are skipped + visitor.set_alternate_box(alternate_box); + set_alternate_box(alternate_box); +#else + bg::model::box box = envelope; + bg::buffer(box, box, box_buffer_distance); + mapper.add(box); +#endif + + boost::ignore_unused(visitor); + } + + void set_alternate_box(bg::model::box const& box) + { + m_alternate_box = box; + m_zoom = true; + } + + template + void map_input_output(Mapper& mapper, Geometry const& geometry, + GeometryBuffer const& buffered, bool negative) + { + bool const areal = boost::is_same + < + typename bg::tag_cast + < + typename bg::tag::type, + bg::areal_tag + >::type, bg::areal_tag + >::type::value; + + if (m_zoom) + { + map_io_zoomed(mapper, geometry, buffered, negative, areal); + } + else + { + map_io(mapper, geometry, buffered, negative, areal); + } + } + + template + void map_self_ips(Mapper& mapper, Geometry const& geometry, Strategy const& strategy, RescalePolicy const& rescale_policy) + { + typedef bg::detail::overlay::turn_info + < + Point, + typename bg::detail::segment_ratio_type::type + > turn_info; + + std::vector turns; + + bg::detail::self_get_turn_points::no_interrupt_policy policy; + bg::self_turns + < + bg::detail::overlay::assign_null_policy + >(geometry, strategy, rescale_policy, turns, policy); + + BOOST_FOREACH(turn_info const& turn, turns) + { + mapper.map(turn.point, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1", 3); + } + } + +private : + + template + void map_io(Mapper& mapper, Geometry const& geometry, + GeometryBuffer const& buffered, bool negative, bool areal) + { + // Map input geometry in green + if (areal) + { + mapper.map(geometry, "opacity:0.5;fill:rgb(0,128,0);stroke:rgb(0,64,0);stroke-width:2"); + } + else + { + // TODO: clip input points/linestring + mapper.map(geometry, "opacity:0.5;stroke:rgb(0,128,0);stroke-width:10"); + } + + { + // Map buffer in yellow (inflate) and with orange-dots (deflate) + std::string style = negative + ? "opacity:0.4;fill:rgb(255,255,192);stroke:rgb(255,128,0);stroke-width:3" + : "opacity:0.4;fill:rgb(255,255,128);stroke:rgb(0,0,0);stroke-width:3"; + + mapper.map(buffered, style); + } + } + + template + void map_io_zoomed(Mapper& mapper, Geometry const& geometry, + GeometryBuffer const& buffered, bool negative, bool areal) + { + // Map input geometry in green + if (areal) + { + // Assuming input is areal + GeometryBuffer clipped; +// TODO: the next line does NOT compile for multi-point, TODO: implement that line +// bg::intersection(geometry, m_alternate_box, clipped); + mapper.map(clipped, "opacity:0.5;fill:rgb(0,128,0);stroke:rgb(0,64,0);stroke-width:2"); + } + else + { + // TODO: clip input (multi)point/linestring + mapper.map(geometry, "opacity:0.5;stroke:rgb(0,128,0);stroke-width:10"); + } + + { + // Map buffer in yellow (inflate) and with orange-dots (deflate) + std::string style = negative + ? "opacity:0.4;fill:rgb(255,255,192);stroke:rgb(255,128,0);stroke-width:3" + : "opacity:0.4;fill:rgb(255,255,128);stroke:rgb(0,0,0);stroke-width:3"; + + try + { + // Clip output multi-polygon with box + GeometryBuffer clipped; + bg::intersection(buffered, m_alternate_box, clipped); + mapper.map(clipped, style); + } + catch (...) + { + std::cout << "Error for buffered output " << m_casename << std::endl; + } + } + } + + bg::model::box m_alternate_box; + bool m_zoom; + std::string m_casename; +}; + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/buffer/test_buffer_svg_per_turn.hpp b/src/boost/libs/geometry/test/algorithms/buffer/test_buffer_svg_per_turn.hpp new file mode 100644 index 000000000..e48d333d1 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/buffer/test_buffer_svg_per_turn.hpp @@ -0,0 +1,164 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test Helper + +// Copyright (c) 2010-2019 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + + +#ifndef BOOST_GEOMETRY_TEST_BUFFER_SVG_PER_TURN_HPP +#define BOOST_GEOMETRY_TEST_BUFFER_SVG_PER_TURN_HPP + +#include +#include + +#include "test_buffer_svg.hpp" +#include + +template +class save_turns_visitor +{ +public : + typedef std::vector > vector_type; + + template + inline void get_turns(Turns const& turns) + { + for (typename boost::range_iterator::type it = + boost::begin(turns); it != boost::end(turns); ++it) + { + m_points.push_back(std::make_pair(it->point, it->turn_index)); + } + } + + template + inline void apply(PieceCollection const& collection, int phase) + { + if (phase == 0) + { + get_turns(collection.m_turns); + } + } + + vector_type const& get_points() { return m_points; } + +private : + vector_type m_points; +}; + + + +template +class mapper_visitor +{ +public : + mapper_visitor(std::string const& complete, int index, Point const& point) + : m_filename(get_filename(complete, index)) + , m_svg(m_filename.c_str()) + , m_mapper(m_svg, 1000, 800) + , m_visitor(m_mapper) + , m_buffer_mapper(m_filename) + { + box_type box; + double half_size = 75.0; // specific for multi_point buffer + bg::set(box, bg::get<0>(point) - half_size); + bg::set(box, bg::get<1>(point) - half_size); + bg::set(box, bg::get<0>(point) + half_size); + bg::set(box, bg::get<1>(point) + half_size); + + m_mapper.add(box); + m_visitor.set_alternate_box(box); + m_buffer_mapper.set_alternate_box(box); + } + + // It is used in a ptr vector + virtual ~mapper_visitor() + { + } + + template + inline void apply(PieceCollection const& collection, int phase) + { + m_visitor.apply(collection, phase); + } + + template + void map_input_output(Geometry const& geometry, + GeometryBuffer const& buffered, bool negative) + { + m_buffer_mapper.map_input_output(m_mapper, geometry, buffered, negative); + } + +private : + std::string get_filename(std::string const& complete, int index) + { + std::ostringstream filename; + filename << "buffer_per_turn_" << complete << "_" << index << ".svg"; + return filename.str(); + } + + typedef bg::svg_mapper mapper_type; + typedef bg::model::box box_type; + + std::string m_filename; + std::ofstream m_svg; + mapper_type m_mapper; + svg_visitor m_visitor; + buffer_svg_mapper m_buffer_mapper; +}; + +template +class per_turn_visitor +{ + // Both fstreams and svg mappers are non-copyable, + // therefore we need to use dynamic memory + typedef boost::ptr_vector > container_type; + container_type mappers; + +public : + + typedef std::pair pair_type; + typedef std::vector vector_type; + + per_turn_visitor(std::string const& complete_caseid, + vector_type const& points) + { + namespace bg = boost::geometry; + + if (points.size() > 100u) + { + // Defensive check. Too much intersections. Don't create anything + return; + } + + BOOST_FOREACH(pair_type const& p, points) + { + mappers.push_back(new mapper_visitor(complete_caseid, p.second, p.first)); + } + } + + template + inline void apply(PieceCollection const& collection, int phase) + { + for(typename container_type::iterator it = mappers.begin(); + it != mappers.end(); ++it) + { + it->apply(collection, phase); + } + } + + template + void map_input_output(Geometry const& geometry, + GeometryBuffer const& buffered, bool negative) + { + for(typename container_type::iterator it = mappers.begin(); + it != mappers.end(); ++it) + { + it->map_input_output(geometry, buffered, negative); + } + } +}; + + +#endif // BOOST_GEOMETRY_TEST_BUFFER_SVG_PER_TURN_HPP diff --git a/src/boost/libs/geometry/test/algorithms/centroid.cpp b/src/boost/libs/geometry/test/algorithms/centroid.cpp new file mode 100644 index 000000000..8f7399230 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/centroid.cpp @@ -0,0 +1,276 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 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. + +// 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) + +#include + +#include +#include +#include +#include + +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +template +void test_polygon() +{ + test_centroid( + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2" + ",3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))", + 4.06923363095238, 1.65055803571429); + + // with holes + test_centroid( + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2" + ",3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3)" + ",(4 2,4.2 1.4,4.8 1.9,4.4 2.2,4 2))", + 4.0466264962959677, 1.6348996057331333); + + test_centroid("POLYGON((0 0,0 10,10 10,10 0,0 0))", 5.0, 5.0); + test_centroid("POLYGON((-10 0,0 0,0 -10,-10 -10,-10 0))", -5.0, -5.0); + + // invalid, self-intersecting polygon (area = 0) + test_centroid("POLYGON((1 1,4 -2,4 2,10 0,1 0,10 1,1 1))", 1.0, 1.0); + // invalid, degenerated + test_centroid("POLYGON((1 1,1 1,1 1,1 1))", 1.0, 1.0); + test_centroid("POLYGON((1 1))", 1.0, 1.0); + + // should (1.5 1) be returned? + // if yes, then all other Polygons degenerated to Linestrings should be handled + test_centroid("POLYGON((1 1,2 1,1 1,1 1))", 1.0, 1.0); + + // reported 2015.04.24 + // input INT, result FP + test_centroid + < + bg::model::polygon >, + typename bg::point_type::type, + typename bg::coordinate_type::type + >("POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))", 1.5, 1.5); +} + + +template +void test_2d() +{ + test_centroid >("LINESTRING(1 1, 2 2, 3 3)", 2.0, 2.0); + test_centroid >("LINESTRING(0 0,0 4, 4 4)", 1.0, 3.0); + test_centroid >("LINESTRING(0 0,3 3,0 6,3 9,0 12)", 1.5, 6.0); + + test_centroid >("LINESTRING(1 1,10 1,1 0,10 0,4 -2,1 1)", + 5.41385255923004, 0.13507358481085); + + // degenerated linestring (length = 0) + test_centroid >("LINESTRING(1 1, 1 1)", 1.0, 1.0); + test_centroid >("LINESTRING(1 1)", 1.0, 1.0); + + { + bg::model::linestring

ls; + // LINESTRING(1 -1,1e308 -1e308,0.0001 0.000) + bg::append(ls, P(1, -1)); + typedef typename bg::coordinate_type

::type coord_type; + //double m = 1.0e308; + coord_type m = (std::numeric_limits::max)(); + bg::append(ls, P(coord_type(m), coord_type(-m))); + bg::append(ls, P(coord_type(0.0001), coord_type(0.000))); + if (BOOST_GEOMETRY_CONDITION((boost::is_same::type, double>::value))) + { + // for doubles the INF is detected and the calculation stopped + // currently for Geometries for which the centroid can't be calculated + // the first Point is returned + test_centroid >(ls, 1.0, -1.0); + } + else + { + // for floats internally the double is used to store intermediate results + // this type is capable to store MAX_FLT and "correctly" calculate the centroid + // test_centroid >(ls, m/3, -m/3); + // the result is around (1.7e38 -1.7e38) + } + } + + test_centroid >("LINESTRING(1 1, 3 3)", 2.0, 2.0); + + test_centroid >( + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2" + ",3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))", + 4.06923363095238, 1.65055803571429); + + test_polygon >(); + test_polygon >(); + + // ccw + test_centroid >( + "POLYGON((2 1.3,2.9 0.7,4.9 0.8,5.4 1.2,5.3 2.6,4.1 3,3.4 2" + ",3.7 1.6,3.4 1.2,2.8 1.8,2.4 1.7,2 1.3))", + 4.06923363095238, 1.65055803571429); + + // open / closed + test_centroid >( + "POLYGON((1 1,2 2,3 1,2 0,1 1))", 2.0, 1.0); + test_centroid >( + "POLYGON((1 1,2 2,3 1,2 0))", 2.0, 1.0); + + test_centroid >("POLYGON((1 2,3 4))", 2, 3); + test_centroid

("POINT(3 3)", 3, 3); + + // INT -> FP + test_centroid + < + bg::model::ring >, + P, typename bg::coordinate_type

::type + >("POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))", 1.5, 1.5); + test_centroid + < + bg::model::linestring >, + P, typename bg::coordinate_type

::type + >("LINESTRING(1 1, 2 2)", 1.5, 1.5); + test_centroid + < + bg::model::box >, + P, typename bg::coordinate_type

::type + >("BOX(1 1, 2 2)", 1.5, 1.5); +} + + +template +void test_3d() +{ + test_centroid >("LINESTRING(1 2 3,4 5 -6,7 -8 9,-10 11 12,13 -14 -15, 16 17 18)", + 5.6748865168734692, 0.31974938587214002, 1.9915270387763671); + test_centroid >("POLYGON((1 2 3,5 6 7))", 3, 4, 5); + test_centroid >("LINESTRING(1 1 1,3 3 3)", 2, 2, 2); + test_centroid

("POINT(1 2 3)", 1, 2, 3); +} + + +template +void test_5d() +{ + test_centroid >("LINESTRING(1 2 3 4 95,4 5 -6 24 40,7 -8 9 -5 -7,-10 11 12 -5 5,13 -14 -15 4 3, 16 17 18 5 12)", + 4.9202312983547678, 0.69590937869808345, 1.2632138719797417, 6.0468332057401986, 23.082402715244868); +} + +template +void test_exceptions() +{ + test_centroid_exception >(); + test_centroid_exception >(); + test_centroid_exception >(); + + // Empty exterior ring + test_centroid_exception >( + "POLYGON((), ())"); + test_centroid_exception >( + "POLYGON((), (0 0, 1 0, 1 1, 0 1, 0 0))"); +} + +template +void test_empty() +{ + // Empty interior ring + test_centroid >( + "POLYGON((0 0, 1 0, 1 1, 0 1, 0 0), ())", + 0.5, 0.5); +} + +void test_large_integers() +{ + typedef bg::model::point int_point_type; + typedef bg::model::point double_point_type; + + bg::model::polygon int_poly; + bg::model::polygon double_poly; + + std::string const polygon_li = "POLYGON((1872000 528000,1872000 192000,1536119 192000,1536000 528000,1200000 528000,1200000 863880,1536000 863880,1872000 863880,1872000 528000))"; + bg::read_wkt(polygon_li, int_poly); + bg::read_wkt(polygon_li, double_poly); + + int_point_type int_centroid; + double_point_type double_centroid; + + bg::centroid(int_poly, int_centroid); + bg::centroid(double_poly, double_centroid); + + int_point_type double_centroid_as_int; + bg::assign_zero(double_centroid_as_int); + bg::assign(int_centroid, double_centroid_as_int); + + BOOST_CHECK_EQUAL(bg::get<0>(int_centroid), bg::get<0>(double_centroid_as_int)); + BOOST_CHECK_EQUAL(bg::get<1>(int_centroid), bg::get<1>(double_centroid_as_int)); +} + +//#include + +void test_large_doubles() +{ + typedef bg::model::point point; + point pt_far, pt_near; + bg::model::polygon poly_far, poly_near; + + // related to ticket #10643 + bg::read_wkt("POLYGON((1074699.93 703064.65, 1074703.90 703064.58, 1074704.53 703061.40, 1074702.10 703054.62, 1074699.93 703064.65))", poly_far); + bg::read_wkt("POLYGON((699.93 64.65, 703.90 64.58, 704.53 61.40, 702.10 54.62, 699.93 64.65))", poly_near); + + bg::centroid(poly_far, pt_far); + bg::centroid(poly_near, pt_near); + + BOOST_CHECK(bg::within(pt_far, poly_far)); + BOOST_CHECK(bg::within(pt_near, poly_near)); + + point pt_near_moved; + bg::set<0>(pt_near_moved, bg::get<0>(pt_near) + 1074000.0); + bg::set<1>(pt_near_moved, bg::get<1>(pt_near) + 703000.0); + + //geom_to_svg(poly_far, pt_far, "far.svg"); + //geom_to_svg(poly_near, pt_near, "near.svg"); + + double d = bg::distance(pt_far, pt_near_moved); + BOOST_CHECK(d < 0.1); +} + +int test_main(int, char* []) +{ + test_2d >(); + test_2d >(); + test_2d >(); + + test_3d >(); + + test_5d >(); + +#if defined(HAVE_TTMATH) + test_2d >(); + test_3d >(); +#endif + +#ifndef NDEBUG + // The test currently fails in release mode. TODO: fix this + test_large_integers(); +#endif + + test_large_doubles(); + + test_exceptions >(); + test_empty >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/centroid_multi.cpp b/src/boost/libs/geometry/test/algorithms/centroid_multi.cpp new file mode 100644 index 000000000..ba946693b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/centroid_multi.cpp @@ -0,0 +1,197 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include + +#include + +#include +#include + +#include +#include + + +// #define REPORT_RESULTS + + +template +void test_2d(bool is_integer = false) +{ + typedef typename bg::coordinate_type

::type ct; + boost::ignore_unused(); + +#ifdef REPORT_RESULTS + std::cout << std::endl << "type: " << typeid(ct).name() << " size: " << sizeof(ct) << std::endl; +#endif + + test_centroid >( + "MULTIPOINT((1 1),(3 3))", + 2.0, 2.0); + + test_centroid >( + "MULTIPOINT((-1 -1),(-3 -3))", + -2.0, -2.0); + + if (! is_integer) + { + // Only working for floating point: + + test_centroid >( + "MULTIPOINT((1 1),(2 3),(5 0))", + 2.666666666666667, 1.33333); + + test_centroid > >( + "MULTILINESTRING((0 0,0 2),(1 0,1 2))", + 0.5, 1.0); + + // degenerated + test_centroid > >( + "MULTILINESTRING((1 1,1 1))", + 1.0, 1.0); + + + test_centroid > >( + "MULTIPOLYGON(((1 1,1 3,3 3,3 1,1 1)),((4 1,4 3,8 3,8 1,4 1)))", + 4.666666666666667, 2.0); + + test_centroid > >( + "MULTIPOLYGON(((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2" + ",3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))," + "((10 10,10 12,12 12,12 10,10 10)))", + 7.338463104108615, 6.0606722055552407); + + // degenerated + test_centroid > >( + "MULTIPOLYGON(((1 1,1 1,1 1,1 1,1 1)))", + 1.0, 1.0); + test_centroid > >( + "MULTIPOLYGON(((1 1)))", + 1.0, 1.0); + } + + + + // Test using real-world polygon with large (Y) coordinates + // (coordinates can be used for integer and floating point point-types) + // Note that this will fail (overflow) if centroid calculation uses float + test_centroid > >( + "MULTIPOLYGON(((426062 4527794,426123 4527731" + ",426113 4527700,426113 4527693,426115 4527671" + ",426133 4527584,426135 4527569,426124 4527558" + ",426103 4527547,426072 4527538,426003 4527535" + ",425972 4527532,425950 4527531,425918 4527528" + ",425894 4527517,425876 4527504,425870 4527484" + ",425858 4527442,425842 4527414,425816 4527397" + ",425752 4527384,425692 4527369,425658 4527349" + ",425624 4527307,425605 4527260,425598 4527213" + ",425595 4527167,425582 4527125,425548 4527064" + ",425535 4527027,425537 4526990,425534 4526943" + ",425525 4526904,425500 4526856,425461 4526811" + ",425450 4526798,425381 4526823,425362 4526830" + ",425329 4526848,425298 4526883,425291 4526897" + ",425268 4526923,425243 4526945,425209 4526971" + ",425172 4526990,425118 4527028,425104 4527044" + ",425042 4527090,424980 4527126,424925 4527147" + ",424881 4527148,424821 4527147,424698 4527125" + ",424610 4527121,424566 4527126,424468 4527139" + ",424426 4527141,424410 4527142,424333 4527130" + ",424261 4527110,424179 4527073,424024 4527012" + ",423947 4526987,423902 4526973,423858 4526961" + ",423842 4526951,423816 4526935,423799 4526910" + ",423776 4526905,423765 4526911,423739 4526927" + ",423692 4526946,423636 4526976,423608 4527008" + ",423570 4527016,423537 4527011,423505 4526996" + ",423480 4526994,423457 4527012,423434 4527021" + ",423367 4527008,423263 4526998,423210 4526993" + ",423157 4526996,423110 4526994,423071 4526984" + ",423048 4526984,423032 4526994,423254 4527613" + ",423889 4528156,424585 4528050,425479 4527974" + ",425795 4527867,426062 4527794)))", + 424530.6059719588, 4527519.619367547); +} + +template +void test_exceptions() +{ + using namespace bg::model; + typedef multi_polygon > multi_polygon; + typedef multi_linestring > multi_linestring; + + // Empty multi-polygon + test_centroid_exception("MULTIPOLYGON()"); + test_centroid_exception("MULTIPOLYGON(())"); + test_centroid_exception("MULTIPOLYGON((), ())"); + test_centroid_exception("MULTIPOLYGON((()), ())"); + test_centroid_exception("MULTIPOLYGON(((), ()))"); + + // Empty multi-linestring + test_centroid_exception("MULTILINESTRING()"); + test_centroid_exception("MULTILINESTRING(())"); + test_centroid_exception("MULTILINESTRING((), ())"); +} + +template +void test_empty() +{ + using namespace bg::model; + typedef multi_polygon > multi_polygon; + typedef multi_linestring > multi_linestring; + + // Multi-linestring with empty linestring + test_centroid( + "MULTILINESTRING((), (0 0))", + 0.0, 0.0); + test_centroid( + "MULTILINESTRING((0 0, 1 0), ())", + 0.5, 0.0); + + // Multi-polygon with empty polygon + test_centroid( + "MULTIPOLYGON((()), ((0 0)))", + 0.0, 0.0); + test_centroid( + "MULTIPOLYGON(((0 0, 1 0, 1 1, 0 1, 0 0)), (()))", + 0.5, 0.5); + + // Multi-polygon with empty interior ring + test_centroid( + "MULTIPOLYGON(((0 0, 1 0, 1 1, 0 1, 0 0), ()))", + 0.5, 0.5); + test_centroid( + "MULTIPOLYGON((()), ((0 0, 1 0, 1 1, 0 1, 0 0), ()))", + 0.5, 0.5); +} + + + +int test_main(int, char* []) +{ + test_2d >(); + test_2d >(); + test_2d >(true); + //test_2d >(true); + //test_2d >(); + +#ifdef HAVE_TTMATH + test_2d >(); +#endif + + test_exceptions >(); + test_empty >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/check_validity.hpp b/src/boost/libs/geometry/test/algorithms/check_validity.hpp new file mode 100644 index 000000000..388ca6fad --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/check_validity.hpp @@ -0,0 +1,79 @@ +// Boost.Geometry + +// Copyright (c) 2017 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#ifndef BOOST_GEOMETRY_TEST_CHECK_VALIDITY_HPP +#define BOOST_GEOMETRY_TEST_CHECK_VALIDITY_HPP + +#include + +#include + +template +inline bool is_output_valid(Geometry const& geometry, + std::string const& case_id, + G1 const& g1, G2 const& g2, + std::string& message) +{ + bool const result = bg::is_valid(geometry, message); + if (! result) + { + // Check if input was valid. If not, do not report output validity + if (! bg::is_valid(g1) || ! bg::is_valid(g2)) + { + std::cout << "WARNING: Input is not considered as valid; " + << "this can cause that output is invalid: " << case_id + << std::endl; + return true; + } + } + return result; +} + +template +< + typename Geometry, + typename Tag = typename bg::tag::type +> +struct check_validity +{ + template + static inline + bool apply(Geometry const& geometry, + std::string const& case_id, + G1 const& g1, G2 const& g2, + std::string& message) + { + return is_output_valid(geometry, case_id, g1, g2, message); + } +}; + +// Specialization for vector of (e.g. rings) +template +struct check_validity +{ + template + static inline + bool apply(Geometry const& geometry, + std::string const& case_id, + G1 const& g1, G2 const& g2, + std::string& message) + { + typedef typename boost::range_value::type single_type; + BOOST_FOREACH(single_type const& element, geometry) + { + if (! is_output_valid(element, case_id, g1, g2, message)) + { + return false; + } + } + return true; + } +}; + + +#endif // BOOST_GEOMETRY_TEST_CHECK_VALIDITY_HPP diff --git a/src/boost/libs/geometry/test/algorithms/clear_multi.cpp b/src/boost/libs/geometry/test/algorithms/clear_multi.cpp new file mode 100644 index 000000000..44f4716e0 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/clear_multi.cpp @@ -0,0 +1,63 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#include + +#include +#include + +#include + +#include +#include + +#include + + +template +void test_geometry(std::string const& wkt, unsigned int expected) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + boost::variant variant_geometry(geometry); + + bg::clear(geometry); + BOOST_CHECK_EQUAL(bg::num_points(geometry), expected); + + bg::clear(variant_geometry); + BOOST_CHECK_EQUAL(bg::num_points(variant_geometry), expected); +} + + +template +void test_all() +{ + typedef bg::model::polygon poly; + typedef bg::model::linestring ls; + typedef bg::model::multi_point mpoint; + typedef bg::model::multi_linestring mls; + typedef bg::model::multi_polygon mpoly; + + test_geometry("POINT(0 0)", 1); + test_geometry("LINESTRING(0 0,0 1)", 0); + test_geometry("POLYGON((0 0,0 1,1 0,0 0))", 0); + test_geometry("MULTIPOINT((0 0),(0 1),(1 0),(0 0))", 0); + test_geometry("MULTILINESTRING((0 0,0 1),(1 0,0 0))", 0); + test_geometry("MULTIPOLYGON(((0 0,0 1,1 0,0 0)),((10 0,10 1,11 0,10 0)))", 0); +} + + +int test_main( int , char* [] ) +{ + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/comparable_distance.cpp b/src/boost/libs/geometry/test/algorithms/comparable_distance.cpp new file mode 100644 index 000000000..3a513387c --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/comparable_distance.cpp @@ -0,0 +1,523 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2014 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2014 Mateusz Loskot, London, UK. +// Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2014, 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 + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +template +void test_distance_result() +{ + typedef typename bg::default_distance_result::type distance_type; + + P p1 = bg::make

(0, 0); + P p2 = bg::make

(3, 0); + P p3 = bg::make

(0, 4); + + distance_type dr12 = bg::comparable_distance(p1, p2); + distance_type dr13 = bg::comparable_distance(p1, p3); + distance_type dr23 = bg::comparable_distance(p2, p3); + + BOOST_CHECK_CLOSE(dr12, 9.000, 0.001); + BOOST_CHECK_CLOSE(dr13, 16.000, 0.001); + BOOST_CHECK_CLOSE(dr23, 25.000, 0.001); + +} + +template +void test_distance_point() +{ + P p1; + bg::set<0>(p1, 1); + bg::set<1>(p1, 1); + + P p2; + bg::set<0>(p2, 2); + bg::set<1>(p2, 2); + + typename bg::coordinate_type

::type d = bg::comparable_distance(p1, p2); + BOOST_CHECK_CLOSE(d, 2.0, 0.001); +} + +template +void test_distance_segment() +{ + typedef typename bg::coordinate_type

::type coordinate_type; + + P s1 = bg::make

(2, 2); + P s2 = bg::make

(3, 3); + + // Check points left, right, projected-left, projected-right, on segment + P p1 = bg::make

(0, 0); + P p2 = bg::make

(4, 4); + P p3 = bg::make

(2.4, 2.6); + P p4 = bg::make

(2.6, 2.4); + P p5 = bg::make

(2.5, 2.5); + + bg::model::referring_segment

const seg(s1, s2); + + coordinate_type d1 = bg::comparable_distance(p1, seg); BOOST_CHECK_CLOSE(d1, 8.0, 0.001); + coordinate_type d2 = bg::comparable_distance(p2, seg); BOOST_CHECK_CLOSE(d2, 2.0, 0.001); + coordinate_type d3 = bg::comparable_distance(p3, seg); BOOST_CHECK_CLOSE(d3, 0.02, 0.001); + coordinate_type d4 = bg::comparable_distance(p4, seg); BOOST_CHECK_CLOSE(d4, 0.02, 0.001); + coordinate_type d5 = bg::comparable_distance(p5, seg); BOOST_CHECK_CLOSE(d5, 0.0, 0.001); + + // Reverse case + coordinate_type dr1 = bg::comparable_distance(seg, p1); BOOST_CHECK_CLOSE(dr1, d1, 0.001); + coordinate_type dr2 = bg::comparable_distance(seg, p2); BOOST_CHECK_CLOSE(dr2, d2, 0.001); +} + +template +void test_distance_linestring() +{ + bg::model::linestring

points; + points.push_back(bg::make

(1, 1)); + points.push_back(bg::make

(3, 3)); + + P p = bg::make

(2, 1); + + typename bg::coordinate_type

::type d = bg::comparable_distance(p, points); + BOOST_CHECK_CLOSE(d, 0.5, 0.001); + + p = bg::make

(5, 5); + d = bg::comparable_distance(p, points); + BOOST_CHECK_CLOSE(d, 8.0, 0.001); + + + bg::model::linestring

line; + line.push_back(bg::make

(1,1)); + line.push_back(bg::make

(2,2)); + line.push_back(bg::make

(3,3)); + + p = bg::make

(5, 5); + + d = bg::comparable_distance(p, line); + BOOST_CHECK_CLOSE(d, 8.0, 0.001); + + // Reverse case + d = bg::comparable_distance(line, p); + BOOST_CHECK_CLOSE(d, 8.0, 0.001); +} + +template +void test_all() +{ + test_distance_result

(); + test_distance_point

(); + test_distance_segment

(); + test_distance_linestring

(); +} + +template +void test_double_result_from_integer() +{ + typedef bg::model::point point_type; + + point_type point; + + // Check linestring + bg::model::linestring linestring; + bg::read_wkt("POINT(2 2)", point); + bg::read_wkt("LINESTRING(4 1,1 4)", linestring); + + double normal_distance = bg::distance(point, linestring); + double comparable_distance = bg::comparable_distance(point, linestring); + + BOOST_CHECK_CLOSE(normal_distance, std::sqrt(0.5), 0.001); + BOOST_CHECK_CLOSE(comparable_distance, 0.5, 0.001); + + // Check polygon + bg::model::polygon polygon; + bg::read_wkt("POLYGON((0 0,1 9,8 1,0 0),(1 1,4 1,1 4,1 1))", polygon); + + normal_distance = bg::distance(point, polygon); + comparable_distance = bg::comparable_distance(point, polygon); + + BOOST_CHECK_CLOSE(normal_distance, std::sqrt(0.5), 0.001); + BOOST_CHECK_CLOSE(comparable_distance, 0.5, 0.001); +} + +template +struct test_variant_different_default_strategy +{ + static inline void apply() + { + typedef bg::model::point point_type; + typedef bg::model::segment segment_type; + typedef bg::model::box box_type; + typedef boost::variant variant_type; + + point_type point; + bg::read_wkt("POINT(1 3)", point); + + segment_type seg; + bg::read_wkt("LINESTRING(1 1,4 4)", seg); + + box_type box; + bg::read_wkt("BOX(-1 -1,0 0)", box); + + variant_type v1, v2; + + BOOST_MPL_ASSERT(( + boost::is_same + < + typename bg::comparable_distance_result + < + variant_type, variant_type, bg::default_strategy + >::type, + typename bg::comparable_distance_result + < + point_type, point_type, bg::default_strategy + >::type + > + )); + + // Default strategy + v1 = point; + v2 = point; + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, v2), + bg::comparable_distance(point, point), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, point), + bg::comparable_distance(point, point), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(point, v2), + bg::comparable_distance(point, point), + 0.0001); + v1 = point; + v2 = seg; + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, v2), + bg::comparable_distance(point, seg), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, seg), + bg::comparable_distance(point, seg), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(point, v2), + bg::comparable_distance(point, seg), 0.0001); + v1 = point; + v2 = box; + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, v2), + bg::comparable_distance(point, box), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, box), + bg::comparable_distance(point, box), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(point, v2), + bg::comparable_distance(point, box), 0.0001); + } +}; + +template +struct test_variant_same_default_strategy +{ + static inline void apply() + { + typedef bg::model::point point_type; + typedef bg::model::segment segment_type; + typedef bg::model::linestring linestring_type; + typedef boost::variant + < + point_type, segment_type, linestring_type + > variant_type; + + point_type point; + bg::read_wkt("POINT(1 3)", point); + + segment_type seg; + bg::read_wkt("LINESTRING(1 1,4 4)", seg); + + linestring_type linestring; + bg::read_wkt("LINESTRING(-1 -1,-1 0,0 0,0 -1,-1 -1)", linestring); + + variant_type v1, v2; + + BOOST_MPL_ASSERT(( + boost::is_same + < + typename bg::comparable_distance_result + < + variant_type, variant_type, bg::default_strategy + >::type, + ExpectedResultType + > + )); + + BOOST_MPL_ASSERT(( + boost::is_same + < + typename bg::comparable_distance_result + < + point_type, point_type, bg::default_strategy + >::type, + ExpectedResultType + > + )); + + // Default strategy + v1 = point; + v2 = point; + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, v2), + bg::comparable_distance(point, point), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, point), + bg::comparable_distance(point, point), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(point, v2), + bg::comparable_distance(point, point), + 0.0001); + v1 = point; + v2 = seg; + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, v2), + bg::comparable_distance(point, seg), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, seg), + bg::comparable_distance(point, seg), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(point, v2), + bg::comparable_distance(point, seg), + 0.0001); + v1 = point; + v2 = linestring; + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, v2), + bg::comparable_distance(point, linestring), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, linestring), + bg::comparable_distance(point, linestring), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(point, v2), + bg::comparable_distance(point, linestring), + 0.0001); + } +}; + +template +struct test_variant_with_strategy +{ + static inline void apply() + { + typedef bg::strategy::distance::projected_point strategy_type; + + typedef bg::model::point point_type; + typedef bg::model::segment segment_type; + typedef bg::model::linestring linestring_type; + typedef bg::model::multi_linestring + < + linestring_type + > multi_linestring_type; + typedef boost::variant + < + segment_type, linestring_type, multi_linestring_type + > variant_type; + + segment_type seg; + bg::read_wkt("LINESTRING(1 1,4 4)", seg); + + linestring_type ls; + bg::read_wkt("LINESTRING(-1 -1,-1 0,0 0,0 -1,-1 -1)", ls); + + multi_linestring_type mls; + bg::read_wkt("MULTILINESTRING((10 0,20 0),(30 0,40 0))", mls); + + variant_type v1, v2; + + strategy_type strategy; + + BOOST_MPL_ASSERT(( + boost::is_same + < + typename bg::comparable_distance_result + < + variant_type, variant_type, strategy_type + >::type, + ExpectedResultType + > + )); + + BOOST_MPL_ASSERT(( + boost::is_same + < + typename bg::comparable_distance_result + < + segment_type, linestring_type, strategy_type + >::type, + ExpectedResultType + > + )); + + // Passed strategy + v1 = seg; + v2 = seg; + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, v2, strategy), + bg::comparable_distance(seg, seg, strategy), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, seg, strategy), + bg::comparable_distance(seg, seg, strategy), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(seg, v2, strategy), + bg::comparable_distance(seg, seg, strategy), + 0.0001); + v1 = seg; + v2 = ls; + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, v2, strategy), + bg::comparable_distance(seg, ls, strategy), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, ls, strategy), + bg::comparable_distance(seg, ls, strategy), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(seg, v2, strategy), + bg::comparable_distance(seg, ls, strategy), + 0.0001); + v1 = seg; + v2 = mls; + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, v2, strategy), + bg::comparable_distance(seg, mls, strategy), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, mls, strategy), + bg::comparable_distance(seg, mls, strategy), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(seg, v2, strategy), + bg::comparable_distance(seg, mls, strategy), + 0.0001); + v1 = ls; + v2 = mls; + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, v2, strategy), + bg::comparable_distance(ls, mls, strategy), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(v1, mls, strategy), + bg::comparable_distance(ls, mls, strategy), + 0.0001); + BOOST_CHECK_CLOSE(bg::comparable_distance(ls, v2, strategy), + bg::comparable_distance(ls, mls, strategy), + 0.0001); + } +}; + +template ::value> +struct check_result +{ + template + static inline void apply(T const& value, + ExpectedResult const& expected_value) + { + BOOST_CHECK_EQUAL(value, expected_value); + } +}; + +template +struct check_result +{ + template + static inline void apply(T const& value, + ExpectedResult const& expected_value) + { + BOOST_CHECK_CLOSE(value, expected_value, 0.0001); + } +}; + +template +struct test_variant_boxes +{ + static inline void apply() + { + typedef bg::model::point point_type; + typedef bg::model::box box_type; + typedef boost::variant variant_type; + + box_type box1, box2; + bg::read_wkt("BOX(-1 -1,0 0)", box1); + bg::read_wkt("BOX(1 1,2 2)", box2); + + variant_type v1 = box1, v2 = box2; + + typedef typename boost::mpl::if_c + < + boost::is_float::value, + double, + typename bg::util::detail::default_integral::type + >::type expected_result_type; + + BOOST_MPL_ASSERT(( + boost::is_same + < + typename bg::comparable_distance_result + < + variant_type, variant_type, bg::default_strategy + >::type, + expected_result_type + > + )); + + // Default strategy + check_result::apply(bg::comparable_distance(v1, v2), + bg::comparable_distance(box1, box2)); + check_result::apply(bg::comparable_distance(v1, box2), + bg::comparable_distance(box1, box2)); + check_result::apply(bg::comparable_distance(box1, v2), + bg::comparable_distance(box1, box2)); + } +}; + + +int test_main(int, char* []) +{ + test_double_result_from_integer(); + test_double_result_from_integer(); + + test_all >(); + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + // test variant support + test_variant_different_default_strategy::apply(); + + test_variant_same_default_strategy::apply(); + test_variant_same_default_strategy::apply(); + test_variant_same_default_strategy::apply(); + + test_variant_with_strategy::apply(); + test_variant_with_strategy::apply(); + test_variant_with_strategy::apply(); + test_variant_with_strategy::apply(); +#ifdef HAVE_TTMATH + test_variant_with_strategy::apply(); +#endif + + test_variant_boxes::apply(); + test_variant_boxes::apply(); + test_variant_boxes::apply(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/convert.cpp b/src/boost/libs/geometry/test/algorithms/convert.cpp new file mode 100644 index 000000000..a2758832d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/convert.cpp @@ -0,0 +1,338 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include + + + +template +void test_mixed_point_types() +{ + // Point + test_mixed_identical_result("POINT(1 2)"); + + // Box + test_mixed_identical_result + < + bg::model::box, + bg::model::box + > + ("POLYGON((1 2,1 4,3 4,3 2,1 2))"); + + test_mixed_identical_result + < + bg::model::segment, + bg::model::segment + > + ("LINESTRING(1 1,2 2)"); + + // Linestring + test_mixed_identical_result + < + bg::model::linestring, + bg::model::linestring + > + ("LINESTRING(1 1,2 2)"); + + // Ring + test_mixed_identical_result + < + bg::model::ring, + bg::model::ring + > + ("POLYGON((1 1,2 2,3 0,1 1))"); + + test_mixed_reversible_result + < + bg::model::ring, + bg::model::ring + > + ( + "POLYGON((1 1,2 2,3 0,1 1))", + "POLYGON((1 1,3 0,2 2,1 1))" + ); + + test_mixed + < + bg::model::ring, + bg::model::ring + > + ( + "POLYGON((1 1,2 2,3 0,1 1))", + "POLYGON((1 1,2 2,3 0))", + 3 + ); + + test_mixed + < + bg::model::ring, + bg::model::ring + > + ( + "POLYGON((1 1,2 2,3 0))", + "POLYGON((1 1,2 2,3 0,1 1))", + 4 + ); + + // Polygon + test_mixed_reversible_result + < + bg::model::polygon, + bg::model::polygon + > + ( + "POLYGON((0 0,0 5,5 5,5 0,0 0),(1 1,3 2,2 4,1 1))", + "POLYGON((0 0,5 0,5 5,0 5,0 0),(1 1,2 4,3 2,1 1))" + ); + + test_mixed + < + bg::model::polygon, + bg::model::polygon + > + ( + "POLYGON((0 0,0 5,5 5,5 0,0 0),(1 1,3 2,2 4,1 1))", + "POLYGON((0 0,5 0,5 5,0 5,0 0),(1 1,2 4,3 2,1 1))", + 7 // WKT is closed, polygon is open + ); + // (polygon uses ring, so other tests omitted here) + + // Combinations: + // ring <-> polygon + test_mixed_identical_result + < + bg::model::polygon, + bg::model::ring + > + ("POLYGON((1 1,2 2,3 0,1 1))"); + + test_mixed_reversible_result + < + bg::model::polygon, + bg::model::ring + > + ( + "POLYGON((1 1,2 2,3 0,1 1))", + "POLYGON((1 1,3 0,2 2,1 1))" + ); + + // Any hole will be omitted going from polygon to ring + test_mixed + < + bg::model::polygon, + bg::model::ring + > + ( + "POLYGON((0 0,0 5,5 5,5 0,0 0),(1 1,3 2,2 4,1 1))", + "POLYGON((0 0,0 5,5 5,5 0,0 0))", + 5 + ); + + // point -> box + test_mixed + < + Point1, + bg::model::box + > + ( + "POINT(0 0)", + "POLYGON((0 0,0 0,0 0,0 0,0 0))", + 4 + ); + + // segment -> line + test_mixed + < + bg::model::segment, + bg::model::linestring + > + ( + "LINESTRING(0 0,1 1)", + "LINESTRING(0 0,1 1)", + 2 + ); + + // box -> ring ( <- is NYI) + test_mixed + < + bg::model::box, + bg::model::ring + > + ( + "BOX(0 0,2 2)", + "POLYGON((0 0,0 2,2 2,2 0,0 0))", + 5 + ); + + test_mixed + < + bg::model::box, + bg::model::ring + > + ( + "BOX(0 0,2 2)", + "POLYGON((0 0,2 0,2 2,0 2,0 0))", + 5 + ); + + test_mixed + < + bg::model::box, + bg::model::ring + > + ( + "BOX(0 0,2 2)", + "POLYGON((0 0,0 2,2 2,2 0))", + 4 + ); + + test_mixed + < + bg::model::box, + bg::model::ring + > + ( + "BOX(0 0,2 2)", + "POLYGON((0 0,2 0,2 2,0 2))", + 4 + ); + + // box -> polygon ( <- is NYI) + test_mixed + < + bg::model::box, + bg::model::polygon + > + ( + "BOX(0 0,2 2)", + "POLYGON((0 0,0 2,2 2,2 0,0 0))", + 5 + ); + + test_mixed + < + bg::model::box, + bg::model::polygon + > + ( + "BOX(0 0,2 2)", + "POLYGON((0 0,2 0,2 2,0 2,0 0))", + 5 + ); + + test_mixed + < + bg::model::box, + bg::model::polygon + > + ( + "BOX(0 0,2 2)", + "POLYGON((0 0,0 2,2 2,2 0,0 0))", + 4 // WKT is closed, polygon is open + ); + + test_mixed + < + bg::model::box, + bg::model::polygon + > + ( + "BOX(0 0,2 2)", + "POLYGON((0 0,2 0,2 2,0 2,0 0))", + 4 // WKT is closed, polygon is open + ); +} + +template +void test_mixed_point_types_3d() +{ + // Point + test_mixed_identical_result("POINT(1 2 3)"); + + test_mixed_identical_result + < + bg::model::segment, + bg::model::segment + > + ("LINESTRING(1 2 3,4 5 6)"); + + // Linestring + test_mixed_identical_result + < + bg::model::linestring, + bg::model::linestring + > + ("LINESTRING(1 2 3,4 5 6,7 8 9)"); + + // segment -> line + test_mixed + < + bg::model::segment, + bg::model::linestring + > + ( + "LINESTRING(1 2 3,4 5 6)", + "LINESTRING(1 2 3,4 5 6)", + 2 + ); +} + + + +template +void test_mixed_types() +{ + test_mixed_point_types(); + test_mixed_point_types(); +} + + +template +void test_mixed_types_3d() +{ + test_mixed_point_types_3d(); + test_mixed_point_types_3d(); +} + +void test_array() +{ + int a[2] = {1, 2}; + int b[2]; + bg::convert(a, b); + BOOST_CHECK_EQUAL(b[0], 1); + BOOST_CHECK_EQUAL(b[1], 2); +} + +int test_main(int, char* []) +{ + test_mixed_types + < + bg::model::point, + bg::model::point + >(); + test_mixed_types + < + boost::tuple, + bg::model::point + >(); + test_mixed_types_3d + < + boost::tuple, + bg::model::point + >(); + + test_array(); + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/convert_multi.cpp b/src/boost/libs/geometry/test/algorithms/convert_multi.cpp new file mode 100644 index 000000000..ad24d3d7a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/convert_multi.cpp @@ -0,0 +1,98 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#include + + +template +void test_mixed_point_types() +{ + test_mixed_identical_result + < + bg::model::multi_point, + bg::model::multi_point + > + ("MULTIPOINT((1 1),(2 2),(3 3))"); + + test_mixed_identical_result + < + bg::model::multi_linestring >, + bg::model::multi_linestring > + > + ("MULTILINESTRING((1 1,2 2),(3 3,4 4))"); + + // Single -> multi (always possible) + test_mixed + < + Point1, bg::model::multi_point + > + ( + "POINT(1 1)", + "MULTIPOINT((1 1))", + 1 + ); + test_mixed + < + bg::model::linestring, + bg::model::multi_linestring > + > + ( + "LINESTRING(1 1,2 2)", + "MULTILINESTRING((1 1,2 2))", + 2 + ); + test_mixed + < + bg::model::segment, + bg::model::multi_linestring > + > + ( + "LINESTRING(1 1,2 2)", + "MULTILINESTRING((1 1,2 2))", + 2 + ); + test_mixed + < + bg::model::box, + bg::model::multi_polygon > + > + ( + "BOX(0 0,1 1)", + "MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)))", + 5 + ); + test_mixed + < + bg::model::ring, + bg::model::multi_polygon > + > + ( + "POLYGON((0 0,0 1,1 1,1 0,0 0))", + "MULTIPOLYGON(((0 0,1 0,1 1,0 1,0 0)))", + 5 + ); + + // Multi -> single: should not compile (because multi often have 0 or >1 elements) +} + +template +void test_mixed_types() +{ + test_mixed_point_types(); + test_mixed_point_types(); +} + +int test_main( int , char* [] ) +{ + test_mixed_types + < + bg::model::point, + bg::model::point + >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/convex_hull.cpp b/src/boost/libs/geometry/test/algorithms/convex_hull.cpp new file mode 100644 index 000000000..0ca1bcb7b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/convex_hull.cpp @@ -0,0 +1,89 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2015. +// Modifications copyright (c) 2015 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. + +// 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) + +#include +#include + +#include + +#include +#include + + +template +void test_all() +{ + // from sample linestring + test_geometry >( + "linestring(1.1 1.1, 2.5 2.1, 3.1 3.1, 4.9 1.1, 3.1 1.9)", 5, 4, 3.8); + + // rectangular, with concavity + test_geometry >( + "polygon((1 1, 1 4, 3 4, 3 3, 4 3, 4 4, 5 4, 5 1, 1 1))", + 9, 5, 12.0); + + // from sample polygon, with concavity + test_geometry >( + "polygon((2.0 1.3, 2.4 1.7, 2.8 1.8, 3.4 1.2, 3.7 1.6,3.4 2.0, 4.1 3.0" + ", 5.3 2.6, 5.4 1.2, 4.9 0.8, 2.9 0.7,2.0 1.3))", + 12, 8, 5.245); + + test_geometry >( + "polygon((2.0 1.3, 2.4 1.7, 2.8 1.8, 3.4 1.2, 3.7 1.6,3.4 2.0, 4.1 3.0" + ", 5.3 2.6, 5.4 1.2, 4.9 0.8, 2.9 0.7,2.0 1.3))", + 12, 8, 5.245); + + test_geometry >("box(0 0,2 2)", 4, 5, 4); + + // https://svn.boost.org/trac/boost/ticket/6443 + { + test_geometry >( + "polygon((0 0, 2 0))", // note that this polygon is very invalid + 2, 4, 0, 4); + } + + // degenerated hulls + test_geometry >( + "multipoint(0 0)", + 1, 4, 0, 0); + test_geometry >( + "multipoint(0 0, 2 0)", + 2, 4, 0, 4); + test_geometry >( + "linestring(0 0, 2 0)", + 2, 4, 0, 4); + + test_empty_input >(); + test_empty_input >(); + test_empty_input >(); +} + + +int test_main(int, char* []) +{ + //test_all >(); + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/convex_hull_multi.cpp b/src/boost/libs/geometry/test/algorithms/convex_hull_multi.cpp new file mode 100644 index 000000000..eaf0ddc8d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/convex_hull_multi.cpp @@ -0,0 +1,91 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 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. + +// 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) + +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include + +#include + +#include +#include +#include + + + + +template +void test_all() +{ + typedef bg::model::multi_point

mp; + typedef bg::model::multi_linestring > ml; + typedef bg::model::multi_polygon > mpoly; + + // All points below in upper-points and lower-points + test_geometry("MULTIPOINT((0 0),(5 0),(1 1),(4 1))", 0, 5, 4.0); + test_geometry("MULTIPOINT((0 1),(5 1),(1 0),(4 0))", 0, 5, 4.0); + + // All points in vertical line (this delivers an empty polygon with 3 points and closing point for closed) + test_geometry("MULTIPOINT((1 0),(5 0),(3 0),(4 0),(2 0))", 0, 4, 0.0); + + // One point only + test_geometry("MULTIPOINT((1 0))", 0, 4, 0.0); + + // Problem of 6019, reproduced by the convex hull robustness test: + test_geometry("MULTIPOINT((2 9),(1 3),(9 4),(1 1),(1 0),(7 9),(2 5),(3 7),(3 6),(2 4))", + 0, 6, 48.0); + + // Ticket 6019: + test_geometry("MULTIPOINT((0 53),(0 103),(0 53),(0 3),(0 3),(0 0),(1 0),(1 1),(2 1),(2 0),(2 0),(2 0),(3 0),(3 1),(4 1),(4 0),(5 0),(0 3),(10 3),(10 2),(10 2),(10 2),(5 2),(5 0),(5 0),(55 0),(105 0))", + 0, 4, 5407.5); + // Ticket 6021: + test_geometry("multipoint((0 53), (0 103), (1 53))", 3, 4, 25); + + test_geometry("multipoint((1.1 1.1), (2.5 2.1), (3.1 3.1), (4.9 1.1), (3.1 1.9))", 5, 4, 3.8); + test_geometry("multilinestring((2 4, 3 4, 3 5), (4 3,4 4,5 4))", 6, 5, 3.0); + test_geometry("multipolygon(((1 4,1 6,2 5,3 5,4 6,4 4,1 4)), ((4 2,4 3,6 3,6 2,4 2)))", 12, 7, 14.0); + + test_empty_input(); + test_empty_input(); + test_empty_input(); +} + + +int test_main(int, char* []) +{ + //test_all >(); + //test_all >(); + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/correct.cpp b/src/boost/libs/geometry/test/algorithms/correct.cpp new file mode 100644 index 000000000..154117634 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/correct.cpp @@ -0,0 +1,183 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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. + +// 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) + +#include + +#include + +#include + +#include + +#include +#include +#include +#include + + +// Note: 3D/box test cannot be done using WKT because: +// -> wkt-box does not exist +// -> so it is converted to a ring +// -> ring representation of 3d-box is not supported, nor feasible +// -> so it uses DSV which can represent a box +template +void test_geometry_dsv(std::string const& wkt, std::string const& expected) +{ + Geometry geometry; + + bg::read_wkt(wkt, geometry); + bg::correct(geometry); + + std::ostringstream out; + out << bg::dsv(geometry); + + BOOST_CHECK_EQUAL(out.str(), expected); +} + + + + + + +template +void test_ring_polygon() +{ + // Define clockwise and counter clockwise polygon + std::string cw_ring = "POLYGON((0 0,0 1,1 1,1 0,0 0))"; + std::string ccw_ring = "POLYGON((0 0,1 0,1 1,0 1,0 0))"; + std::string cw_open_ring = "POLYGON((0 0,0 1,1 1,1 0))"; + std::string ccw_open_ring = "POLYGON((0 0,1 0,1 1,0 1))"; + + // already cw_ring + test_geometry >(cw_ring, cw_ring); + + // wrong order + test_geometry >(ccw_ring, cw_ring); + + // ccw-ring, input ccw-ring, already correct + test_geometry >(ccw_ring, ccw_ring); + + // ccw-ring, input cw-ring, corrected + test_geometry >(cw_ring, ccw_ring); + + // open-ring, input ccw-ring, already correct + test_geometry >(cw_open_ring, cw_open_ring); + + // ccw-ring, input cw-ring, corrected + test_geometry >(ccw_open_ring, "POLYGON((0 1,1 1,1 0,0 0))"); + + + + // not closed + test_geometry >( + ccw_open_ring, + cw_ring); + + // counter clockwise, cw_ring + test_geometry >(ccw_ring, ccw_ring); + + test_geometry >(cw_ring, ccw_ring); + + + // polygon: cw_ring + test_geometry >(cw_ring, cw_ring); + // wrong order + test_geometry >( + "POLYGON((0 0,1 0,1 1,0 1,0 0))", + cw_ring); + // wrong order & not closed + test_geometry >( + ccw_open_ring, + cw_ring); + + + std::string cw_holey_polygon = + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,2 1,2 2,1 2,1 1))"; + std::string ccw_holey_polygon = + "POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1,1 2,2 2,2 1,1 1))"; + + // with holes: cw_ring + test_geometry >( + cw_holey_polygon, + cw_holey_polygon); + // wrong order of main + test_geometry >( + "POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1))", + cw_holey_polygon); + // wrong order of hole + test_geometry >( + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 2,2 2,2 1,1 1))", + cw_holey_polygon); + + // wrong order of main and hole + test_geometry >(ccw_holey_polygon, cw_holey_polygon); + + // test the counter-clockwise + test_geometry >( + ccw_holey_polygon, ccw_holey_polygon); + +} + +template +void test_box() +{ + // Boxes. Reference is an open box (because in this test WKT is not + // explicitly closed) + std::string proper_box = "POLYGON((0 0,0 2,2 2,2 0))"; + test_geometry >(proper_box, proper_box); + test_geometry >("BOX(0 0,2 2)", proper_box); + test_geometry >("BOX(2 2,0 0)", proper_box); + test_geometry >("BOX(0 2,2 0)", proper_box); + + // Cubes + typedef bg::model::box > box3d; + std::string proper_3d_dsv_box = "((0, 0, 0), (2, 2, 2))"; + test_geometry_dsv("BOX(0 0 0,2 2 2)", proper_3d_dsv_box); + test_geometry_dsv("BOX(2 2 2,0 0 0)", proper_3d_dsv_box); + test_geometry_dsv("BOX(0 2 2,2 0 0)", proper_3d_dsv_box); + test_geometry_dsv("BOX(2 0 2,0 2 0)", proper_3d_dsv_box); + test_geometry_dsv("BOX(0 0 2,2 2 0)", proper_3d_dsv_box); +} + +template +void test_all() +{ + test_ring_polygon

(); + test_box

(); +} + + +int test_main(int, char* []) +{ + //test_all(); + //test_all(); not yet because cannot be copied, for polygon + //test_all(); + + test_all >(); + test_all >(); + test_all >(); + + test_ring_polygon > >(); + test_ring_polygon > >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/correct_closure.cpp b/src/boost/libs/geometry/test/algorithms/correct_closure.cpp new file mode 100644 index 000000000..6dec6970d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/correct_closure.cpp @@ -0,0 +1,114 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include + +#include + +#include + +#include +#include +#include + +#include +#include +#include + +#include + + +template +void check_geometry(Geometry const& geometry, std::string const& expected) +{ + std::ostringstream out; + out << bg::wkt_manipulator(geometry, false); + BOOST_CHECK_EQUAL(out.str(), expected); +} + +template +void test_geometry(std::string const& wkt, std::string const& expected) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + + // Test tye type + bg::correct_closure(geometry); + check_geometry(geometry, expected); + + // Test varianted type + boost::variant v(geometry); + bg::correct_closure(v); + check_geometry(v, expected); +} + +template +void test_all() +{ + typedef bg::model::ring cw_closed_ring_type; + typedef bg::model::ring cw_open_ring_type; + typedef bg::model::ring ccw_closed_ring_type; + typedef bg::model::ring ccw_open_ring_type; + + // Define clockwise and counter clockwise polygon + std::string cw_ring = "POLYGON((0 0,0 1,1 1,1 0,0 0))"; + std::string cw_open_ring = "POLYGON((0 0,0 1,1 1,1 0))"; + + std::string ccw_ring = "POLYGON((0 0,1 0,1 1,0 1,0 0))"; + std::string ccw_open_ring = "POLYGON((0 0,1 0,1 1,0 1))"; + + // Cases which should be closed or opened + test_geometry(cw_open_ring, cw_ring); + test_geometry(cw_ring, cw_open_ring); + test_geometry(ccw_open_ring, ccw_ring); + test_geometry(ccw_ring, ccw_open_ring); + + // Cases which are incorrect but should still be closed or opened + test_geometry(ccw_open_ring, ccw_ring); + test_geometry(cw_ring, cw_open_ring); + + // Cases where no action is necessary (even if order is incorrect) + test_geometry(cw_ring, cw_ring); + test_geometry(ccw_ring, ccw_ring); + test_geometry(cw_open_ring, cw_open_ring); + test_geometry(ccw_open_ring, ccw_open_ring); + test_geometry(cw_ring, cw_ring); + test_geometry(ccw_ring, ccw_ring); + test_geometry(cw_open_ring, cw_open_ring); + test_geometry(ccw_open_ring, ccw_open_ring); + + // Polygon cases + std::string cw_polygon = + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,2 1,2 2,1 2,1 1))"; + + std::string cw_open_polygon = + "POLYGON((0 0,0 4,4 4,4 0),(1 1,2 1,2 2,1 2))"; + + typedef bg::model::polygon cw_closed_polygon_type; + typedef bg::model::polygon cw_open_polygon_type; + + test_geometry(cw_open_polygon, cw_polygon); + test_geometry(cw_polygon, cw_open_polygon); + + test_geometry(cw_polygon, cw_polygon); + test_geometry(cw_open_polygon, cw_open_polygon); +} + + +int test_main(int, char* []) +{ + test_all >(); + test_all >(); + test_all >(); + + test_all > >(); + test_all > >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/correct_multi.cpp b/src/boost/libs/geometry/test/algorithms/correct_multi.cpp new file mode 100644 index 000000000..be61640cd --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/correct_multi.cpp @@ -0,0 +1,60 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#include + +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + + +template +void test_geometry(std::string const& wkt, std::string const& expected) +{ + Geometry geometry; + + bg::read_wkt(wkt, geometry); + bg::correct(geometry); + + std::ostringstream out; + out << bg::wkt(geometry); + + BOOST_CHECK_EQUAL(out.str(), expected); +} + +template +void test_all() +{ + typedef bg::model::multi_polygon > cw_type; + std::string cw_mp = + "MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)))"; + test_geometry(cw_mp, cw_mp); + + test_geometry("MULTIPOLYGON(((0 0,1 0,1 1,0 1,0 0)))", + cw_mp); +} + +int test_main( int , char* [] ) +{ + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/covered_by/Jamfile b/src/boost/libs/geometry/test/algorithms/covered_by/Jamfile new file mode 100644 index 000000000..0a7b57359 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/covered_by/Jamfile @@ -0,0 +1,23 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2016. +# Modifications copyright (c) 2014-2016, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-covered_by + : + [ run covered_by.cpp : : : : algorithms_covered_by ] + [ run covered_by_multi.cpp : : : : algorithms_covered_by_multi ] + [ run covered_by_sph.cpp : : : : algorithms_covered_by_sph ] + [ run covered_by_sph_geo.cpp : : : : algorithms_covered_by_sph_geo ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/covered_by/covered_by.cpp b/src/boost/libs/geometry/test/algorithms/covered_by/covered_by.cpp new file mode 100644 index 000000000..2052ea58e --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/covered_by/covered_by.cpp @@ -0,0 +1,197 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2015, 2017. +// Modifications copyright (c) 2017 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) + +#include "test_covered_by.hpp" + + +#include +#include + + +template +void test_all() +{ + /* + // trivial case + test_ring

("POINT(1 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", true, false); + + // on border/corner + test_ring

("POINT(0 0)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", false, true); + test_ring

("POINT(0 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", false, true); + + // aligned to segment/vertex + test_ring

("POINT(1 1)", "POLYGON((0 0,0 3,3 3,3 1,2 1,2 0,0 0))", true, false); + test_ring

("POINT(1 1)", "POLYGON((0 0,0 3,4 3,3 1,2 2,2 0,0 0))", true, false); + + // same polygon, but point on border + test_ring

("POINT(3 3)", "POLYGON((0 0,0 3,3 3,3 1,2 1,2 0,0 0))", false, true); + test_ring

("POINT(3 3)", "POLYGON((0 0,0 3,4 3,3 1,2 2,2 0,0 0))", false, true); + + // holes + test_geometry >("POINT(2 2)", + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,3 1,3 3,1 3,1 1))", false); + + */ + + test_geometry("POINT(0 0)", "POINT(0 0)", true); + test_geometry("POINT(0 0)", "POINT(1 1)", false); + + typedef bg::model::multi_point

mpt; + test_geometry("POINT(0 0)", "MULTIPOINT(0 0, 1 1)", true); + test_geometry("MULTIPOINT(0 0, 1 1)", "POINT(1 1)", false); + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTIPOINT(1 1, 2 2)", false); + + typedef bg::model::segment

seg; + test_geometry("POINT(1 1)", "LINESTRING(0 0, 2 2)", true); + test_geometry("POINT(0 0)", "LINESTRING(0 0, 1 1)", true); + test_geometry("POINT(1 0)", "LINESTRING(0 0, 1 1)", false); + + // linestrings + typedef bg::model::linestring

ls; + test_geometry("POINT(0 0)", "LINESTRING(0 0,1 1,2 2)", true); + test_geometry("POINT(3 3)", "LINESTRING(0 0,1 1,2 2)", false); + test_geometry("POINT(1 1)", "LINESTRING(0 0,2 2,3 3)", true); + + // multi_linestrings + typedef bg::model::multi_linestring mls; + test_geometry("POINT(0 0)", "MULTILINESTRING((0 0,1 1,2 2),(0 0,0 1))", true); + test_geometry("POINT(0 0)", "MULTILINESTRING((0 0,1 1,2 2),(0 0,0 1),(0 0,1 0))", true); + + // multi_point/segment + typedef bg::model::multi_point

mpt; + test_geometry("MULTIPOINT(0 0, 1 1)", "LINESTRING(0 0, 2 2)", true); + + // multi_point/linestring + test_geometry("MULTIPOINT(0 0, 2 2)", "LINESTRING(0 0, 2 2)", true); + test_geometry("MULTIPOINT(1 1, 3 3)", "LINESTRING(0 0, 2 2)", false); + + // multi_point/multi_linestring + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 3))", true); + test_geometry("MULTIPOINT(0 0, 2 2)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 3))", true); + test_geometry("MULTIPOINT(0 0, 3 3)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 3))", true); + test_geometry("MULTIPOINT(1 1, 4 4)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 3))", false); + + // point/A + typedef bg::model::ring

ring; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + test_geometry("POINT(1 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", true); + test_geometry("POINT(1 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", true); + test_geometry("POINT(1 1)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)),((2 2,2 3,3 3,3 2,2 2)))", true); + + // multi_point/A + test_geometry("MULTIPOINT(0 0, 1 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", true); + test_geometry("MULTIPOINT(0 0, 2 2)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", true); + test_geometry("MULTIPOINT(1 1, 3 3)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", false); + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)),((2 2,2 3,3 3,3 2,2 2)))", true); + test_geometry("MULTIPOINT(0 0, 2 2)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)),((2 2,2 3,3 3,3 2,2 2)))", true); + test_geometry("MULTIPOINT(0 0, 3 3)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)),((2 2,2 3,3 3,3 2,2 2)))", true); + test_geometry("MULTIPOINT(1 1, 4 4)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)),((2 2,2 3,3 3,3 2,2 2)))", false); + + typedef bg::model::box

box_type; + + test_geometry("POINT(1 1)", "BOX(0 0,2 2)", true); + test_geometry("POINT(0 0)", "BOX(0 0,2 2)", true); + test_geometry("POINT(2 2)", "BOX(0 0,2 2)", true); + test_geometry("POINT(0 1)", "BOX(0 0,2 2)", true); + test_geometry("POINT(1 0)", "BOX(0 0,2 2)", true); + test_geometry("POINT(3 3)", "BOX(0 0,2 2)", false); + + test_geometry("BOX(1 1,2 2)", "BOX(0 0,3 3)", true); + test_geometry("BOX(0 0,3 3)", "BOX(1 1,2 2)", false); + test_geometry("BOX(0 0,2 2)", "BOX(0 0,3 3)", true); + test_geometry("BOX(1 1,3 3)", "BOX(0 0,3 3)", true); + test_geometry("BOX(1 2,3 3)", "BOX(0 0,3 3)", true); + test_geometry("BOX(1 1,4 3)", "BOX(0 0,3 3)", false); +} + + +void test_3d() +{ + typedef boost::geometry::model::point point_type; + typedef boost::geometry::model::box box_type; + box_type box(point_type(0, 0, 0), point_type(4, 4, 4)); + BOOST_CHECK_EQUAL(bg::covered_by(point_type(2, 2, 2), box), true); + BOOST_CHECK_EQUAL(bg::covered_by(point_type(2, 4, 2), box), true); + BOOST_CHECK_EQUAL(bg::covered_by(point_type(2, 2, 4), box), true); + BOOST_CHECK_EQUAL(bg::covered_by(point_type(2, 2, 5), box), false); +} + +template +void test_mixed_of() +{ + typedef boost::geometry::model::polygon polygon_type1; + typedef boost::geometry::model::polygon polygon_type2; + typedef boost::geometry::model::box box_type1; + typedef boost::geometry::model::box box_type2; + + polygon_type1 poly1; + polygon_type2 poly2; + boost::geometry::read_wkt("POLYGON((0 0,0 5,5 5,5 0,0 0))", poly1); + boost::geometry::read_wkt("POLYGON((0 0,0 5,5 5,5 0,0 0))", poly2); + + box_type1 box1(P1(1, 1), P1(4, 4)); + box_type2 box2(P2(0, 0), P2(5, 5)); + P1 p1(3, 3); + P2 p2(3, 3); + + BOOST_CHECK_EQUAL(bg::covered_by(p1, poly2), true); + BOOST_CHECK_EQUAL(bg::covered_by(p2, poly1), true); + BOOST_CHECK_EQUAL(bg::covered_by(p2, box1), true); + BOOST_CHECK_EQUAL(bg::covered_by(p1, box2), true); + BOOST_CHECK_EQUAL(bg::covered_by(box1, box2), true); + BOOST_CHECK_EQUAL(bg::covered_by(box2, box1), false); +} + + +void test_mixed() +{ + // Mixing point types and coordinate types + test_mixed_of + < + boost::geometry::model::d2::point_xy, + boost::geometry::model::point + >(); + test_mixed_of + < + boost::geometry::model::d2::point_xy, + boost::geometry::model::point + >(); + test_mixed_of + < + boost::geometry::model::d2::point_xy, + boost::geometry::model::d2::point_xy + >(); +} + + +int test_main( int , char* [] ) +{ + test_all >(); + test_all >(); + + //test_spherical > >(); + + test_mixed(); + test_3d(); + + +#if defined(HAVE_TTMATH) + test_all >(); + test_eps >(); + //test_spherical > >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/covered_by/covered_by_multi.cpp b/src/boost/libs/geometry/test/algorithms/covered_by/covered_by_multi.cpp new file mode 100644 index 000000000..720e72716 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/covered_by/covered_by_multi.cpp @@ -0,0 +1,56 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#include + +#include +#include + +#include + +#include + +#include +#include + +#include + +#include "test_covered_by.hpp" + + +template +void test_all() +{ + typedef bg::model::multi_polygon > mp; + + // test multi-with-one-polygon (trivial case) + test_geometry("POINT(1 1)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", true); + test_geometry("POINT(3 3)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", false); + test_geometry("POINT(0 1)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", true); + test_geometry("POINT(4 4)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", false); + + // test if it is in one of them + std::string multi("MULTIPOLYGON(" + "((0 0,0 2,2 2,2 0,0 0))" + "((3 3,3 6,6 6,6 3,3 3))" + ")"); + test_geometry("POINT(4 4)", multi, true); + test_geometry("POINT(1 1)", multi, true); + test_geometry("POINT(0 1)", multi, true); +} + +int test_main( int , char* [] ) +{ + //test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/covered_by/covered_by_sph.cpp b/src/boost/libs/geometry/test/algorithms/covered_by/covered_by_sph.cpp new file mode 100644 index 000000000..a80fb2390 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/covered_by/covered_by_sph.cpp @@ -0,0 +1,320 @@ +// Boost.Geometry + +// Copyright (c) 2016 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) + +#include "test_covered_by.hpp" + +#include +#include + +#include + + +template +void test_polygon_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + + test_geometry(case_1[0], case_1[1], + false); + test_geometry(case_1[0], case_1[1], + false); + + test_geometry(case_1[0], case_1[1], + false); + test_geometry(case_2[0], case_2[1], + false); + test_geometry(case_3_sph[0], case_3_sph[1], + true); + test_geometry(case_3_2_sph[0], case_3_2_sph[1], + true); + test_geometry(case_4[0], case_4[1], + false); + test_geometry(case_5[0], case_5[1], + false); + test_geometry(case_6_sph[0], case_6_sph[1], + false); + test_geometry(case_6_sph[1], case_6_sph[0], + true); + + test_geometry(case_7[0], case_7[1], + false); + test_geometry(case_8_sph[0], case_8_sph[1], + false); + test_geometry(case_9_sph[0], case_9_sph[1], + false); + test_geometry(case_10_sph[0], case_10_sph[1], + false); + test_geometry(case_11_sph[0], case_11_sph[1], + false); + test_geometry(case_11_sph[1], case_11_sph[0], + true); + test_geometry(case_12[0], case_12[1], + false); + + test_geometry(case_13_sph[0], case_13_sph[1], + false); + test_geometry(case_14_sph[0], case_14_sph[1], + false); + test_geometry(case_15_sph[0], case_15_sph[1], + false); + test_geometry(case_16_sph[0], case_16_sph[1], + false); + test_geometry(case_17_sph[0], case_17_sph[1], + false); + test_geometry(case_17_sph[1], case_17_sph[0], + true); + test_geometry(case_18_sph[0], case_18_sph[1], + false); + test_geometry(case_18_sph[1], case_18_sph[0], + true); +} + +template +void test_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_1[0], case_multi_2[0], + false); + test_geometry(case_2[0], case_multi_2[0], + false); +} + +template +void test_multi_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_multi_2[0], case_multi_2[1], + false); +} + +template +void test_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::polygon

ring; + + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(0 0,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_geometry("LINESTRING(5 0,5 5,10 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_geometry("LINESTRING(5 1,5 5,9 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_geometry("LINESTRING(11 1,11 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + true); + + test_geometry("LINESTRING(9 1,10 5,9 9,1 9,1 1,9 1)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + true); + + test_geometry("LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + true); +} + +template +void test_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("LINESTRING(10 1,10 5,10 9)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)))", + true); +} + +template +void test_multi_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((11 11, 20 20),(5 7, 4 1))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2))", + false); + + test_geometry("MULTILINESTRING((6 6,15 15),(0 0, 7 7))", + "POLYGON((5 5,5 15,15 15,15 5,5 5))", + false); + + test_geometry("MULTILINESTRING((3 10.031432746397092, 1 5, 1 10.013467818052765, 3 4, 7 8, 6 10.035925377760330, 10 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + true); +} + +template +void test_multi_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_linestring mls; + typedef bg::model::multi_polygon mpoly; + + test_geometry("MULTILINESTRING((0 0,10 0,10 10,0 10,0 0),(2 2,5 5,2 8,2 2))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(2 2,5 5,2 8,2 2)))", + true); + + test_geometry("MULTILINESTRING((0 0,10 0,10 10),(10 10,0 10,0 0),(20 20,50 50,20 80,20 20))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + false); + + test_geometry("MULTILINESTRING((5 -2,4 -2,5 0),(5 -2,6 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + true); +} + +template +void test_linestring_linestring() +{ + typedef bg::model::linestring

ls; + + test_geometry("LINESTRING(0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", true); + + test_geometry("LINESTRING(1 0,2 2,2 3)", "LINESTRING(0 0, 2 2, 3 2)", false); +} + +template +void test_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("LINESTRING(0 0,10 0)", + "MULTILINESTRING((1 0,2 0),(1 1,2 1))", + false); + + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,0 5,0 0),(0 0,5 0,5 5))", + true); +} + +template +void test_multi_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0))", + false); +} + +template +void test_point_polygon() +{ + typedef bg::model::polygon

poly; + + // https://svn.boost.org/trac/boost/ticket/9162 + test_geometry("POINT(0 90)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(-120 21)", + "POLYGON((30 0,30 30,90 30, 90 0, 30 0))", + false); + // extended + test_geometry("POINT(0 90)", + "POLYGON((0 80, 0 81, -90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(0 90)", + "POLYGON((0 80, -90 80, -90 81, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(0 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(-180 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(0 -90)", + "POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))", + true); + test_geometry("POINT(0 -89)", + "POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))", + true); + test_geometry("POINT(1 -90)", + "POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))", + true); + test_geometry("POINT(1 -89)", + "POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))", + true); + test_geometry("POINT(1 90)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(1 90)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + + + + // MySQL report 08.2017 + test_geometry("POINT(-179 0)", + "POLYGON((0 0, 0 2, 2 0, 0 -2, 0 0))", + false); + // extended + test_geometry("POINT(179 0)", + "POLYGON((0 0, 0 2, 2 0, 0 -2, 0 0))", + false); + test_geometry("POINT(180 0)", + "POLYGON((0 0, 0 2, 2 0, 0 -2, 0 0))", + false); + test_geometry("POINT(-179 0)", + "POLYGON((-10 -10, -10 10, 10 10, 10 -10, -10 10))", + false); + test_geometry("POINT(179 0)", + "POLYGON((-10 -10, -10 10, 10 10, 10 -10, -10 10))", + false); + test_geometry("POINT(-179 0)", + "POLYGON((0 0, 0 1, 1 0, 0 -1, 0 0))", + false); + test_geometry("POINT(179 0)", + "POLYGON((0 0, 0 1, 1 0, 0 -1, 0 0))", + false); +} + + +template +void test_all() +{ + test_polygon_polygon

(); + test_polygon_multi_polygon

(); + test_multi_polygon_multi_polygon

(); + + test_linestring_polygon

(); + test_linestring_multi_polygon

(); + test_multi_linestring_polygon

(); + test_multi_linestring_multi_polygon

(); + + test_linestring_linestring

(); + test_linestring_multi_linestring

(); + test_multi_linestring_multi_linestring

(); + + test_point_polygon

(); +} + + +int test_main( int , char* [] ) +{ + test_all > >(); + +#if defined(HAVE_TTMATH) + test_cs > >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/covered_by/covered_by_sph_geo.cpp b/src/boost/libs/geometry/test/algorithms/covered_by/covered_by_sph_geo.cpp new file mode 100644 index 000000000..6c8d5853b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/covered_by/covered_by_sph_geo.cpp @@ -0,0 +1,132 @@ +// Boost.Geometry + +// Copyright (c) 2016 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) + +#include "test_covered_by.hpp" + + +#include + + +template +void test_point_box() +{ + typedef bg::model::box

box_t; + + test_geometry("POINT(0 0)", "BOX(0 0, 1 1)", true); + test_geometry("POINT(1 1)", "BOX(0 0, 2 2)", true); + + test_geometry("POINT(180 1)", "BOX(170 0, 190 2)", true); + test_geometry("POINT(-180 1)", "BOX(170 0, 190 2)", true); + test_geometry("POINT(180 1)", "BOX(170 0, 180 2)", true); + test_geometry("POINT(-180 1)", "BOX(170 0, 180 2)", true); + test_geometry("POINT(179 1)", "BOX(170 0, 190 2)", true); + test_geometry("POINT(-179 1)", "BOX(170 0, 190 2)", true); + test_geometry("POINT(179 1)", "BOX(170 0, 180 2)", true); + test_geometry("POINT(-179 1)", "BOX(170 0, 180 2)", false); + test_geometry("POINT(169 1)", "BOX(170 0, 180 2)", false); + + // https://svn.boost.org/trac/boost/ticket/12412 + test_geometry("POINT(-0.127592 51.7)", "BOX(-2.08882 51.5034, -0.127592 51.9074)", true); + // and related + test_geometry("POINT(-2.08882 51.7)", "BOX(-2.08882 51.5034, -0.127592 51.9074)", true); + test_geometry("POINT(0.127592 51.7)", "BOX(0.127592 51.5034, 2.08882 51.9074)", true); + test_geometry("POINT(2.08882 51.7)", "BOX(0.127592 51.5034, 2.08882 51.9074)", true); + + test_geometry("POINT(179.08882 1)", "BOX(179.08882 0, 538.127592 2)", true); + test_geometry("POINT(178.127592 1)", "BOX(179.08882 0, 538.127592 2)", true); + test_geometry("POINT(179.08882 1)", "BOX(179.08882 0, 182.127592 2)", true); + test_geometry("POINT(-177.872408 1)", "BOX(179.08882 0, 182.127592 2)", true); +} + +template +void test_box_box() +{ + typedef bg::model::box

box_t; + + test_geometry("BOX(0 0, 1 1)", "BOX(0 0, 1 1)", true); + + test_geometry("BOX(-170 0,-160 1)", "BOX(-180 0, 180 1)", true); + test_geometry("BOX(-170 0,-160 1)", "BOX(170 0, 200 1)", true); + test_geometry("BOX(-170 0,-150 1)", "BOX(170 0, 200 1)", false); + test_geometry("BOX(0 0,1 1)", "BOX(170 0, 370 1)", true); + test_geometry("BOX(0 0,10 1)", "BOX(170 0, 370 1)", true); + test_geometry("BOX(-180 0,10 1)", "BOX(170 0, 370 1)", true); + test_geometry("BOX(-180 0,20 1)", "BOX(170 0, 370 1)", false); + test_geometry("BOX(10 0,20 1)", "BOX(170 0, 370 1)", false); + test_geometry("BOX(160 0,180 1)", "BOX(170 0, 370 1)", false); + + test_geometry("BOX(-180 0,-170 1)", "BOX(180 0, 190 1)", true); // invalid? + test_geometry("BOX(-180 0,-170 1)", "BOX(180 0, 191 1)", true); // invalid? + test_geometry("BOX(-180 0,-170 1)", "BOX(179 0, 190 1)", true); + test_geometry("BOX(-180 0,-170 1)", "BOX(181 0, 190 1)", false); // invalid? + test_geometry("BOX(-180 0,-170 1)", "BOX(180 0, 189 1)", false); // invalid? + + // Related to https://svn.boost.org/trac/boost/ticket/12412 + test_geometry("BOX(-1.346346 51.6, -0.127592 51.7)", "BOX(-2.08882 51.5034, -0.127592 51.9074)", true); + test_geometry("BOX(-2.08882 51.6, -1.346346 51.7)", "BOX(-2.08882 51.5034, -0.127592 51.9074)", true); + test_geometry("BOX(0.127592 51.6, 1.346346 51.7)", "BOX(0.127592 51.5034, 2.08882 51.9074)", true); + test_geometry("BOX(1.346346 51.6, 2.08882 51.7)", "BOX(0.127592 51.5034, 2.08882 51.9074)", true); + + test_geometry("BOX(179.08882 1, 180.0 1)", "BOX(179.08882 0, 538.127592 2)", true); + test_geometry("BOX(177.0 1, 178.127592 1)", "BOX(179.08882 0, 538.127592 2)", true); + test_geometry("BOX(179.08882 1, 179.9 1)", "BOX(179.08882 0, 182.127592 2)", true); + test_geometry("BOX(-179.9 1, -177.872408 1)", "BOX(179.08882 0, 182.127592 2)", true); +} + +template +void test_point_polygon() +{ + typename boost::mpl::if_ + < + boost::is_same::type, bg::geographic_tag>, + bg::strategy::within::geographic_winding

, + bg::strategy::within::spherical_winding

+ >::type s; + + typedef bg::model::polygon

poly; + + // MySQL report 08.2017 + test_geometry("POINT(-179 0)", + "POLYGON((0 0, 0 2, 2 0, 0 -2, 0 0))", + false); + test_geometry("POINT(-179 0)", + "POLYGON((0 0, 0 2, 2 0, 0 -2, 0 0))", + false, + s); + + test_geometry("POINT(1 0)", + "POLYGON((0 0, 0 2, 2 0, 0 -2, 0 0))", + true); + test_geometry("POINT(1 0)", + "POLYGON((0 0, 0 2, 2 0, 0 -2, 0 0))", + true, + s); +} + +template +void test_cs() +{ + test_point_box

(); + test_box_box

(); + test_point_polygon

(); +} + + +int test_main( int , char* [] ) +{ + test_cs > >(); + test_cs > >(); + +#if defined(HAVE_TTMATH) + test_cs > >(); + test_cs > >();; +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/covered_by/test_covered_by.hpp b/src/boost/libs/geometry/test/algorithms/covered_by/test_covered_by.hpp new file mode 100644 index 000000000..e22ed03fd --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/covered_by/test_covered_by.hpp @@ -0,0 +1,184 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. + +// 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 + +// 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) + + +#ifndef BOOST_GEOMETRY_TEST_COVERED_BY_HPP +#define BOOST_GEOMETRY_TEST_COVERED_BY_HPP + + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +struct no_strategy {}; + +template +bool call_covered_by(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) +{ + return bg::covered_by(geometry1, geometry2, strategy); +} + +template +bool call_covered_by(Geometry1 const& geometry1, + Geometry2 const& geometry2, + no_strategy) +{ + return bg::covered_by(geometry1, geometry2); +} + +template +void check_geometry(Geometry1 const& geometry1, + Geometry2 const& geometry2, + std::string const& wkt1, + std::string const& wkt2, + bool expected, + Strategy const& strategy) +{ + bool detected = call_covered_by(geometry1, geometry2, strategy); + + BOOST_CHECK_MESSAGE(detected == expected, + "covered_by: " << wkt1 + << " in " << wkt2 + << " -> Expected: " << expected + << " detected: " << detected); +} + +template +void test_geometry(std::string const& wkt1, + std::string const& wkt2, bool expected) +{ + Geometry1 geometry1; + Geometry2 geometry2; + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); + boost::variant v1(geometry1); + boost::variant v2(geometry2); + + typedef typename bg::strategy::covered_by::services::default_strategy + < + Geometry1, Geometry2 + >::type strategy_type; + + check_geometry(geometry1, geometry2, wkt1, wkt2, expected, no_strategy()); + check_geometry(geometry1, geometry2, wkt1, wkt2, expected, strategy_type()); + check_geometry(v1, geometry2, wkt1, wkt2, expected, no_strategy()); + check_geometry(geometry1, v2, wkt1, wkt2, expected, no_strategy()); + check_geometry(v1, v2, wkt1, wkt2, expected, no_strategy()); +} + +template +void test_geometry(std::string const& wkt1, + std::string const& wkt2, + bool expected, + Strategy const& strategy) +{ + Geometry1 geometry1; + Geometry2 geometry2; + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); + + check_geometry(geometry1, geometry2, wkt1, wkt2, expected, strategy); +} + +/* + +template +void test_ordered_ring(std::string const& wkt_point, + std::string const& wkt_geometry, bool expected) +{ + typedef bg::model::ring ring_type; + ring_type ring; + Point point; + + bg::read_wkt(wkt_geometry, ring); + if (! Clockwise) + { + std::reverse(boost::begin(ring), boost::end(ring)); + } + if (! Closed) + { + ring.resize(ring.size() - 1); + } + + bg::read_wkt(wkt_point, point); + + bool detected = bg::covered_by(point, ring); + + BOOST_CHECK_MESSAGE(detected == expected, + "covered_by: " << wkt_point + << " in " << wkt_geometry + << " -> Expected: " << expected + << " detected: " << detected + << " clockwise: " << int(Clockwise) + << " closed: " << int(Closed) + ); + + // other strategy (note that this one cannot detect OnBorder + // (without modifications) + + bg::strategy::covered_by::franklin franklin; + detected = bg::covered_by(point, ring, franklin); + if (! on_border) + { + BOOST_CHECK_MESSAGE(detected == expected, + "covered_by: " << wkt_point + << " in " << wkt_geometry + << " -> Expected: " << expected + << " detected: " << detected + << " clockwise: " << int(Clockwise) + << " closed: " << int(Closed) + ); + } + + + bg::strategy::covered_by::crossings_multiply cm; + detected = bg::covered_by(point, ring, cm); + if (! on_border) + { + BOOST_CHECK_MESSAGE(detected == expected, + "covered_by: " << wkt_point + << " in " << wkt_geometry + << " -> Expected: " << expected + << " detected: " << detected + << " clockwise: " << int(Clockwise) + << " closed: " << int(Closed) + ); + } +} + +template +void test_ring(std::string const& wkt_point, + std::string const& wkt_geometry, + bool expected) +{ + test_ordered_ring(wkt_point, wkt_geometry, expected); + test_ordered_ring(wkt_point, wkt_geometry, expected); + test_ordered_ring(wkt_point, wkt_geometry, expected); + test_ordered_ring(wkt_point, wkt_geometry, expected); + test_geometry >(wkt_point, wkt_geometry, expected); +} +*/ + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/crosses/Jamfile b/src/boost/libs/geometry/test/algorithms/crosses/Jamfile new file mode 100644 index 000000000..d1d924f30 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/crosses/Jamfile @@ -0,0 +1,21 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2016. +# Modifications copyright (c) 2014-2016, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-crosses + : + [ run crosses.cpp : : : : algorithms_crosses ] + [ run crosses_sph.cpp : : : : algorithms_crosses_sph ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/crosses/crosses.cpp b/src/boost/libs/geometry/test/algorithms/crosses/crosses.cpp new file mode 100644 index 000000000..21ed78d12 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/crosses/crosses.cpp @@ -0,0 +1,107 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2014, 2017. +// Modifications copyright (c) 2014-2017 Oracle and/or its affiliates. + +// 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) + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +#include "test_crosses.hpp" + +template +void test_pl() +{ + typedef bg::model::multi_point

mpt; + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTIPOINT(1 0,1 1)", "LINESTRING(0 0,1 0,3 3)", true); + test_geometry("MULTIPOINT(0 0,1 1)", "LINESTRING(0 0,1 0,3 3)", false); + test_geometry("MULTIPOINT(0 0,1 1)", "LINESTRING(0 0,1 1,3 3)", false); + + test_geometry("MULTIPOINT(0 0,3 0)", "MULTILINESTRING((0 0,0 1,1 1),(1 1,1 0,0 0))", true); + test_geometry("MULTIPOINT(0 0,1 1)", "MULTILINESTRING((0 0,0 1,1 1),(1 1,1 0,0 0))", false); +} + +template +void test_pa() +{ + typedef bg::model::multi_point

mpt; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("MULTIPOINT(1 1,6 6)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); + test_geometry("MULTIPOINT(0 0,6 6)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); + test_geometry("MULTIPOINT(0 0,1 1)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); + + test_geometry("MULTIPOINT(0 0,1 1)", "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 9,9 9,9 5,5 5)))", false); + test_geometry("MULTIPOINT(1 1,1 6)", "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 9,9 9,9 5,5 5)))", true); +} + +template +void test_ll() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("LINESTRING(0 0,2 2,4 4)", "LINESTRING(0 1,2 1,3 1)", true); + test_geometry("LINESTRING(0 0,2 2)", "LINESTRING(0 1,2 1)", true); + test_geometry("LINESTRING(0 0,2 2,4 4)", "LINESTRING(0 1,1 1,2 2,3 2)", false); + + test_geometry("LINESTRING(0 0,2 2,4 4)", "MULTILINESTRING((0 1,4 1),(0 2,4 2))", true); + test_geometry("MULTILINESTRING((0 1,4 1),(0 2,4 2))", "LINESTRING(0 0,2 2,4 4)", true); + + test_geometry("MULTILINESTRING((0 0,2 2,4 4),(3 0,3 4))", "MULTILINESTRING((0 1,4 1),(0 2,4 2))", true); + + // spike - boundary and interior on the same point + test_geometry("LINESTRING(3 7, 8 8, 2 6)", "LINESTRING(5 7, 10 7, 0 7)", true); +} + +template +void test_la() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + typedef bg::model::ring

ring; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("LINESTRING(0 0, 10 10)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); + test_geometry("LINESTRING(0 0, 10 10)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); + test_geometry("LINESTRING(0 0, 10 10)", "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))", true); + + test_geometry("LINESTRING(0 0, 10 0)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); + test_geometry("LINESTRING(1 1, 5 5)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); + + test_geometry("MULTILINESTRING((1 1, 5 5),(6 6,7 7))", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); + test_geometry("MULTILINESTRING((1 1, 5 5),(6 6,7 7))", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); + test_geometry("MULTILINESTRING((1 1, 5 5),(6 6,7 7))", "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))", true); +} + +template +void test_2d() +{ + test_pl

(); + test_pa

(); + test_ll

(); + test_la

(); +} + +int test_main( int , char* [] ) +{ + test_2d >(); + test_2d >(); + +#if defined(HAVE_TTMATH) + test_2d >(); +#endif + + //test_3d >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/crosses/crosses_sph.cpp b/src/boost/libs/geometry/test/algorithms/crosses/crosses_sph.cpp new file mode 100644 index 000000000..93657eb38 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/crosses/crosses_sph.cpp @@ -0,0 +1,119 @@ +// Boost.Geometry + +// Copyright (c) 2016 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) + +#include "test_crosses.hpp" + +#include +#include + +#include + + +template +void test_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::polygon

ring; + + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(0 0,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(5 0,5 5,10 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(5 1,5 5,9 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(11 1,11 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + false); + + test_geometry("LINESTRING(9 1,10 5,9 9,1 9,1 1,9 1)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + false); + + test_geometry("LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + false); +} + +template +void test_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("LINESTRING(10 1,10 5,10 9)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)))", + false); +} + +template +void test_multi_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((11 11, 20 20),(5 7, 4 1))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2))", + true); + + test_geometry("MULTILINESTRING((6 6,15 15),(0 0, 7 7))", + "POLYGON((5 5,5 15,15 15,15 5,5 5))", + true); + + test_geometry("MULTILINESTRING((3 10.031432746397092, 1 5, 1 10.013467818052765, 3 4, 7 8, 6 10.035925377760330, 10 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + false); +} + +template +void test_multi_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_linestring mls; + typedef bg::model::multi_polygon mpoly; + + test_geometry("MULTILINESTRING((0 0,10 0,10 10,0 10,0 0),(2 2,5 5,2 8,2 2))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(2 2,5 5,2 8,2 2)))", + false); + + test_geometry("MULTILINESTRING((0 0,10 0,10 10),(10 10,0 10,0 0),(20 20,50 50,20 80,20 20))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + false); + + test_geometry("MULTILINESTRING((5 -2,4 -2,5 0),(5 -2,6 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + false); +} + + +template +void test_all() +{ + test_linestring_polygon

(); + test_linestring_multi_polygon

(); + test_multi_linestring_polygon

(); + test_multi_linestring_multi_polygon

(); +} + + +int test_main( int , char* [] ) +{ + test_all > >(); + +#if defined(HAVE_TTMATH) + test_cs > >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/crosses/test_crosses.hpp b/src/boost/libs/geometry/test/algorithms/crosses/test_crosses.hpp new file mode 100644 index 000000000..10d4e55d0 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/crosses/test_crosses.hpp @@ -0,0 +1,110 @@ +// Generic Geometry2 Library +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2014, 2017. +// Modifications copyright (c) 2014-2017 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) + +#ifndef BOOST_GEOMETRY_TEST_CROSSES_HPP +#define BOOST_GEOMETRY_TEST_CROSSES_HPP + + +#include + +#include +#include +#include +#include +#include + +#include +#include + + +struct no_strategy {}; + +template +bool call_crosses(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) +{ + return bg::crosses(geometry1, geometry2, strategy); +} + +template +bool call_crosses(Geometry1 const& geometry1, + Geometry2 const& geometry2, + no_strategy) +{ + return bg::crosses(geometry1, geometry2); +} + +template +void test_geometry(std::string const& wkt1, + std::string const& wkt2, bool expected) +{ + Geometry1 geometry1; + Geometry2 geometry2; + + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); + + bool detected = call_crosses(geometry1, geometry2, no_strategy()); + + BOOST_CHECK_MESSAGE(detected == expected, + "crosses: " << wkt1 + << " with " << wkt2 + << " -> Expected: " << expected + << " detected: " << detected); + + typedef typename bg::strategy::relate::services::default_strategy + < + Geometry1, Geometry2 + >::type strategy_type; + + detected = call_crosses(geometry1, geometry2, strategy_type()); + + BOOST_CHECK_MESSAGE(detected == expected, + "crosses: " << wkt1 + << " with " << wkt2 + << " -> Expected: " << expected + << " detected: " << detected); + +#if !defined(BOOST_GEOMETRY_TEST_DEBUG) + detected = bg::crosses(geometry1, + boost::variant(geometry2)); + + BOOST_CHECK_MESSAGE(detected == expected, + "crosses: " << wkt1 + << " with " << wkt2 + << " -> Expected: " << expected + << " detected: " << detected); + + detected = bg::crosses(boost::variant(geometry1), + geometry2); + + BOOST_CHECK_MESSAGE(detected == expected, + "crosses: " << wkt1 + << " with " << wkt2 + << " -> Expected: " << expected + << " detected: " << detected); + + detected = bg::crosses(boost::variant(geometry1), + boost::variant(geometry2)); + + BOOST_CHECK_MESSAGE(detected == expected, + "crosses: " << wkt1 + << " with " << wkt2 + << " -> Expected: " << expected + << " detected: " << detected); +#endif +} + + +#endif // BOOST_GEOMETRY_TEST_CROSSES_HPP diff --git a/src/boost/libs/geometry/test/algorithms/densify.cpp b/src/boost/libs/geometry/test/algorithms/densify.cpp new file mode 100644 index 000000000..bf723bbc1 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/densify.cpp @@ -0,0 +1,227 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017-2018, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#include + +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + + +struct check_lengths +{ + template + void operator()(G const& g, G const& o, S const& s) const + { + double d1 = bg::length(g, s); + double d2 = bg::length(o, s); + + BOOST_CHECK_CLOSE(d1, d2, 0.0001); + } +}; + +struct check_perimeters +{ + template + void operator()(G const& g, G const& o, S const& s) const + { + double d1 = bg::perimeter(g, s); + double d2 = bg::perimeter(o, s); + + BOOST_CHECK_CLOSE(d1, d2, 0.0001); + } +}; + +template +double inline shortest_length(G const& g, DistS const& dist_s) +{ + double min_len = (std::numeric_limits::max)(); + for (bg::segment_iterator it = bg::segments_begin(g); + it != bg::segments_end(g); ++it) + { + double len = bg::length(*it, dist_s); + min_len = (std::min)(min_len, len); + } + return min_len; +} + +template +double inline greatest_length(G const& o, DistS const& dist_s) +{ + double max_len = 0.0; + for (bg::segment_iterator it = bg::segments_begin(o); + it != bg::segments_end(o); ++it) + { + double len = bg::length(*it, dist_s); + max_len = (std::max)(max_len, len); + } + return max_len; +} + +template ::type> +struct cs_data +{}; + +template +struct cs_data +{ + bg::strategy::densify::cartesian<> compl_s; + bg::strategy::distance::pythagoras<> dist_s; +}; + +template +struct cs_data +{ + cs_data() + : model(6378137.0) + , compl_s(model) + , dist_s(6378137.0) + {} + + bg::srs::sphere model; + bg::strategy::densify::spherical<> compl_s; + bg::strategy::distance::haversine dist_s; +}; + +template +struct cs_data +{ + cs_data() + : model(6378137.0, 6356752.3142451793) + , compl_s(model) + , dist_s(model) + {} + + bg::srs::spheroid model; + bg::strategy::densify::geographic<> compl_s; + bg::strategy::distance::geographic<> dist_s; +}; + +template +inline void check_result(G const& g, G const& o, double max_distance, + DistS const& dist_s, Check const& check) +{ + // geometry was indeed densified + std::size_t g_count = bg::num_points(g); + std::size_t o_count = bg::num_points(o); + BOOST_CHECK(g_count < o_count); + + // all segments have lengths smaller or equal to max_distance + double gr_len = greatest_length(o, dist_s); + // NOTE: Currently geographic strategies can generate segments that have + // lengths slightly greater than max_distance. In order to change + // this the generation of new points should e.g. be recursive with + // stop condition comparing the current distance calculated by + // inverse strategy. + // NOTE: Closeness value tweaked for Andoyer + bool is_close = (gr_len - max_distance) / (std::max)(gr_len, max_distance) < 0.0001; + BOOST_CHECK(gr_len <= max_distance || is_close); + + // the overall length or perimeter didn't change + check(g, o, dist_s); +} + +template +inline void test_geometry(std::string const& wkt, Check const& check) +{ + cs_data d; + + G g; + bg::read_wkt(wkt, g); + + { + bg::default_strategy def_s; + double max_distance = shortest_length(g, def_s) / 3.0; + + G o; + bg::densify(g, o, max_distance); + + check_result(g, o, max_distance, def_s, check); + } + + { + double max_distance = shortest_length(g, d.dist_s) / 3.0; + + G o; + bg::densify(g, o, max_distance, d.compl_s); + + check_result(g, o, max_distance, d.dist_s, check); + } +} + +template +inline void test_linear(std::string const& wkt) +{ + test_geometry(wkt, check_lengths()); +} + +template +inline void test_areal(std::string const& wkt) +{ + test_geometry(wkt, check_perimeters()); +} + +template +void test_all() +{ + typedef bg::model::linestring

ls_t; + typedef bg::model::multi_linestring mls_t; + + typedef bg::model::ring

ring_t; + typedef bg::model::polygon

poly_t; + typedef bg::model::multi_polygon mpoly_t; + + typedef bg::model::ring oring_t; + typedef bg::model::polygon opoly_t; + typedef bg::model::multi_polygon ompoly_t; + + test_linear("LINESTRING(4 -4, 4 -1)"); + test_linear("LINESTRING(4 4, 4 1)"); + test_linear("LINESTRING(0 0, 180 0)"); + test_linear("LINESTRING(1 1, -179 -1)"); + + test_linear("LINESTRING(1 1, 2 2, 4 2)"); + test_linear("MULTILINESTRING((1 1, 2 2),(2 2, 4 2))"); + + test_areal("POLYGON((1 1, 1 2, 2 2, 1 1))"); + test_areal("POLYGON((1 1, 1 4, 4 4, 4 1, 1 1),(1 1, 2 2, 2 3, 1 1))"); + test_areal("MULTIPOLYGON(((1 1, 1 4, 4 4, 4 1, 1 1),(1 1, 2 2, 2 3, 1 1)),((4 4, 5 5, 5 4, 4 4)))"); + + test_areal("POLYGON((1 1, 1 2, 2 2))"); + test_areal("POLYGON((1 1, 1 4, 4 4, 4 1),(1 1, 2 2, 2 3))"); + test_areal("MULTIPOLYGON(((1 1, 1 4, 4 4, 4 1),(1 1, 2 2, 2 3)),((4 4, 5 5, 5 4)))"); + + test_areal("POLYGON((0 0,0 40,40 40,40 0,0 0))"); + test_areal("POLYGON((0 0,0 40,40 40,40 0))"); +} + +int test_main(int, char* []) +{ + test_all< bg::model::point >(); + test_all< bg::model::point > >(); + test_all< bg::model::point > >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/detail/Jamfile b/src/boost/libs/geometry/test/algorithms/detail/Jamfile new file mode 100644 index 000000000..5f55a45db --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/detail/Jamfile @@ -0,0 +1,24 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2015, 2019. +# Modifications copyright (c) 2015, 2019 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) + +test-suite boost-geometry-algorithms-detail + : + [ run as_range.cpp : : : : algorithms_as_range ] + [ run calculate_point_order.cpp : : : : algorithms_calculate_point_order ] + [ run partition.cpp : : : : algorithms_partition ] + [ run tupled_output.cpp : : : : algorithms_tupled_output ] + ; + +build-project sections ; diff --git a/src/boost/libs/geometry/test/algorithms/detail/as_range.cpp b/src/boost/libs/geometry/test/algorithms/detail/as_range.cpp new file mode 100644 index 000000000..dd6aabf28 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/detail/as_range.cpp @@ -0,0 +1,79 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include + + +#include +#include + +#include +#include + +#include + +template +double sum(Range const& range) +{ + double s = 0.0; + for (typename boost::range_const_iterator::type it = boost::begin(range); + it != boost::end(range); ++it) + { + s += bg::get(*it); + } + return s; +} + +template +void test_geometry(std::string const& wkt, double expected_x, double expected_y) +{ + G geometry; + + // Declare a range-type, compatible with boost::range, + // such that range_iterator etc could be called + typedef typename bg::detail::range_type::type range_type; + + bg::read_wkt(wkt, geometry); + + double s = sum<0>(bg::detail::as_range(geometry)); + BOOST_CHECK_CLOSE(s, expected_x, 0.001); + + s = sum<1>(bg::detail::as_range(geometry)); + BOOST_CHECK_CLOSE(s, expected_y, 0.001); +} + + +template +void test_all() +{ + // As-range utility should consider a geometry as a range, so + // linestring stays linestring + test_geometry >("LINESTRING(1 2,3 4)", 4, 6); + + // polygon will only be outer-ring + test_geometry >("POLYGON((1 2,3 4))", 4, 6); + test_geometry >("POLYGON((1 2,3 4),(5 6,7 8,9 10))", 4, 6); + + // the utility is useful for: + // - convex hull (holes do not count) + // - envelope (idem) +} + +int test_main(int, char* []) +{ + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/detail/calculate_point_order.cpp b/src/boost/libs/geometry/test/algorithms/detail/calculate_point_order.cpp new file mode 100644 index 000000000..45ae3380b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/detail/calculate_point_order.cpp @@ -0,0 +1,148 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#include + +#include + +#include +#include + +#include + +#include +#include +#include + + +inline const char * order_str(bg::order_selector o) +{ + if (o == bg::clockwise) + return "clockwise"; + else if (o == bg::counterclockwise) + return "counterclockwise"; + else + return "order_undetermined"; +} + +inline const char * cs_str(bg::cartesian_tag) +{ + return "cartesian"; +} + +inline const char * cs_str(bg::spherical_equatorial_tag) +{ + return "spherical_equatorial"; +} + +inline const char * cs_str(bg::geographic_tag) +{ + return "geographic"; +} + +template +inline void test_one(Ring const& ring, bg::order_selector expected) +{ + typedef typename bg::cs_tag::type cs_tag; + + bg::order_selector result = bg::detail::calculate_point_order(ring); + + BOOST_CHECK_MESSAGE(result == expected, "Expected: " << order_str(expected) << " for " << bg::wkt(ring) << " in " << cs_str(cs_tag())); + + if (expected != bg::order_undetermined && result != bg::order_undetermined) + { + Ring ring_rev = ring; + + std::reverse(boost::begin(ring_rev), boost::end(ring_rev)); + + bg::order_selector result_rev = bg::detail::calculate_point_order(ring_rev); + + BOOST_CHECK_MESSAGE(result != result_rev, "Invalid order of reversed: " << bg::wkt(ring) << " in " << cs_str(cs_tag())); + } +} + +template +inline void test_one(std::string const& ring_wkt, bg::order_selector expected) +{ + //typedef typename bg::cs_tag

::type cs_tag; + + bg::model::ring

ring; + bg::read_wkt(ring_wkt, ring); + + std::size_t n = boost::size(ring); + for (size_t i = 1; i < n; ++i) + { + test_one(ring, expected); + std::rotate(boost::begin(ring), boost::begin(ring) + 1, boost::end(ring)); + + // it seems that area method doesn't work for invalid "opened" polygons + //if (! boost::is_same::value) + { + P p = bg::range::front(ring); + bg::range::push_back(ring, p); + } + } +} + +template +void test_all() +{ + // From correct() test, rings rotated and reversed in test_one() + test_one

("POLYGON((0 0,0 1,1 1,1 0,0 0))", bg::clockwise); + test_one

("POLYGON((0 0,0 1,1 1,1 0))", bg::clockwise); + test_one

("POLYGON((0 0,0 4,4 4,4 0,0 0))", bg::clockwise); + test_one

("POLYGON((1 1,2 1,2 2,1 2,1 1))", bg::counterclockwise); + + test_one

("POLYGON((0 5, 5 5, 5 0, 0 0, 0 5))", bg::clockwise); + test_one

("POLYGON((0 5, 0 5, 0 6, 0 6, 0 4, 0 5, 5 5, 5 0, 0 0, 0 6, 0 5))", bg::clockwise); + test_one

("POLYGON((2 0, 2 1, 2 -1, 2 0, 1 0, 1 -1, 0 -1, 0 1, 1 1, 1 0, 2 0))", bg::clockwise); + test_one

("POLYGON((2 0, 2 1, 2 -1, 2 0, 1 0, 1 -1, 0 -1, 0 1, 1 1, 1 0))", bg::clockwise); + test_one

("POLYGON((2 0, 2 1, 3 1, 3 -1, 2 -1, 2 0, 1 0, 1 -1, 0 -1, 0 1, 1 1, 1 0, 2 0))", bg::clockwise); + test_one

("POLYGON((0 85, 5 85, 5 84, 0 84, 0 85))", bg::clockwise); + test_one

("POLYGON((0 2, 170 2, 170 0, 0 0, 0 2))", bg::clockwise); + test_one

("POLYGON((0 2, 170 2, 170 1, 160 1, 10 1, 0 1, 0 2))", bg::clockwise); + test_one

("POLYGON((0 2, 170 2, 170 -2, 0 -2, 0 2))", bg::clockwise); + test_one

("POLYGON((5 5, 6 5, 6 6, 6 4, 6 5, 5 5, 5 4, 4 4, 4 6, 5 6, 5 5))", bg::clockwise); + test_one

("POLYGON((5 5, 6 5, 6 6, 6 4, 6 5, 5 5, 5 6, 4 6, 4 4, 5 4, 5 5))", bg::counterclockwise); + test_one

("POLYGON((5 5, 6 5, 6 5, 6 6, 6 5, 6 4, 6 5, 6 5, 5 5, 5 4, 4 4, 4 6, 5 6, 5 5))", bg::clockwise); + + // https://github.com/boostorg/geometry/pull/554 + test_one

("POLYGON((9.8591674311151110 54.602813224425063, 9.8591651519791412 54.602359676428932, 9.8584586199249316 54.602359676428932, 9.8591674311151110 54.602813224425063))", + bg::clockwise); +} + +template +void test_cartesian() +{ + test_one

("POLYGON((0 5, 1 5, 1 6, 1 4, 2 4, 0 4, 0 3, 0 5))", bg::clockwise); +} + +template +void test_spheroidal() +{ + test_one

("POLYGON((0 5, 1 5, 1 6, 1 4, 0 4, 0 3, 0 5))", bg::clockwise); + + test_one

("POLYGON((0 45, 120 45, -120 45, 0 45))", bg::counterclockwise); +} + +int test_main(int, char* []) +{ + test_all >(); + test_all > >(); + test_all > >(); + + test_cartesian >(); + + test_spheroidal > >(); + test_spheroidal > >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/detail/partition.cpp b/src/boost/libs/geometry/test/algorithms/detail/partition.cpp new file mode 100644 index 000000000..9d63668d8 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/detail/partition.cpp @@ -0,0 +1,675 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. +// +// This file was modified by Oracle on 2017, 2018. +// Modifications copyright (c) 2017-2018 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) + +#include + +#include + + +#include +#include +#include +#include + +#include + +#include + +#if defined(TEST_WITH_SVG) +# include +#endif + +#include +#include +#include +#include + + +template +struct box_item +{ + int id; + Box box; + box_item(int i = 0, std::string const& wkt = "") + : id(i) + { + if (! wkt.empty()) + { + bg::read_wkt(wkt, box); + } + } +}; + + +struct get_box +{ + template + static inline void apply(Box& total, InputItem const& item) + { + bg::expand(total, item.box); + } +}; + +struct ovelaps_box +{ + template + static inline bool apply(Box const& box, InputItem const& item) + { + typename bg::strategy::disjoint::services::default_strategy + < + Box, Box + >::type strategy; + + return ! bg::detail::disjoint::disjoint_box_box(box, item.box, strategy); + } +}; + + +template +struct box_visitor +{ + int count; + typename bg::default_area_result::type area; + + box_visitor() + : count(0) + , area(0) + {} + + template + inline bool apply(Item const& item1, Item const& item2) + { + if (bg::intersects(item1.box, item2.box)) + { + Box b; + bg::intersection(item1.box, item2.box, b); + area += bg::area(b); + count++; + } + return true; + } +}; + +struct point_in_box_visitor +{ + int count; + + point_in_box_visitor() + : count(0) + {} + + template + inline bool apply(Point const& point, BoxItem const& box_item) + { + if (bg::within(point, box_item.box)) + { + count++; + } + return true; + } +}; + +struct reversed_point_in_box_visitor +{ + int count; + + reversed_point_in_box_visitor() + : count(0) + {} + + template + inline bool apply(BoxItem const& box_item, Point const& point) + { + if (bg::within(point, box_item.box)) + { + count++; + } + return true; + } +}; + + + +template +void test_boxes(std::string const& wkt_box_list, double expected_area, int expected_count) +{ + std::vector wkt_boxes; + + boost::split(wkt_boxes, wkt_box_list, boost::is_any_of(";"), boost::token_compress_on); + + typedef box_item sample; + std::vector boxes; + + int index = 1; + BOOST_FOREACH(std::string const& wkt, wkt_boxes) + { + boxes.push_back(sample(index++, wkt)); + } + + box_visitor visitor; + bg::partition + < + Box + >::apply(boxes, visitor, get_box(), ovelaps_box(), 1); + + BOOST_CHECK_CLOSE(visitor.area, expected_area, 0.001); + BOOST_CHECK_EQUAL(visitor.count, expected_count); +} + + + +struct point_item +{ + point_item() + : id(0) + {} + + int id; + double x; + double y; +}; + +BOOST_GEOMETRY_REGISTER_POINT_2D(point_item, double, cs::cartesian, x, y) + + +struct get_point +{ + template + static inline void apply(Box& total, InputItem const& item) + { + bg::expand(total, item); + } +}; + +struct ovelaps_point +{ + template + static inline bool apply(Box const& box, InputItem const& item) + { + return ! bg::disjoint(item, box); + } +}; + + +struct point_visitor +{ + int count; + + point_visitor() + : count(0) + {} + + template + inline bool apply(Item const& item1, Item const& item2) + { + if (bg::equals(item1, item2)) + { + count++; + } + return true; + } +}; + + + +void test_points(std::string const& wkt1, std::string const& wkt2, int expected_count) +{ + bg::model::multi_point mp1, mp2; + bg::read_wkt(wkt1, mp1); + bg::read_wkt(wkt2, mp2); + + int id = 1; + BOOST_FOREACH(point_item& p, mp1) + { p.id = id++; } + id = 1; + BOOST_FOREACH(point_item& p, mp2) + { p.id = id++; } + + point_visitor visitor; + bg::partition + < + bg::model::box + >::apply(mp1, mp2, visitor, get_point(), ovelaps_point(), + get_point(), ovelaps_point(), 1); + + BOOST_CHECK_EQUAL(visitor.count, expected_count); +} + + + +template +void test_all() +{ + typedef bg::model::box

box; + + test_boxes( + // 1 2 3 4 5 6 7 + "box(0 0,1 1); box(0 0,2 2); box(9 9,10 10); box(8 8,9 9); box(4 4,6 6); box(2 4,6 8); box(7 1,8 2)", + 5, // Area(Intersection(1,2)) + A(I(5,6)) + 3); + + test_boxes( + "box(0 0,10 10); box(4 4,6 6); box(3 3,7 7)", + 4 + 16 + 4, // A(I(1,2)) + A(I(1,3)) + A(I(2,3)) + 3); + + test_boxes( + "box(0 2,10 3); box(3 1,4 5); box(7 1,8 5)", + 1 + 1, // A(I(1,2)) + A(I(1,3)) + 2); + + test_points("multipoint((1 1))", "multipoint((1 1))", 1); + test_points("multipoint((0 0),(1 1),(7 3),(10 10))", "multipoint((1 1),(2 2),(7 3))", 2); + +} + +//------------------- higher volumes + +#if defined(TEST_WITH_SVG) +template +struct svg_visitor +{ + SvgMapper& m_mapper; + + svg_visitor(SvgMapper& mapper) + : m_mapper(mapper) + {} + + template + inline void apply(Box const& box, int level) + { + /* + std::string color("rgb(64,64,64)"); + switch(level) + { + case 0 : color = "rgb(255,0,0)"; break; + case 1 : color = "rgb(0,255,0)"; break; + case 2 : color = "rgb(0,0,255)"; break; + case 3 : color = "rgb(255,255,0)"; break; + case 4 : color = "rgb(255,0,255)"; break; + case 5 : color = "rgb(0,255,255)"; break; + case 6 : color = "rgb(255,128,0)"; break; + case 7 : color = "rgb(0,128,255)"; break; + } + std::ostringstream style; + style << "fill:none;stroke-width:" << (5.0 - level / 2.0) << ";stroke:" << color << ";"; + m_mapper.map(box, style.str()); + */ + m_mapper.map(box, "fill:none;stroke-width:2;stroke:rgb(0,0,0);"); + + } +}; +#endif + + +template +void fill_points(Collection& collection, int seed, int size, int count) +{ + typedef boost::minstd_rand base_generator_type; + + base_generator_type generator(seed); + + boost::uniform_int<> random_coordinate(0, size - 1); + boost::variate_generator > + coordinate_generator(generator, random_coordinate); + + std::set > included; + + int n = 0; + for (int i = 0; n < count && i < count*count; i++) + { + int x = coordinate_generator(); + int y = coordinate_generator(); + std::pair pair = std::make_pair(x, y); + if (included.find(pair) == included.end()) + { + included.insert(pair); + typename boost::range_value::type item; + item.x = x; + item.y = y; + collection.push_back(item); + n++; + } + } +} + +void test_many_points(int seed, int size, int count) +{ + bg::model::multi_point mp1, mp2; + + fill_points(mp1, seed, size, count); + fill_points(mp2, seed * 2, size, count); + + // Test equality in quadratic loop + int expected_count = 0; + BOOST_FOREACH(point_item const& item1, mp1) + { + BOOST_FOREACH(point_item const& item2, mp2) + { + if (bg::equals(item1, item2)) + { + expected_count++; + } + } + } + +#if defined(TEST_WITH_SVG) + std::ostringstream filename; + filename << "partition" << seed << ".svg"; + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 800, 800); + + { + point_item p; + p.x = -1; p.y = -1; mapper.add(p); + p.x = size + 1; p.y = size + 1; mapper.add(p); + } + + typedef svg_visitor > box_visitor_type; + box_visitor_type box_visitor(mapper); +#else + typedef bg::detail::partition::visit_no_policy box_visitor_type; + box_visitor_type box_visitor; +#endif + + point_visitor visitor; + bg::partition + < + bg::model::box, + bg::detail::partition::include_all_policy, + bg::detail::partition::include_all_policy + >::apply(mp1, mp2, visitor, get_point(), ovelaps_point(), + get_point(), ovelaps_point(), 2, box_visitor); + + BOOST_CHECK_EQUAL(visitor.count, expected_count); + +#if defined(TEST_WITH_SVG) + BOOST_FOREACH(point_item const& item, mp1) + { + mapper.map(item, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1", 8); + } + BOOST_FOREACH(point_item const& item, mp2) + { + mapper.map(item, "fill:rgb(0,128,255);stroke:rgb(0,0,100);stroke-width:1", 4); + } +#endif +} + +template +void fill_boxes(Collection& collection, int seed, int size, int count) +{ + typedef boost::minstd_rand base_generator_type; + + base_generator_type generator(seed); + + boost::uniform_int<> random_coordinate(0, size * 10 - 1); + boost::variate_generator > + coordinate_generator(generator, random_coordinate); + + int n = 0; + for (int i = 0; n < count && i < count*count; i++) + { + int w = coordinate_generator() % 30; + int h = coordinate_generator() % 30; + if (w > 0 && h > 0) + { + int x = coordinate_generator(); + int y = coordinate_generator(); + if (x + w < size * 10 && y + h < size * 10) + { + typename boost::range_value::type item(n+1); + bg::assign_values(item.box, x / 10.0, y / 10.0, (x + w) / 10.0, (y + h) / 10.0); + collection.push_back(item); + n++; + } + } + } +} + +void test_many_boxes(int seed, int size, int count) +{ + typedef bg::model::box box_type; + std::vector > boxes; + + fill_boxes(boxes, seed, size, count); + + // Test equality in quadratic loop + int expected_count = 0; + double expected_area = 0.0; + BOOST_FOREACH(box_item const& item1, boxes) + { + BOOST_FOREACH(box_item const& item2, boxes) + { + if (item1.id < item2.id) + { + if (bg::intersects(item1.box, item2.box)) + { + box_type b; + bg::intersection(item1.box, item2.box, b); + expected_area += bg::area(b); + expected_count++; + } + } + } + } + + +#if defined(TEST_WITH_SVG) + std::ostringstream filename; + filename << "partition_box_" << seed << ".svg"; + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 800, 800); + + { + point_item p; + p.x = -1; p.y = -1; mapper.add(p); + p.x = size + 1; p.y = size + 1; mapper.add(p); + } + + BOOST_FOREACH(box_item const& item, boxes) + { + mapper.map(item.box, "opacity:0.6;fill:rgb(50,50,210);stroke:rgb(0,0,0);stroke-width:1"); + } + + typedef svg_visitor > partition_box_visitor_type; + partition_box_visitor_type partition_box_visitor(mapper); + +#else + typedef bg::detail::partition::visit_no_policy partition_box_visitor_type; + partition_box_visitor_type partition_box_visitor; +#endif + + box_visitor visitor; + bg::partition + < + box_type, + bg::detail::partition::include_all_policy, + bg::detail::partition::include_all_policy + >::apply(boxes, visitor, get_box(), ovelaps_box(), + 2, partition_box_visitor); + + BOOST_CHECK_EQUAL(visitor.count, expected_count); + BOOST_CHECK_CLOSE(visitor.area, expected_area, 0.001); +} + +void test_two_collections(int seed1, int seed2, int size, int count) +{ + typedef bg::model::box box_type; + std::vector > boxes1, boxes2; + + fill_boxes(boxes1, seed1, size, count); + fill_boxes(boxes2, seed2, size, count); + + // Get expectations in quadratic loop + int expected_count = 0; + double expected_area = 0.0; + BOOST_FOREACH(box_item const& item1, boxes1) + { + BOOST_FOREACH(box_item const& item2, boxes2) + { + if (bg::intersects(item1.box, item2.box)) + { + box_type b; + bg::intersection(item1.box, item2.box, b); + expected_area += bg::area(b); + expected_count++; + } + } + } + + +#if defined(TEST_WITH_SVG) + std::ostringstream filename; + filename << "partition_boxes_" << seed1 << "_" << seed2 << ".svg"; + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 800, 800); + + { + point_item p; + p.x = -1; p.y = -1; mapper.add(p); + p.x = size + 1; p.y = size + 1; mapper.add(p); + } + + BOOST_FOREACH(box_item const& item, boxes1) + { + mapper.map(item.box, "opacity:0.6;fill:rgb(50,50,210);stroke:rgb(0,0,0);stroke-width:1"); + } + BOOST_FOREACH(box_item const& item, boxes2) + { + mapper.map(item.box, "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:1"); + } + + typedef svg_visitor > partition_box_visitor_type; + partition_box_visitor_type partition_box_visitor(mapper); +#else + typedef bg::detail::partition::visit_no_policy partition_box_visitor_type; + partition_box_visitor_type partition_box_visitor; +#endif + + box_visitor visitor; + bg::partition + < + box_type, + bg::detail::partition::include_all_policy, + bg::detail::partition::include_all_policy + >::apply(boxes1, boxes2, visitor, get_box(), ovelaps_box(), + get_box(), ovelaps_box(), 2, partition_box_visitor); + + BOOST_CHECK_EQUAL(visitor.count, expected_count); + BOOST_CHECK_CLOSE(visitor.area, expected_area, 0.001); +} + + +void test_heterogenuous_collections(int seed1, int seed2, int size, int count) +{ + typedef bg::model::box box_type; + std::vector points; + std::vector > boxes; + + fill_points(points, seed1, size, count); + fill_boxes(boxes, seed2, size, count); + + // Get expectations in quadratic loop + int expected_count = 0; + BOOST_FOREACH(point_item const& point, points) + { + BOOST_FOREACH(box_item const& box_item, boxes) + { + if (bg::within(point, box_item.box)) + { + expected_count++; + } + } + } + + +#if defined(TEST_WITH_SVG) + std::ostringstream filename; + filename << "partition_heterogeneous_" << seed1 << "_" << seed2 << ".svg"; + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 800, 800); + + { + point_item p; + p.x = -1; p.y = -1; mapper.add(p); + p.x = size + 1; p.y = size + 1; mapper.add(p); + } + + BOOST_FOREACH(point_item const& point, points) + { + mapper.map(point, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1", 8); + } + BOOST_FOREACH(box_item const& item, boxes) + { + mapper.map(item.box, "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:1"); + } + + typedef svg_visitor > partition_box_visitor_type; + partition_box_visitor_type partition_box_visitor(mapper); +#else + typedef bg::detail::partition::visit_no_policy partition_box_visitor_type; + partition_box_visitor_type partition_box_visitor; +#endif + + point_in_box_visitor visitor1; + bg::partition + < + box_type, + bg::detail::partition::include_all_policy, + bg::detail::partition::include_all_policy + >::apply(points, boxes, visitor1, get_point(), ovelaps_point(), + get_box(), ovelaps_box(), 2, partition_box_visitor); + + reversed_point_in_box_visitor visitor2; + bg::partition + < + box_type, + bg::detail::partition::include_all_policy, + bg::detail::partition::include_all_policy + >::apply(boxes, points, visitor2, get_box(), ovelaps_box(), + get_point(), ovelaps_point(), 2, partition_box_visitor); + + BOOST_CHECK_EQUAL(visitor1.count, expected_count); + BOOST_CHECK_EQUAL(visitor2.count, expected_count); +} + +int test_main( int , char* [] ) +{ + test_all >(); + + test_many_points(12345, 20, 40); + test_many_points(54321, 20, 60); + test_many_points(67890, 20, 80); + test_many_points(98765, 20, 100); + for (int i = 1; i < 10; i++) + { + test_many_points(i, 30, i * 20); + } + + test_many_boxes(12345, 20, 40); + for (int i = 1; i < 10; i++) + { + test_many_boxes(i, 20, i * 10); + } + + test_two_collections(12345, 54321, 20, 40); + test_two_collections(67890, 98765, 20, 60); + + test_heterogenuous_collections(67890, 98765, 20, 60); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/detail/sections/Jamfile b/src/boost/libs/geometry/test/algorithms/detail/sections/Jamfile new file mode 100644 index 000000000..ff2d3e1e1 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/detail/sections/Jamfile @@ -0,0 +1,20 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2015. +# Modifications copyright (c) 2015 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) + +test-suite boost-geometry-algorithms-detail-sections + : + [ run sectionalize.cpp : : : : algorithms_sectionalize ] + [ run range_by_section.cpp : : : : algorithms_range_by_section ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/detail/sections/range_by_section.cpp b/src/boost/libs/geometry/test/algorithms/detail/sections/range_by_section.cpp new file mode 100644 index 000000000..1263ba5ed --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/detail/sections/range_by_section.cpp @@ -0,0 +1,105 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#define BOOST_GEOMETRY_UNIT_TEST_SECTIONALIZE + +#include + +#include +#include +#include +#include +#include +#include +#include + + +template +void test_sectionalize(std::string const /*caseid*/, Geometry const& geometry, std::size_t section_count) +{ + typedef typename bg::point_type::type point; + typedef bg::model::box box; + typedef bg::sections sections; + + typedef boost::mpl::vector_c dim2; + + sections s; + bg::sectionalize(geometry, bg::detail::no_rescale_policy(), s); + + BOOST_CHECK_EQUAL(s.size(), section_count); + + typedef typename bg::closeable_view + < + typename bg::detail::range_type::type const, + bg::closure::value + >::type cview_type; + typedef typename bg::reversible_view + < + cview_type const, + Reverse ? bg::iterate_reverse : bg::iterate_forward + >::type view_type; + typedef typename boost::range_iterator + < + view_type const + >::type range_iterator; + + BOOST_FOREACH(typename sections::value_type const& sec, s) + { + cview_type cview(bg::range_by_section(geometry, sec)); + view_type view(cview); + range_iterator it1 = boost::begin(view) + sec.begin_index; + range_iterator it2 = boost::begin(view) + sec.end_index; + int count = 0; + for (range_iterator it = it1; it != it2; ++it) + { + count++; + } + BOOST_CHECK_EQUAL(int(sec.count), count); + } +} + +template +void test_sectionalize(std::string const& caseid, std::string const& wkt, + std::size_t count1) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + if ( BOOST_GEOMETRY_CONDITION( bg::closure::value == bg::open ) ) + { + geometry.outer().resize(geometry.outer().size() - 1); + } + //bg::correct(geometry); + test_sectionalize<1, Reverse>(caseid + "_d1", geometry, count1); +} + +template +void test_all() +{ + std::string const first = "polygon((2.0 1.3, 2.4 1.7, 2.8 1.8, 3.4 1.2, 3.7 1.6,3.4 2.0, 4.1 3.0, 5.3 2.6, 5.4 1.2, 4.9 0.8, 2.9 0.7,2.0 1.3))"; + test_sectionalize, false>("first", first, 4); + + test_sectionalize, true>("first_reverse", + first, 4); + + test_sectionalize, false>("first_open", + first, 4); + + test_sectionalize, true>("first_open_reverse", + first, 4); +} + +int test_main(int, char* []) +{ + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/detail/sections/sectionalize.cpp b/src/boost/libs/geometry/test/algorithms/detail/sections/sectionalize.cpp new file mode 100644 index 000000000..dd4050bf0 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/detail/sections/sectionalize.cpp @@ -0,0 +1,363 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + + +#include + +#if defined(TEST_WITH_SVG) +# include +# include +# include +#endif + +template +void test_sectionalize_part() +{ + typedef typename bg::point_type::type point_type; + typedef bg::model::box box_type; + + typedef bg::sections sections_type; + typedef typename boost::range_value::type section_type; + + typedef boost::mpl::vector_c dimension_list; + + typedef bg::detail::sectionalize::sectionalize_part + < + point_type, dimension_list + > sectionalize_part; + + sections_type sections; + section_type section; + + + Geometry geometry; + geometry.push_back(bg::make(1, 1)); + + bg::detail::no_rescale_policy rescale_policy; + + bg::ring_identifier ring_id; + sectionalize_part::apply(sections, geometry.begin(), geometry.end(), rescale_policy, ring_id, 10); + // There should not yet be anything generated, because it is only ONE point + + geometry.push_back(bg::make(2, 2)); + sectionalize_part::apply(sections, geometry.begin(), geometry.end(), rescale_policy, ring_id, 10); +} + + +template +void test_sectionalize(std::string const& caseid, G const& g, std::size_t section_count, + std::string const& index_check, std::string const& dir_check, + std::size_t max_count = 10) +{ + boost::ignore_unused(caseid); + + static const std::size_t dimension_count = boost::mpl::size::value; + + + typedef typename bg::point_type::type point; + typedef bg::model::box box; + typedef bg::sections sections; + + sections s; + bg::sectionalize(g, + bg::detail::no_rescale_policy(), s, 0, max_count); + + BOOST_CHECK_EQUAL(s.size(), section_count); + + // Check if sections are consecutive and consistent + int previous_index = -1; + BOOST_FOREACH(typename sections::value_type const& sec, s) + { + if (sec.begin_index > 0) + { + BOOST_CHECK_EQUAL(previous_index, sec.begin_index); + } + BOOST_CHECK_EQUAL(int(sec.count), int(sec.end_index - sec.begin_index)); + previous_index = sec.end_index; + } + + // Output streams for sections, boxes, other + std::ostringstream out_sections; + std::ostringstream out_boxes; + std::ostringstream out_dirs; + + + for (typename sections::size_type i = 0; i < s.size(); i++) + { + box const& b = s[i].bounding_box; + + if (i > 0) + { + out_sections << "|"; + out_dirs << "|"; + out_boxes << "|"; + } + + out_sections << s[i].begin_index << ".." << s[i].end_index; + out_boxes << bg::get<0,0>(b) << " " << bg::get<0,1>(b) + << ".." << bg::get<1,0>(b) << " " << bg::get<1,1>(b); + for (std::size_t d = 0; d < dimension_count; d++) + { + out_dirs << (d == 0 ? "" : " "); + switch(s[i].directions[d]) + { + case -99: out_dirs << "DUP"; break; + case -1 : out_dirs << "-"; break; + case 0 : out_dirs << "."; break; + case +1 : out_dirs << "+"; break; + } + } + } + + if (! index_check.empty()) + { + BOOST_CHECK_EQUAL(out_sections.str(), index_check); + } + if (! dir_check.empty()) + { + BOOST_CHECK_EQUAL(out_dirs.str(), dir_check); + } + +#if defined(TEST_WITH_SVG) + { + std::ostringstream filename; + filename << "sectionalize_" + << caseid << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + typedef typename bg::point_type::type point_type; + bg::svg_mapper mapper(svg, 500, 500); + + mapper.add(g); + + static const bool is_line = bg::geometry_id::type::value == 2; + mapper.map(g, is_line + ? "opacity:0.6;stroke:rgb(0,0,255);stroke-width:5" + : "opacity:0.6;fill:rgb(0,0,255);stroke:rgb(0,0,0);stroke-width:0.5"); + + + for (typename sections::size_type i = 0; i < s.size(); i++) + { + box b = s[i].bounding_box; + bg::buffer(b, b, 0.01); + mapper.map(b, s[i].duplicate + ? "fill-opacity:0.4;stroke-opacity:0.6;fill:rgb(0,128,0);stroke:rgb(0,255,0);stroke-width:2.0" + : "fill-opacity:0.2;stroke-opacity:0.4;fill:rgb(255,0,0);stroke:rgb(255,0,0);stroke-width:0.5"); + + std::ostringstream out; + + for (int d = 0; d < dimension_count; d++) + { + out << (d == 0 ? "[" : " "); + switch(s[i].directions[d]) + { + case -99: out << "DUP"; break; + case -1 : out << "-"; break; + case 0 : out << "."; break; + case +1 : out << "+"; break; + } + } + out << "] " << s[i].begin_index << ".." << s[i].end_index; + + + point_type p; + bg::centroid(b, p); + mapper.text(p, out.str(), ""); + } + } +#endif + +} + +template +void test_sectionalize(std::string const& caseid, std::string const& wkt, + std::size_t count2, std::string const& s2, std::string const d2, + std::size_t count1, std::string const& s1, std::string const d1, + std::size_t max_count = 10) +{ + G g; + bg::read_wkt(wkt, g); + + typedef boost::mpl::vector_c dim2; + typedef boost::mpl::vector_c dim1; + + test_sectionalize(caseid + "_d2", g, count2, s2, d2, max_count); + test_sectionalize(caseid + "_d1", g, count1, s1, d1, max_count); +} + +template +void test_all() +{ + test_sectionalize_part<1, bg::model::linestring

>(); + + test_sectionalize, false>("ls", + "LINESTRING(1 1,2 2,3 0,5 0,5 8)", + 4, "0..1|1..2|2..3|3..4", "+ +|+ -|+ .|. +", + 2, "0..3|3..4", "+|."); + + // These strings mean: + // 0..1|1..2 -> first section: [0, 1] | second section [1, 2], etc + // + +|+ - -> X increases, Y increases | X increases, Y decreases + // +|. -> (only X considered) X increases | X constant + + test_sectionalize, false>("simplex", + "POLYGON((0 0,0 7,4 2,2 0,0 0))", + 4, "0..1|1..2|2..3|3..4", ". +|+ -|- -|- .", + // . + - - -> 3 sections + 3, "0..1|1..2|2..4", ".|+|-"); + + // CCW polygon - orientation is not (always) relevant for sections, + // they are just generated in the order they come. + test_sectionalize, false>("simplex_ccw", + "POLYGON((0 0,2 0,4 2,0 7,0 0))", + 4, "0..1|1..2|2..3|3..4", "+ .|+ +|- +|. -", + // . + - - -> 3 sections + 3, "0..2|2..3|3..4", "+|-|."); + + // Open polygon - closeness IS relevant for sections, the + // last section which is not explicit here should be included. + // So results are the same as the pre-previous one. + test_sectionalize, false>("simplex_open", + "POLYGON((0 0,0 7,4 2,2 0))", + 4, "0..1|1..2|2..3|3..4", ". +|+ -|- -|- .", + // . + - - -> 3 sections + 3, "0..1|1..2|2..4", ".|+|-"); + + test_sectionalize, false>("first", + "polygon((2.0 1.3, 2.4 1.7, 2.8 1.8, 3.4 1.2, 3.7 1.6,3.4 2.0, 4.1 3.0, 5.3 2.6, 5.4 1.2, 4.9 0.8, 2.9 0.7,2.0 1.3))", + 8, "0..2|2..3|3..4|4..5|5..6|6..8|8..10|10..11", "+ +|+ -|+ +|- +|+ +|+ -|- -|- +", + 4, "0..4|4..5|5..8|8..11", "+|-|+|-"); + + test_sectionalize, true>("first_reverse", + "polygon((2.0 1.3, 2.4 1.7, 2.8 1.8, 3.4 1.2, 3.7 1.6,3.4 2.0, 4.1 3.0, 5.3 2.6, 5.4 1.2, 4.9 0.8, 2.9 0.7,2.0 1.3))", + 8, "0..1|1..3|3..5|5..6|6..7|7..8|8..9|9..11", "+ -|+ +|- +|- -|+ -|- -|- +|- -", + 4, "0..3|3..6|6..7|7..11", "+|-|+|-"); + + test_sectionalize, false>("second", + "POLYGON((3 1,2 2,1 3,2 4,3 5,4 4,5 3,4 2,3 1))", + 4, "0..2|2..4|4..6|6..8", "- +|+ +|+ -|- -", + // - - - + + + + - - -> 3 sections + 3, "0..2|2..6|6..8", "-|+|-"); + + // With holes + test_sectionalize, false>("with_holes", + "POLYGON((3 1,2 2,1 3,2 4,3 5,4 4,5 3,4 2,3 1), (3 2,2 2,3 4,3 2))", + 7, "0..2|2..4|4..6|6..8|0..1|1..2|2..3", "- +|+ +|+ -|- -|- .|+ +|. -", + // - - - + + + + - - - + . -> 6 sections + 6, "0..2|2..6|6..8|0..1|1..2|2..3", "-|+|-|-|+|."); + + // With duplicates + test_sectionalize, false>("with_dups", + "LINESTRING(1 1,2 2,3 0,3 0,5 0,5 8)", + 5, "0..1|1..2|2..3|3..4|4..5", "+ +|+ -|DUP DUP|+ .|. +", + 4, "0..2|2..3|3..4|4..5", "+|DUP|+|."); + // With two subsequent duplicate segments + test_sectionalize, false>("with_subseq_dups", + "LINESTRING(1 1,2 2,3 0,3 0,3 0,5 0,5 0,5 0,5 0,5 8)", + 6, "0..1|1..2|2..4|4..5|5..8|8..9", "+ +|+ -|DUP DUP|+ .|DUP DUP|. +", + 5, "0..2|2..4|4..5|5..8|8..9", "+|DUP|+|DUP|."); + + + typedef bg::model::box

B; + test_sectionalize("box2", "BOX(0 0,4 4)", + 4, "0..1|1..2|2..3|3..4", ". +|+ .|. -|- .", + 4, "0..1|1..2|2..3|3..4", ".|+|.|-"); + + std::string horizontal("POLYGON((0 10,1 8,2 10,3 8,4 10,5 8,6 10,7 8,8 10,9 8,10 10,11 8,12 10,12 5,9 5,9 4,8 4,8 5,7 5,7 4,6 4,6 5,5 5,5 4,4 4,4 5,3 5,3 4,2 4,2 5,1 5,1 4,0 4,0 10))"); + test_sectionalize, false>("horizontal", horizontal, + 33, "", "", + 22, "", "", 100); + test_sectionalize, false>("horizontal4", horizontal, + 33, "", "", + 24, "", "", 4); + + std::string vertical("POLYGON((4 0,6 1,4 2,6 3,4 4,6 5,4 6,6 7,4 8,6 9,4 10,10 10,10 9,9 9,9 8,10 8,10 7,9 7,9 6,10 6,10 5,9 5,9 4,10 4,10 3,9 3,9 2,10 2,10 1,9 1,9 0,5 0))"); + test_sectionalize, false>("vertical", vertical, + 31, "", "", + 31, "", "", 100); + + { + typedef boost::mpl::vector_c only_y_dim; + bg::model::polygon

pol; + bg::read_wkt(vertical, pol); + test_sectionalize("vertical_y", pol, 22, "", "", 100); + } + + return; + // Buffer-case + test_sectionalize, false>("buffer", + "POLYGON((-1.1713 0.937043,2.8287 5.93704,2.90334 6.02339,2.98433 6.10382,2.98433 6.10382,3.07121 6.17786,3.16346 6.24507,3.16346 6.24507,3.16346 6.24507,3.26056 6.30508,3.36193 6.35752,3.36193 6.35752,3.46701 6.40211,3.57517 6.43858,3.57517 6.43858,3.57517 6.43858,3.57517 6.43858,3.68579 6.46672,3.79822 6.48637,3.79822 6.48637,3.91183 6.49741,4.02595 6.49978,4.02595 6.49978,4.02595 6.49978,4.13991 6.49346,4.25307 6.4785,4.25307 6.4785,4.36476 6.45497,4.47434 6.42302,4.47434 6.42302,4.47434 6.42302,4.47434 6.42302,7.47434 5.42302,6.84189 3.52566,4.39043 4.68765,0.390434 -0.312348,-1.1713 0.937043))", + 8, "0..2|2..3|3..4|4..5|5..6|6..8|8..10|10..11", "+ +|+ -|+ +|- +|+ +|+ -|- -|- +", + 4, "0..4|4..5|5..8|8..11", "+|-|+|-"); +} + +void test_large_integers() +{ + typedef bg::model::point int_point_type; + typedef bg::model::point double_point_type; + + std::string const polygon_li = "POLYGON((1872000 528000,1872000 192000,1536119 192000,1536000 528000,1200000 528000,1200000 863880,1536000 863880,1872000 863880,1872000 528000))"; + bg::model::polygon int_poly; + bg::model::polygon double_poly; + bg::read_wkt(polygon_li, int_poly); + bg::read_wkt(polygon_li, double_poly); + + typedef boost::mpl::vector_c dimensions; + bg::sections, 1> int_sections; + bg::sections, 1> double_sections; + + + bg::sectionalize(int_poly, bg::detail::no_rescale_policy(), int_sections); + bg::sectionalize(double_poly, bg::detail::no_rescale_policy(), double_sections); + + bool equally_sized = int_sections.size() == double_sections.size(); + BOOST_CHECK(equally_sized); + if (! equally_sized) + { + return; + } + + for (unsigned int i = 0; i < int_sections.size(); i++) + { + BOOST_CHECK(int_sections[i].begin_index == double_sections[i].begin_index); + BOOST_CHECK(int_sections[i].count == double_sections[i].count); + } + +} + + + +int test_main(int, char* []) +{ + test_large_integers(); + + //test_all >(); + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/detail/tupled_output.cpp b/src/boost/libs/geometry/test/algorithms/detail/tupled_output.cpp new file mode 100644 index 000000000..3c8659ea1 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/detail/tupled_output.cpp @@ -0,0 +1,116 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2019 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) + + +#include + +#include +#include +#include + +namespace bgd = boost::geometry::detail; +namespace bgt = boost::geometry::tuples; +namespace bgr = boost::geometry::range; + +template +void add_points(MultiPoint & mp) +{ + typedef typename bg::point_type::type point_type; + + bg::range::push_back(mp, point_type(1, 2)); + bg::range::push_back(mp, point_type(2, 3)); + bg::range::push_back(mp, point_type(3, 4)); +} + +template +void test_range_values() +{ + typedef typename bgd::tupled_range_values::type tuple_s; + BOOST_CHECK_EQUAL((boost::is_same::value), true); +} + +template +void test_back_inserters() +{ + typedef typename bgd::tupled_back_inserters::type tuple_bi; + BOOST_CHECK_EQUAL((boost::is_same::value), true); + + TupleM tup; + bgd::tupled_back_inserters::apply(tup); +} + +template +void test_all() +{ + BOOST_CHECK_EQUAL((bgd::is_tupled_output::value), false); + BOOST_CHECK_EQUAL((bgd::is_tupled_output::value), true); + + BOOST_CHECK_EQUAL((bgd::tupled_output_has::value), false); + BOOST_CHECK_EQUAL((bgd::tupled_output_has::value), true); + + BOOST_CHECK_EQUAL((bgd::tupled_output_has::value), false); + BOOST_CHECK_EQUAL((bgd::tupled_output_has::value), false); + + TupleLsMPt tup; + add_points(bgd::tupled_output_get(tup)); + BOOST_CHECK_EQUAL((boost::size(bgt::get<1>(tup))), 3u); +} + +int test_main(int, char* []) +{ + typedef bg::model::point point; + typedef bg::model::linestring linestring; + typedef bg::model::polygon polygon; + typedef bg::model::multi_point multi_point; + typedef bg::model::multi_linestring multi_linestring; + //typedef bg::model::multi_polygon multi_polygon; + + BOOST_CHECK_EQUAL((bgd::is_range::value), false); + BOOST_CHECK_EQUAL((bgd::is_range::value), true); + BOOST_CHECK_EQUAL((bgd::is_range::value), true); + + BOOST_CHECK_EQUAL((bgd::is_tupled_output_element::value), false); + BOOST_CHECK_EQUAL((bgd::is_tupled_output_element::value), false); + BOOST_CHECK_EQUAL((bgd::is_tupled_output_element::value), true); + + test_all, boost::tuple >(); + test_all, std::pair >(); + + test_range_values, + boost::tuples::cons > >(); + test_range_values, + std::pair >(); + + test_back_inserters, + boost::tuples::cons, + boost::tuples::cons, + boost::tuples::null_type> > >(); + test_back_inserters, + std::pair, + bgr::back_insert_iterator > >(); + +#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_VARIADIC_TEMPLATES) + + test_all, std::tuple >(); + + test_range_values, + std::tuple >(); + + test_back_inserters, + std::tuple, + bgr::back_insert_iterator > >(); + +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/Jamfile b/src/boost/libs/geometry/test/algorithms/disjoint/Jamfile new file mode 100644 index 000000000..6f1c08d9e --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/Jamfile @@ -0,0 +1,30 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2016, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-disjoint + : + [ run disjoint.cpp : : : : algorithms_disjoint ] + [ run disjoint_coverage_a_a.cpp : : : : algorithms_disjoint_coverage_a_a ] + [ run disjoint_coverage_l_a.cpp : : : : algorithms_disjoint_coverage_l_a ] + [ run disjoint_coverage_l_l.cpp : : : : algorithms_disjoint_coverage_l_l ] + [ run disjoint_coverage_p_a.cpp : : : : algorithms_disjoint_coverage_p_a ] + [ run disjoint_coverage_p_l.cpp : : : : algorithms_disjoint_coverage_p_l ] + [ run disjoint_coverage_p_p.cpp : : : : algorithms_disjoint_coverage_p_p ] + [ run disjoint_multi.cpp : : : : algorithms_disjoint_multi ] + [ run disjoint_point_box_geometry.cpp : : : : algorithms_disjoint_point_box_geometry ] + [ run disjoint_seg_box.cpp : : : : algorithms_disjoint_seg_box ] + [ run disjoint_sph.cpp : : : : algorithms_disjoint_sph ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/disjoint.cpp b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint.cpp new file mode 100644 index 000000000..2d0225daf --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint.cpp @@ -0,0 +1,165 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2015. +// Modifications copyright (c) 2015, 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. + +// 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) + + +#include "test_disjoint.hpp" + +#include +#include +#include + +#include + +#include + +#include + + +template +void test_all() +{ + // Test triangles for polygons/rings, boxes + // Note that intersections are tested elsewhere, they don't need + // thorough test at this place + typedef bg::model::polygon

polygon; + typedef bg::model::ring

ring; + + // Four times same test with other types + test_disjoint("disjoint_simplex_pp", disjoint_simplex[0], disjoint_simplex[1], true); + test_disjoint("disjoint_simplex_rp", disjoint_simplex[0], disjoint_simplex[1], true); + test_disjoint("disjoint_simplex_rr", disjoint_simplex[0], disjoint_simplex[1], true); + test_disjoint("disjoint_simplex_pr", disjoint_simplex[0], disjoint_simplex[1], true); + + test_disjoint("ticket_8310a", ticket_8310a[0], ticket_8310a[1], false); + test_disjoint("ticket_8310b", ticket_8310b[0], ticket_8310b[1], false); + test_disjoint("ticket_8310c", ticket_8310c[0], ticket_8310c[1], false); + + // Testing touch + test_disjoint("touch_simplex_pp", touch_simplex[0], touch_simplex[1], false); + + // Test if within(a,b) returns false for disjoint + test_disjoint("within_simplex_rr1", within_simplex[0], within_simplex[1], false); + test_disjoint("within_simplex_rr2", within_simplex[1], within_simplex[0], false); + + // Linear + typedef bg::model::linestring

ls; + typedef bg::model::segment

segment; + test_disjoint("ls/ls 1", "linestring(0 0,1 1)", "linestring(1 0,0 1)", false); + test_disjoint("ls/ls 2", "linestring(0 0,1 1)", "linestring(1 0,2 1)", true); + test_disjoint("s/s 1", "linestring(0 0,1 1)", "linestring(1 0,0 1)", false); + test_disjoint("s/s 2", "linestring(0 0,1 1)", "linestring(1 0,2 1)", true); + + // Test degenerate segments (patched by Karsten Ahnert on 2012-07-25) + test_disjoint("s/s 3", "linestring(0 0,0 0)", "linestring(1 0,0 1)", true); + test_disjoint("s/s 4", "linestring(0 0,0 0)", "linestring(0 0,0 0)", false); + test_disjoint("s/s 5", "linestring(0 0,0 0)", "linestring(1 0,1 0)", true); + test_disjoint("s/s 6", "linestring(0 0,0 0)", "linestring(0 1,0 1)", true); + + // Collinear opposite + test_disjoint("ls/ls co", "linestring(0 0,2 2)", "linestring(1 1,0 0)", false); + // Collinear opposite and equal + test_disjoint("ls/ls co-e", "linestring(0 0,1 1)", "linestring(1 1,0 0)", false); + + + // Degenerate linestrings + { + // Submitted by Zachary on the Boost.Geometry Mailing List, on 2012-01-29 + std::string const a = "linestring(100 10, 0 10)"; + std::string const b = "linestring(50 10, 50 10)"; // one point only, with same y-coordinate + std::string const c = "linestring(100 10, 100 10)"; // idem, at left side + test_disjoint("dls/dls 1", a, b, false); + test_disjoint("dls/dls 2", b, a, false); + test_disjoint("ds/ds 1", a, b, false); + test_disjoint("ds/ds 2", b, a, false); + test_disjoint("dls/dls 1", a, c, false); + } + + // Linestrings making angles normally ignored + { + // These (non-disjoint) cases + // correspond to the test "segment_intersection_collinear" + + // Collinear ('a') + // a1---------->a2 + // b1--->b2 + test_disjoint("n1", "linestring(2 0,0 6)", "linestring(0 0,2 0)", false); + + // a1---------->a2 + // b1--->b2 + test_disjoint("n7", "linestring(2 0,6 0)", "linestring(6 0,8 0)", false); + + // Collinear - opposite ('f') + // a1---------->a2 + // b2<---b1 + test_disjoint("o1", "linestring(2 0,6 0)", "linestring(2 0,0 0)", false); + } + + { + // Starting in the middle ('s') + // b2 + // ^ + // | + // | + // a1--------b1----->a2 + test_disjoint("case_s", "linestring(0 0,4 0)", "linestring(2 0,2 2)", false); + + // Collinear, but disjoint + test_disjoint("c-d", "linestring(2 0,6 0)", "linestring(7 0,8 0)", true); + + // Parallel, disjoint + test_disjoint("c-d", "linestring(2 0,6 0)", "linestring(2 1,6 1)", true); + + // Error still there until 1.48 (reported "error", was reported to disjoint, so that's why it did no harm) + test_disjoint("case_recursive_boxes_1", + "linestring(10 7,10 6)", "linestring(10 10,10 9)", true); + + } + + // TODO test_disjoint("s/ls 1", "linestring(0 0,1 1)", "linestring(1 0,0 1)", false); + // TODO test_disjoint("s/ls 2", "linestring(0 0,1 1)", "linestring(1 0,2 1)", true); + // TODO test_disjoint("ls/s 1", "linestring(0 0,1 1)", "linestring(1 0,0 1)", false); + // TODO test_disjoint("ls/s 2", "linestring(0 0,1 1)", "linestring(1 0,2 1)", true); + + // 22.01.2015 + test_disjoint("col-op", "LINESTRING(5 5,10 10)", "LINESTRING(6 6,3 3)", false); + test_disjoint("col-op", "LINESTRING(5 5,2 8)", "LINESTRING(4 6,7 3)", false); + + test_disjoint("col-op", "LINESTRING(10 10,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_disjoint("col-op", "LINESTRING(9 10,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + + // assertion failure in 1.57 + test_disjoint("point_ll_assert_1_57", + "LINESTRING(-2305843009213693956 4611686018427387906, -33 -92, 78 83)", + "LINESTRING(31 -97, -46 57, -20 -4)", + false); +} + + +int test_main(int, char* []) +{ + test_all >(); + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_a_a.cpp b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_a_a.cpp new file mode 100644 index 000000000..25d6c5d77 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_a_a.cpp @@ -0,0 +1,387 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_disjoint_coverage +#endif + +// unit test to test disjoint for all geometry combinations + +#include + +#include + +#include +#include + +#include + +#include +#include + +#include + +#include + +#include + + +#ifdef HAVE_TTMATH +#include +#endif + +namespace bg = ::boost::geometry; + +//============================================================================ + +struct test_disjoint +{ + template + static inline void apply(std::string const& case_id, + Geometry1 const& geometry1, + Geometry2 const& geometry2, + bool expected_result) + { + bool result = bg::disjoint(geometry1, geometry2); + BOOST_CHECK_MESSAGE(result == expected_result, + "case ID: " << case_id << ", G1: " << bg::wkt(geometry1) + << ", G2: " << bg::wkt(geometry2) << " -> Expected: " + << expected_result << ", detected: " << result); + + result = bg::disjoint(geometry2, geometry1); + BOOST_CHECK_MESSAGE(result == expected_result, + "case ID: " << case_id << ", G1: " << bg::wkt(geometry2) + << ", G2: " << bg::wkt(geometry1) << " -> Expected: " + << expected_result << ", detected: " << result); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "case ID: " << case_id << "; G1 - G2: "; + std::cout << bg::wkt(geometry1) << " - "; + std::cout << bg::wkt(geometry2) << std::endl; + std::cout << std::boolalpha; + std::cout << "expected/computed result: " + << expected_result << " / " << result << std::endl; + std::cout << std::endl; + std::cout << std::noboolalpha; +#endif + } +}; + +//============================================================================ + +// areal-areal geometries +template +inline void test_box_box() +{ + typedef bg::model::box

B; + + typedef test_disjoint tester; + + tester::apply("b-b-01", + from_wkt("BOX(2 2,3 3)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("b-b-02", + from_wkt("BOX(1 1,3 3)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("b-b-03", + from_wkt("BOX(3 3,4 4)"), + from_wkt("BOX(0 0,2 2)"), + true); +} + +template +inline void test_ring_box() +{ + typedef bg::model::box

B; + typedef bg::model::ring R; // ccw, open + + typedef test_disjoint tester; + + tester::apply("r-b-01", + from_wkt("BOX(2 2,3 3)"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + false); + + tester::apply("r-b-02", + from_wkt("BOX(1 1,3 3)"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + false); + + tester::apply("r-b-03", + from_wkt("BOX(3 3,4 4)"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + true); +} + +template +inline void test_polygon_box() +{ + typedef bg::model::box

B; + typedef bg::model::polygon PL; // ccw, open + + typedef test_disjoint tester; + + tester::apply("pg-b-01", + from_wkt("BOX(2 2,3 3)"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + false); + + tester::apply("pg-b-02", + from_wkt("BOX(1 1,3 3)"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + false); + + tester::apply("pg-b-03", + from_wkt("BOX(3 3,4 4)"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + true); +} + +template +inline void test_multipolygon_box() +{ + typedef bg::model::box

B; + typedef bg::model::polygon PL; // ccw, open + typedef bg::model::multi_polygon MPL; + + typedef test_disjoint tester; + + tester::apply("mpg-b-01", + from_wkt("BOX(2 2,3 3)"), + from_wkt("MULTIPOLYGON(((0 0,2 0,2 2,0 2)))"), + false); + + tester::apply("mpg-b-02", + from_wkt("BOX(1 1,3 3)"), + from_wkt("MULTIPOLYGON(((0 0,2 0,2 2,0 2)))"), + false); + + tester::apply("mpg-b-03", + from_wkt("BOX(3 3,4 4)"), + from_wkt("MULTIPOLYGON(((0 0,2 0,2 2,0 2)))"), + true); +} + +template +inline void test_ring_ring() +{ + typedef bg::model::ring R; // ccw, open + + typedef test_disjoint tester; + + tester::apply("r-r-01", + from_wkt("POLYGON((2 2,2 3,3 3,3 2))"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + false); + + tester::apply("r-r-02", + from_wkt("POLYGON((1 1,1 3,3 3,3 1))"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + false); + + tester::apply("r-r-03", + from_wkt("POLYGON((3 3,3 4,4 4,4 3))"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + true); +} + +template +inline void test_polygon_ring() +{ + typedef bg::model::ring R; // ccw, open + typedef bg::model::polygon PL; // ccw, open + + typedef test_disjoint tester; + + tester::apply("pg-r-01", + from_wkt("POLYGON((2 2,2 3,3 3,3 2))"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + false); + + tester::apply("pg-r-02", + from_wkt("POLYGON((1 1,1 3,3 3,3 1))"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + false); + + tester::apply("pg-r-03", + from_wkt("POLYGON((3 3,3 4,4 4,4 3))"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + true); +} + +template +inline void test_multipolygon_ring() +{ + typedef bg::model::ring R; // ccw, open + typedef bg::model::polygon PL; // ccw, open + typedef bg::model::multi_polygon MPL; + + typedef test_disjoint tester; + + tester::apply("mpg-r-01", + from_wkt("POLYGON((2 2,2 3,3 3,3 2))"), + from_wkt("MULTIPOLYGON(((0 0,2 0,2 2,0 2)))"), + false); + + tester::apply("mpg-r-02", + from_wkt("POLYGON((1 1,1 3,3 3,3 1))"), + from_wkt("MULTIPOLYGON(((0 0,2 0,2 2,0 2)))"), + false); + + tester::apply("mpg-r-03", + from_wkt("POLYGON((3 3,3 4,4 4,4 3))"), + from_wkt("MULTIPOLYGON(((0 0,2 0,2 2,0 2)))"), + true); +} + +template +inline void test_polygon_polygon() +{ + typedef bg::model::polygon PL; // ccw, open + + typedef test_disjoint tester; + + tester::apply("pg-pg-01", + from_wkt("POLYGON((2 2,2 3,3 3,3 2))"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + false); + + tester::apply("pg-pg-02", + from_wkt("POLYGON((1 1,1 3,3 3,3 1))"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + false); + + tester::apply("pg-pg-03", + from_wkt("POLYGON((3 3,3 4,4 4,4 3))"), + from_wkt("POLYGON((0 0,2 0,2 2,0 2))"), + true); + + tester::apply("pg-pg-04", + from_wkt("POLYGON((0 0,9 0,9 9,0 9))"), + from_wkt("POLYGON((3 3,6 3,6 6,3 6))"), + false); + // polygon with a hole which entirely contains the other polygon + tester::apply("pg-pg-05", + from_wkt("POLYGON((0 0,9 0,9 9,0 9),(2 2,2 7,7 7,7 2))"), + from_wkt("POLYGON((3 3,6 3,6 6,3 6))"), + true); + // polygon with a hole, but the inner ring intersects the other polygon + tester::apply("pg-pg-06", + from_wkt("POLYGON((0 0,9 0,9 9,0 9),(3 2,3 7,7 7,7 2))"), + from_wkt("POLYGON((2 3,6 3,6 6,2 6))"), + false); + // polygon with a hole, but the other polygon is entirely contained + // between the inner and outer rings. + tester::apply("pg-pg-07", + from_wkt("POLYGON((0 0,9 0,9 9,0 9),(6 2,6 7,7 7,7 2))"), + from_wkt("POLYGON((3 3,5 3,5 6,3 6))"), + false); + // polygon with a hole and the outer ring of the other polygon lies + // between the inner and outer, but without touching either. + tester::apply("pg-pg-08", + from_wkt("POLYGON((0 0,9 0,9 9,0 9),(3 3,3 6,6 6,6 3))"), + from_wkt("POLYGON((2 2,7 2,7 7,2 7))"), + false); + + { + typedef bg::model::polygon

PL; // cw, closed + + // https://svn.boost.org/trac/boost/ticket/10647 + tester::apply("ticket-10647", + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0)(1 1, 4 1, 4 4, 1 4, 1 1))"), + from_wkt("POLYGON((2 2, 2 3, 3 3, 3 2, 2 2))"), + true); + } +} + +template +inline void test_polygon_multipolygon() +{ + typedef bg::model::polygon PL; // ccw, open + typedef bg::model::multi_polygon MPL; + + typedef test_disjoint tester; + + tester::apply("pg-mpg-01", + from_wkt("POLYGON((2 2,2 3,3 3,3 2))"), + from_wkt("MULTIPOLYGON(((0 0,2 0,2 2,0 2)))"), + false); + + tester::apply("pg-mpg-02", + from_wkt("POLYGON((1 1,1 3,3 3,3 1))"), + from_wkt("MULTIPOLYGON(((0 0,2 0,2 2,0 2)))"), + false); + + tester::apply("pg-mpg-03", + from_wkt("POLYGON((3 3,3 4,4 4,4 3))"), + from_wkt("MULTIPOLYGON(((0 0,2 0,2 2,0 2)))"), + true); +} + +template +inline void test_multipolygon_multipolygon() +{ + typedef bg::model::polygon PL; // ccw, open + typedef bg::model::multi_polygon MPL; + + typedef test_disjoint tester; + + tester::apply("mpg-mpg-01", + from_wkt("MULTIPOLYGON(((2 2,2 3,3 3,3 2)))"), + from_wkt("MULTIPOLYGON(((0 0,2 0,2 2,0 2)))"), + false); + + tester::apply("mpg-mpg-02", + from_wkt("MULTIPOLYGON(((1 1,1 3,3 3,3 1)))"), + from_wkt("MULTIPOLYGON(((0 0,2 0,2 2,0 2)))"), + false); + + tester::apply("mpg-mpg-03", + from_wkt("MULTIPOLYGON(((3 3,3 4,4 4,4 3)))"), + from_wkt("MULTIPOLYGON(((0 0,2 0,2 2,0 2)))"), + true); +} + +//============================================================================ + +template +inline void test_areal_areal() +{ + typedef bg::model::point point_type; + + test_polygon_polygon(); + test_polygon_multipolygon(); + test_polygon_ring(); + test_polygon_box(); + + test_multipolygon_multipolygon(); + test_multipolygon_ring(); + test_multipolygon_box(); + + test_ring_ring(); + test_ring_box(); + + test_box_box(); +} + +//============================================================================ + +BOOST_AUTO_TEST_CASE( test_areal_areal_all ) +{ + test_areal_areal(); + test_areal_areal(); +#ifdef HAVE_TTMATH + test_areal_areal(); +#endif +} diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_l_a.cpp b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_l_a.cpp new file mode 100644 index 000000000..cb55aaa8d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_l_a.cpp @@ -0,0 +1,538 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_disjoint_coverage +#endif + +// unit test to test disjoint for all geometry combinations + +#include + +#include + +#include +#include + +#include + +#include +#include + +#include + +#include + +#include + + +#ifdef HAVE_TTMATH +#include +#endif + +namespace bg = ::boost::geometry; + +//============================================================================ + +struct test_disjoint +{ + template + static inline void apply(std::string const& case_id, + Geometry1 const& geometry1, + Geometry2 const& geometry2, + bool expected_result) + { + bool result = bg::disjoint(geometry1, geometry2); + BOOST_CHECK_MESSAGE(result == expected_result, + "case ID: " << case_id << ", G1: " << bg::wkt(geometry1) + << ", G2: " << bg::wkt(geometry2) << " -> Expected: " + << expected_result << ", detected: " << result); + + result = bg::disjoint(geometry2, geometry1); + BOOST_CHECK_MESSAGE(result == expected_result, + "case ID: " << case_id << ", G1: " << bg::wkt(geometry2) + << ", G2: " << bg::wkt(geometry1) << " -> Expected: " + << expected_result << ", detected: " << result); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "case ID: " << case_id << "; G1 - G2: "; + std::cout << bg::wkt(geometry1) << " - "; + std::cout << bg::wkt(geometry2) << std::endl; + std::cout << std::boolalpha; + std::cout << "expected/computed result: " + << expected_result << " / " << result << std::endl; + std::cout << std::endl; + std::cout << std::noboolalpha; +#endif + } +}; + +//============================================================================ + +// linear-areal geometries +template +inline void test_segment_box() +{ + typedef bg::model::segment

S; + typedef bg::model::box

B; + + typedef test_disjoint tester; + + tester::apply("s-b-01", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("s-b-02", + from_wkt("SEGMENT(1 1,3 3)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("s-b-03", + from_wkt("SEGMENT(2 2,3 3)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("s-b-04", + from_wkt("SEGMENT(4 4,3 3)"), + from_wkt("BOX(0 0,2 2)"), + true); + + tester::apply("s-b-05", + from_wkt("SEGMENT(0 4,4 4)"), + from_wkt("BOX(0 0,2 2)"), + true); + + tester::apply("s-b-06", + from_wkt("SEGMENT(4 0,4 4)"), + from_wkt("BOX(0 0,2 2)"), + true); + + tester::apply("s-b-07", + from_wkt("SEGMENT(0 -2,0 -1)"), + from_wkt("BOX(0 0,1 1)"), + true); + + tester::apply("s-b-08", + from_wkt("SEGMENT(-2 -2,-2 -1)"), + from_wkt("BOX(0 0,1 1)"), + true); + + tester::apply("s-b-09", + from_wkt("SEGMENT(-2 -2,-2 -2)"), + from_wkt("BOX(0 0,1 1)"), + true); + + tester::apply("s-b-10", + from_wkt("SEGMENT(-2 0,-2 0)"), + from_wkt("BOX(0 0,1 1)"), + true); + + tester::apply("s-b-11", + from_wkt("SEGMENT(0 -2,0 -2)"), + from_wkt("BOX(0 0,1 1)"), + true); + + tester::apply("s-b-12", + from_wkt("SEGMENT(-2 0,-1 0)"), + from_wkt("BOX(0 0,1 1)"), + true); + + // segment degenerates to a point + tester::apply("s-b-13", + from_wkt("SEGMENT(0 0,0 0)"), + from_wkt("BOX(0 0,1 1)"), + false); + + tester::apply("s-b-14", + from_wkt("SEGMENT(1 1,1 1)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("s-b-15", + from_wkt("SEGMENT(2 2,2 2)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("s-b-16", + from_wkt("SEGMENT(2 0,2 0)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("s-b-17", + from_wkt("SEGMENT(0 2,0 2)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("s-b-18", + from_wkt("SEGMENT(2 2,2 2)"), + from_wkt("BOX(0 0,1 1)"), + true); +} + +template +inline void test_segment_ring() +{ + typedef bg::model::segment

S; + typedef bg::model::ring R; // ccw, open + + typedef test_disjoint tester; + + tester::apply("s-r-01", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("s-r-02", + from_wkt("SEGMENT(1 0,3 3)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("s-r-03", + from_wkt("SEGMENT(1 1,3 3)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("s-r-04", + from_wkt("SEGMENT(2 2,3 3)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + true); +} + +template +inline void test_segment_polygon() +{ + typedef bg::model::segment

S; + typedef bg::model::polygon PL; // ccw, open + + typedef test_disjoint tester; + + tester::apply("s-pg-01", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("s-pg-02", + from_wkt("SEGMENT(1 0,3 3)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("s-pg-03", + from_wkt("SEGMENT(1 1,3 3)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("s-pg-04", + from_wkt("SEGMENT(2 2,3 3)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + true); +} + +template +inline void test_segment_multipolygon() +{ + typedef bg::model::segment

S; + typedef bg::model::polygon PL; // ccw, open + typedef bg::model::multi_polygon MPL; + + typedef test_disjoint tester; + + tester::apply("s-mpg-01", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("MULTIPOLYGON(((0 0,2 0,0 2)))"), + false); + + tester::apply("s-mpg-02", + from_wkt("SEGMENT(1 0,3 3)"), + from_wkt("MULTIPOLYGON(((0 0,2 0,0 2)))"), + false); + + tester::apply("s-mpg-03", + from_wkt("SEGMENT(1 1,3 3)"), + from_wkt("MULTIPOLYGON(((0 0,2 0,0 2)))"), + false); + + tester::apply("s-mpg-04", + from_wkt("SEGMENT(2 2,3 3)"), + from_wkt("MULTIPOLYGON(((0 0,2 0,0 2)))"), + true); +} + +template +inline void test_linestring_box() +{ + typedef bg::model::linestring

L; + typedef bg::model::box

B; + + typedef test_disjoint tester; + + tester::apply("l-b-01", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("l-b-02", + from_wkt("LINESTRING(1 1,3 3)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("l-b-03", + from_wkt("LINESTRING(2 2,3 3)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("l-b-04", + from_wkt("LINESTRING(4 4,3 3)"), + from_wkt("BOX(0 0,2 2)"), + true); +} + +template +inline void test_linestring_ring() +{ + typedef bg::model::linestring

L; + typedef bg::model::ring R; // ccw, open + + typedef test_disjoint tester; + + tester::apply("l-r-01", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("l-r-02", + from_wkt("LINESTRING(1 0,3 3)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("l-r-03", + from_wkt("LINESTRING(1 1,3 3)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("l-r-04", + from_wkt("LINESTRING(2 2,3 3)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + true); +} + +template +inline void test_linestring_polygon() +{ + typedef bg::model::linestring

L; + typedef bg::model::polygon PL; // ccw, open + + typedef test_disjoint tester; + + tester::apply("l-pg-01", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("l-pg-02", + from_wkt("LINESTRING(1 0,3 3)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("l-pg-03", + from_wkt("LINESTRING(1 1,3 3)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("l-pg-04", + from_wkt("LINESTRING(2 2,3 3)"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + true); +} + +template +inline void test_linestring_multipolygon() +{ + typedef bg::model::linestring

L; + typedef bg::model::polygon PL; // ccw, open + typedef bg::model::multi_polygon MPL; + + typedef test_disjoint tester; + + tester::apply("l-mpg-01", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("MULTIPOLYGON(((0 0,2 0,0 2)))"), + false); + + tester::apply("l-mpg-02", + from_wkt("LINESTRING(1 0,3 3)"), + from_wkt("MULTIPOLYGON(((0 0,2 0,0 2)))"), + false); + + tester::apply("l-mpg-03", + from_wkt("LINESTRING(1 1,3 3)"), + from_wkt("MULTIPOLYGON(((0 0,2 0,0 2)))"), + false); + + tester::apply("l-mpg-04", + from_wkt("LINESTRING(2 2,3 3)"), + from_wkt("MULTIPOLYGON(((0 0,2 0,0 2)))"), + true); +} + +template +inline void test_multilinestring_box() +{ + typedef bg::model::linestring

L; + typedef bg::model::multi_linestring ML; + typedef bg::model::box

B; + + typedef test_disjoint tester; + + tester::apply("ml-b-01", + from_wkt("MULTILINESTRING((0 0,2 0))"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("ml-b-02", + from_wkt("MULTILINESTRING((1 1,3 3))"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("ml-b-03", + from_wkt("MULTILINESTRING((2 2,3 3))"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("ml-b-04", + from_wkt("MULTILINESTRING((4 4,3 3))"), + from_wkt("BOX(0 0,2 2)"), + true); +} + +template +inline void test_multilinestring_ring() +{ + typedef bg::model::linestring

L; + typedef bg::model::multi_linestring ML; + typedef bg::model::ring R; // ccw, open + + typedef test_disjoint tester; + + tester::apply("ml-r-01", + from_wkt("MULTILINESTRING((0 0,2 0))"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("ml-r-02", + from_wkt("MULTILINESTRING((1 0,3 3))"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("ml-r-03", + from_wkt("MULTILINESTRING((1 1,3 3))"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("ml-r-04", + from_wkt("MULTILINESTRING((2 2,3 3))"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + true); +} + +template +inline void test_multilinestring_polygon() +{ + typedef bg::model::linestring

L; + typedef bg::model::multi_linestring ML; + typedef bg::model::polygon PL; // ccw, open + + typedef test_disjoint tester; + + tester::apply("ml-pg-01", + from_wkt("MULTILINESTRING((0 0,2 0))"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("ml-pg-02", + from_wkt("MULTILINESTRING((1 0,3 3))"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("ml-pg-03", + from_wkt("MULTILINESTRING((1 1,3 3))"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + false); + + tester::apply("ml-pg-04", + from_wkt("MULTILINESTRING((2 2,3 3))"), + from_wkt("POLYGON((0 0,2 0,0 2))"), + true); +} + +template +inline void test_multilinestring_multipolygon() +{ + typedef bg::model::linestring

L; + typedef bg::model::multi_linestring ML; + typedef bg::model::polygon PL; // ccw, open + typedef bg::model::multi_polygon MPL; + + typedef test_disjoint tester; + + tester::apply("ml-mpg-01", + from_wkt("MULTILINESTRING((0 0,2 0))"), + from_wkt("MULTIPOLYGON(((0 0,2 0,0 2)))"), + false); + + tester::apply("ml-mpg-02", + from_wkt("MULTILINESTRING((1 0,3 3))"), + from_wkt("MULTIPOLYGON(((0 0,2 0,0 2)))"), + false); + + tester::apply("ml-mpg-03", + from_wkt("MULTILINESTRING((1 1,3 3))"), + from_wkt("MULTIPOLYGON(((0 0,2 0,0 2)))"), + false); + + tester::apply("ml-mpg-04", + from_wkt("MULTILINESTRING((2 2,3 3))"), + from_wkt("MULTIPOLYGON(((0 0,2 0,0 2)))"), + true); +} + +//============================================================================ + +template +inline void test_linear_areal() +{ + typedef bg::model::point point_type; + + test_segment_polygon(); + test_segment_multipolygon(); + test_segment_ring(); + test_segment_box(); + + test_linestring_polygon(); + test_linestring_multipolygon(); + test_linestring_ring(); + test_linestring_box(); + + test_multilinestring_polygon(); + test_multilinestring_multipolygon(); + test_multilinestring_ring(); + test_multilinestring_box(); +} + +//============================================================================ + +BOOST_AUTO_TEST_CASE( test_linear_areal_all ) +{ + test_linear_areal(); + test_linear_areal(); +#ifdef HAVE_TTMATH + test_linear_areal(); +#endif +} diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_l_l.cpp b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_l_l.cpp new file mode 100644 index 000000000..1d1161e1c --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_l_l.cpp @@ -0,0 +1,379 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_disjoint_coverage +#endif + +// unit test to test disjoint for all geometry combinations + +#include + +#include + +#include +#include + +#include + +#include +#include + +#include + +#include + +#include + + +#ifdef HAVE_TTMATH +#include +#endif + +namespace bg = ::boost::geometry; + +//============================================================================ + +struct test_disjoint +{ + template + static inline void apply(std::string const& case_id, + Geometry1 const& geometry1, + Geometry2 const& geometry2, + bool expected_result) + { + bool result = bg::disjoint(geometry1, geometry2); + BOOST_CHECK_MESSAGE(result == expected_result, + "case ID: " << case_id << ", G1: " << bg::wkt(geometry1) + << ", G2: " << bg::wkt(geometry2) << " -> Expected: " + << expected_result << ", detected: " << result); + + result = bg::disjoint(geometry2, geometry1); + BOOST_CHECK_MESSAGE(result == expected_result, + "case ID: " << case_id << ", G1: " << bg::wkt(geometry2) + << ", G2: " << bg::wkt(geometry1) << " -> Expected: " + << expected_result << ", detected: " << result); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "case ID: " << case_id << "; G1 - G2: "; + std::cout << bg::wkt(geometry1) << " - "; + std::cout << bg::wkt(geometry2) << std::endl; + std::cout << std::boolalpha; + std::cout << "expected/computed result: " + << expected_result << " / " << result << std::endl; + std::cout << std::endl; + std::cout << std::noboolalpha; +#endif + } +}; + +//============================================================================ + +// linear-linear geometries +template +inline void test_segment_segment() +{ + typedef bg::model::segment

S; + + typedef test_disjoint tester; + + tester::apply("s-s-01", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("SEGMENT(0 0,0 2)"), + false); + + tester::apply("s-s-02", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("SEGMENT(2 0,3 0)"), + false); + + tester::apply("s-s-03", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("SEGMENT(1 0,3 0)"), + false); + + tester::apply("s-s-04", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("SEGMENT(1 0,1 1)"), + false); + + tester::apply("s-s-05", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("SEGMENT(1 1,2 2)"), + true); + + tester::apply("s-s-06", + from_wkt("SEGMENT(0 0,1 1)"), + from_wkt("SEGMENT(1 1,1 1)"), + false); + + tester::apply("s-s-07", + from_wkt("SEGMENT(0 0,1 1)"), + from_wkt("SEGMENT(2 2,2 2)"), + true); + + tester::apply("s-s-08", + from_wkt("SEGMENT(0 0,1 1)"), + from_wkt("SEGMENT(2 2,3 3)"), + true); +} + +template +inline void test_linestring_segment() +{ + typedef bg::model::segment

S; + typedef bg::model::linestring

L; + + typedef test_disjoint tester; + + tester::apply("l-s-01", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("LINESTRING(0 0,0 2)"), + false); + + tester::apply("l-s-02", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("LINESTRING(2 0,3 0)"), + false); + + tester::apply("l-s-03", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("LINESTRING(1 0,3 0)"), + false); + + tester::apply("l-s-04", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("LINESTRING(1 0,1 1)"), + false); + + tester::apply("l-s-05", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("LINESTRING(1 1,2 2)"), + true); + + tester::apply("l-s-06", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("LINESTRING(1 1,1 1,2 2)"), + true); + + tester::apply("l-s-07", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("LINESTRING(1 0,1 0,1 1,2 2)"), + false); + + tester::apply("l-s-08", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("LINESTRING(1 0,1 0,3 0)"), + false); + + tester::apply("l-s-09", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("LINESTRING(3 0,3 0,4 0)"), + true); + + tester::apply("l-s-10", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("LINESTRING(3 0,3 0)"), + true); + + tester::apply("l-s-11", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("LINESTRING(-1 0,-1 0)"), + true); + + tester::apply("l-s-12", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("LINESTRING(1 0,1 0)"), + false); + + tester::apply("l-s-13", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("LINESTRING(1 1,1 1)"), + true); +} + +template +inline void test_multilinestring_segment() +{ + typedef bg::model::segment

S; + typedef bg::model::linestring

L; + typedef bg::model::multi_linestring ML; + + typedef test_disjoint tester; + + tester::apply("s-ml-01", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("MULTILINESTRING((0 0,0 2))"), + false); + + tester::apply("s-ml-02", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("MULTILINESTRING((2 0,3 0))"), + false); + + tester::apply("s-ml-03", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("MULTILINESTRING((1 0,3 0))"), + false); + + tester::apply("s-ml-04", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("MULTILINESTRING((1 0,1 1))"), + false); + + tester::apply("s-ml-05", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("MULTILINESTRING((1 1,2 2))"), + true); + + tester::apply("s-ml-06", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("MULTILINESTRING((1 1,2 2),(3 3,3 3))"), + true); + + tester::apply("s-ml-07", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("MULTILINESTRING((1 1,2 2),(1 0,1 0))"), + false); + + tester::apply("s-ml-08", + from_wkt("SEGMENT(0 0,2 0)"), + from_wkt("MULTILINESTRING((1 1,2 2),(3 0,3 0))"), + true); +} + +template +inline void test_linestring_linestring() +{ + typedef bg::model::linestring

L; + + typedef test_disjoint tester; + + tester::apply("l-l-01", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("LINESTRING(0 0,0 2)"), + false); + + tester::apply("l-l-02", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("LINESTRING(2 0,3 0)"), + false); + + tester::apply("l-l-03", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("LINESTRING(1 0,3 0)"), + false); + + tester::apply("l-l-04", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("LINESTRING(1 0,1 1)"), + false); + + tester::apply("l-l-05", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("LINESTRING(1 1,2 2)"), + true); +} + +template +inline void test_linestring_multilinestring() +{ + typedef bg::model::linestring

L; + typedef bg::model::multi_linestring ML; + + typedef test_disjoint tester; + + tester::apply("l-ml-01", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("MULTILINESTRING((0 0,0 2))"), + false); + + tester::apply("l-ml-02", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("MULTILINESTRING((2 0,3 0))"), + false); + + tester::apply("l-ml-03", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("MULTILINESTRING((1 0,3 0))"), + false); + + tester::apply("l-ml-04", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("MULTILINESTRING((1 0,1 1))"), + false); + + tester::apply("l-ml-05", + from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("MULTILINESTRING((1 1,2 2))"), + true); +} + +template +inline void test_multilinestring_multilinestring() +{ + typedef bg::model::linestring

L; + typedef bg::model::multi_linestring ML; + + typedef test_disjoint tester; + + tester::apply("ml-ml-01", + from_wkt("MULTILINESTRING((0 0,2 0))"), + from_wkt("MULTILINESTRING((0 0,0 2))"), + false); + + tester::apply("ml-ml-02", + from_wkt("MULTILINESTRING((0 0,2 0))"), + from_wkt("MULTILINESTRING((2 0,3 0))"), + false); + + tester::apply("ml-ml-03", + from_wkt("MULTILINESTRING((0 0,2 0))"), + from_wkt("MULTILINESTRING((1 0,3 0))"), + false); + + tester::apply("ml-ml-04", + from_wkt("MULTILINESTRING((0 0,2 0))"), + from_wkt("MULTILINESTRING((1 0,1 1))"), + false); + + tester::apply("ml-ml-05", + from_wkt("MULTILINESTRING((0 0,2 0))"), + from_wkt("MULTILINESTRING((1 1,2 2))"), + true); +} + +//============================================================================ + +template +inline void test_linear_linear() +{ + typedef bg::model::point point_type; + + test_linestring_linestring(); + test_linestring_multilinestring(); + test_linestring_segment(); + + test_multilinestring_multilinestring(); + test_multilinestring_segment(); + + test_segment_segment(); +} + +//============================================================================ + +BOOST_AUTO_TEST_CASE( test_linear_linear_all ) +{ + test_linear_linear(); + test_linear_linear(); +#ifdef HAVE_TTMATH + test_linear_linear(); +#endif +} diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_p_a.cpp b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_p_a.cpp new file mode 100644 index 000000000..9c8437b17 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_p_a.cpp @@ -0,0 +1,292 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_disjoint_coverage +#endif + +// unit test to test disjoint for all geometry combinations + +#include + +#include + +#include +#include + +#include + +#include +#include + +#include + +#include + +#include + + +#ifdef HAVE_TTMATH +#include +#endif + +namespace bg = ::boost::geometry; + +//============================================================================ + +struct test_disjoint +{ + template + static inline void apply(std::string const& case_id, + Geometry1 const& geometry1, + Geometry2 const& geometry2, + bool expected_result) + { + bool result = bg::disjoint(geometry1, geometry2); + BOOST_CHECK_MESSAGE(result == expected_result, + "case ID: " << case_id << ", G1: " << bg::wkt(geometry1) + << ", G2: " << bg::wkt(geometry2) << " -> Expected: " + << expected_result << ", detected: " << result); + + result = bg::disjoint(geometry2, geometry1); + BOOST_CHECK_MESSAGE(result == expected_result, + "case ID: " << case_id << ", G1: " << bg::wkt(geometry2) + << ", G2: " << bg::wkt(geometry1) << " -> Expected: " + << expected_result << ", detected: " << result); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "case ID: " << case_id << "; G1 - G2: "; + std::cout << bg::wkt(geometry1) << " - "; + std::cout << bg::wkt(geometry2) << std::endl; + std::cout << std::boolalpha; + std::cout << "expected/computed result: " + << expected_result << " / " << result << std::endl; + std::cout << std::endl; + std::cout << std::noboolalpha; +#endif + } +}; + +//============================================================================ + +// pointlike-areal geometries +template +inline void test_point_box() +{ + typedef test_disjoint tester; + typedef bg::model::box

B; + + tester::apply("p-b-01", + from_wkt

("POINT(0 0)"), + from_wkt("BOX(0 0,1 1)"), + false); + + tester::apply("p-b-02", + from_wkt

("POINT(2 2)"), + from_wkt("BOX(0 0,1 0)"), + true); +} + +template +inline void test_point_ring() +{ + typedef bg::model::ring R; // ccw, open + + typedef test_disjoint tester; + + tester::apply("p-r-01", + from_wkt

("POINT(0 0)"), + from_wkt("POLYGON((0 0,1 0,0 1))"), + false); + + tester::apply("p-r-02", + from_wkt

("POINT(1 1)"), + from_wkt("POLYGON((0 0,1 0,0 1))"), + true); +} + +template +inline void test_point_polygon() +{ + typedef bg::model::polygon PL; // ccw, open + + typedef test_disjoint tester; + + tester::apply("p-pg-01", + from_wkt

("POINT(0 0)"), + from_wkt("POLYGON((0 0,1 0,0 1))"), + false); + + tester::apply("p-pg-02", + from_wkt

("POINT(1 1)"), + from_wkt("POLYGON((0 0,1 0,0 1))"), + true); +} + +template +inline void test_point_multipolygon() +{ + typedef bg::model::polygon PL; // ccw, open + typedef bg::model::multi_polygon MPL; + + typedef test_disjoint tester; + + tester::apply("p-mpg-01", + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOLYGON(((0 0,1 0,0 1)),((2 0,3 0,2 1)))"), + false); + + tester::apply("p-mpg-02", + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOLYGON(((0 0,1 0,0 1)),((2 0,3 0,2 1)))"), + true); +} + +template +inline void test_multipoint_box() +{ + typedef test_disjoint tester; + typedef bg::model::multi_point

MP; + typedef bg::model::box

B; + + tester::apply("mp-b-01", + from_wkt("MULTIPOINT(0 0,1 1)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("mp-b-02", + from_wkt("MULTIPOINT(1 1,3 3)"), + from_wkt("BOX(0 0,2 2)"), + false); + + tester::apply("mp-b-03", + from_wkt("MULTIPOINT(3 3,4 4)"), + from_wkt("BOX(0 0,2 2)"), + true); + + tester::apply("mp-b-04", + from_wkt("MULTIPOINT()"), + from_wkt("BOX(0 0,2 2)"), + true); +} + +template +inline void test_multipoint_ring() +{ + typedef bg::model::multi_point

MP; + typedef bg::model::ring R; // ccw, open + + typedef test_disjoint tester; + + tester::apply("mp-r-01", + from_wkt("MULTIPOINT(0 0,1 0)"), + from_wkt("POLYGON((0 0,1 0,0 1))"), + false); + + tester::apply("mp-r-02", + from_wkt("MULTIPOINT(1 0,1 1)"), + from_wkt("POLYGON((0 0,1 0,0 1))"), + false); + + tester::apply("mp-r-03", + from_wkt("MULTIPOINT(1 1,2 2)"), + from_wkt("POLYGON((0 0,1 0,0 1))"), + true); +} + +template +inline void test_multipoint_polygon() +{ + typedef bg::model::multi_point

MP; + typedef bg::model::polygon PL; // ccw, open + + typedef test_disjoint tester; + + tester::apply("mp-pg-01", + from_wkt("MULTIPOINT(0 0,1 0)"), + from_wkt("POLYGON((0 0,1 0,0 1))"), + false); + + tester::apply("mp-pg-02", + from_wkt("MULTIPOINT(0 0,2 0)"), + from_wkt("POLYGON((0 0,1 0,0 1))"), + false); + + tester::apply("mp-pg-03", + from_wkt("MULTIPOINT(1 1,2 0)"), + from_wkt("POLYGON((0 0,1 0,0 1))"), + true); + + tester::apply("mp-pg-04", + from_wkt("MULTIPOINT(1 1,2 3)"), + from_wkt("POLYGON((0 0,1 0,0 1))"), + true); +} + +template +inline void test_multipoint_multipolygon() +{ + typedef bg::model::multi_point

MP; + typedef bg::model::polygon PL; // ccw, open + typedef bg::model::multi_polygon MPL; + + typedef test_disjoint tester; + + tester::apply("mp-mp-01", + from_wkt("MULTIPOINT(0 0,2 0)"), + from_wkt("MULTIPOLYGON(((0 0,1 0,0 1)),((2 0,3 0,2 1)))"), + false); + + tester::apply("mp-mp-02", + from_wkt("MULTIPOINT(0 0,1 0)"), + from_wkt("MULTIPOLYGON(((0 0,1 0,0 1)),((2 0,3 0,2 1)))"), + false); + + tester::apply("mp-mp-03", + from_wkt("MULTIPOINT(1 1,2 0)"), + from_wkt("MULTIPOLYGON(((0 0,1 0,0 1)),((2 0,3 0,2 1)))"), + false); + + tester::apply("mp-mp-04", + from_wkt("MULTIPOINT(1 1,2 3)"), + from_wkt("MULTIPOLYGON(((0 0,1 0,0 1)),((2 0,3 0,2 1)))"), + true); +} + +//============================================================================ + +template +inline void test_pointlike_areal() +{ + typedef bg::model::point point_type; + + test_point_polygon(); + test_point_multipolygon(); + test_point_ring(); + test_point_box(); + + test_multipoint_polygon(); + test_multipoint_multipolygon(); + test_multipoint_ring(); + + test_multipoint_box(); +} + +//============================================================================ + +BOOST_AUTO_TEST_CASE( test_pointlike_areal_all ) +{ + test_pointlike_areal(); + test_pointlike_areal(); +#ifdef HAVE_TTMATH + test_pointlike_areal(); +#endif +} diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_p_l.cpp b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_p_l.cpp new file mode 100644 index 000000000..ab4b8839a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_p_l.cpp @@ -0,0 +1,391 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_disjoint_coverage +#endif + +// unit test to test disjoint for all geometry combinations + +#include + +#include + +#include +#include + +#include + +#include +#include + +#include + +#include + +#include + + +#ifdef HAVE_TTMATH +#include +#endif + +namespace bg = ::boost::geometry; + +//============================================================================ + +struct test_disjoint +{ + template + static inline void apply(std::string const& case_id, + Geometry1 const& geometry1, + Geometry2 const& geometry2, + bool expected_result) + { + bool result = bg::disjoint(geometry1, geometry2); + BOOST_CHECK_MESSAGE(result == expected_result, + "case ID: " << case_id << ", G1: " << bg::wkt(geometry1) + << ", G2: " << bg::wkt(geometry2) << " -> Expected: " + << expected_result << ", detected: " << result); + + result = bg::disjoint(geometry2, geometry1); + BOOST_CHECK_MESSAGE(result == expected_result, + "case ID: " << case_id << ", G1: " << bg::wkt(geometry2) + << ", G2: " << bg::wkt(geometry1) << " -> Expected: " + << expected_result << ", detected: " << result); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "case ID: " << case_id << "; G1 - G2: "; + std::cout << bg::wkt(geometry1) << " - "; + std::cout << bg::wkt(geometry2) << std::endl; + std::cout << std::boolalpha; + std::cout << "expected/computed result: " + << expected_result << " / " << result << std::endl; + std::cout << std::endl; + std::cout << std::noboolalpha; +#endif + } +}; + +//============================================================================ + +// pointlike-linear geometries +template +inline void test_point_segment() +{ + typedef test_disjoint tester; + typedef bg::model::segment

S; + + tester::apply("p-s-01", + from_wkt

("POINT(0 0)"), + from_wkt("SEGMENT(0 0,2 0)"), + false); + + tester::apply("p-s-02", + from_wkt

("POINT(2 0)"), + from_wkt("SEGMENT(0 0,2 0)"), + false); + + tester::apply("p-s-03", + from_wkt

("POINT(1 0)"), + from_wkt("SEGMENT(0 0,2 0)"), + false); + + tester::apply("p-s-04", + from_wkt

("POINT(1 1)"), + from_wkt("SEGMENT(0 0,2 0)"), + true); + + tester::apply("p-s-05", + from_wkt

("POINT(3 0)"), + from_wkt("SEGMENT(0 0,2 0)"), + true); + + tester::apply("p-s-06", + from_wkt

("POINT(-1 0)"), + from_wkt("SEGMENT(0 0,2 0)"), + true); + + // degenerate segment + tester::apply("p-s-07", + from_wkt

("POINT(-1 0)"), + from_wkt("SEGMENT(2 0,2 0)"), + true); + + // degenerate segment + tester::apply("p-s-08", + from_wkt

("POINT(2 0)"), + from_wkt("SEGMENT(2 0,2 0)"), + false); + + // degenerate segment + tester::apply("p-s-09", + from_wkt

("POINT(3 0)"), + from_wkt("SEGMENT(2 0,2 0)"), + true); + + // degenerate segment + tester::apply("p-s-10", + from_wkt

("POINT(1 1)"), + from_wkt("SEGMENT(2 0,2 0)"), + true); +} + +template +inline void test_point_linestring() +{ + typedef bg::model::linestring

L; + + typedef test_disjoint tester; + + tester::apply("p-l-01", + from_wkt

("POINT(0 0)"), + from_wkt("LINESTRING(0 0,2 2,4 4)"), + false); + + tester::apply("p-l-02", + from_wkt

("POINT(1 1)"), + from_wkt("LINESTRING(0 0,2 2,4 4)"), + false); + + tester::apply("p-l-03", + from_wkt

("POINT(3 3)"), + from_wkt("LINESTRING(0 0,2 2,4 4)"), + false); + + tester::apply("p-l-04", + from_wkt

("POINT(1 0)"), + from_wkt("LINESTRING(0 0,2 2,4 4)"), + true); + + tester::apply("p-l-05", + from_wkt

("POINT(5 5)"), + from_wkt("LINESTRING(0 0,2 2,4 4)"), + true); + + tester::apply("p-l-06", + from_wkt

("POINT(5 5)"), + from_wkt("LINESTRING(0 0,2 2)"), + true); +} + +template +inline void test_point_multilinestring() +{ + typedef bg::model::linestring

L; + typedef bg::model::multi_linestring ML; + + typedef test_disjoint tester; + + tester::apply("p-ml-01", + from_wkt

("POINT(0 1)"), + from_wkt("MULTILINESTRING((0 0,2 2,4 4),(0 0,2 0,4 0))"), + true); + + tester::apply("p-ml-02", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((0 0,2 2,4 4),(0 0,2 0,4 0))"), + false); + + tester::apply("p-ml-03", + from_wkt

("POINT(1 1)"), + from_wkt("MULTILINESTRING((0 0,2 2,4 4),(0 0,2 0,4 0))"), + false); + + tester::apply("p-ml-04", + from_wkt

("POINT(1 0)"), + from_wkt("MULTILINESTRING((0 0,2 2,4 4),(0 0,2 0,4 0))"), + false); + + tester::apply("p-ml-05", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((1 1,2 2,4 4),(3 0,4 0))"), + true); + + tester::apply("p-ml-06", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((1 1,2 2,4 4),(0 0,4 0))"), + false); + + tester::apply("p-ml-07", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((1 1,2 2,4 4),(-1 0,4 0))"), + false); +} + +template +inline void test_multipoint_segment() +{ + typedef test_disjoint tester; + typedef bg::model::multi_point

MP; + typedef bg::model::segment

S; + + tester::apply("mp-s-01", + from_wkt("MULTIPOINT(0 0,1 1)"), + from_wkt("SEGMENT(0 0,2 0)"), + false); + + tester::apply("mp-s-02", + from_wkt("MULTIPOINT(1 0,1 1)"), + from_wkt("SEGMENT(0 0,2 0)"), + false); + + tester::apply("mp-s-03", + from_wkt("MULTIPOINT(1 1,2 2)"), + from_wkt("SEGMENT(0 0,2 0)"), + true); + + tester::apply("mp-s-04", + from_wkt("MULTIPOINT()"), + from_wkt("SEGMENT(0 0,2 0)"), + true); + + tester::apply("mp-s-05", + from_wkt("MULTIPOINT(3 0,4 0)"), + from_wkt("SEGMENT(0 0,2 0)"), + true); + + tester::apply("mp-s-06", + from_wkt("MULTIPOINT(1 0,4 0)"), + from_wkt("SEGMENT(0 0,2 0)"), + false); + + // segments that degenerate to a point + tester::apply("mp-s-07", + from_wkt("MULTIPOINT(1 1,2 2)"), + from_wkt("SEGMENT(0 0,0 0)"), + true); + + tester::apply("mp-s-08", + from_wkt("MULTIPOINT(1 1,2 2)"), + from_wkt("SEGMENT(1 1,1 1)"), + false); +} + +template +inline void test_multipoint_linestring() +{ + typedef bg::model::multi_point

MP; + typedef bg::model::linestring

L; + + typedef test_disjoint tester; + + tester::apply("mp-l-01", + from_wkt("MULTIPOINT(0 0,1 0)"), + from_wkt("LINESTRING(0 0,2 2,4 4)"), + false); + + tester::apply("mp-l-02", + from_wkt("MULTIPOINT(1 0,1 1)"), + from_wkt("LINESTRING(0 0,2 2,4 4)"), + false); + + tester::apply("mp-l-03", + from_wkt("MULTIPOINT(1 0,3 3)"), + from_wkt("LINESTRING(0 0,2 2,4 4)"), + false); + + tester::apply("mp-l-04", + from_wkt("MULTIPOINT(1 0,2 0)"), + from_wkt("LINESTRING(0 0,2 2,4 4)"), + true); + + tester::apply("mp-l-05", + from_wkt("MULTIPOINT(-1 -1,2 0)"), + from_wkt("LINESTRING(0 0,2 2,4 4)"), + true); + + tester::apply("mp-l-06", + from_wkt("MULTIPOINT(-1 -1,2 0)"), + from_wkt("LINESTRING(1 0,3 0)"), + false); + + tester::apply("mp-l-07", + from_wkt("MULTIPOINT(-1 -1,2 0,-1 -1,2 0)"), + from_wkt("LINESTRING(1 0,3 0)"), + false); + + tester::apply("mp-l-08", + from_wkt("MULTIPOINT(2 0)"), + from_wkt("LINESTRING(1 0)"), + true); + + tester::apply("mp-l-09", + from_wkt("MULTIPOINT(3 0,0 0,3 0)"), + from_wkt("LINESTRING(1 0,2 0)"), + true); +} + +template +inline void test_multipoint_multilinestring() +{ + typedef bg::model::multi_point

MP; + typedef bg::model::linestring

L; + typedef bg::model::multi_linestring ML; + + typedef test_disjoint tester; + + tester::apply("mp-ml-01", + from_wkt("MULTIPOINT(0 1,0 2)"), + from_wkt("MULTILINESTRING((0 0,2 2,4 4),(0 0,2 0,4 0))"), + true); + + tester::apply("mp-ml-02", + from_wkt("MULTIPOINT(0 0,1 0)"), + from_wkt("MULTILINESTRING((0 0,2 2,4 4),(0 0,2 0,4 0))"), + false); + + tester::apply("mp-ml-03", + from_wkt("MULTIPOINT(0 1,1 1)"), + from_wkt("MULTILINESTRING((0 0,2 2,4 4),(0 0,2 0,4 0))"), + false); + + tester::apply("mp-ml-04", + from_wkt("MULTIPOINT(0 1,1 0)"), + from_wkt("MULTILINESTRING((0 0,2 2,4 4),(0 0,2 0,4 0))"), + false); + + tester::apply("mp-ml-05", + from_wkt("MULTIPOINT(0 0,10 0)"), + from_wkt("MULTILINESTRING((0 0,2 2,4 4),(0 0,2 0,4 0))"), + false); + + tester::apply("mp-ml-06", + from_wkt("MULTIPOINT(-1 0,3 0)"), + from_wkt("MULTILINESTRING((0 0,2 2,4 4),(0 0,2 0,4 0))"), + false); +} + +//============================================================================ + +template +inline void test_pointlike_linear() +{ + typedef bg::model::point point_type; + + test_point_linestring(); + test_point_multilinestring(); + test_point_segment(); + + test_multipoint_linestring(); + test_multipoint_multilinestring(); + test_multipoint_segment(); +} + +//============================================================================ + +BOOST_AUTO_TEST_CASE( test_pointlike_linear_all ) +{ + test_pointlike_linear(); + test_pointlike_linear(); +#ifdef HAVE_TTMATH + test_pointlike_linear(); +#endif +} diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_p_p.cpp b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_p_p.cpp new file mode 100644 index 000000000..a634e9291 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_coverage_p_p.cpp @@ -0,0 +1,187 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_disjoint_coverage +#endif + +// unit test to test disjoint for all geometry combinations + +#include + +#include + +#include +#include + +#include + +#include +#include + +#include + +#include + +#include + + +#ifdef HAVE_TTMATH +#include +#endif + +namespace bg = ::boost::geometry; + +//============================================================================ + +struct test_disjoint +{ + template + static inline void apply(std::string const& case_id, + Geometry1 const& geometry1, + Geometry2 const& geometry2, + bool expected_result) + { + bool result = bg::disjoint(geometry1, geometry2); + BOOST_CHECK_MESSAGE(result == expected_result, + "case ID: " << case_id << ", G1: " << bg::wkt(geometry1) + << ", G2: " << bg::wkt(geometry2) << " -> Expected: " + << expected_result << ", detected: " << result); + + result = bg::disjoint(geometry2, geometry1); + BOOST_CHECK_MESSAGE(result == expected_result, + "case ID: " << case_id << ", G1: " << bg::wkt(geometry2) + << ", G2: " << bg::wkt(geometry1) << " -> Expected: " + << expected_result << ", detected: " << result); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "case ID: " << case_id << "; G1 - G2: "; + std::cout << bg::wkt(geometry1) << " - "; + std::cout << bg::wkt(geometry2) << std::endl; + std::cout << std::boolalpha; + std::cout << "expected/computed result: " + << expected_result << " / " << result << std::endl; + std::cout << std::endl; + std::cout << std::noboolalpha; +#endif + } +}; + +//============================================================================ + +// pointlike-pointlike geometries +template +inline void test_point_point() +{ + typedef test_disjoint tester; + + tester::apply("p-p-01", + from_wkt

("POINT(0 0)"), + from_wkt

("POINT(0 0)"), + false); + + tester::apply("p-p-02", + from_wkt

("POINT(0 0)"), + from_wkt

("POINT(1 1)"), + true); +} + +template +inline void test_point_multipoint() +{ + typedef bg::model::multi_point

MP; + + typedef test_disjoint tester; + + tester::apply("p-mp-01", + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0,1 1)"), + false); + + tester::apply("p-mp-02", + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(1 1,2 2)"), + true); + + tester::apply("p-mp-03", + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT()"), + true); +} + +template +inline void test_multipoint_point() +{ + typedef bg::model::multi_point

MP; + + typedef test_disjoint tester; + + tester::apply("mp-p-01", + from_wkt("MULTIPOINT(0 0,1 1)"), + from_wkt

("POINT(0 0)"), + false); + + tester::apply("mp-p-02", + from_wkt("MULTIPOINT(1 1,2 2)"), + from_wkt

("POINT(0 0)"), + true); +} + +template +inline void test_multipoint_multipoint() +{ + typedef bg::model::multi_point

MP; + + typedef test_disjoint tester; + + tester::apply("mp-mp-01", + from_wkt("MULTIPOINT(0 0,1 0)"), + from_wkt("MULTIPOINT(0 0,1 1)"), + false); + + tester::apply("mp-mp-02", + from_wkt("MULTIPOINT(0 0,1 0)"), + from_wkt("MULTIPOINT(1 1,2 2)"), + true); + + tester::apply("mp-mp-03", + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT(1 1,2 2)"), + true); + + tester::apply("mp-mp-04", + from_wkt("MULTIPOINT(0 0,1 0)"), + from_wkt("MULTIPOINT()"), + true); +} + +//============================================================================ + +template +inline void test_pointlike_pointlike() +{ + typedef bg::model::point point_type; + + test_point_point(); + test_point_multipoint(); + test_multipoint_point(); + test_multipoint_multipoint(); +} + +//============================================================================ + +BOOST_AUTO_TEST_CASE( test_pointlike_pointlike_all ) +{ + test_pointlike_pointlike(); + test_pointlike_pointlike(); +#ifdef HAVE_TTMATH + test_pointlike_pointlike(); +#endif +} diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_multi.cpp b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_multi.cpp new file mode 100644 index 000000000..8bc8a6b55 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_multi.cpp @@ -0,0 +1,129 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#include "test_disjoint.hpp" + +#include + +#include +#include + +#include + +#include + + +template +void test_all() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + typedef bg::model::polygon

polygon; + typedef bg::model::multi_polygon mp; + + test_disjoint("", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + false); + + // True disjoint + test_disjoint("", + "MULTIPOLYGON(((0 0,0 4,4 4,4 0,0 0)))", + "MULTIPOLYGON(((6 6,6 10,10 10,10 6,6 6)))", + true); + + // Touch -> not disjoint + test_disjoint("", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))", + "MULTIPOLYGON(((5 5,5 10,10 10,10 5,5 5)))", + false); + + // Not disjoint but no IP's + test_disjoint("no_ips", + "MULTIPOLYGON(((2 2,2 8,8 8,8 2,2 2)),((20 0,20 10,30 10,30 0,20 0)))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((22 2,28 2,28 8,22 8,22 2)))", + false); + + // Not disjoint and not inside each other (in first ring) but wrapped (in second rings) + test_disjoint("no_ips2", + "MULTIPOLYGON(((2 2,2 8,8 8,8 2,2 2)),((20 0,20 10,30 10,30 0,20 0)))", + "MULTIPOLYGON(((2 12,2 18,8 18,8 12,2 12)),((22 2,28 2,28 8,22 8,22 2)))", + false); + + test_disjoint("no_ips2_rev", + "MULTIPOLYGON(((2 12,2 18,8 18,8 12,2 12)),((22 2,28 2,28 8,22 8,22 2)))", + "MULTIPOLYGON(((2 2,2 8,8 8,8 2,2 2)),((20 0,20 10,30 10,30 0,20 0)))", + false); + + + test_disjoint("point_mp1", + "POINT(0 0)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + false); + + test_disjoint("point_mp2", + "POINT(5 5)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + false); + + test_disjoint("point_mp1", + "POINT(11 11)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + true); + + std::string polygon_inside_hole("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0), (2 2,8 2,8 8,2 8,2 2)),((4 4,4 6,6 6,6 4,4 4)))"); + test_disjoint("point_mp_pih1", + "POINT(5 5)", + polygon_inside_hole, + false); + + test_disjoint("point_mp_pih2", + "POINT(3 3)", + polygon_inside_hole, + true); + + test_disjoint("point_mp1rev", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + "POINT(0 0)", + false); + + // assertion failure in 1.57 + test_disjoint("point_l_ml_assert_1_57", + "LINESTRING(-2305843009213693956 4611686018427387906, -33 -92, 78 83)", + "MULTILINESTRING((20 100, 31 -97, -46 57, -20 -4))", + false); + test_disjoint("point_l_ml_assert_1_57", + "LINESTRING(-2305843009213693956 4611686018427387906, -33 -92, 78 83)", + "MULTILINESTRING((20 100, 31 -97, -46 57, -20 -4),(-71 -4))", + false); +} + +int test_main(int, char* []) +{ + //test_all >(); + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} + + +/* +with viewy as +( +select geometry::STGeomFromText('MULTIPOLYGON(((2 2,2 8,8 8,8 2,2 2)),((20 0,20 10,30 10,30 0,20 0)))',0) as p + , geometry::STGeomFromText('MULTIPOLYGON(((2 12,2 18,8 18,8 12,2 12)),((22 2,28 2,28 8,22 8,22 2)))',0) as q +) + select p from viewy union all select q from viewy +-- select p.STDisjoint(q) from viewy +*/ diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_point_box_geometry.cpp b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_point_box_geometry.cpp new file mode 100644 index 000000000..37fb8b15a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_point_box_geometry.cpp @@ -0,0 +1,128 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2015. +// Modifications copyright (c) 2015, 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. + +// 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) + + +#include "test_disjoint.hpp" + +#include +#include +#include + +#include + +#include + +#include + + +template +void test_all() +{ + typedef bg::model::box

box; + + test_disjoint("pp1", "point(1 1)", "point(1 1)", false); + test_disjoint("pp2", "point(1 1)", "point(1.001 1)", true); + + // left-right + test_disjoint("bb1", "box(1 1, 2 2)", "box(3 1, 4 2)", true); + test_disjoint("bb2", "box(1 1, 2 2)", "box(2 1, 3 2)", false); + test_disjoint("bb3", "box(1 1, 2 2)", "box(2 2, 3 3)", false); + test_disjoint("bb4", "box(1 1, 2 2)", "box(2.001 2, 3 3)", true); + + // up-down + test_disjoint("bb5", "box(1 1, 2 2)", "box(1 3, 2 4)", true); + test_disjoint("bb6", "box(1 1, 2 2)", "box(1 2, 2 3)", false); + // right-left + test_disjoint("bb7", "box(1 1, 2 2)", "box(0 1, 1 2)", false); + test_disjoint("bb8", "box(1 1, 2 2)", "box(0 1, 1 2)", false); + + // point-box + test_disjoint("pb1", "point(1 1)", "box(0 0, 2 2)", false); + test_disjoint("pb2", "point(2 2)", "box(0 0, 2 2)", false); + test_disjoint("pb3", "point(2.0001 2)", "box(1 1, 2 2)", true); + test_disjoint("pb4", "point(0.9999 2)", "box(1 1, 2 2)", true); + + // box-point (to test reverse compiling) + test_disjoint("bp1", "box(1 1, 2 2)", "point(2 2)", false); + + // Test triangles for polygons/rings, boxes + // Note that intersections are tested elsewhere, they don't need + // thorough test at this place + typedef bg::model::polygon

polygon; + typedef bg::model::ring

ring; + + // Testing overlap (and test compiling with box) + test_disjoint("overlaps_box_pp", overlaps_box[0], overlaps_box[1], false); + test_disjoint("overlaps_box_bp", overlaps_box[0], overlaps_box[1], false); + test_disjoint("overlaps_box_br", overlaps_box[0], overlaps_box[1], false); + test_disjoint("overlaps_box_pb", overlaps_box[1], overlaps_box[0], false); + test_disjoint("overlaps_box_rb", overlaps_box[1], overlaps_box[0], false); + + test_disjoint("point_ring1", "POINT(0 0)", "POLYGON((0 0,3 3,6 0,0 0))", false); + test_disjoint("point_ring2", "POINT(3 1)", "POLYGON((0 0,3 3,6 0,0 0))", false); + test_disjoint("point_ring3", "POINT(0 3)", "POLYGON((0 0,3 3,6 0,0 0))", true); + test_disjoint("point_polygon1", "POINT(0 0)", "POLYGON((0 0,3 3,6 0,0 0))", false); + test_disjoint("point_polygon2", "POINT(3 1)", "POLYGON((0 0,3 3,6 0,0 0))", false); + test_disjoint("point_polygon3", "POINT(0 3)", "POLYGON((0 0,3 3,6 0,0 0))", true); + + test_disjoint("point_ring2", "POLYGON((0 0,3 3,6 0,0 0))", "POINT(0 0)", false); + test_disjoint("point_polygon2", "POLYGON((0 0,3 3,6 0,0 0))", "POINT(0 0)", false); + + + // Problem described by Volker/Albert 2012-06-01 + test_disjoint("volker_albert_1", + "POLYGON((1992 3240,1992 1440,3792 1800,3792 3240,1992 3240))", + "BOX(1941 2066, 2055 2166)", false); + + test_disjoint("volker_albert_2", + "POLYGON((1941 2066,2055 2066,2055 2166,1941 2166))", + "BOX(1941 2066, 2055 2166)", false); +} + + +template +void test_3d() +{ + typedef bg::model::box

box; + + test_disjoint("pp 3d 1", "point(1 1 1)", "point(1 1 1)", false); + test_disjoint("pp 3d 2", "point(1 1 1)", "point(1.001 1 1)", true); + + test_disjoint("bb1", "box(1 1 1, 2 2 2)", "box(3 1 1, 4 2 1)", true); + test_disjoint("bb2", "box(1 1 1, 2 2 2)", "box(2 1 1, 3 2 1)", false); + test_disjoint("bb3", "box(1 1 1, 2 2 2)", "box(2 2 1, 3 3 1)", false); + test_disjoint("bb4", "box(1 1 1, 2 2 2)", "box(2.001 2 1, 3 3 1)", true); + +} + + +int test_main(int, char* []) +{ + test_all >(); + + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + test_3d >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_seg_box.cpp b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_seg_box.cpp new file mode 100644 index 000000000..2aa8c3f23 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_seg_box.cpp @@ -0,0 +1,301 @@ +// Boost.Geometry + +// Copyright (c) 2016-2019 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, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#include + +#include "test_disjoint_seg_box.hpp" + + +namespace bg = boost::geometry; + +//Tests for disjoint(point, box), disjoint(box, box) and disjoint(segment, box) + +template +void disjoint_tests_1() +{ + test_disjoint, P>("BOX(1 1,3 3)", "POINT(4 4)", true); + test_disjoint, P>("BOX(1 1,3 3)", "POINT(2 2)", false); + test_disjoint, P>("BOX(1 1,3 3)", "POINT(3 3)", false); + test_disjoint, P>("BOX(1 1,3 3)", "POINT(2 3)", false); + + test_disjoint, bg::model::box

>("BOX(1 1,3 3)", + "BOX(1 4,5 5)", + true); + test_disjoint, bg::model::box

>("BOX(1 1,3 3)", + "BOX(2 2,4 4)", + false); + test_disjoint, bg::model::box

>("BOX(1 1,3 3)", + "BOX(3 3,4 4)", + false); + test_disjoint, bg::model::box

>("BOX(1 1,3 3)", + "BOX(2 3,4 4)", + false); + + test_disjoint, bg::model::segment

>("BOX(1 1,3 3)", + "SEGMENT(1 4, 5 5)", + true); + test_disjoint, bg::model::segment

>("BOX(1 1,3 3)", + "SEGMENT(3 3, 5 5)", + false); + test_disjoint, bg::model::segment

>("BOX(1 1,3 3)", + "SEGMENT(1 1, 4 1)", + false); + test_disjoint, bg::model::segment

>("BOX(1 1,3 3)", + "SEGMENT(1 2, 5 5)", + false); + test_disjoint, bg::model::segment

>("BOX(1 1,3 3)", + "SEGMENT(1 2, 3 2)", + false); + test_disjoint, bg::model::segment

>("BOX(1 1,3 3)", + "SEGMENT(0 0, 4 0)", + true); + test_disjoint, bg::model::segment

>("BOX(1 1,3 3)", + "SEGMENT(2 2, 4 4)", + false); + test_disjoint, bg::model::segment

>("BOX(1 1,3 3)", + "SEGMENT(4 4, 2 2)", + false); + test_disjoint, bg::model::segment

>("BOX(1 1,3 3)", + "SEGMENT(1.5 1.5, 2 2)", + false); +} + +template +void disjoint_tests_2(bool expected_result) +{ + test_disjoint, bg::model::segment

>("BOX(1 1,3 3)", + "SEGMENT(1 0.999, 10 0.999)", + expected_result); + test_disjoint, bg::model::segment

>("BOX(1 1,3 3)", + "SEGMENT(10 0.999, 1 0.999)", + expected_result); +} + +template +void disjoint_tests_3(bool expected_result) +{ + test_disjoint, bg::model::segment

>("BOX(3 4.42, 100 5)", + "SEGMENT(2 2.9, 100 2.9)", + expected_result); + test_disjoint, bg::model::segment

>("BOX(3 4.42, 100 5)", + "SEGMENT(100 2.9, 2 2.9)", + expected_result); +} + +template +void disjoint_tests_4(bool expected_result) +{ + test_disjoint, bg::model::segment

>("BOX(1 1,3 3)", + "SEGMENT(0 0.99999999, 2 0.99999999)", + expected_result); + test_disjoint, bg::model::segment

>("BOX(1 1,3 3)", + "SEGMENT(2 0.99999999, 0 0.99999999)", + expected_result); +} + +template +void disjoint_tests_with_strategy(bool expected_result) +{ + bg::strategy::disjoint::segment_box_geographic + < + bg::strategy::andoyer, + bg::srs::spheroid, + CT + > geographic_andoyer; + + bg::strategy::disjoint::segment_box_geographic + < + bg::strategy::thomas, + bg::srs::spheroid, + CT + > geographic_thomas; + + bg::strategy::disjoint::segment_box_geographic + < + bg::strategy::vincenty, + bg::srs::spheroid, + CT + > geographic_vincenty; + + test_disjoint_strategy, bg::model::segment

> + ("BOX(1 1,3 3)", "SEGMENT(1 0.999, 10 0.999)", + expected_result, geographic_andoyer); + test_disjoint_strategy, bg::model::segment

> + ("BOX(1 1,3 3)", "SEGMENT(1 0.999, 10 0.999)", + expected_result, geographic_thomas); + test_disjoint_strategy, bg::model::segment

> + ("BOX(1 1,3 3)", "SEGMENT(1 0.999, 10 0.999)", + expected_result, geographic_vincenty); +} + +template +void disjoint_tests_sph_geo() +{ + //Case A: box intersects without containing the vertex + test_disjoint, bg::model::segment

>("BOX(0 6, 120 7)", + "SEGMENT(0 5, 120 5)", + false); + test_disjoint, bg::model::segment

>("BOX(0 -6, 120 -7)", + "SEGMENT(0 -5, 120 -5)", + false); + + //Case B: box intersects and contains the vertex + test_disjoint, bg::model::segment

>("BOX(0 9, 120 10)", + "SEGMENT(0 5, 120 5)", + false); + test_disjoint, bg::model::segment

>("BOX(0 -10, 120 -9)", + "SEGMENT(0 -5, 120 -5)", + false); + + //Case C: bounding boxes disjoint + test_disjoint, bg::model::segment

>("BOX(0 10, 10 20)", + "SEGMENT(0 5, 120 5)", + true); + test_disjoint, bg::model::segment

>("BOX(0 -20, 10 -10)", + "SEGMENT(0 -5, 120 -5)", + true); + + //Case D: bounding boxes intersect but box segment are disjoint + test_disjoint, bg::model::segment

>("BOX(0 9, 0.1 20)", + "SEGMENT(0 5, 120 5)", + true); + test_disjoint, bg::model::segment

>("BOX(0 -20, 0.1 -9)", + "SEGMENT(0 -5, 120 -5)", + true); + + //Case E: geodesic intersects box but box segment are disjoint + test_disjoint, bg::model::segment

>("BOX(121 0, 122 10)", + "SEGMENT(0 5, 120 5)", + true); + test_disjoint, bg::model::segment

>("BOX(121 -10, 122 0)", + "SEGMENT(0 -5, 120 -5)", + true); + + //Case F: segment crosses box + test_disjoint, bg::model::segment

>("BOX(100 0, 110 20)", + "SEGMENT(0 5, 120 5)", + false); + test_disjoint, bg::model::segment

>("BOX(100 -20, 110 0)", + "SEGMENT(0 -5, 120 -5)", + false); + + //Case G: box contains one segment endpoint + test_disjoint, bg::model::segment

>("BOX(110 0, 130 10)", + "SEGMENT(0 5, 120 5)", + false); + test_disjoint, bg::model::segment

>("BOX(110 -10, 130 0)", + "SEGMENT(0 -5, 120 -5)", + false); + + //Case H: box below segment + test_disjoint, bg::model::segment

>("BOX(50 0, 70 6)", + "SEGMENT(0 5, 120 5)", + true); + test_disjoint, bg::model::segment

>("BOX(50 -6, 70 0)", + "SEGMENT(0 -5, 120 -5)", + true); + + //Case I: box contains segment + test_disjoint, bg::model::segment

>("BOX(-10 0, 130 10)", + "SEGMENT(0 5, 120 5)", + false); + test_disjoint, bg::model::segment

>("BOX(-10 -10, 130 0)", + "SEGMENT(0 -5, 120 -5)", + false); + + //ascending segment + test_disjoint, bg::model::segment

>("BOX(0 10, 120 10.1)", + "SEGMENT(0 5, 120 5.1)", + false); + + //descending segment + test_disjoint, bg::model::segment

>("BOX(0 9.8, 120 10)", + "SEGMENT(0 5, 120 4.9)", + false); + + //ascending segment both hemispheres + test_disjoint, bg::model::segment

>("BOX(100 5, 120 6)", + "SEGMENT(0 -1, 120 4.9)", + false); + + //descending segment both hemispheres + test_disjoint, bg::model::segment

>("BOX(0 5, 20 6)", + "SEGMENT(0 4.9, 120 -1)", + false); + + //https://github.com/boostorg/geometry/issues/579 + test_disjoint, bg::model::segment

>("BOX(10 10,20 20)", + "SEGMENT(12 2,12 1)", + true); + test_disjoint, bg::model::segment

>("BOX(10 10,20 20)", + "SEGMENT(12 1,12 2)", + true); +} + +template +void test_all() +{ + typedef bg::model::d2::point_xy point; + typedef bg::model::point > sph_point; + typedef bg::model::point > geo_point; + + disjoint_tests_1(); + disjoint_tests_1(); + disjoint_tests_1(); + + disjoint_tests_2(true); + disjoint_tests_2(false); + disjoint_tests_2(false); + + //illustrate difference between spherical and geographic computation on same data + disjoint_tests_3(true); + disjoint_tests_3(true); + disjoint_tests_3(false); + + disjoint_tests_4(false); + disjoint_tests_4(false); + + disjoint_tests_with_strategy(false); + + disjoint_tests_sph_geo(); + disjoint_tests_sph_geo(); +} + + +int test_main( int , char* [] ) +{ + test_all(); + test_all(); + +#ifdef HAVE_TTMATH + common_tests >(); + common_tests >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_sph.cpp b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_sph.cpp new file mode 100644 index 000000000..b6f6f4adb --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/disjoint_sph.cpp @@ -0,0 +1,327 @@ +// Boost.Geometry + +// Copyright (c) 2016, 2019 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) + +#include "test_disjoint.hpp" + +#include +#include + +#include + +#include + + +template +void test_polygon_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + + test_geometry(case_1[0], case_1[1], + false); + test_geometry(case_1[0], case_1[1], + false); + + test_geometry(case_1[0], case_1[1], + false); + test_geometry(case_2[0], case_2[1], + false); + test_geometry(case_3_sph[0], case_3_sph[1], + false); + test_geometry(case_3_2_sph[0], case_3_2_sph[1], + false); + test_geometry(case_4[0], case_4[1], + false); + test_geometry(case_5[0], case_5[1], + false); + test_geometry(case_6_sph[0], case_6_sph[1], + false); + + test_geometry(case_7[0], case_7[1], + false); + test_geometry(case_8_sph[0], case_8_sph[1], + false); + test_geometry(case_9_sph[0], case_9_sph[1], + false); + test_geometry(case_10_sph[0], case_10_sph[1], + false); + test_geometry(case_11_sph[0], case_11_sph[1], + false); + test_geometry(case_12[0], case_12[1], + false); + + test_geometry(case_13_sph[0], case_13_sph[1], + false); + test_geometry(case_14_sph[0], case_14_sph[1], + false); + test_geometry(case_15_sph[0], case_15_sph[1], + false); + test_geometry(case_16_sph[0], case_16_sph[1], + false); + test_geometry(case_17_sph[0], case_17_sph[1], + false); + test_geometry(case_17_sph[1], case_17_sph[0], + false); + test_geometry(case_18_sph[0], case_18_sph[1], + false); + test_geometry(case_18_sph[1], case_18_sph[0], + false); +} + +template +void test_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_1[0], case_multi_2[0], + false); + test_geometry(case_2[0], case_multi_2[0], + false); +} + +template +void test_multi_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_multi_2[0], case_multi_2[1], + false); +} + +template +void test_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::polygon

ring; + + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_geometry("LINESTRING(0 0,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(5 0,5 5,10 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(5 1,5 5,9 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(11 1,11 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + false); + + test_geometry("LINESTRING(9 1,10 5,9 9,1 9,1 1,9 1)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + false); + + test_geometry("LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + false); +} + +template +void test_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("LINESTRING(10 1,10 5,10 9)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)))", + false); +} + +template +void test_multi_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((11 11, 20 20),(5 7, 4 1))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2))", + false); + + test_geometry("MULTILINESTRING((6 6,15 15),(0 0, 7 7))", + "POLYGON((5 5,5 15,15 15,15 5,5 5))", + false); + + test_geometry("MULTILINESTRING((3 10.031432746397092, 1 5, 1 10.013467818052765, 3 4, 7 8, 6 10.035925377760330, 10 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + false); +} + +template +void test_multi_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_linestring mls; + typedef bg::model::multi_polygon mpoly; + + test_geometry("MULTILINESTRING((0 0,10 0,10 10,0 10,0 0),(2 2,5 5,2 8,2 2))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(2 2,5 5,2 8,2 2)))", + false); + + test_geometry("MULTILINESTRING((0 0,10 0,10 10),(10 10,0 10,0 0),(20 20,50 50,20 80,20 20))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + false); + + test_geometry("MULTILINESTRING((5 -2,4 -2,5 0),(5 -2,6 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + false); +} + +template +void test_linestring_linestring() +{ + typedef bg::model::linestring

ls; + + test_geometry("LINESTRING(0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", false); + + test_geometry("LINESTRING(1 0,2 2,2 3)", "LINESTRING(0 0, 2 2, 3 2)", false); +} + +//https://svn.boost.org/trac10/ticket/13057 +template +void test_linestring_linestring_radians() +{ + typedef bg::model::linestring

ls; + + test_geometry("LINESTRING(0 -0.31415926535897897853,\ + 0.26179938779914918578 0,\ + -0.034906585039886556254 0.13962634015954622502,\ + -0.12217304763960294689 0.12217304763960294689)",\ + "LINESTRING(-0.034906585039886556254 0.13962634015954622502,\ + -0.26179938779914918578 0)", false); + +} + +template +void test_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("LINESTRING(0 0,10 0)", + "MULTILINESTRING((1 0,2 0),(1 1,2 1))", + false); + + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,0 5,0 0),(0 0,5 0,5 5))", + false); +} + +template +void test_multi_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0))", + false); +} + +template +void test_point_polygon() +{ + typedef bg::model::polygon

poly; + + // https://svn.boost.org/trac/boost/ticket/9162 + test_geometry("POINT(0 90)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + false); + test_geometry("POINT(-120 21)", + "POLYGON((30 0,30 30,90 30, 90 0, 30 0))", + true); + // extended + test_geometry("POINT(0 -90)", + "POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))", + false); + test_geometry("POINT(0 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + false); + test_geometry("POINT(-180 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + false); +} + +template +void test_box_polygon() +{ + typedef bg::model::box

box; + typedef bg::model::polygon

poly; + + // https://github.com/boostorg/geometry/issues/466 + test_geometry("BOX(2.2 48.88, 2.5 48.9021)", + "POLYGON((2.4 48.90205, 2.4 48.89, 2.3 48.89, 2.3 48.90205, 2.4 48.90205))", + false); + test_geometry("BOX(2.2 48.88, 2.5 48.9021)", + "POLYGON((2.4 48.9021, 2.4 48.89, 2.3 48.89, 2.3 48.9021, 2.4 48.9021))", + false); + test_geometry("BOX(2.2 48.88, 2.5 48.9021)", + "POLYGON((2.4 48.90215, 2.4 48.89, 2.3 48.89, 2.3 48.90215, 2.4 48.90215))", + false); + // extended + test_geometry("BOX(2.2 48.88, 2.5 48.9021)", + "POLYGON((2.4 48.9022, 2.4 48.89, 2.3 48.89, 2.3 48.9022, 2.4 48.9022))", + false); + // box within poly + test_geometry("BOX(2.2 48.88, 2.5 48.9021)", + "POLYGON((2.6 48.9021, 2.6 48.8, 2.1 48.8, 2.1 48.9021, 2.6 48.9021))", + false); + test_geometry("BOX(2.2 48.88, 2.5 48.9021)", + "POLYGON((2.6 48.9022, 2.6 48.8, 2.1 48.8, 2.1 48.9022, 2.6 48.9022))", + false); + + // related to https://github.com/boostorg/geometry/issues/579 + test_geometry("BOX(10 10,20 20)", + "POLYGON((11 0,10 1,11 2,12 3,13 1,11 0)," + "(12 1,11 1,12 2,12 1))", + true); +} + + +template +void test_all() +{ + test_polygon_polygon

(); + test_polygon_multi_polygon

(); + test_multi_polygon_multi_polygon

(); + + test_linestring_polygon

(); + test_linestring_multi_polygon

(); + test_multi_linestring_polygon

(); + test_multi_linestring_multi_polygon

(); + + test_linestring_linestring

(); + test_linestring_multi_linestring

(); + test_multi_linestring_multi_linestring

(); + + test_point_polygon

(); + test_box_polygon

(); +} + + +int test_main( int , char* [] ) +{ + typedef bg::model::point > point_deg; + typedef bg::model::point > point_rad; + + test_all(); + + test_linestring_linestring_radians(); + +#if defined(HAVE_TTMATH) + test_cs > >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/test_disjoint.hpp b/src/boost/libs/geometry/test/algorithms/disjoint/test_disjoint.hpp new file mode 100644 index 000000000..bf6c46f9b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/test_disjoint.hpp @@ -0,0 +1,112 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 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. + +// 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) + +#ifndef BOOST_GEOMETRY_TEST_DISJOINT_HPP +#define BOOST_GEOMETRY_TEST_DISJOINT_HPP + +#include +#include +#include + +#include + +#include +#include + + +struct no_strategy {}; + +template +bool call_disjoint(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) +{ + return bg::disjoint(geometry1, geometry2, strategy); +} + +template +bool call_disjoint(Geometry1 const& geometry1, + Geometry2 const& geometry2, + no_strategy) +{ + return bg::disjoint(geometry1, geometry2); +} + +template +void check_disjoint(std::string const& id, + std::string const& wkt1, + std::string const& wkt2, + G1 const& g1, + G2 const& g2, + bool expected, + Strategy const& strategy) +{ + bool detected = call_disjoint(g1, g2, strategy); + if (id.empty()) + { + BOOST_CHECK_MESSAGE(detected == expected, + "disjoint: " << wkt1 << " and " << wkt2 + << " -> Expected: " << expected + << " detected: " << detected); + } + else + { + BOOST_CHECK_MESSAGE(detected == expected, + "disjoint: " << id + << " -> Expected: " << expected + << " detected: " << detected); + } +} + +template +void test_disjoint(std::string const& id, + std::string const& wkt1, + std::string const& wkt2, + bool expected) +{ + G1 g1; + bg::read_wkt(wkt1, g1); + + G2 g2; + bg::read_wkt(wkt2, g2); + + boost::variant v1(g1); + boost::variant v2(g2); + + typedef typename bg::strategy::disjoint::services::default_strategy + < + G1, G2 + >::type strategy_type; + + check_disjoint(id, wkt1, wkt2, g1, g2, expected, no_strategy()); + check_disjoint(id, wkt1, wkt2, g1, g2, expected, strategy_type()); + check_disjoint(id, wkt1, wkt2, g1, g2, expected, no_strategy()); + check_disjoint(id, wkt1, wkt2, v1, g2, expected, no_strategy()); + check_disjoint(id, wkt1, wkt2, g1, v2, expected, no_strategy()); + check_disjoint(id, wkt1, wkt2, v1, v2, expected, no_strategy()); +} + +template +void test_geometry(std::string const& wkt1, + std::string const& wkt2, + bool expected) +{ + test_disjoint("", wkt1, wkt2, expected); +} + +#endif // BOOST_GEOMETRY_TEST_DISJOINT_HPP diff --git a/src/boost/libs/geometry/test/algorithms/disjoint/test_disjoint_seg_box.hpp b/src/boost/libs/geometry/test/algorithms/disjoint/test_disjoint_seg_box.hpp new file mode 100644 index 000000000..dbed11321 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/disjoint/test_disjoint_seg_box.hpp @@ -0,0 +1,62 @@ +// Boost.Geometry + +// Copyright (c) 2016-2017 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, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +#include + +template +inline void test_disjoint_check(bool result, bool expected_result, + Geometry1 const& geometry1, Geometry2 const& geometry2) +{ + BOOST_CHECK_MESSAGE((result == expected_result), + "result {" << result << "} different than expected result {" + << expected_result << "} for geometries " + << bg::wkt(geometry1) << " and " << bg::wkt(geometry2)); +} + +template +inline void test_disjoint(std::string const& wkt1, + std::string const& wkt2, + bool const expected_result) +{ + Geometry1 geometry1; + bg::read_wkt(wkt1, geometry1); + + Geometry2 geometry2; + bg::read_wkt(wkt2, geometry2); + + test_disjoint_check(bg::disjoint(geometry1, geometry2), expected_result, + geometry1, geometry2); + //reverse + test_disjoint_check(bg::disjoint(geometry2, geometry1), expected_result, + geometry2, geometry1); +} + +template +inline void test_disjoint_strategy(std::string const& wkt1, + std::string const& wkt2, + bool const expected_result, + Strategy strategy) +{ + Geometry1 geometry1; + bg::read_wkt(wkt1, geometry1); + + Geometry2 geometry2; + bg::read_wkt(wkt2, geometry2); + + test_disjoint_check(bg::disjoint(geometry1, geometry2, strategy), expected_result, + geometry1, geometry2); + //reverse + test_disjoint_check(bg::disjoint(geometry2, geometry1, strategy), expected_result, + geometry2, geometry1); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/Jamfile b/src/boost/libs/geometry/test/algorithms/distance/Jamfile new file mode 100644 index 000000000..beebe9d41 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/Jamfile @@ -0,0 +1,35 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2014 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2014 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014-2018. +# Modifications copyright (c) 2014-2018, 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 +# 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) + +test-suite boost-geometry-algorithms-distance + : + [ run distance.cpp : : : : algorithms_distance ] + [ run distance_ca_ar_ar.cpp : : : : algorithms_distance_ca_ar_ar ] + [ run distance_ca_l_ar.cpp : : : : algorithms_distance_ca_l_ar ] + [ run distance_ca_l_l.cpp : : : : algorithms_distance_ca_l_l ] + [ run distance_ca_pl_ar.cpp : : : : algorithms_distance_ca_pl_ar ] + [ run distance_ca_pl_l.cpp : : : : algorithms_distance_ca_pl_l ] + [ run distance_ca_pl_pl.cpp : : : : algorithms_distance_ca_pl_pl ] + [ run distance_se_geo_ar_ar.cpp : : : : algorithms_distance_se_geo_ar_ar ] + [ run distance_se_geo_l_ar.cpp : : : : algorithms_distance_se_geo_l_ar ] + [ run distance_se_geo_l_l.cpp : : : : algorithms_distance_se_geo_l_l ] + [ run distance_se_geo_pl_ar.cpp : : : : algorithms_distance_se_geo_pl_ar ] + [ run distance_geo_pl_l.cpp : : : : algorithms_distance_geo_pl_l ] + [ run distance_se_geo_pl_pl.cpp : : : : algorithms_distance_se_geo_pl_pl ] + [ run distance_se_pl_l.cpp : : : : algorithms_distance_se_pl_l ] + [ run distance_se_pl_pl.cpp : : : : algorithms_distance_se_pl_pl ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance.cpp new file mode 100644 index 000000000..f86969209 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance.cpp @@ -0,0 +1,536 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +//#include + +#include +#include + +#include "test_distance.hpp" + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +// Register boost array as a linestring +namespace boost { namespace geometry { namespace traits +{ +template +struct tag< boost::array > +{ + typedef linestring_tag type; +}; + +}}} + +template +void test_distance_point() +{ + namespace services = bg::strategy::distance::services; + typedef typename bg::default_distance_result

::type return_type; + + // Basic, trivial test + + P p1; + bg::set<0>(p1, 1); + bg::set<1>(p1, 1); + + P p2; + bg::set<0>(p2, 2); + bg::set<1>(p2, 2); + + return_type d = bg::distance(p1, p2); + BOOST_CHECK_CLOSE(d, return_type(1.4142135), 0.001); + + // Test specifying strategy manually + typename services::default_strategy + < + bg::point_tag, bg::point_tag, P + >::type strategy; + + d = bg::distance(p1, p2, strategy); + BOOST_CHECK_CLOSE(d, return_type(1.4142135), 0.001); + + { + // Test custom strategy + BOOST_CONCEPT_ASSERT( (bg::concepts::PointDistanceStrategy) ); + + typedef typename services::return_type::type cab_return_type; + BOOST_MPL_ASSERT((boost::is_same::type>)); + + taxicab_distance tcd; + cab_return_type d = bg::distance(p1, p2, tcd); + + BOOST_CHECK( bg::math::abs(d - cab_return_type(2)) <= cab_return_type(0.01) ); + } + + { + // test comparability + + typedef typename services::default_strategy + < + bg::point_tag, bg::point_tag, P + >::type strategy_type; + typedef typename services::comparable_type::type comparable_strategy_type; + + strategy_type strategy; + comparable_strategy_type comparable_strategy = services::get_comparable::apply(strategy); + return_type comparable = services::result_from_distance::apply(comparable_strategy, 3); + + BOOST_CHECK_CLOSE(comparable, return_type(9), 0.001); + } +} + +template +void test_distance_segment() +{ + typedef typename bg::default_distance_result

::type return_type; + + P s1; bg::set<0>(s1, 1); bg::set<1>(s1, 1); + P s2; bg::set<0>(s2, 4); bg::set<1>(s2, 4); + + // Check points left, right, projected-left, projected-right, on segment + P p1; bg::set<0>(p1, 0); bg::set<1>(p1, 1); + P p2; bg::set<0>(p2, 1); bg::set<1>(p2, 0); + P p3; bg::set<0>(p3, 3); bg::set<1>(p3, 1); + P p4; bg::set<0>(p4, 1); bg::set<1>(p4, 3); + P p5; bg::set<0>(p5, 3); bg::set<1>(p5, 3); + + bg::model::referring_segment

const seg(s1, s2); + + return_type d1 = bg::distance(p1, seg); + return_type d2 = bg::distance(p2, seg); + return_type d3 = bg::distance(p3, seg); + return_type d4 = bg::distance(p4, seg); + return_type d5 = bg::distance(p5, seg); + + BOOST_CHECK_CLOSE(d1, return_type(1), 0.001); + BOOST_CHECK_CLOSE(d2, return_type(1), 0.001); + BOOST_CHECK_CLOSE(d3, return_type(1.4142135), 0.001); + BOOST_CHECK_CLOSE(d4, return_type(1.4142135), 0.001); + BOOST_CHECK_CLOSE(d5, return_type(0), 0.001); + + // Reverse case: segment/point instead of point/segment + return_type dr1 = bg::distance(seg, p1); + return_type dr2 = bg::distance(seg, p2); + + BOOST_CHECK_CLOSE(dr1, d1, 0.001); + BOOST_CHECK_CLOSE(dr2, d2, 0.001); + + // Test specifying strategy manually: + // 1) point-point-distance + typename bg::strategy::distance::services::default_strategy + < + bg::point_tag, bg::point_tag, P + >::type pp_strategy; + d1 = bg::distance(p1, seg, pp_strategy); + BOOST_CHECK_CLOSE(d1, return_type(1), 0.001); + + // 2) point-segment-distance + typename bg::strategy::distance::services::default_strategy + < + bg::point_tag, bg::segment_tag, P + >::type ps_strategy; + d1 = bg::distance(p1, seg, ps_strategy); + BOOST_CHECK_CLOSE(d1, return_type(1), 0.001); + + // 3) custom point strategy + taxicab_distance tcd; + d1 = bg::distance(p1, seg, tcd); + BOOST_CHECK_CLOSE(d1, return_type(1), 0.001); +} + +template +void test_distance_linear(std::string const& wkt_point, std::string const& wkt_geometry, T const& expected) +{ + Point p; + bg::read_wkt(wkt_point, p); + + Geometry g; + bg::read_wkt(wkt_geometry, g); + + typedef typename bg::default_distance_result::type return_type; + return_type d = bg::distance(p, g); + + // For point-to-linestring (or point-to-polygon), both a point-strategy and a point-segment-strategy can be specified. + // Test this. + return_type ds1 = bg::distance(p, g, bg::strategy::distance::pythagoras<>()); + return_type ds2 = bg::distance(p, g, bg::strategy::distance::projected_point<>()); + + BOOST_CHECK_CLOSE(d, return_type(expected), 0.001); + BOOST_CHECK_CLOSE(ds1, return_type(expected), 0.001); + BOOST_CHECK_CLOSE(ds2, return_type(expected), 0.001); +} + +template +void test_distance_array_as_linestring() +{ + typedef typename bg::default_distance_result

::type return_type; + + // Normal array does not have + boost::array points; + bg::set<0>(points[0], 1); + bg::set<1>(points[0], 1); + bg::set<0>(points[1], 3); + bg::set<1>(points[1], 3); + + P p; + bg::set<0>(p, 2); + bg::set<1>(p, 1); + + return_type d = bg::distance(p, points); + BOOST_CHECK_CLOSE(d, return_type(0.70710678), 0.001); + + bg::set<0>(p, 5); bg::set<1>(p, 5); + d = bg::distance(p, points); + BOOST_CHECK_CLOSE(d, return_type(2.828427), 0.001); +} + + +// code moved from the distance unit test in multi/algorithms -- start +template +void test_distance(std::string const& wkt1, std::string const& wkt2, double expected) +{ + Geometry1 g1; + Geometry2 g2; + bg::read_wkt(wkt1, g1); + bg::read_wkt(wkt2, g2); + typename bg::default_distance_result::type d = bg::distance(g1, g2); + + BOOST_CHECK_CLOSE(d, expected, 0.0001); +} + +template +void test_distance(Strategy const& strategy, std::string const& wkt1, + std::string const& wkt2, double expected) +{ + Geometry1 g1; + Geometry2 g2; + bg::read_wkt(wkt1, g1); + bg::read_wkt(wkt2, g2); + typename bg::default_distance_result::type d = bg::distance(g1, g2, strategy); + + BOOST_CHECK_CLOSE(d, expected, 0.0001); +} + + +template +void test_2d() +{ + typedef bg::model::multi_point

mp; + typedef bg::model::multi_linestring > ml; + test_distance("POINT(0 0)", "POINT(1 1)", sqrt(2.0)); + test_distance("POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + test_distance("MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); + test_distance("MULTIPOINT((1 1),(1 0),(0 2))", "MULTIPOINT((2 2),(2 3))", sqrt(2.0)); + test_distance("POINT(0 0)", "MULTILINESTRING((1 1,2 2),(1 0,2 0),(0 2,0 3))", 1.0); + test_distance("MULTILINESTRING((1 1,2 2),(1 0,2 0),(0 2,0 3))", "POINT(0 0)", 1.0); + test_distance("MULTILINESTRING((1 1,2 2),(1 0,2 0),(0 2,0 3))", "MULTIPOINT((0 0),(1 1))", 0.0); + + // Test with a strategy + bg::strategy::distance::pythagoras<> pyth; + test_distance(pyth, "POINT(0 0)", "POINT(1 1)", sqrt(2.0)); + test_distance(pyth, "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + test_distance(pyth, "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); +} + + +template +void test_3d() +{ + typedef bg::model::multi_point

mp; + test_distance("POINT(0 0 0)", "POINT(1 1 1)", sqrt(3.0)); + test_distance("POINT(0 0 0)", "MULTIPOINT((1 1 1),(1 0 0),(0 1 2))", 1.0); + test_distance("MULTIPOINT((1 1 1),(1 0 0),(0 0 2))", "MULTIPOINT((2 2 2),(2 3 4))", sqrt(3.0)); +} + + +template +void test_mixed() +{ + typedef bg::model::multi_point mp1; + typedef bg::model::multi_point mp2; + + test_distance("POINT(0 0)", "POINT(1 1)", sqrt(2.0)); + + test_distance("POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + test_distance("POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + test_distance("POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + test_distance("POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + + // Test automatic reversal + test_distance("MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); + test_distance("MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); + test_distance("MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); + test_distance("MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); + + // Test multi-multi using different point types for each + test_distance("MULTIPOINT((1 1),(1 0),(0 2))", "MULTIPOINT((2 2),(2 3))", sqrt(2.0)); + + // Test with a strategy + using namespace bg::strategy::distance; + + test_distance(pythagoras<>(), "POINT(0 0)", "POINT(1 1)", sqrt(2.0)); + + test_distance(pythagoras<>(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + test_distance(pythagoras<>(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + test_distance(pythagoras<>(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + test_distance(pythagoras<>(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + + // Most interesting: reversal AND a strategy (note that the stategy must be reversed automatically + test_distance(pythagoras<>(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); + test_distance(pythagoras<>(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); + test_distance(pythagoras<>(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); + test_distance(pythagoras<>(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); +} +// code moved from the distance unit test in multi/algorithms -- end + + + + +template +void test_all() +{ + test_distance_point

(); + test_distance_segment

(); + test_distance_array_as_linestring

(); + + test_geometry >("POINT(1 3)", "LINESTRING(1 1,4 4)", sqrt(2.0)); + test_geometry >("POINT(3 1)", "LINESTRING(1 1,4 4)", sqrt(2.0)); + + test_geometry("POINT(1 1)", "POINT(2 2)", sqrt(2.0)); + test_geometry("POINT(0 0)", "POINT(0 3)", 3.0); + test_geometry("POINT(0 0)", "POINT(4 0)", 4.0); + test_geometry("POINT(0 3)", "POINT(4 0)", 5.0); + test_geometry >("POINT(1 3)", "LINESTRING(1 1,4 4)", sqrt(2.0)); + test_geometry >("POINT(3 1)", "LINESTRING(1 1,4 4)", sqrt(2.0)); + test_geometry >("POINT(50 50)", "LINESTRING(50 40, 40 50)", sqrt(50.0)); + test_geometry >("POINT(50 50)", "LINESTRING(50 40, 40 50, 0 90)", sqrt(50.0)); + test_geometry, P>("LINESTRING(1 1,4 4)", "POINT(1 3)", sqrt(2.0)); + test_geometry, P>("LINESTRING(50 40, 40 50)", "POINT(50 50)", sqrt(50.0)); + test_geometry, P>("LINESTRING(50 40, 40 50, 0 90)", "POINT(50 50)", sqrt(50.0)); + + // Rings + test_geometry >("POINT(1 3)", "POLYGON((1 1,4 4,5 0,1 1))", sqrt(2.0)); + test_geometry >("POINT(3 1)", "POLYGON((1 1,4 4,5 0,1 1))", 0.0); + // other way round + test_geometry, P>("POLYGON((1 1,4 4,5 0,1 1))", "POINT(3 1)", 0.0); + // open ring + test_geometry >("POINT(1 3)", "POLYGON((4 4,5 0,1 1))", sqrt(2.0)); + + // Polygons + test_geometry >("POINT(1 3)", "POLYGON((1 1,4 4,5 0,1 1))", sqrt(2.0)); + test_geometry >("POINT(3 1)", "POLYGON((1 1,4 4,5 0,1 1))", 0.0); + // other way round + test_geometry, P>("POLYGON((1 1,4 4,5 0,1 1))", "POINT(3 1)", 0.0); + // open polygon + test_geometry >("POINT(1 3)", "POLYGON((4 4,5 0,1 1))", sqrt(2.0)); + + // Polygons with holes + std::string donut = "POLYGON ((0 0,1 9,8 1,0 0),(1 1,4 1,1 4,1 1))"; + test_geometry >("POINT(2 2)", donut, 0.5 * sqrt(2.0)); + test_geometry >("POINT(3 3)", donut, 0.0); + // other way round + test_geometry, P>(donut, "POINT(2 2)", 0.5 * sqrt(2.0)); + // open + test_geometry >("POINT(2 2)", "POLYGON ((0 0,1 9,8 1),(1 1,4 1,1 4))", 0.5 * sqrt(2.0)); + + // Should (currently) give compiler assertion + // test_geometry, bg::model::polygon

>(donut, donut, 0.5 * sqrt(2.0)); + + // DOES NOT COMPILE - cannot do read_wkt (because boost::array is not variably sized) + // test_geometry >("POINT(3 1)", "LINESTRING(1 1,4 4)", sqrt(2.0)); + + test_geometry >("POINT(3 1)", "LINESTRING(1 1,4 4)", sqrt(2.0)); + + test_distance_linear >("POINT(3 1)", "LINESTRING(1 1,4 4)", sqrt(2.0)); +} + +template +void test_empty_input() +{ + P p; + bg::model::linestring

line_empty; + bg::model::polygon

poly_empty; + bg::model::ring

ring_empty; + bg::model::multi_point

mp_empty; + bg::model::multi_linestring > ml_empty; + + test_empty_input(p, line_empty); + test_empty_input(p, poly_empty); + test_empty_input(p, ring_empty); + + test_empty_input(p, mp_empty); + test_empty_input(p, ml_empty); + test_empty_input(mp_empty, mp_empty); + + // Test behaviour if one of the inputs is empty + bg::model::multi_point

mp; + mp.push_back(p); + test_empty_input(mp_empty, mp); + test_empty_input(mp, mp_empty); +} + +void test_large_integers() +{ + typedef bg::model::point int_point_type; + typedef bg::model::point double_point_type; + + // point-point + { + std::string const a = "POINT(2544000 528000)"; + std::string const b = "POINT(2768040 528000)"; + int_point_type ia, ib; + double_point_type da, db; + bg::read_wkt(a, ia); + bg::read_wkt(b, ib); + bg::read_wkt(a, da); + bg::read_wkt(b, db); + + BOOST_AUTO(idist, bg::distance(ia, ib)); + BOOST_AUTO(ddist, bg::distance(da, db)); + + BOOST_CHECK_MESSAGE(std::abs(idist - ddist) < 0.1, + "within different from within"); + } + // Point-segment + { + std::string const a = "POINT(2600000 529000)"; + std::string const b = "LINESTRING(2544000 528000, 2768040 528000)"; + int_point_type ia; + double_point_type da; + bg::model::segment ib; + bg::model::segment db; + bg::read_wkt(a, ia); + bg::read_wkt(b, ib); + bg::read_wkt(a, da); + bg::read_wkt(b, db); + + BOOST_AUTO(idist, bg::distance(ia, ib)); + BOOST_AUTO(ddist, bg::distance(da, db)); + + BOOST_CHECK_MESSAGE(std::abs(idist - ddist) < 0.1, + "within different from within"); + } +} + +template +void test_variant() +{ + typedef bg::model::point point_type; + typedef bg::model::segment segment_type; + typedef bg::model::box box_type; + typedef boost::variant variant_type; + + point_type point; + std::string const point_li = "POINT(1 3)"; + bg::read_wkt(point_li, point); + + segment_type seg; + std::string const seg_li = "LINESTRING(1 1,4 4)"; + bg::read_wkt(seg_li, seg); + + variant_type v1, v2; + + BOOST_MPL_ASSERT(( + boost::is_same + < + typename bg::distance_result + < + variant_type, variant_type, bg::default_strategy + >::type, + double + > + )); + + // Default strategy + v1 = point; + v2 = point; + BOOST_CHECK_CLOSE(bg::distance(v1, v2), bg::distance(point, point), 0.0001); + BOOST_CHECK_CLOSE(bg::distance(v1, point), bg::distance(point, point), 0.0001); + BOOST_CHECK_CLOSE(bg::distance(point, v2), bg::distance(point, point), 0.0001); + v1 = point; + v2 = seg; + BOOST_CHECK_CLOSE(bg::distance(v1, v2), bg::distance(point, seg), 0.0001); + BOOST_CHECK_CLOSE(bg::distance(v1, seg), bg::distance(point, seg), 0.0001); + BOOST_CHECK_CLOSE(bg::distance(point, v2), bg::distance(point, seg), 0.0001); + + // User defined strategy + v1 = point; + v2 = point; + bg::strategy::distance::haversine s; + //BOOST_CHECK_CLOSE(bg::distance(v1, v2, s), bg::distance(point, point, s), 0.0001); + //BOOST_CHECK_CLOSE(bg::distance(v1, point, s), bg::distance(point, point, s), 0.0001); + //BOOST_CHECK_CLOSE(bg::distance(point, v2, s), bg::distance(point, point, s), 0.0001); +} + +int test_main(int, char* []) +{ +#ifdef TEST_ARRAY + //test_all(); + //test_all(); + //test_all(); + //test_all(); // located here because of 3D +#endif + + test_large_integers(); + + test_all >(); + test_all >(); + test_all >(); + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + test_empty_input >(); + + // below are the test cases moved here from the distance unit test + // in test/multi/algorithms + test_2d >(); + test_2d >(); + test_2d >(); + + test_3d >(); + test_3d >(); + + test_mixed, bg::model::d2::point_xy >(); + +#ifdef HAVE_TTMATH + test_2d >(); + test_mixed, bg::model::d2::point_xy >(); +#endif + + test_empty_input >(); + + test_variant(); + test_variant(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_all.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_all.cpp new file mode 100644 index 000000000..74a46fffb --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_all.cpp @@ -0,0 +1,20 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_all +#endif + +#include "distance_pointlike_pointlike.cpp" +#include "distance_pointlike_linear.cpp" +#include "distance_pointlike_areal.cpp" +#include "distance_linear_linear.cpp" +#include "distance_linear_areal.cpp" +#include "distance_areal_areal.cpp" diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_brute_force.hpp b/src/boost/libs/geometry/test/algorithms/distance/distance_brute_force.hpp new file mode 100644 index 000000000..82d0015b8 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_brute_force.hpp @@ -0,0 +1,1356 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014, 2018 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_TEST_DISTANCE_BRUTE_FORCE_HPP +#define BOOST_GEOMETRY_TEST_DISTANCE_BRUTE_FORCE_HPP + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include + + +namespace boost { namespace geometry +{ + +namespace unit_test +{ + +namespace detail { namespace distance_brute_force +{ + +struct distance_from_bg +{ + template + struct use_distance_from_bg + { + typedef typename boost::mpl::or_ + < + boost::is_same::type, point_tag>, + typename boost::mpl::or_ + < + boost::is_same::type, segment_tag>, + boost::is_same::type, box_tag> + >::type + >::type type; + }; + + template + static inline + typename distance_result::type + apply(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) + { + BOOST_MPL_ASSERT((typename use_distance_from_bg::type)); + BOOST_MPL_ASSERT((typename use_distance_from_bg::type)); + + return geometry::distance(geometry1, geometry2, strategy); + } +}; + + +template +inline +typename distance_result::type +bg_distance(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) +{ + return distance_from_bg::apply(geometry1, geometry2, strategy); +} + + +template +struct one_to_many +{ + template + static inline typename distance_result + < + Geometry, + typename std::iterator_traits::value_type, + Strategy + >::type + apply(Geometry const& geometry, Iterator begin, Iterator end, + Strategy const& strategy) + { + typedef typename distance_result + < + Geometry, + typename std::iterator_traits::value_type, + Strategy + >::type distance_type; + + bool first = true; + distance_type d_min(0); + for (Iterator it = begin; it != end; ++it, first = false) + { + distance_type d = Policy::apply(geometry, *it, strategy); + + if ( first || d < d_min ) + { + d_min = d; + } + } + return d_min; + } +}; + + + +}} // namespace detail::distance_brute_force + + +namespace dispatch +{ + +template +< + typename Geometry1, + typename Geometry2, + typename Strategy, + typename Tag1 = typename tag_cast + < + typename tag::type, + segment_tag, + linear_tag + >::type, + typename Tag2 = typename tag_cast + < + typename tag::type, + segment_tag, + linear_tag + >::type, + bool Reverse = reverse_dispatch::type::value +> +struct distance_brute_force + : not_implemented +{}; + +template +< + typename Geometry1, + typename Geometry2, + typename Strategy, + typename Tag1, + typename Tag2 +> +struct distance_brute_force +{ + static inline typename distance_result::type + apply(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) + { + return distance_brute_force + < + Geometry2, Geometry1, Strategy + >::apply(geometry2, geometry1, strategy); + } +}; + +//=================================================================== + +template +< + typename Point1, + typename Point2, + typename Strategy +> +struct distance_brute_force +< + Point1, Point2, Strategy, + point_tag, point_tag, false +> : detail::distance_brute_force::distance_from_bg +{}; + + +template +< + typename Point, + typename Segment, + typename Strategy +> +struct distance_brute_force +< + Point, Segment, Strategy, + point_tag, segment_tag, false +> : detail::distance_brute_force::distance_from_bg +{}; + +template +< + typename Point, + typename Linear, + typename Strategy +> +struct distance_brute_force +< + Point, Linear, Strategy, + point_tag, linear_tag, false +> +{ + typedef typename distance_result + < + Point, Linear, Strategy + >::type distance_type; + + static inline distance_type apply(Point const& point, + Linear const& linear, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + detail::distance_brute_force::distance_from_bg + >::apply(point, + geometry::segments_begin(linear), + geometry::segments_end(linear), + strategy); + } +}; + +template +< + typename Point, + typename Ring, + typename Strategy +> +struct distance_brute_force +< + Point, Ring, Strategy, + point_tag, ring_tag, false +> +{ + typedef typename distance_result + < + Point, Ring, Strategy + >::type distance_type; + + static inline distance_type apply(Point const& point, + Ring const& ring, + Strategy const& strategy) + { + + if (geometry::covered_by(point, ring)) + { + return 0; + } + + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Point, + typename std::iterator_traits + < + segment_iterator + >::value_type, + Strategy + > + >::apply(point, + geometry::segments_begin(ring), + geometry::segments_end(ring), + strategy); + } +}; + +//TODO do it more brute force (also in all polygon-geometry cases) +template +< + typename Point, + typename Polygon, + typename Strategy +> +struct distance_brute_force +< + Point, Polygon, Strategy, + point_tag, polygon_tag, false +> +{ + typedef typename distance_result + < + Point, Polygon, Strategy + >::type distance_type; + + static inline distance_type apply(Point const& point, + Polygon const& polygon, + Strategy const& strategy) + { + return geometry::distance(point, polygon, strategy); + } +}; + +template +< + typename Point, + typename Box, + typename Strategy +> +struct distance_brute_force +< + Point, Box, Strategy, + point_tag, box_tag, false +> : detail::distance_brute_force::distance_from_bg +{}; + +template +< + typename Point, + typename MultiPoint, + typename Strategy +> +struct distance_brute_force +< + Point, MultiPoint, Strategy, + point_tag, multi_point_tag, false +> +{ + typedef typename distance_result + < + Point, MultiPoint, Strategy + >::type distance_type; + + static inline distance_type apply(Point const& p, + MultiPoint const& mp, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + detail::distance_brute_force::distance_from_bg + >::apply(p, boost::begin(mp), boost::end(mp), strategy); + } +}; + +template +< + typename Point, + typename MultiPolygon, + typename Strategy +> +struct distance_brute_force +< + Point, MultiPolygon, Strategy, + point_tag, multi_polygon_tag, false +> +{ + typedef typename distance_result + < + Point, MultiPolygon, Strategy + >::type distance_type; + + static inline distance_type apply(Point const& p, + MultiPolygon const& mp, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Point, + typename boost::range_value::type, + Strategy + > + >::apply(p, boost::begin(mp), boost::end(mp), strategy); + } +}; + +//======================================================================= + +template +< + typename Linear, + typename Segment, + typename Strategy +> +struct distance_brute_force +< + Linear, Segment, Strategy, + linear_tag, segment_tag, false +> +{ + typedef typename distance_result + < + Linear, Segment, Strategy + >::type distance_type; + + static inline distance_type apply(Linear const& linear, + Segment const& segment, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + detail::distance_brute_force::distance_from_bg + >::apply(segment, + geometry::segments_begin(linear), + geometry::segments_end(linear), + strategy); + } +}; + + +template +< + typename Linear1, + typename Linear2, + typename Strategy +> +struct distance_brute_force +< + Linear1, Linear2, Strategy, + linear_tag, linear_tag, false +> +{ + typedef typename distance_result + < + Linear1, Linear2, Strategy + >::type distance_type; + + static inline distance_type apply(Linear1 const& linear1, + Linear2 const& linear2, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Linear1, + typename std::iterator_traits + < + segment_iterator + >::value_type, + Strategy + > + >::apply(linear1, + geometry::segments_begin(linear2), + geometry::segments_end(linear2), + strategy); + } +}; + +template +< + typename Linear, + typename Ring, + typename Strategy +> +struct distance_brute_force +< + Linear, Ring, Strategy, + linear_tag, ring_tag, false +> +{ + typedef typename distance_result + < + Linear, Ring, Strategy + >::type distance_type; + + static inline distance_type apply(Linear const& linear, + Ring const& ring, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Linear, + typename std::iterator_traits + < + segment_iterator + >::value_type, + Strategy + > + >::apply(linear, + geometry::segments_begin(ring), + geometry::segments_end(ring), + strategy); + } +}; + +template +< + typename Linear, + typename Polygon, + typename Strategy +> +struct distance_brute_force +< + Linear, Polygon, Strategy, + linear_tag, polygon_tag, false +> +{ + typedef typename distance_result + < + Linear, Polygon, Strategy + >::type distance_type; + + static inline distance_type apply(Linear const& linear, + Polygon const& polygon, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Polygon, + typename std::iterator_traits + < + segment_iterator + >::value_type, + Strategy + > + >::apply(polygon, + geometry::segments_begin(linear), + geometry::segments_end(linear), + strategy); + } +}; + + +template +< + typename Linear, + typename Box, + typename Strategy +> +struct distance_brute_force +< + Linear, Box, Strategy, + linear_tag, box_tag, false +> +{ + typedef typename distance_result + < + Linear, Box, Strategy + >::type distance_type; + + static inline distance_type apply(Linear const& linear, + Box const& box, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + detail::distance_brute_force::distance_from_bg + >::apply(box, + geometry::segments_begin(linear), + geometry::segments_end(linear), + strategy); + } +}; + +template +< + typename Linear, + typename MultiPoint, + typename Strategy +> +struct distance_brute_force +< + Linear, MultiPoint, Strategy, + linear_tag, multi_point_tag, false +> +{ + typedef typename distance_result + < + Linear, MultiPoint, Strategy + >::type distance_type; + + static inline distance_type apply(Linear const& linear, + MultiPoint const& mp, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Linear, + typename boost::range_value::type, + Strategy + > + >::apply(linear, boost::begin(mp), boost::end(mp), strategy); + } +}; + +template +< + typename Linear, + typename MultiPolygon, + typename Strategy +> +struct distance_brute_force +< + Linear, MultiPolygon, Strategy, + linear_tag, multi_polygon_tag, false +> +{ + typedef typename distance_result + < + Linear, MultiPolygon, Strategy + >::type distance_type; + + static inline distance_type apply(Linear const& linear, + MultiPolygon const& mp, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Linear, + typename boost::range_value::type, + Strategy + > + >::apply(linear, boost::begin(mp), boost::end(mp), strategy); + } +}; + +//================================================================= + +template +< + typename Polygon, + typename Segment, + typename Strategy +> +struct distance_brute_force +< + Polygon, Segment, Strategy, + polygon_tag, segment_tag, false +> +{ + typedef typename distance_result + < + Polygon, Segment, Strategy + >::type distance_type; + + static inline distance_type apply(Polygon const& polygon, + Segment const& segment, + Strategy const& strategy) + { + return geometry::distance(segment, polygon, strategy); + } +}; + +template +< + typename Polygon, + typename Linear, + typename Strategy +> +struct distance_brute_force +< + Polygon, Linear, Strategy, + polygon_tag, linear_tag, false +> +{ + typedef typename distance_result + < + Polygon, Linear, Strategy + >::type distance_type; + + static inline distance_type apply(Polygon const& polygon, + Linear const& linear, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Polygon, + typename std::iterator_traits + < + segment_iterator + >::value_type, + Strategy + > + >::apply(polygon, + geometry::segments_begin(linear), + geometry::segments_end(linear), + strategy); + } +}; + +template +< + typename Polygon1, + typename Polygon2, + typename Strategy +> +struct distance_brute_force +< + Polygon1, Polygon2, Strategy, + polygon_tag, polygon_tag, false +> +{ + typedef typename distance_result + < + Polygon1, Polygon2, Strategy + >::type distance_type; + + static inline distance_type apply(Polygon1 const& polygon1, + Polygon2 const& polygon2, + Strategy const& strategy) + { + return geometry::distance(polygon1, polygon2, strategy); + } +}; + + +template +< + typename Polygon, + typename MultiPoint, + typename Strategy +> +struct distance_brute_force +< + Polygon, MultiPoint, Strategy, + polygon_tag, multi_point_tag, false +> +{ + typedef typename distance_result + < + Polygon, MultiPoint, Strategy + >::type distance_type; + + static inline distance_type apply(Polygon const& polygon, + MultiPoint const& mp, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Polygon, + typename boost::range_value::type, + Strategy + > + >::apply(polygon, boost::begin(mp), boost::end(mp), strategy); + } +}; + +template +< + typename Polygon, + typename MultiPolygon, + typename Strategy +> +struct distance_brute_force +< + Polygon, MultiPolygon, Strategy, + polygon_tag, multi_polygon_tag, false +> +{ + typedef typename distance_result + < + Polygon, MultiPolygon, Strategy + >::type distance_type; + + static inline distance_type apply(Polygon const& poly, + MultiPolygon const& mp, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Polygon, + typename boost::range_value::type, + Strategy + > + >::apply(poly, boost::begin(mp), boost::end(mp), strategy); + } +}; + +template +< + typename Polygon, + typename Ring, + typename Strategy +> +struct distance_brute_force +< + Polygon, Ring, Strategy, + polygon_tag, ring_tag, false +> +{ + typedef typename distance_result + < + Polygon, Ring, Strategy + >::type distance_type; + + static inline distance_type apply(Polygon const& polygon, + Ring const& ring, + Strategy const& strategy) + { + return geometry::distance(ring, polygon, strategy); + } +}; + +template +< + typename Polygon, + typename Box, + typename Strategy +> +struct distance_brute_force +< + Polygon, Box, Strategy, + polygon_tag, box_tag, false +> +{ + typedef typename distance_result + < + Polygon, Box, Strategy + >::type distance_type; + + static inline distance_type apply(Polygon const& polygon, + Box const& box, + Strategy const& strategy) + { + return geometry::distance(box, polygon, strategy); + } +}; + +//======================================================================== + +template +< + typename MultiPoint1, + typename MultiPoint2, + typename Strategy +> +struct distance_brute_force +< + MultiPoint1, MultiPoint2, Strategy, + multi_point_tag, multi_point_tag, false +> +{ + typedef typename distance_result + < + MultiPoint1, MultiPoint2, Strategy + >::type distance_type; + + static inline distance_type apply(MultiPoint1 const& mp1, + MultiPoint2 const& mp2, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + MultiPoint1, + typename boost::range_value::type, + Strategy + > + >::apply(mp1, boost::begin(mp2), boost::end(mp2), strategy); + } +}; + +template +< + typename MultiPoint, + typename Linear, + typename Strategy +> +struct distance_brute_force +< + MultiPoint, Linear, Strategy, + multi_point_tag, linear_tag, false +> +{ + typedef typename distance_result + < + MultiPoint, Linear, Strategy + >::type distance_type; + + static inline distance_type apply(MultiPoint const& mp, + Linear const& l, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + MultiPoint, + typename boost::range_value::type, + Strategy + > + >::apply(mp, boost::begin(l), boost::end(l), strategy); + } +}; + +template +< + typename MultiPoint, + typename MultiPolygon, + typename Strategy +> +struct distance_brute_force +< + MultiPoint, MultiPolygon, Strategy, + multi_point_tag, multi_polygon_tag, false +> +{ + typedef typename distance_result + < + MultiPoint, MultiPolygon, Strategy + >::type distance_type; + + static inline distance_type apply(MultiPoint const& mp, + MultiPolygon const& mpl, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + MultiPoint, + typename boost::range_value::type, + Strategy + > + >::apply(mp, boost::begin(mpl), boost::end(mpl), strategy); + } +}; + +template +< + typename MultiPoint, + typename Segment, + typename Strategy +> +struct distance_brute_force +< + MultiPoint, Segment, Strategy, + multi_point_tag, segment_tag, false +> +{ + typedef typename distance_result + < + MultiPoint, Segment, Strategy + >::type distance_type; + + static inline distance_type apply(MultiPoint const& mp, + Segment const& segment, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + detail::distance_brute_force::distance_from_bg + >::apply(segment, boost::begin(mp), boost::end(mp), strategy); + } +}; + +template +< + typename MultiPoint, + typename Ring, + typename Strategy +> +struct distance_brute_force +< + MultiPoint, Ring, Strategy, + multi_point_tag, ring_tag, false +> +{ + typedef typename distance_result + < + MultiPoint, Ring, Strategy + >::type distance_type; + + static inline distance_type apply(MultiPoint const& mp, + Ring const& ring, + Strategy const& strategy) + { + + + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + MultiPoint, + typename std::iterator_traits + < + segment_iterator + >::value_type, + Strategy + > + >::apply(mp, + geometry::segments_begin(ring), + geometry::segments_end(ring), + strategy); + } +}; + +template +< + typename MultiPoint, + typename Box, + typename Strategy +> +struct distance_brute_force +< + MultiPoint, Box, Strategy, + multi_point_tag, box_tag, false +> +{ + typedef typename distance_result + < + MultiPoint, Box, Strategy + >::type distance_type; + + static inline distance_type apply(MultiPoint const& mp, + Box const& box, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Box, + typename boost::range_value::type, + Strategy + > + >::apply(box, boost::begin(mp), boost::end(mp), strategy); + } +}; + +//===================================================================== + +template +< + typename MultiPolygon1, + typename MultiPolygon2, + typename Strategy +> +struct distance_brute_force +< + MultiPolygon1, MultiPolygon2, Strategy, + multi_polygon_tag, multi_polygon_tag, false +> +{ + typedef typename distance_result + < + MultiPolygon1, MultiPolygon2, Strategy + >::type distance_type; + + static inline distance_type apply(MultiPolygon1 const& mp1, + MultiPolygon2 const& mp2, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + MultiPolygon1, + typename boost::range_value::type, + Strategy + > + >::apply(mp1, boost::begin(mp2), boost::end(mp2), strategy); + } +}; + +template +< + typename MultiPolygon, + typename Segment, + typename Strategy +> +struct distance_brute_force +< + MultiPolygon, Segment, Strategy, + multi_polygon_tag, segment_tag, false +> +{ + typedef typename distance_result + < + MultiPolygon, Segment, Strategy + >::type distance_type; + + static inline distance_type apply(MultiPolygon const& mp, + Segment const& segment, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Segment, + typename boost::range_value::type, + Strategy + > + >::apply(segment, boost::begin(mp), boost::end(mp), strategy); + } +}; + +template +< + typename MultiPolygon, + typename Ring, + typename Strategy +> +struct distance_brute_force +< + MultiPolygon, Ring, Strategy, + multi_polygon_tag, ring_tag, false +> +{ + typedef typename distance_result + < + MultiPolygon, Ring, Strategy + >::type distance_type; + + static inline distance_type apply(MultiPolygon const& mp, + Ring const& ring, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Ring, + typename boost::range_value::type, + Strategy + > + >::apply(ring, boost::begin(mp), boost::end(mp), strategy); + } +}; + +template +< + typename MultiPolygon, + typename Box, + typename Strategy +> +struct distance_brute_force +< + MultiPolygon, Box, Strategy, + multi_polygon_tag, box_tag, false +> +{ + typedef typename distance_result + < + MultiPolygon, Box, Strategy + >::type distance_type; + + static inline distance_type apply(MultiPolygon const& mp, + Box const& box, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Box, + typename boost::range_value::type, + Strategy + > + >::apply(box, boost::begin(mp), boost::end(mp), strategy); + } +}; + + +//======================================================================== + +template +< + typename Ring, + typename Box, + typename Strategy +> +struct distance_brute_force +< + Ring, Box, Strategy, + ring_tag, box_tag, false +> +{ + typedef typename distance_result + < + Ring, Box, Strategy + >::type distance_type; + + static inline distance_type apply(Ring const& ring, + Box const& box, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Box, + typename std::iterator_traits + < + segment_iterator + >::value_type, + Strategy + > + >::apply(box, + geometry::segments_begin(ring), + geometry::segments_end(ring), + strategy); + } +}; + +template +< + typename Ring1, + typename Ring2, + typename Strategy +> +struct distance_brute_force +< + Ring1, Ring2, Strategy, + ring_tag, ring_tag, false +> +{ + typedef typename distance_result + < + Ring1, Ring2, Strategy + >::type distance_type; + + static inline distance_type apply(Ring1 const& ring1, + Ring2 const& ring2, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Ring1, + typename std::iterator_traits + < + segment_iterator + >::value_type, + Strategy + > + >::apply(ring1, + geometry::segments_begin(ring2), + geometry::segments_end(ring2), + strategy); + } +}; + +//======================================================================== + +template +< + typename Segment1, + typename Segment2, + typename Strategy +> +struct distance_brute_force +< + Segment1, Segment2, Strategy, + segment_tag, segment_tag, false +> : detail::distance_brute_force::distance_from_bg +{}; + +template +< + typename Segment, + typename Ring, + typename Strategy +> +struct distance_brute_force +< + Segment, Ring, Strategy, + segment_tag, ring_tag, false +> +{ + typedef typename distance_result + < + Segment, Ring, Strategy + >::type distance_type; + + static inline distance_type apply(Segment const& segment, + Ring const& ring, + Strategy const& strategy) + { + return detail::distance_brute_force::one_to_many + < + distance_brute_force + < + Segment, + typename std::iterator_traits + < + segment_iterator + >::value_type, + Strategy + > + >::apply(segment, + geometry::segments_begin(ring), + geometry::segments_end(ring), + strategy); + } +}; + +template +< + typename Segment, + typename Box, + typename Strategy +> +struct distance_brute_force +< + Segment, Box, Strategy, + segment_tag, box_tag, false +> : detail::distance_brute_force::distance_from_bg +{}; + +//==================================================================== + +template +< + typename Box1, + typename Box2, + typename Strategy +> +struct distance_brute_force +< + Box1, Box2, Strategy, + box_tag, box_tag, false +> : detail::distance_brute_force::distance_from_bg +{}; + +} // namespace dispatch + + + + + +template +inline typename distance_result::type +distance_brute_force(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) +{ + return dispatch::distance_brute_force + < + Geometry1, Geometry2, Strategy + >::apply(geometry1, geometry2, strategy); +} + +} // namespace unit_test + + +}} // namespace boost::geometry +#endif // BOOST_GEOMETRY_TEST_DISTANCE_BRUTE_FORCE_HPP diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_ca_ar_ar.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_ca_ar_ar.cpp new file mode 100644 index 000000000..1971d8c35 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_ca_ar_ar.cpp @@ -0,0 +1,437 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014-2018, 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_cartesian_areal_areal +#endif + +#include + +#include "test_distance_common.hpp" + + +typedef bg::model::point int_point_type; +typedef bg::model::point point_type; +typedef bg::model::polygon polygon_type; +typedef bg::model::multi_polygon multi_polygon_type; +typedef bg::model::ring ring_type; +typedef bg::model::box int_box_type; +typedef bg::model::box box_type; + +namespace services = bg::strategy::distance::services; +typedef bg::default_distance_result::type return_type; + +typedef bg::strategy::distance::projected_point<> point_segment_strategy; +typedef bg::strategy::distance::pythagoras_box_box<> box_box_strategy; + +//=========================================================================== + +template +void test_distance_polygon_polygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "polygon/polygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + "polygon((-5 20,5 20,5 25,-5 25,-5 20))", + 10, 100, strategy); + + tester::apply("polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + "polygon((-5 20,-5 5,5 5,5 20,-5 20))", + 0, 0, strategy); + + tester::apply("polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + "polygon((-5 20,-5 -20,5 -20,5 20,-5 20))", + 0, 0, strategy); + + tester::apply("polygon((-10 -10,10 -10,10 10,-10 10,-10 -10),\ + (-5 -5,-5 5,5 5,5 -5,-5 -5))", + "polygon((-1 -1,0 0,-1 0,-1 -1))", + 4, 16, strategy); +} + +//=========================================================================== + +template +void test_distance_polygon_multipolygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "polygon/multipolygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + polygon_type, multi_polygon_type + > tester; + + tester::apply("polygon((12 0,14 0,19 0,19.9 -1,12 0))", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 0.1, 0.01, strategy); + + tester::apply("polygon((19 0,19.9 -1,12 0,20.5 0.5,19 0))", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_polygon_ring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "polygon/ring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + "polygon((-5 20,5 20,5 25,-5 25,-5 20))", + 10, 100, strategy); + + tester::apply("polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + "polygon((-5 20,-5 5,5 5,5 20,-5 20))", + 0, 0, strategy); + + tester::apply("polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + "polygon((-5 20,-5 -20,5 -20,5 20,-5 20))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_multipolygon_multipolygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipolygon/multipolygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + multi_polygon_type, multi_polygon_type + > tester; + + tester::apply("multipolygon(((12 0,14 0,14 1,12 0)),\ + ((18 0,19 0,19.9 -1,18 0)))", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 0.1, 0.01, strategy); + + tester::apply("multipolygon(((18 0,19 0,19.9 -1,18 0)),\ + ((12 0,14 0,20.5 0.5,12 0)))", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_multipolygon_ring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipolygon/ring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + multi_polygon_type, ring_type + > tester; + + tester::apply("multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + "polygon((12 0,14 0,19 0,19.9 -1,12 0))", + 0.1, 0.01, strategy); + + tester::apply("multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + "polygon((19 0,19.9 -1,12 0,20.5 0.5,19 0))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_ring_ring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "ring/ring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + "polygon((-5 20,5 20,5 25,-5 25,-5 20))", + 10, 100, strategy); + + tester::apply("polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + "polygon((-5 20,-5 5,5 5,5 20,-5 20))", + 0, 0, strategy); + + tester::apply("polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + "polygon((-5 20,-5 -20,5 -20,5 20,-5 20))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_box_box(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "box/box distance tests" << std::endl; +#endif + typedef test_distance_of_geometries int_tester; + typedef test_distance_of_geometries tester; + + int_tester::apply("box(5 5,10 10)", + "box(0 0,1 1)", + sqrt(32.0), 32, strategy); + + tester::apply("box(5 5,10 10)", + "box(0 0,1 1)", + sqrt(32.0), 32, strategy); + + tester::apply("box(3 8,13 18)", + "box(0 0,5 5)", + 3, 9, strategy); + + tester::apply("box(5 5,10 10)", + "box(0 0,5 5)", + 0, 0, strategy); + + tester::apply("box(5 5,10 10)", + "box(0 0,6 6)", + 0, 0, strategy); + + tester::apply("box(3 5,13 15)", + "box(0 0,5 5)", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_polygon_box(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "polygon/box distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("polygon((10 10,10 5,5 5,5 10,10 10))", + "box(0 0,1 1)", + sqrt(32.0), 32, strategy); + + tester::apply("polygon((10 10,10 5,5 5,5 10,10 10))", + "box(0 0,5 5)", + 0, 0, strategy); + + tester::apply("polygon((10 10,10 5,5 5,5 10,10 10))", + "box(0 0,6 6)", + 0, 0, strategy); + + tester::apply("polygon((10 10,15 5,10 0,5 5,10 10))", + "box(5 0,7.5 2.5)", + 0, 0, strategy); + + tester::apply("polygon((10 10,15 5,10 0,5 5,10 10))", + "box(5 0,6 1)", + sqrt(4.5), 4.5, strategy); +} + +//=========================================================================== + +template +void test_distance_multipolygon_box(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipolygon/box distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("multipolygon(((-10 -10,-10 -9,-9 -9,-9 -10,-10 -10)),\ + ((2 2,2 3,3 3,3 2,2 2)))", + "box(0 0,1 1)", + sqrt(2.0), 2, strategy); + + tester::apply("multipolygon(((-10 -10,-10 -9,-9 -9,-9 -10,-10 -10)),\ + ((2 2,2 3,3 3,3 2,2 2)))", + "box(0 0,2 2)", + 0, 0, strategy); + + tester::apply("multipolygon(((-10 -10,-10 -9,-9 -9,-9 -10,-10 -10)),\ + ((2 2,2 3,3 3,3 2,2 2)))", + "box(0 0,2.5 2)", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_ring_box(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "ring/box distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("polygon((10 10,10 5,5 5,5 10,10 10))", + "box(0 0,1 1)", + sqrt(32.0), 32, strategy); + + tester::apply("polygon((10 10,10 5,5 5,5 10,10 10))", + "box(0 0,5 5)", + 0, 0, strategy); + + tester::apply("polygon((10 10,10 5,5 5,5 10,10 10))", + "box(0 0,6 6)", + 0, 0, strategy); + + tester::apply("polygon((10 10,15 5,10 0,5 5,10 10))", + "box(5 0,7.5 2.5)", + 0, 0, strategy); + + tester::apply("polygon((10 10,15 5,10 0,5 5,10 10))", + "box(5 0,6 1)", + sqrt(4.5), 4.5, strategy); +} + +//=========================================================================== + +template +void test_more_empty_input_areal_areal(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "testing on empty inputs... " << std::flush; +#endif + bg::model::polygon polygon_empty; + bg::model::multi_polygon > multipolygon_empty; + bg::model::ring ring_empty; + + bg::model::polygon polygon = + from_wkt >("polygon((0 0,1 0,0 1))"); + + bg::model::multi_polygon > multipolygon = + from_wkt + < + bg::model::multi_polygon > + >("multipolygon(((0 0,1 0,0 1)))"); + + bg::model::ring ring = + from_wkt >("polygon((0 0,1 0,0 1))"); + + // 1st geometry is empty + test_empty_input(polygon_empty, polygon, strategy); + test_empty_input(polygon_empty, multipolygon, strategy); + test_empty_input(polygon_empty, ring, strategy); + test_empty_input(multipolygon_empty, polygon, strategy); + test_empty_input(multipolygon_empty, multipolygon, strategy); + test_empty_input(multipolygon_empty, ring, strategy); + test_empty_input(ring_empty, polygon, strategy); + test_empty_input(ring_empty, multipolygon, strategy); + test_empty_input(ring_empty, ring, strategy); + + // 2nd geometry is empty + test_empty_input(polygon, polygon_empty, strategy); + test_empty_input(polygon, multipolygon_empty, strategy); + test_empty_input(polygon, ring_empty, strategy); + test_empty_input(multipolygon, polygon_empty, strategy); + test_empty_input(multipolygon, multipolygon_empty, strategy); + test_empty_input(multipolygon, ring_empty, strategy); + test_empty_input(ring, polygon_empty, strategy); + test_empty_input(ring, multipolygon_empty, strategy); + test_empty_input(ring, ring_empty, strategy); + + // both geometries are empty + test_empty_input(polygon_empty, polygon_empty, strategy); + test_empty_input(polygon_empty, multipolygon_empty, strategy); + test_empty_input(polygon_empty, ring_empty, strategy); + test_empty_input(multipolygon_empty, polygon_empty, strategy); + test_empty_input(multipolygon_empty, multipolygon_empty, strategy); + test_empty_input(multipolygon_empty, ring_empty, strategy); + test_empty_input(ring_empty, polygon_empty, strategy); + test_empty_input(ring_empty, multipolygon_empty, strategy); + test_empty_input(ring_empty, ring_empty, strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "done!" << std::endl; +#endif +} + +//=========================================================================== + +BOOST_AUTO_TEST_CASE( test_all_polygon_polygon ) +{ + test_distance_polygon_polygon(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_polygon_multipolygon ) +{ + test_distance_polygon_multipolygon(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_polygon_ring ) +{ + test_distance_polygon_ring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multipolygon_multipolygon ) +{ + test_distance_multipolygon_multipolygon(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multipolygon_ring ) +{ + test_distance_multipolygon_ring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_ring_ring ) +{ + test_distance_ring_ring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_box_box ) +{ + test_distance_box_box(box_box_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_polygon_box ) +{ + test_distance_polygon_box(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multipolygon_box ) +{ + test_distance_multipolygon_box(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_ring_box ) +{ + test_distance_ring_box(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_empty_input_areal_areal ) +{ + test_more_empty_input_areal_areal(point_segment_strategy()); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_ca_l_ar.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_ca_l_ar.cpp new file mode 100644 index 000000000..60a1e1c5b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_ca_l_ar.cpp @@ -0,0 +1,972 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014-2018, 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_cartesian_linear_areal +#endif + +#include + +#include "test_distance_common.hpp" + +typedef bg::model::point point_type; +typedef bg::model::point int_point_type; +typedef bg::model::segment segment_type; +typedef bg::model::segment int_segment_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_linestring multi_linestring_type; +typedef bg::model::polygon polygon_type; +typedef bg::model::polygon open_polygon_type; +typedef bg::model::multi_polygon multi_polygon_type; +typedef bg::model::multi_polygon open_multipolygon_type; +typedef bg::model::ring ring_type; +typedef bg::model::box box_type; +typedef bg::model::box int_box_type; + +namespace services = bg::strategy::distance::services; +typedef bg::default_distance_result::type return_type; + +typedef bg::strategy::distance::pythagoras<> point_point_strategy; +typedef bg::strategy::distance::projected_point<> point_segment_strategy; +typedef bg::strategy::distance::cartesian_segment_box<> segment_box_strategy; + +//=========================================================================== + +template +void test_distance_segment_polygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/polygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("segment(-1 20,1 20)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 10, 100, strategy); + + tester::apply("segment(1 20,2 40)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 10, 100, strategy); + + tester::apply("segment(-1 20,-1 5)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); + + tester::apply("segment(-1 20,-1 -20)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); + + tester::apply("segment(0 0,1 1)", + "polygon((2 2))", + sqrt(2.0), 2, strategy); +} + +//=========================================================================== + +template +void test_distance_linestring_polygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/polygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("linestring(-1 20,1 20,1 30)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 10, 100, strategy); + + tester::apply("linestring(-5 1,-2 1)", + "polygon((0 0,10 0,10 10,0 10,0 0))", + 2, 4, strategy); + + tester::apply("linestring(-1 20,1 20,1 5)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); + + tester::apply("linestring(-1 20,1 20,1 -20)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); + + tester::apply("linestring(-2 1)", + "polygon((0 0,10 0,10 10,0 10,0 0))", + 2, 4, strategy); + + tester::apply("linestring(-5 1,-2 1)", + "polygon((0 0))", + sqrt(5.0), 5, strategy); +} + +//=========================================================================== + +template +void test_distance_linestring_open_polygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/open polygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + linestring_type, open_polygon_type + > tester; + + tester::apply("linestring(-5 1,-2 1)", + "polygon((0 0,10 0,10 10,0 10))", + 2, 4, strategy); +} + +//=========================================================================== + +template +void test_distance_multilinestring_polygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multilinestring/polygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + multi_linestring_type, polygon_type + > tester; + + tester::apply("multilinestring((-100 -100,-90 -90),(-1 20,1 20,1 30))", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 10, 100, strategy); + + tester::apply("multilinestring((-1 20,1 20,1 30),(-1 20,1 20,1 5))", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); + + tester::apply("multilinestring((-1 20,1 20,1 30),(-1 20,1 20,1 -20))", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); + + tester::apply("multilinestring((-100 -100,-90 -90),(1 20))", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 10, 100, strategy); + + tester::apply("multilinestring((-100 -100,-90 -90),(-1 20,1 20,1 30))", + "polygon((-110 -110))", + sqrt(200.0), 200, strategy); +} + +//=========================================================================== + +template +void test_distance_segment_multipolygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/multipolygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + segment_type, multi_polygon_type + > tester; + + tester::apply("segment(-1 20,1 20)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((0 22,-1 30, 2 40,0 22)))", + 2, 4, strategy); + + tester::apply("segment(12 0,14 0)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 2, 4, strategy); + + tester::apply("segment(12 0,20.5 0.5)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 0, 0, strategy); + + tester::apply("segment(12 0,50 0)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_linestring_multipolygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/multipolygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + linestring_type, multi_polygon_type + > tester; + + tester::apply("linestring(-1 20,1 20)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((0 22,-1 30, 2 40,0 22)))", + 2, 4, strategy); + + tester::apply("linestring(12 0,14 0)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 2, 4, strategy); + + tester::apply("linestring(12 0,20.5 0.5)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 0, 0, strategy); + + tester::apply("linestring(12 0,50 0)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_linestring_open_multipolygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/open multipolygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + linestring_type, open_multipolygon_type + > tester; + + tester::apply("linestring(-5 1,-2 1)", + "multipolygon(((0 0,10 0,10 10,0 10)))", + 2, 4, strategy); + + tester::apply("linestring(-5 1,-3 1)", + "multipolygon(((20 20,21 20,21 21,20 21)),((0 0,10 0,10 10,0 10)))", + 3, 9, strategy); +} + +//=========================================================================== + +template +void test_distance_multilinestring_multipolygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multilinestring/multipolygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + multi_linestring_type, multi_polygon_type + > tester; + + tester::apply("multilinestring((12 0,14 0),(19 0,19.9 -1))", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10)))", + 0.1, 0.01, strategy); + + tester::apply("multilinestring((19 0,19.9 -1),(12 0,20.5 0.5))", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_segment_ring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/ring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("segment(-1 20,1 20)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 10, 100, strategy); + + tester::apply("segment(1 20,2 40)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 10, 100, strategy); + + tester::apply("segment(-1 20,-1 5)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); + + tester::apply("segment(-1 20,-1 -20)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_linestring_ring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/ring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("linestring(-1 20,1 20,1 30)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 10, 100, strategy); + + tester::apply("linestring(-1 20,1 20,1 5)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); + + tester::apply("linestring(-1 20,1 20,1 -20)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_multilinestring_ring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multilinestring/ring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + multi_linestring_type, ring_type + > tester; + + tester::apply("multilinestring((-100 -100,-90 -90),(-1 20,1 20,1 30))", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 10, 100, strategy); + + tester::apply("multilinestring((-1 20,1 20,1 30),(-1 20,1 20,1 5))", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); + + tester::apply("multilinestring((-1 20,1 20,1 30),(-1 20,1 20,1 -20))", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_segment_box(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "2D segment/box distance tests" << std::endl; +#endif + typedef int_box_type B; + typedef segment_type S; + typedef int_segment_type IS; + + typedef test_distance_of_geometries tester; + typedef test_distance_of_geometries itester; + + // 1st example by Adam Wulkiewicz + tester::apply("BOX(5 51,42 96)", + "SEGMENT(6.6799994 95.260002,35.119999 56.340004)", + 0, 0, strategy); + + // 2nd example by Adam Wulkiewicz + tester::apply("BOX(51 55,94 100)", + "SEGMENT(92.439995 50.130001,59.959999 80.870003)", + 0, 0, strategy); + + // segments that intersect the box + tester::apply("box(0 0,1 1)", + "segment(-1 0.5,0.5 0.75)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 0.5,1.5 0.75)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 -1,0.5 2)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 1,1.5 0.75)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(2 0,0 2)", + 0, 0, strategy); + + // segment that has closest point on box boundary + tester::apply("box(0 0,1 1)", + "segment(4 0.5,5 0.75)", + 3, 9, strategy); + + // segment that has closest point on box corner + tester::apply("box(0 0,1 1)", + "segment(4 0,0 4)", + sqrt(2.0), 2, strategy); + itester::apply("box(0 0,1 1)", + "segment(-4 0,0 -4)", + sqrt(8.0), 8, strategy); + itester::apply("box(0 0,1 1)", + "segment(-8 4,4 -8)", + sqrt(8.0), 8, strategy); + tester::apply("box(0 0,1 1)", + "segment(-4 0,0 4)", + 1.5 * sqrt(2.0), 4.5, strategy); + tester::apply("box(0 0,1 1)", + "segment(-4 0,1 5)", + 1.5 * sqrt(2.0), 4.5, strategy); + itester::apply("box(0 0,1 1)", + "segment(0 -2,3 1)", + 0.5 * sqrt(2.0), 0.5, strategy); + itester::apply("box(0 0,1 1)", + "segment(0 -2,2 2)", + 0, 0, strategy); + + // horizontal segments + itester::apply("box(0 0,1 1)", + "segment(-2 -1,-1 -1)", + sqrt(2.0), 2, strategy); + itester::apply("box(0 0,1 1)", + "segment(-1 -1,0 -1)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(-0.5 -1,0.5 -1)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 -1,0.75 -1)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 -1,1.25 -1)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 -1,2 -1)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(2 -1,3 -1)", + sqrt(2.0), 2, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -1,2 -1)", + 1, 1, strategy); + + tester::apply("box(0 0,1 1)", + "segment(-2 0,-1 0)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 0,0 0)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(-0.5 0,0.5 0)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 0,0.75 0)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 0,1.25 0)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 0,2 0)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(2 0,3 0)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 0,2 0)", + 0, 0, strategy); + + tester::apply("box(0 0,1 1)", + "segment(-2 0.5,-1 0.5)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 0.5,0 0.5)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(-0.5 0.5,0.5 0.5)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 0.5,0.75 0.5)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 0.5,1.25 0.5)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 0.5,2 0.5)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(2 0.5,3 0.5)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 0.5,2 0.5)", + 0, 0, strategy); + + tester::apply("box(0 0,1 1)", + "segment(-2 1,-1 1)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 1,0 1)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(-0.5 1,0.5 1)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 1,0.75 1)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 1,1.25 1)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 1,2 1)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(2 1,3 1)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 1,2 1)", + 0, 0, strategy); + + tester::apply("box(0 0,1 1)", + "segment(-2 3,-1 3)", + sqrt(5.0), 5, strategy); + itester::apply("box(0 0,1 1)", + "segment(-1 3,0 3)", + 2, 4, strategy); + tester::apply("box(0 0,1 1)", + "segment(-0.5 3,0.5 3)", + 2, 4, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 3,0.75 3)", + 2, 4, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 3,1.25 3)", + 2, 4, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 3,2 3)", + 2, 4, strategy); + tester::apply("box(0 0,1 1)", + "segment(2 3,3 3)", + sqrt(5.0), 5, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 3,2 3)", + 2, 4, strategy); + + // vertical segments + tester::apply("box(0 0,1 1)", + "segment(-1 -2,-1 -1)", + sqrt(2.0), 2, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 -1,-1 0)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 -0.5,-1 0.5)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 0.5,-1 0.75)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 0.5,-1 1.25)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 1,-1 2)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 2,-1 3)", + sqrt(2.0), 2, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 -2,-1 2)", + 1, 1, strategy); + + tester::apply("box(0 0,1 1)", + "segment(0 -2,0 -1)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(0 -1,0 0)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0 -0.5,0 0.5)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0 0.5,0 0.75)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0 0.5,0 1.25)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0 1,0 2)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0 2,0 3)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(0 -2,0 2)", + 0, 0, strategy); + + tester::apply("box(0 0,1 1)", + "segment(0.5 -2,0.5 -1)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 -1,0.5 0)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 -0.5,0.5 0.5)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 0.5,0.5 0.75)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 0.5,0.5 1.25)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 1,0.5 2)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 2,0.5 3)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 -2,0.5 2)", + 0, 0, strategy); + + tester::apply("box(0 0,1 1)", + "segment(1 -2,1 -1)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 -1,1 0)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 -0.5,1 0.5)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 0.5,1 0.75)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 0.5,1 1.25)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 1,1 2)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 2,1 3)", + 1, 1, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 -2,1 2)", + 0, 0, strategy); + + tester::apply("box(0 0,1 1)", + "segment(3 -2,3 -1)", + sqrt(5.0), 5, strategy); + tester::apply("box(0 0,1 1)", + "segment(3 -1,3 0)", + 2, 4, strategy); + tester::apply("box(0 0,1 1)", + "segment(3 -0.5,3 0.5)", + 2, 4, strategy); + tester::apply("box(0 0,1 1)", + "segment(3 0.5,3 0.75)", + 2, 4, strategy); + tester::apply("box(0 0,1 1)", + "segment(3 0.5,3 1.25)", + 2, 4, strategy); + tester::apply("box(0 0,1 1)", + "segment(3 1,3 2)", + 2, 4, strategy); + tester::apply("box(0 0,1 1)", + "segment(3 2,3 3)", + sqrt(5.0), 5, strategy); + tester::apply("box(0 0,1 1)", + "segment(3 -2,3 2)", + 2, 4, strategy); + + // positive slope + itester::apply("box(0 0,1 1)", + "segment(-2 -2,-1 -1)", + sqrt(2.0), 2, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,0 -0.5)", + 0.5, 0.25, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,0.5 -0.5)", + 0.5, 0.25, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,1 -0.5)", + 0.5, 0.25, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,2 0)", + sqrt(0.2), 0.2, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,4 1)", + sqrt(0.2), 0.2, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,-1.5 0)", + 1.5, 2.25, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,-1.5 0.5)", + 1.5, 2.25, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,-1.5 1)", + 1.5, 2.25, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,0 2)", + sqrt(0.2), 0.2, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,1 4)", + sqrt(0.2), 0.2, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,4 2)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,2 4)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,4 3)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,3 4)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 -2,3 3)", + 0, 0, strategy); + + // negative slope + tester::apply("box(0 0,1 1)", + "segment(-2 -2,-1 -3)", + sqrt(8.0), 8, strategy); + tester::apply("box(0 0,1 1)", + "segment(-3 -1,0 -4)", + sqrt(8.0), 8, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 0.75,-1.5 0.5)", + 1.5, 2.25, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 1.5,-1.5 0.5)", + 1.5, 2.25, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 2,0.75 1.5)", + 0.5, 0.25, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 2,0.75 1.5)", + 0.5, 0.25, strategy); + tester::apply("box(0 0,1 1)", + "segment(0 2,2 0)", + 0, 0, strategy); + tester::apply("box(0 0,1 1)", + "segment(0 3,3 0)", + sqrt(0.5), 0.5, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 4,4 -1)", + sqrt(0.5), 0.5, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 4,0 3)", + 2, 4, strategy); + tester::apply("box(0 0,1 1)", + "segment(-2 5,-1 4)", + sqrt(10.0), 10, strategy); + tester::apply("box(0 0,1 1)", + "segment(3 -1,4 -4)", + sqrt(5.0), 5, strategy); + tester::apply("box(0 0,1 1)", + "segment(1 2,2 1)", + sqrt(0.5), 0.5, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 -2,2 -3)", + 2, 4, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 -2,0 -3)", + sqrt(5.0), 5, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 -2,0.5 -3.5)", + sqrt(5.0), 5, strategy); + tester::apply("box(0 0,1 1)", + "segment(-1 -2,0.5 -3.5)", + sqrt(5.0), 5, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 3,2.5 2)", + sqrt(2.45), 2.45, strategy); + tester::apply("box(0 0,1 1)", + "segment(0.5 1.5,1.5 -1.5)", + 0, 0, strategy); + + // test degenerate segment + tester::apply("box(0 0,2 2)", + "segment(4 1,4 1)", + 2, 4, strategy); +} + +//=========================================================================== + +template +void test_distance_linestring_box(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/box distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + // linestrings that intersect the box + tester::apply("linestring(-1 0.5,0.5 0.75)", + "box(0 0,1 1)", + 0, 0, strategy); + tester::apply("linestring(-1 0.5,1.5 0.75)", + "box(0 0,1 1)", + 0, 0, strategy); + + // linestring that has closest point on box boundary + tester::apply("linestring(4 0.5,5 0.75)", + "box(0 0,1 1)", + 3, 9, strategy); + + // linestring that has closest point on box corner + tester::apply("linestring(4 0,0 4)", + "box(0 0,1 1)", + sqrt(2.0), 2, strategy); +} + +//=========================================================================== + +template +void test_distance_multilinestring_box(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multilinestring/box distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + // multilinestring that intersects the box + tester::apply("multilinestring((-1 0.5,0.5 0.75),(4 0.5,5 0.75))", + "box(0 0,1 1)", + 0, 0, strategy); + + // multilinestring that has closest point on box boundary + tester::apply("multilinestring((4 0.5,5 0.75))", + "box(0 0,1 1)", + 3, 9, strategy); + + // multilinestring that has closest point on box corner + tester::apply("multilinestring((5 0,0 5),(4 0,0 4))", + "box(0 0,1 1)", + sqrt(2.0), 2, strategy); +} + +//=========================================================================== + +template +void test_more_empty_input_linear_areal(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "testing on empty inputs... " << std::flush; +#endif + bg::model::linestring line_empty; + bg::model::polygon polygon_empty; + bg::model::multi_linestring > multiline_empty; + bg::model::multi_polygon > multipolygon_empty; + bg::model::ring ring_empty; + + bg::model::linestring line = + from_wkt >("linestring(0 0,1 1)"); + + bg::model::polygon polygon = + from_wkt >("polygon((0 0,1 0,0 1))"); + + bg::model::ring ring = + from_wkt >("polygon((0 0,1 0,0 1))"); + + // 1st geometry is empty + test_empty_input(line_empty, polygon, strategy); + test_empty_input(line_empty, ring, strategy); + test_empty_input(multiline_empty, polygon, strategy); + test_empty_input(multiline_empty, ring, strategy); + + // 2nd geometry is empty + test_empty_input(line, polygon_empty, strategy); + test_empty_input(line, multipolygon_empty, strategy); + test_empty_input(line, ring_empty, strategy); + + // both geometries are empty + test_empty_input(line_empty, polygon_empty, strategy); + test_empty_input(line_empty, multipolygon_empty, strategy); + test_empty_input(line_empty, ring_empty, strategy); + test_empty_input(multiline_empty, polygon_empty, strategy); + test_empty_input(multiline_empty, multipolygon_empty, strategy); + test_empty_input(multiline_empty, ring_empty, strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "done!" << std::endl; +#endif +} + +//=========================================================================== + +BOOST_AUTO_TEST_CASE( test_all_segment_polygon ) +{ + test_distance_segment_polygon(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_linestring_polygon ) +{ + test_distance_linestring_polygon(point_segment_strategy()); + test_distance_linestring_open_polygon(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multilinestring_polygon ) +{ + test_distance_multilinestring_polygon(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_segment_multipolygon ) +{ + test_distance_segment_multipolygon(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_linestring_multipolygon ) +{ + test_distance_linestring_multipolygon(point_segment_strategy()); + test_distance_linestring_open_multipolygon(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multilinestring_multipolygon ) +{ + test_distance_multilinestring_multipolygon(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_segment_ring ) +{ + test_distance_segment_ring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_linestring_ring ) +{ + test_distance_linestring_ring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multilinestring_ring ) +{ + test_distance_multilinestring_ring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_segment_box ) +{ + test_distance_segment_box(segment_box_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_linestring_box ) +{ + test_distance_linestring_box(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multilinestring_box ) +{ + test_distance_multilinestring_box(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_empty_input_linear_areal ) +{ + test_more_empty_input_linear_areal(point_segment_strategy()); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_ca_l_l.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_ca_l_l.cpp new file mode 100644 index 000000000..62a5de869 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_ca_l_l.cpp @@ -0,0 +1,321 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014-2018, 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_cartesian_linear_linear +#endif + +#include + +#include "test_distance_common.hpp" + + +typedef bg::model::point point_type; +typedef bg::model::segment segment_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_linestring multi_linestring_type; + +namespace services = bg::strategy::distance::services; +typedef bg::default_distance_result::type return_type; + +typedef bg::strategy::distance::projected_point<> point_segment_strategy; + +//=========================================================================== + +template +void test_distance_segment_segment(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/segment distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("segment(0 0,10 0)", + "segment(4 2,4 0.5)", + return_type(0.5), return_type(0.25), strategy); + + tester::apply("segment(0 0,10 0)", + "segment(4 2,4 -0.5)", + return_type(0), return_type(0), strategy); + + tester::apply("segment(0 0,10 0)", + "segment(4 2,0 0)", + return_type(0), return_type(0), strategy); + + tester::apply("segment(0 0,10 0)", + "segment(-2 3,1 2)", + return_type(2), return_type(4), strategy); +} + +//=========================================================================== + +template +void test_distance_segment_linestring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/linestring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("segment(-1 -1,-2 -2)", + "linestring(2 1,1 2,4 0)", + sqrt(12.5), 12.5, strategy); + + tester::apply("segment(1 1,2 2)", + "linestring(2 1,1 2,4 0)", + 0, 0, strategy); + + tester::apply("segment(1 1,2 2)", + "linestring(3 3,3 3)", + sqrt(2.0), 2, strategy); + + tester::apply("segment(1 1,2 2)", + "linestring(3 3)", + sqrt(2.0), 2, strategy); +} + +//=========================================================================== + +template +void test_distance_linestring_linestring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/linestring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + linestring_type, linestring_type + > tester; + + // It is not obvious that linestrings with only one point are valid + tester::apply("linestring(1 1)", "linestring(2 1)", + 1, 1, strategy); + + tester::apply("linestring(1 1,3 1)", "linestring(2 1)", + 0, 0, strategy); + + tester::apply("linestring(1 1)", "linestring(0 0,-2 0,2 -2,2 0)", + sqrt(2.0), 2, strategy); + + tester::apply("linestring(1 1,1 1)", "linestring(2 1,2 1)", + 1, 1, strategy); + + tester::apply("linestring(1 1,1 1,1 1)", "linestring(2 1,2 1,2 1,2 1)", + 1, 1, strategy); + + tester::apply("linestring(1 1,3 1)", "linestring(2 1,2 1)", + 0, 0, strategy); + + tester::apply("linestring(1 1,1 1)", "linestring(0 0,-2 0,2 -2,2 0)", + sqrt(2.0), 2, strategy); + + tester::apply("linestring(1 1,3 1)", "linestring(2 1, 4 1)", + 0, 0, strategy); + + tester::apply("linestring(1 1,2 2,3 3)", "linestring(2 1,1 2,4 0)", + 0, 0, strategy); + + tester::apply("linestring(1 1,2 2,3 3)", "linestring(1 0,2 -1,4 0)", + 1, 1, strategy); + + tester::apply("linestring(1 1,2 2,3 3)", + "linestring(1 -10,2 0,2.1 -10,4 0)", + sqrt(2.0), 2, strategy); + + tester::apply("linestring(1 1,2 2,3 3)", + "linestring(1 -10,2 1.9,2.1 -10,4 0)", + sqrt(0.005), 0.005, strategy); + + tester::apply("linestring(1 1,1 2)", "linestring(0 0,-2 0,2 -2,2 0)", + sqrt(2.0), 2, strategy); +} + +//=========================================================================== + +template +void test_distance_segment_multilinestring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/multilinestring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + segment_type, multi_linestring_type + > tester; + + tester::apply("segment(-1 -1,-2 -2)", + "multilinestring((2 1,1 2),(4 0,4 10))", + sqrt(12.5), 12.5, strategy); + + tester::apply("segment(1 1,2 2)", + "multilinestring((2 1,1 2),(4 0,4 10))", + 0, 0, strategy); + + tester::apply("segment(1 1,2 2)", + "multilinestring((2.5 0,4 0,5 0),(3 3,3 3))", + sqrt(2.0), 2, strategy); + + tester::apply("segment(1 1,2 2)", + "multilinestring((2.5 0),(3 3,3 3))", + sqrt(2.0), 2, strategy); + + tester::apply("segment(1 1,2 2)", + "multilinestring((2.5 0,4 0,5 0),(3 3))", + sqrt(2.0), 2, strategy); +} + +//=========================================================================== + +template +void test_distance_linestring_multilinestring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/multilinestring distance tests" << std::endl; +#endif + + typedef test_distance_of_geometries + < + linestring_type, multi_linestring_type + > tester; + + tester::apply("linestring(1 1,2 2,3 3)", + "multilinestring((2 1,1 2,4 0),(1 -10,2 1.9,2.1 -10,4 0))", + 0, 0, strategy); + + tester::apply("linestring(1 1,2 2,3 3)", + "multilinestring((1 -10,2 0,2.1 -10,4 0),(1 -10,2 1.9,2.1 -10,4 0))", + sqrt(0.005), 0.005, strategy); + + tester::apply("linestring(1 1,2 2)", + "multilinestring((2.5 0,4 0,5 0),(3 3,3 3))", + sqrt(2.0), 2, strategy); + + tester::apply("linestring(2 2)", + "multilinestring((2.5 0,4 0,5 0),(3 3,3 3))", + sqrt(2.0), 2, strategy); + + tester::apply("linestring(1 1,2 2)", + "multilinestring((2.5 0,4 0,5 0),(3 3))", + sqrt(2.0), 2, strategy); + + tester::apply("linestring(1 1,2 2,3 3,4 4,5 5,6 6,7 7,8 8,9 9)", + "multilinestring((2.5 0,4 0,5 0),(10 10,10 10))", + sqrt(2.0), 2, strategy); +} + +//=========================================================================== + +template +void test_distance_multilinestring_multilinestring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multilinestring/multilinestring distance tests" << std::endl; +#endif + + typedef test_distance_of_geometries + < + multi_linestring_type, multi_linestring_type + > tester; + + tester::apply("multilinestring((0 0,0 1,1 1),(10 0,11 1,12 2))", + "multilinestring((0.5 0.5,0.75 0.75),(11 0,11 7))", + 0, 0, strategy); + + tester::apply("multilinestring((0 0,0 1,1 1),(10 0,11 1,12 2))", + "multilinestring((0.5 0.5,0.75 0.75),(11 0,11 0.9))", + sqrt(0.005), 0.005, strategy); + + tester::apply("multilinestring((0 0,0 1,1 1),(10 0,11 1,12 2))", + "multilinestring((0.5 0.5,0.75 0.75),(11.1 0,11.1 0.9))", + sqrt(0.02), 0.02, strategy); + + tester::apply("multilinestring((0 0),(1 1))", + "multilinestring((2 2),(3 3))", + sqrt(2.0), 2, strategy); +} + +//=========================================================================== + +template +void test_more_empty_input_linear_linear(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "testing on empty inputs... " << std::flush; +#endif + bg::model::linestring line_empty; + bg::model::multi_linestring > multiline_empty; + + bg::model::linestring line = + from_wkt >("linestring(0 0,1 1)"); + + // 1st geometry is empty + test_empty_input(line_empty, line, strategy); + test_empty_input(multiline_empty, line, strategy); + + // 2nd geometry is empty + test_empty_input(line, line_empty, strategy); + test_empty_input(line, multiline_empty, strategy); + + // both geometries are empty + test_empty_input(line_empty, line_empty, strategy); + test_empty_input(line_empty, multiline_empty, strategy); + test_empty_input(multiline_empty, multiline_empty, strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "done!" << std::endl; +#endif +} + +//=========================================================================== + +BOOST_AUTO_TEST_CASE( test_all_segment_segment ) +{ + test_distance_segment_segment(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_segment_linestring ) +{ + test_distance_segment_linestring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_linestring_linestring ) +{ + test_distance_linestring_linestring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_segment_multilinestring ) +{ + test_distance_segment_multilinestring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_linestring_multilinestring ) +{ + test_distance_linestring_multilinestring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multilinestring_multilinestring ) +{ + test_distance_multilinestring_multilinestring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_empty_input_linear_linear ) +{ + test_more_empty_input_linear_linear(point_segment_strategy()); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_ca_pl_ar.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_ca_pl_ar.cpp new file mode 100644 index 000000000..2eb132bc8 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_ca_pl_ar.cpp @@ -0,0 +1,671 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014-2018, 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_cartesian_pointlike_areal +#endif + +#include + +#include "test_distance_common.hpp" + + +typedef bg::model::point point_type; +typedef bg::model::multi_point multi_point_type; +typedef bg::model::point point_type_3d; +typedef bg::model::multi_point multi_point_type_3d; +typedef bg::model::polygon polygon_type; +typedef bg::model::multi_polygon multi_polygon_type; +typedef bg::model::ring ring_type; +typedef bg::model::box box_type; +typedef bg::model::box box_type_3d; + +namespace services = bg::strategy::distance::services; +typedef bg::default_distance_result::type return_type; + +typedef bg::strategy::distance::pythagoras<> point_point_strategy; +typedef bg::strategy::distance::projected_point<> point_segment_strategy; +typedef bg::strategy::distance::pythagoras_point_box<> point_box_strategy; + +//=========================================================================== + +template +void test_distance_point_polygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/polygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("point(0 -20)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 10, 100, strategy); + + tester::apply("point(12 0)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 2, 4, strategy); + + tester::apply("point(0 0)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); + + tester::apply("point(0 0)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10),\ + (-5 -5,-5 5,5 5,5 -5,-5 -5))", + 5, 25, strategy); + + // polygons with single-point rings + tester::apply("point(0 0)", + "polygon((-5 5))", + sqrt(50.0), 50, strategy); + + tester::apply("point(0 0)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10),(-5 5))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_point_ring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/ring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("point(0 -20)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 10, 100, strategy); + + tester::apply("point(12 0)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 2, 4, strategy); + + tester::apply("point(0 0)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); + + // single-point rings + tester::apply("point(0 0)", + "polygon((-10 -10))", + sqrt(200.0), 200, strategy); +} + +//=========================================================================== + +template +void test_distance_point_multipolygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/multipolygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("point(0 -20)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((0 22,-1 30,2 40,0 22)))", + 10, 100, strategy); + + tester::apply("point(12 0)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 2, 4, strategy); + + tester::apply("point(0 0)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 0, 0, strategy); + + tester::apply("point(0 0)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10),\ + (-5 -5,-5 5,5 5,5 -5,-5 -5)),\ + ((100 0,101 0,101 1,100 1,100 0)))", + 5, 25, strategy); +} + +//=========================================================================== + +template +void test_distance_multipoint_polygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/polygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("multipoint(0 -20,0 -15)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 5, 25, strategy); + + tester::apply("multipoint(16 0,12 0)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 2, 4, strategy); + + tester::apply("multipoint(0 0,5 5,4 4)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); + + tester::apply("multipoint(0 0,2 0)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10),\ + (-5 -5,-5 5,5 5,5 -5,-5 -5))", + 3, 9, strategy); + + tester::apply("multipoint(4 4,11 11)", + "polygon((0 0,0 10,10 10,10 0,0 0))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_multipoint_ring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/ring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("multipoint(0 -20,0 -15)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 5, 25, strategy); + + tester::apply("multipoint(16 0,12 0)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 2, 4, strategy); + + tester::apply("multipoint(0 0,5 5,4 4)", + "polygon((-10 -10,10 -10,10 10,-10 10,-10 -10))", + 0, 0, strategy); + + // single-point ring + tester::apply("multipoint(0 0,5 5,4 4)", + "polygon((10 10))", + sqrt(50.0), 50, strategy); +} + +//=========================================================================== + +template +void test_distance_multipoint_multipolygon(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/multipolygon distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + multi_point_type, multi_polygon_type + > tester; + + tester::apply("multipoint(0 -20,0 -15)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((0 22,-1 30,2 40,0 22)))", + 5, 25, strategy); + + tester::apply("multipoint(16 0,12 0)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 2, 4, strategy); + + tester::apply("multipoint(0 0,4 4,5 5)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10)),\ + ((20 -1,21 2,30 -10,20 -1)))", + 0, 0, strategy); + + tester::apply("multipoint(0 0,2 0)", + "multipolygon(((-10 -10,10 -10,10 10,-10 10,-10 -10),\ + (-5 -5,-5 5,5 5,5 -5,-5 -5)),\ + ((100 0,101 0,101 1,100 1,100 0)))", + 3, 9, strategy); + + tester::apply("MULTIPOINT(19 19,100 100)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),\ + (4 4,4 6,6 6,6 4,4 4)), ((10 10,10 20,20 20,20 10,10 10),\ + (14 14,14 16,16 16,16 14,14 14)))", + 0, 0, strategy); +} + +//=========================================================================== + +template +void test_distance_point_box_2d(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "2D point/box distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + // point inside box + tester::apply("box(-1 -1,1 1)", + "point(0 0)", 0, 0, strategy); + + // points on box corners + tester::apply("box(-1 -1,1 1)", + "point(-1 -1)", 0, 0, strategy); + tester::apply("box(-1 -1,1 1)", + "point(-1 1)", 0, 0, strategy); + tester::apply("box(-1 -1,1 1)", + "point(1 -1)", 0, 0, strategy); + tester::apply("box(-1 -1,1 1)", + "point(1 1)", 0, 0, strategy); + + // points on box boundary edges + tester::apply("box(-1 -1,1 1)", + "point(0 -1)", 0, 0, strategy); + tester::apply("box(-1 -1,1 1)", + "point(-1 0)", 0, 0, strategy); + tester::apply("box(-1 -1,1 1)", + "point(1 0)", 0, 0, strategy); + tester::apply("box(-1 -1,1 1)", + "point(0 1)", 0, 0, strategy); + + // points outside box + tester::apply("box(-1 -1,1 1)", + "point(0 4)", 3, 9, strategy); + tester::apply("box(-1 -1,1 1)", + "point(0.5 4)", 3, 9, strategy); + tester::apply("box(-1 -1,1 1)", + "point(-0.5 5)", 4, 16, strategy); + tester::apply("box(-1 -1,1 1)", + "point(3 0.25)", 2, 4, strategy); + tester::apply("box(-1 -1,1 1)", + "point(-3 -0.25)", 2, 4, strategy); + tester::apply("box(-1 -1,1 1)", + "point(3 5)", sqrt(20.0), 20, strategy); + tester::apply("box(-1 -1,1 1)", + "point(-5 -4)", 5, 25, strategy); + tester::apply("box(-1 -1,1 1)", + "point(2 -2)", sqrt(2.0), 2, strategy); + tester::apply("box(-1 -1,1 1)", + "point(-3 4)", sqrt(13.0), 13, strategy); +} + +//=========================================================================== + +template +void test_distance_point_box_different_point_types(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "2D point/box distance tests with different points" + << std::endl; +#endif + typedef point_type double_point; + typedef box_type double_box; + typedef bg::model::point int_point; + typedef bg::model::box int_box; + + test_distance_of_geometries + < + int_point, int_box + >::apply("point(0 0)", + "box(1 1, 2 2)", + sqrt(2.0), 2, strategy); + + test_distance_of_geometries + < + double_point, int_box + >::apply("point(0.5 0)", + "box(1 -1,2 1)", + 0.5, 0.25, strategy); + + test_distance_of_geometries + < + double_point, double_box + >::apply("point(1.5 0)", + "box(1 -1,2 1)", + 0, 0, strategy); + + test_distance_of_geometries + < + double_point, int_box + >::apply("point(1.5 0)", + "box(1 -1,2 1)", + 0, 0, strategy); + + test_distance_of_geometries + < + int_point, double_box + >::apply("point(1 0)", + "box(0.5 -1,1.5 1)", + 0, 0, strategy); + + test_distance_of_geometries + < + int_point, double_box + >::apply("point(0 0)", + "box(0.5, -1,1.5, 1)", + 0.5, 0.25, strategy); +} + +//=========================================================================== + +template +void test_distance_point_box_3d(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "3D point/box distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + // point inside box + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 0 0)", 0, 0, strategy); + + // points on box corners + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-1 -1 -1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-1 -1 1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-1 1 -1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-1 1 1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(1 -1 -1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(1 -1 1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(1 1 -1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(1 1 1)", 0, 0, strategy); + + // points on box boundary edges + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 -1 -1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 -1 1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 1 -1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 1 1)", 0, 0, strategy); + + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-1 0 -1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-1 0 1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(1 0 -1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(1 0 1)", 0, 0, strategy); + + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-1 -1 0)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-1 1 0)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(1 -1 0)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(1 1 0)", 0, 0, strategy); + + // point on box faces + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 0 -1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 0 1)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 -1 0)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 1 0)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-1 0 0)", 0, 0, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(1 0 0)", 0, 0, strategy); + + // points outside box -- closer to box corners + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-2 -3 -4)", sqrt(14.0), 14, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-2 -3 3)", 3, 9, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-2 5 -2)", sqrt(18.0), 18, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-2 5 3)", sqrt(21.0), 21, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(4 -6 -3)", sqrt(38.0), 38, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(4 -6 4)", sqrt(43.0), 43, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(4 7 -2)", sqrt(46.0), 46, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(4 7 8)", sqrt(94.0), 94, strategy); + + + // points closer to box facets + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 0 10)", 9, 81, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 0 -5)", 4, 16, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 7 0)", 6, 36, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 -6 0)", 5, 25, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(4 0 0)", 3, 9, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-3 0 0)", 2, 4, strategy); + + // points closer to box edges + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 -4 -5)", 5, 25, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 -3 6)", sqrt(29.0), 29, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 2 -7)", sqrt(37.0), 37, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(0 8 7)", sqrt(85.0), 85, strategy); + + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-4 0 -4)", sqrt(18.0), 18, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-3 0 5)", sqrt(20.0), 20, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(2 0 -6)", sqrt(26.0), 26, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(8 0 6)", sqrt(74.0), 74, strategy); + + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-5 -5 0)", sqrt(32.0), 32, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(-4 6 0)", sqrt(34.0), 34, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(3 -7 0)", sqrt(40.0), 40, strategy); + tester::apply("box(-1 -1 -1,1 1 1)", + "point(9 7 0)", 10, 100, strategy); +} + +//=========================================================================== + +template +void test_distance_multipoint_box_2d(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "2D multipoint/box distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + // at least one point inside the box + tester::apply("box(0 0,10 10)", + "multipoint(0 0,-1 -1,20 20)", + 0, 0, strategy); + + tester::apply("box(0 0,10 10)", + "multipoint(1 1,-1 -1,20 20)", + 0, 0, strategy); + + tester::apply("box(0 0,10 10)", + "multipoint(1 1,2 2,3 3)", + 0, 0, strategy); + + // all points outside the box + tester::apply("box(0 0,10 10)", + "multipoint(-1 -1,20 20)", + sqrt(2.0), 2, strategy); + + tester::apply("box(0 0,10 10)", + "multipoint(5 13, 50 50)", + 3, 9, strategy); +} + +//=========================================================================== + +template +void test_distance_multipoint_box_3d(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "3D multipoint/box distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + box_type_3d, multi_point_type_3d + > tester; + + // at least one point inside the box + tester::apply("box(0 0 0,10 10 10)", + "multipoint(0 0 0,-1 -1 -1,20 20 20)", + 0, 0, strategy); + + tester::apply("box(0 0 0,10 10 10)", + "multipoint(1 1 1,-1 -1 -1,20 20 20)", + 0, 0, strategy); + + tester::apply("box(0 0 0,10 10 10)", + "multipoint(1 1 1,2 2 2,3 3 3)", + 0, 0, strategy); + + // all points outside the box + tester::apply("box(0 0 0,10 10 10)", + "multipoint(-1 -1 -1,20 20 20)", + sqrt(3.0), 3, strategy); + + tester::apply("box(0 0 0,10 10 10)", + "multipoint(5 5 13,50 50 50)", + 3, 9, strategy); +} + +//=========================================================================== + +template +void test_more_empty_input_pointlike_areal(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "testing on empty inputs... " << std::flush; +#endif + bg::model::multi_point multipoint_empty; + bg::model::polygon polygon_empty; + bg::model::multi_polygon > multipolygon_empty; + bg::model::ring ring_empty; + + Point point = from_wkt("point(0 0)"); + bg::model::polygon polygon = + from_wkt >("polygon((0 0,1 0,0 1))"); + bg::model::ring ring = + from_wkt >("polygon((0 0,1 0,0 1))"); + + // 1st geometry is empty + test_empty_input(multipoint_empty, polygon, strategy); + test_empty_input(multipoint_empty, ring, strategy); + + // 2nd geometry is empty + test_empty_input(point, polygon_empty, strategy); + test_empty_input(point, multipolygon_empty, strategy); + test_empty_input(point, ring_empty, strategy); + + // both geometries are empty + test_empty_input(multipoint_empty, polygon_empty, strategy); + test_empty_input(multipoint_empty, multipolygon_empty, strategy); + test_empty_input(multipoint_empty, ring_empty, strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "done!" << std::endl; +#endif +} + +//=========================================================================== + +BOOST_AUTO_TEST_CASE( test_all_pointlike_polygon ) +{ + test_distance_point_polygon(point_point_strategy()); // back-compatibility + test_distance_point_polygon(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_point_multipolygon ) +{ + test_distance_point_multipolygon(point_point_strategy()); // back-compatibility + test_distance_point_multipolygon(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_point_ring ) +{ + test_distance_point_ring(point_point_strategy()); // back-compatibility + test_distance_point_ring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multipoint_polygon ) +{ + test_distance_multipoint_polygon(point_point_strategy()); // back-compatibility + test_distance_multipoint_polygon(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multipoint_multipolygon ) +{ + test_distance_multipoint_multipolygon(point_point_strategy()); // back-compatibility + test_distance_multipoint_multipolygon(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multipoint_ring ) +{ + test_distance_multipoint_ring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_point_box_2d ) +{ + point_box_strategy pb_strategy; + + test_distance_point_box_2d(pb_strategy); + test_distance_point_box_different_point_types(pb_strategy); +} + +BOOST_AUTO_TEST_CASE( test_all_point_box_3d ) +{ + test_distance_point_box_3d(point_box_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multipoint_box_2d ) +{ + test_distance_multipoint_box_2d(point_box_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multipoint_box_3d ) +{ + test_distance_multipoint_box_3d(point_box_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_empty_input_pointlike_areal ) +{ + test_more_empty_input_pointlike_areal + < + point_type + >(point_segment_strategy()); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_ca_pl_l.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_ca_pl_l.cpp new file mode 100644 index 000000000..bd505fcaf --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_ca_pl_l.cpp @@ -0,0 +1,318 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014-2018, 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_cartesian_pointlike_linear +#endif + +#include + +#include "test_distance_common.hpp" +#include "test_empty_geometry.hpp" + +typedef bg::model::point point_type; +typedef bg::model::multi_point multi_point_type; +typedef bg::model::segment segment_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_linestring multi_linestring_type; + +namespace services = bg::strategy::distance::services; +typedef bg::default_distance_result::type return_type; + +typedef bg::strategy::distance::pythagoras<> point_point_strategy; +typedef bg::strategy::distance::projected_point<> point_segment_strategy; + + +//=========================================================================== + + +template +void test_distance_point_segment(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/segment distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("point(0 0)", "segment(2 0,3 0)", 2, 4, strategy); + tester::apply("point(2.5 3)", "segment(2 0,3 0)", 3, 9, strategy); + tester::apply("point(2 0)", "segment(2 0,3 0)", 0, 0, strategy); + tester::apply("point(3 0)", "segment(2 0,3 0)", 0, 0, strategy); + tester::apply("point(2.5 0)", "segment(2 0,3 0)", 0, 0, strategy); + + // distance is a NaN + tester::apply("POINT(4.297374e+307 8.433875e+307)", + "SEGMENT(26 87,13 95)", + 0, 0, strategy, false); +} + +//=========================================================================== + +template +void test_distance_point_linestring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/linestring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("point(0 0)", "linestring(2 0,3 0)", 2, 4, strategy); + tester::apply("point(2.5 3)", "linestring(2 0,3 0)", 3, 9, strategy); + tester::apply("point(2 0)", "linestring(2 0,3 0)", 0, 0, strategy); + tester::apply("point(3 0)", "linestring(2 0,3 0)", 0, 0, strategy); + tester::apply("point(2.5 0)", "linestring(2 0,3 0)", 0, 0, strategy); + + // linestring with a single point + tester::apply("point(0 0)", "linestring(2 0)", 2, 4, strategy); + + // distance is a NaN + tester::apply("POINT(4.297374e+307 8.433875e+307)", + "LINESTRING(26 87,13 95)", + 0, 0, strategy, false); +} + +//=========================================================================== + +template +void test_distance_point_multilinestring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/multilinestring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + point_type, multi_linestring_type + > tester; + + tester::apply("point(0 0)", + "multilinestring((-5 0,-3 0),(2 0,3 0))", + 2, 4, strategy); + tester::apply("point(2.5 3)", + "multilinestring((-5 0,-3 0),(2 0,3 0))", + 3, 9, strategy); + tester::apply("point(2 0)", + "multilinestring((-5 0,-3 0),(2 0,3 0))", + 0, 0, strategy); + tester::apply("point(3 0)", + "multilinestring((-5 0,-3 0),(2 0,3 0))", + 0, 0, strategy); + tester::apply("point(2.5 0)", + "multilinestring((-5 0,-3 0),(2 0,3 0))", + 0, 0, strategy); + tester::apply("POINT(0 0)", + "MULTILINESTRING((10 10,10 0),(0.0 -0.0,0.0 -0.0))", + 0, 0, strategy); + tester::apply("POINT(0 0)", + "MULTILINESTRING((10 10,10 0),(1 1,1 1))", + sqrt(2.0), 2, strategy); + tester::apply("POINT(0 0)", + "MULTILINESTRING((10 10,10 0),(1 1,2 2))", + sqrt(2.0), 2, strategy); + tester::apply("POINT(0 0)", + "MULTILINESTRING((10 10,10 0),(20 20,20 20))", + 10, 100, strategy); + + // multilinestrings containing an empty linestring + tester::apply("POINT(0 0)", + "MULTILINESTRING((),(10 0),(20 20,20 20))", + 10, 100, strategy); + tester::apply("POINT(0 0)", + "MULTILINESTRING((),(10 0),(),(20 20,20 20))", + 10, 100, strategy); + + // multilinestrings containing a linestring with a single point + tester::apply("POINT(0 0)", + "MULTILINESTRING((10 0),(20 20,20 20))", + 10, 100, strategy); + tester::apply("POINT(0 0)", + "MULTILINESTRING((20 20,20 20),(10 0))", + 10, 100, strategy); + + // multilinestring with a single-point linestring and empty linestrings + tester::apply("POINT(0 0)", + "MULTILINESTRING((),(20 20,20 20),(),(10 0))", + 10, 100, strategy); +} + +//=========================================================================== + +template +void test_distance_linestring_multipoint(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/multipoint distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + linestring_type, multi_point_type + > tester; + + tester::apply("linestring(2 0,0 2,100 100)", + "multipoint(0 0,1 0,0 1,1 1)", + 0, 0, strategy); + tester::apply("linestring(4 0,0 4,100 100)", + "multipoint(0 0,1 0,0 1,1 1)", + sqrt(2.0), 2, strategy); + tester::apply("linestring(1 1,2 2,100 100)", + "multipoint(0 0,1 0,0 1,1 1)", + 0, 0, strategy); + tester::apply("linestring(3 3,4 4,100 100)", + "multipoint(0 0,1 0,0 1,1 1)", + sqrt(8.0), 8, strategy); + + // linestring with a single point + tester::apply("linestring(1 8)", + "multipoint(0 0,3 0,4 -7,10 100)", + sqrt(65.0), 65, strategy); +} + +//=========================================================================== + +template +void test_distance_multipoint_multilinestring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/multilinestring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + multi_point_type, multi_linestring_type + > tester; + + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "multilinestring((2 0,0 2),(2 2,3 3))", + 0, 0, strategy); + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "multilinestring((3 0,0 3),(4 4,5 5))", + 0.5 * sqrt(2.0), 0.5, strategy); + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "multilinestring((4 4,5 5),(1 1,2 2))", + 0, 0, strategy); + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "multilinestring((3 3,4 4),(4 4,5 5))", + sqrt(8.0), 8, strategy); + + // multilinestring with empty linestring + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "multilinestring((),(3 3,4 4),(4 4,5 5))", + sqrt(8.0), 8, strategy); + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "multilinestring((3 3,4 4),(),(4 4,5 5))", + sqrt(8.0), 8, strategy); + + // multilinestrings with a single-point linestrings + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "multilinestring((3 3),(4 4,5 5))", + sqrt(8.0), 8, strategy); + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "multilinestring((4 4,5 5),(3 3))", + sqrt(8.0), 8, strategy); + + // multilinestring with a single-point linestring and empty linestring + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "multilinestring((4 4,5 5),(),(3 3))", + sqrt(8.0), 8, strategy); + + // 21890717 - assertion failure in distance(Pt, Box) + { + multi_point_type mpt; + bg::read_wkt("multipoint(1 1,1 1,1 1,1 1,1 1,1 1,1 1,1 1,1 1)", mpt); + multi_linestring_type mls; + linestring_type ls; + point_type pt(std::numeric_limits::quiet_NaN(), 1.0); + ls.push_back(pt); + ls.push_back(pt); + mls.push_back(ls); + bg::distance(mpt, mls); + } +} + +//=========================================================================== + +template +void test_distance_multipoint_segment(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/segment distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "segment(2 0,0 2)", + 0, 0, strategy); + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "segment(4 0,0 4)", + sqrt(2.0), 2, strategy); + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "segment(1 1,2 2)", + 0, 0, strategy); + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "segment(3 3,4 4)", + sqrt(8.0), 8, strategy); + tester::apply("multipoint(4 4,5 5,2 2,3 3)", + "segment(0 0,1 1)", + sqrt(2.0), 2, strategy); +} + +//=========================================================================== +//=========================================================================== +//=========================================================================== + +BOOST_AUTO_TEST_CASE( test_all_point_segment ) +{ + test_distance_point_segment(point_point_strategy()); // back-compatibility + test_distance_point_segment(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_point_linestring ) +{ + test_distance_point_linestring(point_point_strategy()); // back-compatibility + test_distance_point_linestring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_point_multilinestring ) +{ + test_distance_point_multilinestring(point_point_strategy()); // back-compatibility + test_distance_point_multilinestring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_linestring_multipoint ) +{ + test_distance_linestring_multipoint(point_point_strategy()); // back-compatibility + test_distance_linestring_multipoint(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multipoint_multilinestring ) +{ + test_distance_multipoint_multilinestring(point_point_strategy()); // back-compatibility + test_distance_multipoint_multilinestring(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multipoint_segment ) +{ + test_distance_multipoint_segment(point_segment_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_empty_input_pointlike_linear ) +{ + test_more_empty_input_pointlike_linear + < + point_type + >(point_segment_strategy()); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_ca_pl_pl.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_ca_pl_pl.cpp new file mode 100644 index 000000000..8726562a4 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_ca_pl_pl.cpp @@ -0,0 +1,123 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014-2018, 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_cartesian_pointlike_pointlike +#endif + +#include + +#include "test_distance_common.hpp" +#include "test_empty_geometry.hpp" + + +typedef bg::model::point point_type; +typedef bg::model::multi_point multi_point_type; + +namespace services = bg::strategy::distance::services; +typedef bg::default_distance_result::type return_type; + +typedef bg::strategy::distance::pythagoras<> point_point_strategy; + +//=========================================================================== + +template +void test_distance_point_point(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/point distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("point(1 1)", + "point(0 0)", + sqrt(2.0), 2, strategy); + tester::apply("point(1 1)", + "point(1 1)", + 0, 0, strategy); + + // distance overflows + tester::apply("point(0 0)", + "point(4.297374e+307 8.433875e+307)", + 0, 0, strategy, false); +} + +//=========================================================================== + +template +void test_distance_point_multipoint(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/multipoint distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("point(1 1)", + "multipoint(1 1,2 1,2 2,1 2)", + 0, 0, strategy); + tester::apply("point(1 1)", + "multipoint(2 2,2 3,3 2,3 3)", + sqrt(2.0), 2, strategy); + tester::apply("point(3 0)", + "multipoint(2 2,2 4,4 2,4 4)", + sqrt(5.0), 5, strategy); +} + +//=========================================================================== + +template +void test_distance_multipoint_multipoint(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/multipoint distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + multi_point_type, multi_point_type + > tester; + + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "multipoint(1 1,2 1,2 2,1 2)", + 0, 0, strategy); + tester::apply("multipoint(0 0,1 0,0 1,1 1)", + "multipoint(2 2,2 3,3 2,3 3)", + sqrt(2.0), 2, strategy); +} + +//=========================================================================== + +BOOST_AUTO_TEST_CASE( test_all_point_point ) +{ + test_distance_point_point(point_point_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_point_multipoint ) +{ + test_distance_point_multipoint(point_point_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_multipoint_multipoint ) +{ + test_distance_multipoint_multipoint(point_point_strategy()); +} + +BOOST_AUTO_TEST_CASE( test_all_empty_input_pointlike_pointlike ) +{ + test_more_empty_input_pointlike_pointlike + < + point_type + >(point_point_strategy()); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_geo_linear_box.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_geo_linear_box.cpp new file mode 100644 index 000000000..4b6aacf30 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_geo_linear_box.cpp @@ -0,0 +1,567 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2017, 2018 Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_geographic_linear_areal +#endif + +#include +#include + +#include +#include +#include + +#include "test_distance_geo_common.hpp" +//#include "test_empty_geometry.hpp" + + +template +void test_distance_segment_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/polygon distance tests" << std::endl; +#endif + typedef bg::model::segment segment_type; + typedef bg::model::polygon polygon_type; + typedef test_distance_of_geometries tester; + + std::string const polygon = "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("s-r-1", "SEGMENT(0 0, 0 10)", polygon, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); +} + +template +void test_distance_linestring_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/polygon distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::polygon polygon_type; + typedef test_distance_of_geometries tester; + + std::string const polygon = "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("l-r-1", "LINESTRING(0 0, 0 10)", polygon, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); +} + +template +void test_distance_multi_linestring_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multilinestring/polygon distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::multi_linestring multi_linestring_type; + typedef bg::model::polygon polygon_type; + typedef test_distance_of_geometries tester; + + std::string const polygon = "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("ml-r-1", "MULTILINESTRING((0 0, 0 10)(0 0, 10 0))", polygon, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); +} + +//===================================================================== + +template +void test_distance_segment_multi_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/multi_polygon distance tests" << std::endl; +#endif + typedef bg::model::segment segment_type; + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multi_polygon_type; + typedef test_distance_of_geometries tester; + + std::string const mp = "MULTIPOLYGON(((20 20, 20 30, 30 40, 20 20)),\ + ((10 10,0 20, 15 30, 20 15, 15 10, 10 10)))"; + + tester::apply("s-r-1", "SEGMENT(0 0, 0 10)", mp, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); +} + +template +void test_distance_linestring_multi_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/multi_polygon distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multi_polygon_type; + typedef test_distance_of_geometries tester; + + std::string const mp = "MULTIPOLYGON(((20 20, 20 30, 30 40, 20 20)),\ + ((10 10,0 20, 15 30, 20 15, 15 10, 10 10)))"; + + tester::apply("l-r-1", "LINESTRING(0 0, 0 10)", mp, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); +} + +template +void test_distance_multi_linestring_multi_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multilinestring/multi_polygon distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::multi_linestring multi_linestring_type; + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multi_polygon_type; + typedef test_distance_of_geometries tester; + + std::string const polygon = "MULTIPOLYGON(((20 20, 20 30, 30 40, 20 20)),\ + ((10 10,0 20, 15 30, 20 15, 15 10, 10 10)))"; + + tester::apply("ml-r-1", "MULTILINESTRING((0 0, 0 10)(0 0, 10 0))", polygon, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); +} + +//===================================================================== + +template +void test_distance_segment_ring(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/ring distance tests" << std::endl; +#endif + typedef bg::model::segment segment_type; + typedef bg::model::ring ring_type; + typedef test_distance_of_geometries tester; + + std::string const ring = "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("s-r-1", "SEGMENT(0 0, 0 10)", ring, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); +} + +template +void test_distance_linestring_ring(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/ring distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::ring ring_type; + typedef test_distance_of_geometries tester; + + std::string const ring = "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("l-r-1", "LINESTRING(0 0, 0 10)", ring, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); +} + +template +void test_distance_multi_linestring_ring(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multilinestring/ring distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::multi_linestring multi_linestring_type; + typedef bg::model::ring ring_type; + typedef test_distance_of_geometries tester; + + std::string const ring = "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("ml-r-1", "MULTILINESTRING((0 0, 0 10)(0 0, 10 0))", ring, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); +} + +//====================================================================== + +template +void test_distance_segment_box(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps, + Strategy_sb const& strategy_sb) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/box distance tests" << std::endl; +#endif + typedef bg::model::segment segment_type; + typedef bg::model::box box_type; + typedef test_distance_of_geometries tester; + + std::string const box_north = "BOX(10 10,20 20)"; + + tester::apply("sb1-1a", "SEGMENT(0 0, 0 20)", box_north, + pp_distance("POINT(0 20)", "POINT(10 20)", strategy_pp), + strategy_sb); + //segment with slope + tester::apply("sb1-1b", "SEGMENT(10 5, 20 6)", box_north, + pp_distance("POINT(20 6)", "POINT(20 10)", strategy_pp), + strategy_sb); + tester::apply("sb1-2", "SEGMENT(0 0, 0 10)", box_north, + ps_distance("POINT(0 10)", "SEGMENT(10 10,10 20)", strategy_ps), + strategy_sb); + tester::apply("sb1-3", "SEGMENT(0 0, 0 15)", box_north, + ps_distance("POINT(0 15)", "SEGMENT(10 10,10 20)", strategy_ps), + strategy_sb); + tester::apply("sb1-4", "SEGMENT(0 0, 0 25)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(0 0,0 25)", strategy_ps), + strategy_sb); + tester::apply("sb1-5", "SEGMENT(0 10, 0 25)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(0 0,0 25)", strategy_ps), + strategy_sb); + + tester::apply("sb2-2", "SEGMENT(0 5, 15 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5,15 5)", strategy_ps), + strategy_sb); + tester::apply("sb2-3a", "SEGMENT(0 5, 20 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5,20 5)", strategy_ps), + strategy_sb); + + // Test segments below box + tester::apply("test_b1", "SEGMENT(0 5, 9 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5, 9 5)", strategy_ps), + strategy_sb); + tester::apply("test_b2", "SEGMENT(0 5, 10 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5, 10 5)", strategy_ps), + strategy_sb); + tester::apply("test_b3", "SEGMENT(0 5, 11 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5, 11 5)", strategy_ps), + strategy_sb); + tester::apply("test_b4", "SEGMENT(0 5, 20 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5,20 5)", strategy_ps), + strategy_sb); + tester::apply("test_b5", "SEGMENT(0 5, 22 5)", box_north, + ps_distance("POINT(11 10)", "SEGMENT(0 5,22 5)", strategy_ps), + strategy_sb); + tester::apply("test_b6", "SEGMENT(10 5, 20 5)", box_north, + ps_distance("POINT(15 10)", "SEGMENT(10 5,20 5)", strategy_ps), + strategy_sb); + tester::apply("test_b7", "SEGMENT(10 5, 22 5)", box_north, + ps_distance("POINT(16 10)", "SEGMENT(10 5,22 5)", strategy_ps), + strategy_sb); + tester::apply("test_b8", "SEGMENT(12 5, 22 5)", box_north, + ps_distance("POINT(17 10)", "SEGMENT(12 5,22 5)", strategy_ps), + strategy_sb); + tester::apply("test_b9", "SEGMENT(18 5, 22 5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(18 5,22 5)", strategy_ps), + strategy_sb); + tester::apply("test_b10", "SEGMENT(18 5, 24 5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(18 5,24 5)", strategy_ps), + strategy_sb); + tester::apply("test_b11", "SEGMENT(20 5, 24 5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(20 5,24 5)", strategy_ps), + strategy_sb); + tester::apply("test_b12", "SEGMENT(22 5, 24 5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(22 5,24 5)", strategy_ps), + strategy_sb); + tester::apply("test_b13", "SEGMENT(0 5, 125 5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(0 5, 125 5)", strategy_ps), + strategy_sb); + + // Test segments above box + tester::apply("test_a1", "SEGMENT(0 25, 9 25)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(0 25, 9 25)", strategy_ps), + strategy_sb); + tester::apply("test_a2", "SEGMENT(0 25, 10 25)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(0 25, 10 25)", strategy_ps), + strategy_sb); + tester::apply("test_a3", "SEGMENT(0 25, 11 25)", box_north, + ps_distance("POINT(11 20)", "SEGMENT(0 25, 11 25)", strategy_ps), + strategy_sb); + tester::apply("test_a4", "SEGMENT(0 25, 20 25)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(0 25, 20 25)", strategy_ps), + strategy_sb); + tester::apply("test_a5", "SEGMENT(0 25, 22 25)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(0 25, 22 25)", strategy_ps), + strategy_sb); + tester::apply("test_a6", "SEGMENT(10 25, 20 25)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(10 25, 20 25)", strategy_ps), + strategy_sb); + tester::apply("test_a7", "SEGMENT(10 25, 22 25)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(10 25, 22 25)", strategy_ps), + strategy_sb); + tester::apply("test_a8", "SEGMENT(12 25, 22 25)", box_north, + ps_distance("POINT(12 20)", "SEGMENT(12 25, 22 25)", strategy_ps), + strategy_sb); + tester::apply("test_a9", "SEGMENT(18 25, 22 25)", box_north, + ps_distance("POINT(18 20)", "SEGMENT(18 25, 22 25)", strategy_ps), + strategy_sb); + tester::apply("test_a10", "SEGMENT(18 25, 24 25)", box_north, + ps_distance("POINT(18 20)", "SEGMENT(18 25, 24 25)", strategy_ps), + strategy_sb); + tester::apply("test_a11", "SEGMENT(20 25, 24 25)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(20 25, 24 25)", strategy_ps), + strategy_sb); + tester::apply("test_a12", "SEGMENT(22 25, 24 25)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(22 25, 24 25)", strategy_ps), + strategy_sb); + + // Segments left-right of box + tester::apply("test_l1", "SEGMENT(0 5, 9 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5, 9 5)", strategy_ps), + strategy_sb); + tester::apply("test_l2", "SEGMENT(0 10, 9 10)", box_north, + ps_distance("POINT(9 10)", "SEGMENT(10 10, 10 20)", strategy_ps), + strategy_sb); + tester::apply("test_l3", "SEGMENT(0 10, 9 15)", box_north, + ps_distance("POINT(9 15)", "SEGMENT(10 10, 10 20)", strategy_ps), + strategy_sb); + tester::apply("test_l4", "SEGMENT(0 10, 0 15)", box_north, + ps_distance("POINT(0 15)", "SEGMENT(10 10, 10 20)", strategy_ps), + strategy_sb); + tester::apply("test_l5", "SEGMENT(1 10, 0 15)", box_north, + ps_distance("POINT(1 10)", "SEGMENT(10 10, 10 20)", strategy_ps), + strategy_sb); + tester::apply("test_l6", "SEGMENT(0 20, 9 21)", box_north, + ps_distance("POINT(9 21)", "SEGMENT(10 10, 10 20)", strategy_ps), + strategy_sb); + tester::apply("test_r1", "SEGMENT(21 5, 29 5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(21 5, 29 5)", strategy_ps), + strategy_sb); + tester::apply("test_r2", "SEGMENT(21 10, 29 10)", box_north, + ps_distance("POINT(21 10)", "SEGMENT(20 10, 20 20)", strategy_ps), + strategy_sb); + tester::apply("test_r3", "SEGMENT(21 10, 29 15)", box_north, + ps_distance("POINT(21 10)", "SEGMENT(20 10, 20 20)", strategy_ps), + strategy_sb); + tester::apply("test_r4", "SEGMENT(21 10, 21 15)", box_north, + ps_distance("POINT(21 15)", "SEGMENT(20 10, 20 20)", strategy_ps), + strategy_sb); + tester::apply("test_r5", "SEGMENT(21 10, 22 15)", box_north, + ps_distance("POINT(21 10)", "SEGMENT(20 10, 20 20)", strategy_ps), + strategy_sb); + tester::apply("test_r6", "SEGMENT(29 20, 21 21)", box_north, + ps_distance("POINT(21 21)", "SEGMENT(20 10, 20 20)", strategy_ps), + strategy_sb); + + //Segments on corners of box + //left-top corner + //generic + tester::apply("test_c1", "SEGMENT(9 19.5, 11 21)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(9 19.5, 11 21)", strategy_ps), + strategy_sb); + //degenerate + tester::apply("test_c2", "SEGMENT(9 19, 11 21)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(9 19, 11 21)", strategy_ps), + strategy_sb); + //left-bottom corner + //generic + tester::apply("test_c3", "SEGMENT(8.5 11, 11 9)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(8.5 11, 11 9)", strategy_ps), + strategy_sb); + //degenerate + tester::apply("test_c4", "SEGMENT(9 11, 11 9)", box_north, + 0, + strategy_sb); + //right-top corner + //generic + tester::apply("test_c5", "SEGMENT(19 21, 21 19.5)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(19 21, 21 19.5)", strategy_ps), + strategy_sb); + //degenerate + tester::apply("test_c6", "SEGMENT(19 21, 21 19)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(19 21, 21 19)", strategy_ps), + strategy_sb); + //right-bottom corner + //generic + tester::apply("test_c7", "SEGMENT(19 9, 21 10.5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(19 9, 21 10.5)", strategy_ps), + strategy_sb); + tester::apply("test_c7", "SEGMENT(19 9, 21 11)", box_north, + 0, + strategy_sb); + + //Segment and box on different hemispheres + std::string const box_south = "BOX(10 -20,20 -10)"; + + tester::apply("test_ns1", "SEGMENT(10 20, 15 30)", box_south, + ps_distance("POINT(10 -10)", "SEGMENT(10 20, 15 30)", strategy_ps), + strategy_sb); + tester::apply("test_ns2", "SEGMENT(0 10, 12 10)", box_south, + pp_distance("POINT(12 10)", "POINT(12 -10)", strategy_pp), + strategy_sb); + tester::apply("test_ns3", "SEGMENT(10 10, 20 10)", box_south, + pp_distance("POINT(10 10)", "POINT(10 -10)", strategy_pp), + strategy_sb); + tester::apply("test_ns4", "SEGMENT(0 -10, 12 -10)", box_north, + pp_distance("POINT(12 10)", "POINT(12 -10)", strategy_pp), + strategy_sb); + tester::apply("test_ns5", "SEGMENT(10 -10, 20 -10)", box_north, + pp_distance("POINT(10 -10)", "POINT(10 10)", strategy_pp), + strategy_sb); + + //Box crossing equator + std::string const box_crossing_eq = "BOX(10 -10,20 10)"; + + tester::apply("test_cr1", "SEGMENT(10 20, 15 30)", box_crossing_eq, + pp_distance("POINT(10 10)", "POINT(10 20)", strategy_pp), + strategy_sb); + tester::apply("test_cr2", "SEGMENT(10 -20, 15 -30)", box_crossing_eq, + pp_distance("POINT(10 10)", "POINT(10 20)", strategy_pp), + strategy_sb); + + //Box crossing prime meridian + + std::string const box_crossing_mer = "BOX(-10 10,15 20)"; + + tester::apply("test_cr3", "SEGMENT(-5 25, 10 30)", box_crossing_mer, + pp_distance("POINT(-5 25)", "POINT(-5 20)", strategy_pp), + strategy_sb); + tester::apply("test_cr4", "SEGMENT(-5 5, 10 7)", box_crossing_mer, + pp_distance("POINT(10 7)", "POINT(10 10)", strategy_pp), + strategy_sb); + tester::apply("test_cr5", "SEGMENT(-5 5, 10 5)", box_crossing_mer, + ps_distance("POINT(2.5 10)", "SEGMENT(-5 5, 10 5)", strategy_ps), + strategy_sb); + + + //Geometries in south hemisphere + tester::apply("test_south1", "SEGMENT(10 -30, 15 -30)", box_south, + ps_distance("POINT(10 -20)", "SEGMENT(10 -30, 15 -30)", strategy_ps), + strategy_sb); + + //Segments in boxes corner + tester::apply("corner1", "SEGMENT(17 21, 25 20)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(17 21, 25 20)", strategy_ps), + strategy_sb); + tester::apply("corner2", "SEGMENT(17 21, 0 20)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(17 21, 0 20)", strategy_ps), + strategy_sb); + tester::apply("corner3", "SEGMENT(17 5, 0 10)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(17 5, 0 10)", strategy_ps), + strategy_sb); + tester::apply("corner4", "SEGMENT(17 5, 25 9)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(17 5, 25 9)", strategy_ps), + strategy_sb); +} + +template +void test_distance_linestring_box(Strategy_ps const& strategy_ps, Strategy_sb const& strategy_sb) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/box distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::box box_type; + typedef test_distance_of_geometries tester; + + std::string const box_north = "BOX(10 10,20 20)"; + + tester::apply("sl1", "LINESTRING(0 20, 15 21, 25 19.9, 21 5, 15 5, 0 10)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(15 21, 25 19.9)", strategy_ps), + strategy_ps, true, false, false); + + tester::apply("sl2", "LINESTRING(0 20, 15 21, 25 19.9, 21 5, 15 5, 15 15)", box_north, + 0, strategy_ps, true, false, false); + + tester::apply("sl3", "LINESTRING(0 20, 15 21, 25 19.9, 21 5, 15 5, 2 20)", box_north, + 0, strategy_ps, true, false, false); +} + +template +void test_distance_multi_linestring_box(Strategy_ps const& strategy_ps, Strategy_sb const& strategy_sb) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multi_linestring/box distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::multi_linestring multi_linestring_type; + typedef bg::model::box box_type; + typedef test_distance_of_geometries tester; + + std::string const box_north = "BOX(10 10,20 20)"; + + tester::apply("sl1", "MULTILINESTRING((0 20, 15 21, 25 19.9, 21 5, 15 5, 0 10)(25 20, 22 4, 0 0))", box_north, + ps_distance("POINT(20 20)", "SEGMENT(15 21, 25 19.9)", strategy_ps), + strategy_sb, true, false, false); +} + +//=========================================================================== +//=========================================================================== +//=========================================================================== + + +template +void test_all_l_ar(Strategy_pp pp_strategy, Strategy_ps ps_strategy, Strategy_sb sb_strategy) +{ + test_distance_segment_polygon(pp_strategy, ps_strategy); + test_distance_linestring_polygon(pp_strategy, ps_strategy); + test_distance_multi_linestring_polygon(pp_strategy, ps_strategy); + + test_distance_segment_multi_polygon(pp_strategy, ps_strategy); + test_distance_linestring_multi_polygon(pp_strategy, ps_strategy); + test_distance_multi_linestring_multi_polygon(pp_strategy, ps_strategy); + + test_distance_segment_ring(pp_strategy, ps_strategy); + test_distance_linestring_ring(pp_strategy, ps_strategy); + test_distance_multi_linestring_ring(pp_strategy, ps_strategy); + + test_distance_segment_box(pp_strategy, ps_strategy, sb_strategy); + //test_distance_linestring_box(ps_strategy, sb_strategy); + //test_distance_multi_linestring_box(ps_strategy, sb_strategy); + + //test_more_empty_input_linear_areal(ps_strategy); +} + +BOOST_AUTO_TEST_CASE( test_all_linear_areal ) +{ + typedef bg::model::point > + sph_point; + test_all_l_ar(spherical_pp(), spherical_ps(), spherical_sb()); + + typedef bg::model::point > geo_point; + + test_all_l_ar(vincenty_pp(), vincenty_ps(), vincenty_sb()); + test_all_l_ar(thomas_pp(), thomas_ps(), thomas_sb()); + test_all_l_ar(andoyer_pp(), andoyer_ps(), andoyer_sb()); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_geo_pl_l.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_geo_pl_l.cpp new file mode 100644 index 000000000..76e300e66 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_geo_pl_l.cpp @@ -0,0 +1,728 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2016-2018, Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_geographic_pointlike_linear +#endif + +#include + +#include +#include + +#include "test_distance_geo_common.hpp" +#include "test_empty_geometry.hpp" + +typedef bg::cs::geographic cs_type; +typedef bg::model::point point_type; +typedef bg::model::segment segment_type; +typedef bg::model::multi_point multi_point_type; +typedef bg::model::segment segment_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_linestring multi_linestring_type; + +typedef bg::cs::geographic cs_type_rad; +typedef bg::model::point point_type_rad; +typedef bg::model::segment segment_type_rad; + +//=========================================================================== + +template +inline bg::default_distance_result::type +pp_distance(std::string const& wkt1, + std::string const& wkt2, + Strategy const& strategy) +{ + point_type p1, p2; + bg::read_wkt(wkt1, p1); + bg::read_wkt(wkt2, p2); + return bg::distance(p1, p2, strategy); +} + +template +inline bg::default_distance_result::type +ps_distance(std::string const& wkt1, + std::string const& wkt2, + Strategy const& strategy) +{ + point_type p; + segment_type s; + bg::read_wkt(wkt1, p); + bg::read_wkt(wkt2, s); + return bg::distance(p, s, strategy); +} + +//=========================================================================== + +template +void test_distance_point_segment(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps, + bool WGS84) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/segment distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("p-s-01", + "POINT(0 0)", + "SEGMENT(2 0,3 0)", + pp_distance("POINT(0 0)", "POINT(2 0)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-02", + "POINT(2.5 3)", + "SEGMENT(2 0,3 0)", + pp_distance("POINT(2.5 3)", "POINT(2.5 0)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-03", + "POINT(2 0)", + "SEGMENT(2 0,3 0)", + 0, + strategy_ps, true, true); + tester::apply("p-s-04", + "POINT(3 0)", + "SEGMENT(2 0,3 0)", + 0, + strategy_ps, true, true); + tester::apply("p-s-05", + "POINT(2.5 0)", + "SEGMENT(2 0,3 0)", + 0, + strategy_ps, true, true); + tester::apply("p-s-06", + "POINT(3.5 3)", + "SEGMENT(2 0,3 0)", + pp_distance("POINT(3 0)", "POINT(3.5 3)", strategy_pp), + strategy_ps, true, true); + if(WGS84) + { + tester::apply("p-s-07", + "POINT(15 80)", + "SEGMENT(10 15,30 15)", + 7204174.8264546748, + strategy_ps, true, true); + tester::apply("p-s-08", + "POINT(15 10)", + "SEGMENT(10 15,30 15)", + 571412.71247283253, + strategy_ps, true, true); + } + tester::apply("p-s-09", + "POINT(5 10)", + "SEGMENT(10 15,30 15)", + pp_distance("POINT(5 10)", "POINT(10 15)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-10", + "POINT(35 10)", + "SEGMENT(10 15,30 15)", + pp_distance("POINT(35 10)", "POINT(30 15)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-11", + "POINT(5 10)", + "SEGMENT(30 15,10 15)", + pp_distance("POINT(5 10)", "POINT(10 15)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-12", + "POINT(35 10)", + "SEGMENT(30 15,10 15)", + pp_distance("POINT(35 10)", "POINT(30 15)", strategy_pp), + strategy_ps, true, true); + + tester::apply("p-s-right-up", + "POINT(3.5 3)", + "SEGMENT(2 2,3 2)", + pp_distance("POINT(3 2)", "POINT(3.5 3)", strategy_pp), + strategy_ps, true, true); + + tester::apply("p-s-left-up", + "POINT(1.5 3)", + "SEGMENT(2 2,3 2)", + pp_distance("POINT(2 2)", "POINT(1.5 3)", strategy_pp), + strategy_ps, true, true); + + tester::apply("p-s-up-1", + "POINT(2 3)", + "SEGMENT(2 2,3 2)", + pp_distance("POINT(2.0003 2)", "POINT(2 3)", strategy_pp), + strategy_ps, true, true); + + tester::apply("p-s-up-2", + "POINT(3 3)", + "SEGMENT(2 2,3 2)", + pp_distance("POINT(2.9997 2)", "POINT(3 3)", strategy_pp), + strategy_ps, true, true); + + tester::apply("p-s-right-down", + "POINT(3.5 1)", + "SEGMENT(2 2,3 2)", + pp_distance("POINT(3 2)", "POINT(3.5 1)", strategy_pp), + strategy_ps, true, true); + + tester::apply("p-s-left-down", + "POINT(1.5 1)", + "SEGMENT(2 2,3 2)", + pp_distance("POINT(2 2)", "POINT(1.5 1)", strategy_pp), + strategy_ps, true, true); + + tester::apply("p-s-down-1", + "POINT(2 1)", + "SEGMENT(2 2,3 2)", + pp_distance("POINT(2 2)", "POINT(2 1)", strategy_pp), + strategy_ps, true, true); + + tester::apply("p-s-down-2", + "POINT(3 1)", + "SEGMENT(2 2,3 2)", + pp_distance("POINT(3 2)", "POINT(3 1)", strategy_pp), + strategy_ps, true, true); + + tester::apply("p-s-south", + "POINT(3 -1)", + "SEGMENT(2 -2,3 -2)", + pp_distance("POINT(3 -2)", "POINT(3 -1)", strategy_pp), + strategy_ps, true, true); + + tester::apply("p-s-antimeridian-1", + "POINT(3 1)", + "SEGMENT(220 2,3 2)", + pp_distance("POINT(3 2)", "POINT(3 1)", strategy_pp), + strategy_ps, true, true); + + tester::apply("p-s-antimeridian-2", + "POINT(220 1)", + "SEGMENT(220 2,3 2)", + pp_distance("POINT(220 2)", "POINT(220 1)", strategy_pp), + strategy_ps, true, true); + + // equator special case + tester::apply("p-s-eq1", + "POINT(2.5 0)", + "SEGMENT(2 0,3 0)", + 0, + strategy_ps, true, true); + tester::apply("p-s-eq2", + "POINT(2.5 2)", + "SEGMENT(2 0,3 0)", + pp_distance("POINT(2.5 0)", "POINT(2.5 2)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-eq3", + "POINT(2 2)", + "SEGMENT(2 0,3 0)", + pp_distance("POINT(2 0)", "POINT(2 2)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-eq4", + "POINT(3 2)", + "SEGMENT(2 0,3 0)", + pp_distance("POINT(3 0)", "POINT(3 2)", strategy_pp), + strategy_ps, true, true); + + // meridian special case + tester::apply("p-s-mer1", + "POINT(2.5 2)", + "SEGMENT(2 2,2 4)", + pp_distance("POINT(2.5 2)", "POINT(2 2.000076608014728)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-mer3", + "POINT(2.5 5)", + "SEGMENT(2 2,2 4)", + pp_distance("POINT(2.5 5)", "POINT(2 4)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-mer4", + "POINT(0 20)", + "SEGMENT(0 40,180 80)", + pp_distance("POINT(0 20)", "POINT(0 40)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-mer5", + "POINT(0 20)", + "SEGMENT(0 40,0 80)", + pp_distance("POINT(0 20)", "POINT(0 40)", strategy_pp), + strategy_ps, true, true); + + //degenerate segment + tester::apply("p-s-deg", + "POINT(1 80)", + "SEGMENT(0 0,0 0)", + pp_distance("POINT(0 0)", "POINT(1 80)", strategy_pp), + strategy_ps, true, true); + + //point on segment + tester::apply("p-s-deg", + "POINT(0 80)", + "SEGMENT(0 0,0 90)", + 0, + strategy_ps, true, true); + + // very small distances to segment + tester::apply("p-s-07", + "POINT(90 1e-3)", + "SEGMENT(0.5 0,175.5 0)", + pp_distance("POINT(90 0)", "POINT(90 1e-3)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-08", + "POINT(90 1e-4)", + "SEGMENT(0.5 0,175.5 0)", + pp_distance("POINT(90 0)", "POINT(90 1e-4)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-09", + "POINT(90 1e-5)", + "SEGMENT(0.5 0,175.5 0)", + pp_distance("POINT(90 0)", "POINT(90 1e-5)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-10", + "POINT(90 1e-6)", + "SEGMENT(0.5 0,175.5 0)", + pp_distance("POINT(90 0)", "POINT(90 1e-6)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-11", + "POINT(90 1e-7)", + "SEGMENT(0.5 0,175.5 0)", + pp_distance("POINT(90 0)", "POINT(90 1e-7)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-12", + "POINT(90 1e-8)", + "SEGMENT(0.5 0,175.5 0)", + pp_distance("POINT(90 0)", "POINT(90 1e-8)", strategy_pp), + strategy_ps, true, true); + + // very large distance to segment + tester::apply("p-s-13", + "POINT(90 90)", + "SEGMENT(0.5 0,175.5 0)", + pp_distance("POINT(90 0)", "POINT(90 90)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-14", + "POINT(90 90)", + "SEGMENT(0.5 -89,175.5 -89)", + pp_distance("POINT(90 -89)", "POINT(90 90)", strategy_pp), + strategy_ps, true, true); + // degenerate segment + tester::apply("p-s-15", + "POINT(90 90)", + "SEGMENT(0.5 -90,175.5 -90)", + pp_distance("POINT(0.5 -90)", "POINT(90 90)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-16", + "POINT(90 90)", + "SEGMENT(0.5 -90,175.5 -90)", + pp_distance("POINT(90 -90)", "POINT(90 90)", strategy_pp), + strategy_ps, true, true); + // equatorial segment + tester::apply("p-s-17", + "POINT(90 90)", + "SEGMENT(0 0,175.5 0)", + pp_distance("POINT(90 90)", "POINT(0 0)", strategy_pp), + strategy_ps, true, true); + // segment pass by pole + tester::apply("p-s-18", + "POINT(90 90)", + "SEGMENT(0 0,180 0)", + 0, + strategy_ps, true, true); + + tester::apply("p-s-20", + "POINT(80 89)", + "SEGMENT(0 0,180 0)", + pp_distance("POINT(80 89)", "POINT(0 89.82633489283377)", strategy_pp), + strategy_ps, true, true); + + tester::apply("p-s-21", + "POINT(80 89)", + "SEGMENT(0 -1,180 1)", + pp_distance("POINT(80 89)", "POINT(0 89.82633489283377)", strategy_pp), + strategy_ps, true, true); + + // meridian special case + tester::apply("p-s-mer1", + "POINT(2.5 3)", + "SEGMENT(2 2,2 4)", + pp_distance("POINT(2.5 3)", "POINT(2 3.000114792872075)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-mer2", + "POINT(1 80)", + "SEGMENT(0 0,0 90)", + pp_distance("POINT(1 80)", "POINT(0 80.00149225834545)", strategy_pp), + strategy_ps, true, true); + tester::apply("p-s-mer3", + "POINT(2 0)", + "SEGMENT(1 -1,1 0)", + pp_distance("POINT(2 0)", "POINT(1 0)", strategy_pp), + strategy_ps, true, true); + + tester::apply("p-s-acos", + "POINT(0 90)", + "SEGMENT(90 0,0 1.000005)", + pp_distance("POINT(0 90)", "POINT(0.3017072304435489 1.000018955050697)", + strategy_pp), + strategy_ps, true, true); +} + +template +void test_distance_point_segment_no_thomas(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/segment distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + // thomas strategy is failing for those test cases + // this is because of inaccurate results for points close to poles + + tester::apply("p-s-19", + "POINT(90 89)", + "SEGMENT(0 0,180 0)", + pp_distance("POINT(90 89)", "POINT(90 90)", strategy_pp), + strategy_ps, true, true); +} + +template +void test_distance_point_segment_rad_mix(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/segment distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester1; + typedef test_distance_of_geometries tester2; + typedef test_distance_of_geometries tester3; + typedef test_distance_of_geometries tester4; + + const double d2r = bg::math::d2r(); + + std::ostringstream s1; + s1 << 1*d2r; + std::ostringstream s2; + s2 << 2*d2r; + std::ostringstream s3; + s3 << 3*d2r; + + tester1::apply("p-s-mix1", + "POINT(3 1)", + "SEGMENT(2 2,3 2)", + pp_distance("POINT(3 2)", "POINT(3 1)", strategy_pp), + strategy_ps, true, true); + tester2::apply("p-s-mix2", + "POINT(" + s3.str() + " " + s1.str() + ")", + "SEGMENT(2 2,3 2)", + pp_distance("POINT(3 2)", "POINT(3 1)", strategy_pp), + strategy_ps, true, true); + tester3::apply("p-s-mix3", + "POINT(3 1)", + "SEGMENT(" + s2.str() + " " + s2.str() + "," + + s3.str() + " " + s2.str() + ")", + pp_distance("POINT(3 2)", "POINT(3 1)", strategy_pp), + strategy_ps, true, true); + tester4::apply("p-s-mix4", + "POINT(" + s3.str() + " " + s1.str() + ")", + "SEGMENT(" + s2.str() + " " + s2.str() + "," + + s3.str() + " " + s2.str() + ")", + pp_distance("POINT(3 2)", "POINT(3 1)", strategy_pp), + strategy_ps, true, true); +} + +//=========================================================================== + +template +void test_distance_point_linestring(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/linestring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("p-l-01", + "POINT(0 0)", + "LINESTRING(2 0,2 0)", + pp_distance("POINT(0 0)", "POINT(2 0)", strategy_pp), + strategy_ps, true, false, false); + tester::apply("p-l-02", + "POINT(0 0)", + "LINESTRING(2 0,3 0)", + pp_distance("POINT(0 0)", "POINT(2 0)", strategy_pp), + strategy_ps, true, false, false); + tester::apply("p-l-03", + "POINT(2.5 3)", + "LINESTRING(2 0,3 0)", + pp_distance("POINT(2.5 3)", "POINT(2.5 0)", strategy_pp), + strategy_ps, true, false, false); + tester::apply("p-l-04", + "POINT(2 0)", + "LINESTRING(2 0,3 0)", + 0, + strategy_ps, true, false, false); + tester::apply("p-l-05", + "POINT(3 0)", + "LINESTRING(2 0,3 0)", + 0, + strategy_ps, true, false, false); + tester::apply("p-l-06", + "POINT(2.5 0)", + "LINESTRING(2 0,3 0)", + 0, + strategy_ps, true, false, false); + tester::apply("p-l-07", + "POINT(7.5 10)", + "LINESTRING(1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 0)", + ps_distance("POINT(7.5 10)", "SEGMENT(7 0,8 0)", strategy_ps), + strategy_ps, true, false, false); + tester::apply("p-l-08", + "POINT(7.5 10)", + "LINESTRING(1 1,2 1,3 1,4 1,5 1,6 1,7 1,20 2,21 2)", + ps_distance("POINT(7.5 10)", "SEGMENT(7 1,20 2)", strategy_ps), + strategy_ps, true, false, false); +} + +void test_distance_point_linestring_strategies() +{ + typedef test_distance_of_geometries tester; + + tester::apply("p-l-s-01", + "POINT(2.5 3)", + "LINESTRING(2 1,3 1)", + 221147.24332788656, + vincenty_ps(), + true, false, false); + + tester::apply("p-l-s-02", + "POINT(2.5 3)", + "LINESTRING(2 1,3 1)", + 221147.36682199029, + thomas_ps(), + true, false, false); + + tester::apply("p-l-s-03", + "POINT(2.5 3)", + "LINESTRING(2 1,3 1)", + 221144.76527049288, + andoyer_ps(), + true, false, false); +} + +//=========================================================================== + +template +void test_distance_point_multilinestring(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/multilinestring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + point_type, multi_linestring_type + > tester; + + tester::apply("p-ml-01", + "POINT(0 0)", + "MULTILINESTRING((-5 0,-3 0),(2 0,3 0))", + pp_distance("POINT(0 0)", "POINT(2 0)", strategy_pp), + strategy_ps, true, false, false); + tester::apply("p-ml-02", + "POINT(2.5 3)", + "MULTILINESTRING((-5 0,-3 0),(2 0,3 0))", + pp_distance("POINT(2.5 3)", "POINT(2.5 0)", strategy_pp), + strategy_ps, true, false, false); + tester::apply("p-ml-03", + "POINT(2 0)", + "MULTILINESTRING((-5 0,-3 0),(2 0,3 0))", + 0, + strategy_ps, true, false, false); + tester::apply("p-ml-04", + "POINT(3 0)", + "MULTILINESTRING((-5 0,-3 0),(2 0,3 0))", + 0, + strategy_ps, true, false, false); + tester::apply("p-ml-05", + "POINT(2.5 0)", + "MULTILINESTRING((-5 0,-3 0),(2 0,3 0))", + 0, + strategy_ps, true, false, false); + tester::apply("p-ml-06", + "POINT(7.5 10)", + "MULTILINESTRING((-5 0,-3 0),(2 0,3 0,4 0,5 0,6 0,20 1,21 1))", + ps_distance("POINT(7.5 10)", "SEGMENT(6 0,20 1)", strategy_ps), + strategy_ps, true, false, false); + tester::apply("p-ml-07", + "POINT(-8 10)", + "MULTILINESTRING((-20 10,-19 11,-18 10,-6 0,-5 0,-3 0),(2 0,6 0,20 1,21 1))", + ps_distance("POINT(-8 10)", "SEGMENT(-6 0,-18 10)", strategy_ps), + strategy_ps, true, false, false); +} + +//=========================================================================== + +template +void test_distance_linestring_multipoint(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/multipoint distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + linestring_type, multi_point_type + > tester; + + tester::apply("l-mp-01", + "LINESTRING(2 0,0 2,100 80)", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + ps_distance("POINT(1 1)", "SEGMENT(2 0,0 2)", strategy_ps), + strategy_ps, true, false, false); + tester::apply("l-mp-02", + "LINESTRING(4 0,0 4,100 80)", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + ps_distance("POINT(1 1)", "SEGMENT(0 4,4 0)", strategy_ps), + strategy_ps, true, false, false); + tester::apply("l-mp-03", + "LINESTRING(1 1,2 2,100 80)", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + 0, + strategy_ps, true, false, false); + tester::apply("l-mp-04", + "LINESTRING(3 3,4 4,100 80)", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + pp_distance("POINT(1 1)", "POINT(3 3)", strategy_pp), + strategy_ps, true, false, false); + tester::apply("l-mp-05", + "LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "MULTIPOINT(1 -1,80 80,5 0,150 90)", + 0, + strategy_ps, true, false, false); + tester::apply("l-mp-06", + "LINESTRING(90 0,0 1.00005)", + "MULTIPOINT((0 0),(0 0),(0 0),(0 0),(0 0),(0 0),(0 0 ),(0 0),\ + (0 0),(0 0 ),(0 0),(0 0),(69.35235 155.0205),\ + (75.72081 37.97683),(0 0),(0 0),(0 0))", + pp_distance("POINT(0 0)", "POINT(0 1.00005)", strategy_pp), + strategy_ps, true, false, false); +} + +//=========================================================================== +template +void test_distance_multipoint_multilinestring(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/multilinestring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + multi_point_type, multi_linestring_type + > tester; + + tester::apply("mp-ml-01", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "MULTILINESTRING((2 0,0 2),(2 2,3 3))", + ps_distance("POINT(1 1)", "SEGMENT(2 0,0 2)", strategy_ps), + strategy_ps, true, false, false); + tester::apply("mp-ml-02", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "MULTILINESTRING((3 0,0 3),(4 4,5 5))", + ps_distance("POINT(1 1)", "SEGMENT(3 0,0 3)", strategy_ps), + strategy_ps, true, false, false); + tester::apply("mp-ml-03", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "MULTILINESTRING((4 4,5 5),(1 1,2 2))", + 0, + strategy_ps, true, false, false); + tester::apply("mp-ml-04", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "MULTILINESTRING((4 4,3 3),(4 4,5 5))", + pp_distance("POINT(1 1)", "POINT(3 3)", strategy_pp), + strategy_ps, true, false, false); +} + +//=========================================================================== + +template +void test_distance_multipoint_segment(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/segment distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("mp-s-01", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "SEGMENT(2 0,0 2)", + ps_distance("POINT(1 1)", "SEGMENT(2 0,0 2)", strategy_ps), + strategy_ps, true, false, false); + tester::apply("mp-s-02", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "SEGMENT(0 -3,1 -10)", + pp_distance("POINT(0 0)", "POINT(0 -3)", strategy_pp), + strategy_ps, true, false, false); + tester::apply("mp-s-03", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "SEGMENT(1 1,2 2)", + 0, + strategy_ps, true, false, false); + tester::apply("mp-s-04", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "SEGMENT(3 3,4 4)", + pp_distance("POINT(1 1)", "POINT(3 3)", strategy_pp), + strategy_ps, true, false, false); + tester::apply("mp-s-05", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "SEGMENT(0.5 -3,1 -10)", + pp_distance("POINT(1 0)", "POINT(0.5 -3)", strategy_pp), + strategy_ps, true, false, false); +} + +//=========================================================================== +//=========================================================================== +//=========================================================================== + +template +void test_all_pl_l(Strategy_pp pp_strategy, Strategy_ps ps_strategy, + bool WGS84 = true) +{ + test_distance_point_segment(pp_strategy, ps_strategy, WGS84); + test_distance_point_linestring(pp_strategy, ps_strategy); + test_distance_point_multilinestring(pp_strategy, ps_strategy); + test_distance_linestring_multipoint(pp_strategy, ps_strategy); + test_distance_multipoint_multilinestring(pp_strategy, ps_strategy); + test_distance_multipoint_segment(pp_strategy, ps_strategy); + + test_more_empty_input_pointlike_linear(ps_strategy); +} + +BOOST_AUTO_TEST_CASE( test_all_pointlike_linear ) +{ + test_all_pl_l(vincenty_pp(), vincenty_ps_bisection()); + test_all_pl_l(vincenty_pp(), vincenty_ps()); + test_all_pl_l(thomas_pp(), thomas_ps()); + test_all_pl_l(andoyer_pp(), andoyer_ps()); + + // test with different spheroid + stype spheroid(6372000, 6370000); + test_all_pl_l(andoyer_pp(spheroid), andoyer_ps(spheroid), false); + + test_distance_point_segment_no_thomas(vincenty_pp(), vincenty_ps()); + //test_distance_point_segment_no_thomas(thomas_pp(), thomas_ps()); + test_distance_point_segment_no_thomas(andoyer_pp(), andoyer_ps()); + + test_distance_point_segment_rad_mix(vincenty_pp(), vincenty_ps()); + test_distance_point_segment_rad_mix(thomas_pp(), thomas_ps()); + test_distance_point_segment_rad_mix(andoyer_pp(), andoyer_ps()); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_ar_ar.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_ar_ar.cpp new file mode 100644 index 000000000..4e25d7eac --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_ar_ar.cpp @@ -0,0 +1,943 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2017, 2018 Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_geographic_areal_areal +#endif + +#include +#include + +#include +#include +#include + +#include "test_distance_geo_common.hpp" +#include "test_empty_geometry.hpp" + +template +void test_distance_ring_ring(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "ring/ring distance tests" << std::endl; +#endif + typedef bg::model::ring ring_type; + + typedef test_distance_of_geometries tester; + + std::string const ring = "POLYGON((11 0,10 1,11 2,12 3,13 1,11 0))"; + + tester::apply("rr1", ring, "POLYGON((16 0,13 0,15 1,16 0))", + ps_distance("POINT(13 1)", + "SEGMENT(13 0,15 1)", strategy_ps), + strategy_ps, true, false, false); + + tester::apply("rr2", ring, "POLYGON((16 0,14 1,15 1,16 0))", + pp_distance("POINT(13 1)", "POINT(14 1)", strategy_pp), + strategy_ps, true, false, false); + + tester::apply("rr3", ring, ring, + 0, strategy_ps, true, false, false); + +} + +//============================================================================ + +template +void test_distance_ring_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "ring/polygon distance tests" << std::endl; +#endif + typedef bg::model::ring ring_type; + typedef bg::model::polygon polygon_type; + + typedef test_distance_of_geometries tester; + + std::string const ring = "POLYGON((11 0,10 1,11 2,12 3,13 1,11 0))"; + + tester::apply("rp1", ring, "POLYGON((16 0,13 0,15 1,16 0))", + ps_distance("POINT(13 1)", + "SEGMENT(13 0,15 1)", strategy_ps), + strategy_ps, true, false, false); + + tester::apply("rp2", ring, "POLYGON((16 0,14 1,15 1,16 0))", + pp_distance("POINT(13 1)", "POINT(14 1)", strategy_pp), + strategy_ps, true, false, false); + + tester::apply("rp3", ring, "POLYGON((11 0,10 1,11 2,12 3,13 1,11 0))", + 0, strategy_ps, true, false, false); +} + +template +void test_distance_polygon_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "polygon/polygon distance tests" << std::endl; +#endif + typedef bg::model::polygon polygon_type; + + typedef test_distance_of_geometries tester; + + std::string const poly = "POLYGON((11 0,10 1,11 2,12 3,13 1,11 0))"; + + tester::apply("pp1", poly, "POLYGON((16 0,13 0,15 1,16 0))", + ps_distance("POINT(13 1)", + "SEGMENT(13 0,15 1)", strategy_ps), + strategy_ps, true, false, false); + + tester::apply("pp2", poly, "POLYGON((16 0,14 1,15 1,16 0))", + pp_distance("POINT(13 1)", "POINT(14 1)", strategy_pp), + strategy_ps, true, false, false); + + tester::apply("pp3", poly, "POLYGON((11 0,10 1,11 2,12 3,13 1,11 0))", + 0, strategy_ps, true, false, false); + +} + +//============================================================================ + +template +void test_distance_ring_multi_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "ring/multi_polygon distance tests" << std::endl; +#endif + typedef bg::model::ring ring_type; + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multi_polygon_type; + + typedef test_distance_of_geometries tester; + + std::string const ring = "POLYGON((11 0,10 1,11 2,12 3,13 1,11 0))"; + + tester::apply("rmp1", ring, "MULTIPOLYGON(((16 0,13 0,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + ps_distance("POINT(12.5 2.5)", "SEGMENT(12 3,13 1)", + strategy_ps), + strategy_ps, true, false, false); + + tester::apply("rmp2", ring, "MULTIPOLYGON(((16 0,13.1 1,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + pp_distance("POINT(13 1)", "POINT(13.1 1)", strategy_pp), + strategy_ps, true, false, false); + + tester::apply("rmp3", ring, "MULTIPOLYGON(((16 0,13 1,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + 0, strategy_ps, true, false, false); + + tester::apply("rmp4", ring, "MULTIPOLYGON(((16 0,12 1,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + 0, strategy_ps, true, false, false); +} + +template +void test_distance_polygon_multi_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "polygon/multi_polygon distance tests" << std::endl; +#endif + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multi_polygon_type; + + typedef test_distance_of_geometries tester; + + std::string const poly = "POLYGON((11 0,10 1,11 2,12 3,13 1,11 0))"; + + tester::apply("pmp1", poly, "MULTIPOLYGON(((16 0,13 0,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + ps_distance("POINT(12.5 2.5)", "SEGMENT(12 3,13 1)", + strategy_ps), + strategy_ps, true, false, false); + + tester::apply("pmp2", poly, "MULTIPOLYGON(((16 0,13.1 1,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + pp_distance("POINT(13 1)", "POINT(13.1 1)", strategy_pp), + strategy_ps, true, false, false); + + tester::apply("pmp3", poly, "MULTIPOLYGON(((16 0,13 1,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + 0, strategy_ps, true, false, false); + + tester::apply("pmp4", poly, "MULTIPOLYGON(((16 0,12 1,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + 0, strategy_ps, true, false, false); + + // w/ interior ring + std::string const poly_interior = "POLYGON((11 0,10 1,11 2,12 3,13 1,11 0),\ + (12 1,11 1,12 2,12 1))"; + + tester::apply("pmp1", poly_interior, "MULTIPOLYGON(((16 0,13 0,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + ps_distance("POINT(12.5 2.5)", "SEGMENT(12 3,13 1)", + strategy_ps), + strategy_ps, true, false, false); + + tester::apply("pmp2", poly_interior, "MULTIPOLYGON(((16 0,13.1 1,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + pp_distance("POINT(13 1)", "POINT(13.1 1)", strategy_pp), + strategy_ps, true, false, false); + + tester::apply("pmp3", poly_interior, "MULTIPOLYGON(((16 0,13 1,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + 0, strategy_ps, true, false, false); + + tester::apply("pmp4", poly_interior, "MULTIPOLYGON(((16 0,12 1,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + 0, strategy_ps, true, false, false); + +} + + +template +void test_distance_multi_polygon_multi_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multi_polygon/multi_polygon distance tests" << std::endl; +#endif + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multi_polygon_type; + + typedef test_distance_of_geometries + tester; + + std::string const mpoly = "MULTIPOLYGON(((11 0,10 1,11 2,12 3,13 1,11 0)),\ + ((0 0,0 1,1 1,1 0,0 0)))"; + + tester::apply("mpmp1", mpoly, "MULTIPOLYGON(((16 0,13 0,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + ps_distance("POINT(12.5 2.5)", "SEGMENT(12 3,13 1)", + strategy_ps), + strategy_ps, true, false, false); + + tester::apply("mpmp2", mpoly, "MULTIPOLYGON(((16 0,13.1 1,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + pp_distance("POINT(13 1)", "POINT(13.1 1)", strategy_pp), + strategy_ps, true, false, false); + + tester::apply("mpmp3", mpoly, "MULTIPOLYGON(((16 0,13 1,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + 0, strategy_ps, true, false, false); + + tester::apply("mpmp4", mpoly, "MULTIPOLYGON(((16 0,12 1,15 1,16 0)),\ + ((12.5 2.5,12.5 4,14 2.5,12.5 2.5)))", + 0, strategy_ps, true, false, false); + +} + +//============================================================================ + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps, + typename Strategy_sb +> +void test_distance_ring_box(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps, + Strategy_sb const& strategy_sb) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "ring/box distance tests" << std::endl; +#endif + typedef bg::model::box box_type; + typedef bg::model::ring ring_type; + + typedef test_distance_of_geometries tester; + + std::string const ring = "POLYGON((11 0,10 1,11 2,12 3,13 1,11 0))"; + + tester::apply("rb1", ring, "BOX(10 10,20 20)", + sb_distance("SEGMENT(11 2,12 3)", + "BOX(10 10,20 20)", strategy_sb), + strategy_sb, true, false, false); + + tester::apply("rb2", ring, "BOX(17 0,20 3)", + ps_distance("POINT(13 1)", + "SEGMENT(17 0,17 3)", strategy_ps), + strategy_sb, true, false, false); + + tester::apply("rb3", ring, "BOX(17 0,20 1)", + pp_distance("POINT(17 1)", "POINT(13 1)", strategy_pp), + strategy_sb, true, false, false); + + tester::apply("rb4", ring, "BOX(12 0,20 1)", + 0, strategy_sb, true, false, false); +} + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps, + typename Strategy_sb +> +void test_distance_polygon_box(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps, + Strategy_sb const& strategy_sb) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "polygon/box distance tests" << std::endl; +#endif + typedef bg::model::box box_type; + typedef bg::model::polygon polygon_type; + + typedef test_distance_of_geometries tester; + + std::string const polygon = "POLYGON((11 0,10 1,11 2,12 3,13 1,11 0))"; + + tester::apply("pb1", polygon, "BOX(10 10,20 20)", + sb_distance("SEGMENT(11 2,12 3)", + "BOX(10 10,20 20)", strategy_sb), + strategy_sb, true, false, false); + + tester::apply("pb2", polygon, "BOX(17 0,20 3)", + ps_distance("POINT(13 1)", + "SEGMENT(17 0,17 3)", strategy_ps), + strategy_sb, true, false, false); + + tester::apply("pb3", polygon, "BOX(17 0,20 1)", + pp_distance("POINT(17 1)", "POINT(13 1)", strategy_pp), + strategy_sb, true, false, false); + + tester::apply("pb4", polygon, "BOX(12 0,20 1)", + 0, strategy_sb, true, false, false); + + // w/ interior ring + std::string const poly_interior = "POLYGON((11 0,10 1,11 2,12 3,13 1,11 0),\ + (12 1,11 1,12 2,12 1))"; + + tester::apply("pb5", poly_interior, "BOX(10 10,20 20)", + sb_distance("SEGMENT(11 2,12 3)", + "BOX(10 10,20 20)", strategy_sb), + strategy_sb, true, false, false); +} + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps, + typename Strategy_sb +> +void test_distance_multi_polygon_box(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps, + Strategy_sb const& strategy_sb) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multi_polygon/box distance tests" << std::endl; +#endif + typedef bg::model::box box_type; + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multi_polygon_type; + + typedef test_distance_of_geometries tester; + + std::string const multi_polygon = "MULTIPOLYGON(((20 20,20 30,30 40,20 20)),\ + ((10 10,0 20,15 30,20 15,15 10,10 10)))"; + + tester::apply("mpb1", multi_polygon, "BOX(0 0,5 5)", + sb_distance("SEGMENT(10 10,0 20)", + "BOX(0 0,5 5)", strategy_sb), + strategy_sb, true, false, false); + + tester::apply("mpb2", multi_polygon, "BOX(27 0,30 16)", + ps_distance("POINT(20 15)", + "SEGMENT(27 0,27 16)", strategy_ps), + strategy_sb, true, false, false); + + tester::apply("mpb3", multi_polygon, "BOX(27 0,30 15)", + pp_distance("POINT(20 15)", + "POINT(27 15)", strategy_pp), + strategy_sb, true, false, false); + + tester::apply("mpb4", multi_polygon, "BOX(17 0,20 14)", + 0, strategy_sb, true, false, false); +} + + +//=========================================================================== +// Cases for relative location of box2 wrt to box1 +// +// | | +// 11 | 7 | 4 +// | | +// --10---+---------+---3--- +// | | +// 9 | 6 | 2 +// | | +// -------+---------+------- +// | | +// 8 | 5 | 1 +// | | +// +// case 6 includes all possible intersections +// The picture assumes northern hemisphere location +// southern hemisphere picture is mirrored wrt the equator + + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps, + typename Strategy_bb +> +void test_distance_box_box(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps, + Strategy_bb const& strategy_bb) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "box/box distance tests" << std::endl; +#endif + typedef bg::model::box box_type; + + typedef test_distance_of_geometries tester; + + std::string const box1 = "BOX(10 10,20 20)"; + + // case 1 + tester::apply("bb1", box1, "BOX(30 0,40 5)", + pp_distance("POINT(20 10)", "POINT(30 5)", strategy_pp), + strategy_bb); + + // case 2 + tester::apply("bb2-a", box1, "BOX(30 12, 40 17)", + ps_distance("POINT(30 17)", + "SEGMENT(20 10,20 20)", strategy_ps), + strategy_bb); + + tester::apply("bb2-b", box1, "BOX(30 10, 40 17)", + ps_distance("POINT(30 17)", + "SEGMENT(20 10,20 20)", strategy_ps), + strategy_bb); + + tester::apply("bb2-c", box1, "BOX(30 8, 40 17)", + ps_distance("POINT(30 17)", + "SEGMENT(20 10,20 20)", strategy_ps), + strategy_bb); + + + // case 3 + tester::apply("bb3-a", box1, "BOX(30 15, 40 25)", + ps_distance("POINT(20 20)", + "SEGMENT(30 15,30 25)", strategy_ps), + strategy_bb); + + tester::apply("bb3-b", box1, "BOX(30 20, 40 40)", + ps_distance("POINT(20 20)", + "SEGMENT(30 20,30 40)", strategy_ps), + strategy_bb); + + // case 4 + tester::apply("bb4", box1, "BOX(30 25, 40 40)", + pp_distance("POINT(20 20)", + "POINT(30 25)", strategy_pp), + strategy_bb); + + // case 5 + tester::apply("bb5", box1, "BOX(12 2, 17 7)", + pp_distance("POINT(17 7)", "POINT(17 10)", strategy_pp), + strategy_bb); + + // case 6, boxes intersect thus distance is 0 + tester::apply("bb6-a", box1, "BOX(12 2, 17 10)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-b", box1, "BOX(12 2, 17 17)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-c", box1, "BOX(20 2, 30 10)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-d", box1, "BOX(20 11, 30 15)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-e", box1, "BOX(20 20, 30 30)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-f", box1, "BOX(15 20, 17 30)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-g", box1, "BOX(8 20, 10 25)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-h", box1, "BOX(8 15 , 10 17)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-i", box1, "BOX(8 8, 10 10)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-j", box1, "BOX(15 8, 17 10)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + // case 7 + tester::apply("bb7", box1, "BOX(12 22, 17 27)", + pp_distance("POINT(17 20)", + "POINT(17 22)", strategy_pp), + strategy_bb); + + // case 8 + tester::apply("bb8", box1, "BOX(4 4, 8 8)", + pp_distance("POINT(8 8)", "POINT(10 10)", strategy_pp), + strategy_bb); + + // case 9 + tester::apply("bb9-a", box1, "BOX(4 14, 8 18)", + ps_distance("POINT(8 18)", + "SEGMENT(10 10, 10 20)", strategy_ps), + strategy_bb); + + tester::apply("bb9-b", box1, "BOX(4 10, 8 18)", + ps_distance("POINT(8 18)", + "SEGMENT(10 10, 10 20)", strategy_ps), + strategy_bb); + + tester::apply("bb9-c", box1, "BOX(4 8, 8 18)", + ps_distance("POINT(8 18)", + "SEGMENT(10 10, 10 20)", strategy_ps), + strategy_bb); + + // case 10 + tester::apply("bb10a", box1, "BOX(4 18, 8 22)", + ps_distance("POINT(10 20)", + "SEGMENT(8 18, 8 22)", strategy_ps), + strategy_bb); + + std::string const box1m = "BOX(10 -20,20 -10)"; + tester::apply("bb10am", box1m, "BOX(4 -22, 8 -18)", + ps_distance("POINT(10 20)", + "SEGMENT(8 18, 8 22)", strategy_ps), + strategy_bb); + + tester::apply("bb10b", box1, "BOX(4 20, 8 22)", + ps_distance("POINT(10 20)", + "SEGMENT(8 20, 8 22)", strategy_ps), + strategy_bb); + + tester::apply("bb10bm", box1m, "BOX(4 -22, 8 -20)", + ps_distance("POINT(10 20)", + "SEGMENT(8 22, 8 20)", strategy_ps), + strategy_bb); + + // case 11 + tester::apply("bb11", box1, "BOX(4 22, 8 24)", + pp_distance("POINT(8 22)", "POINT(10 20)", strategy_pp), + strategy_bb); + + // far away boxes + tester::apply("bb-far", "BOX(150 15, 170 25)", box1, + ps_distance("POINT(20 20)", + "SEGMENT(150 15, 150 25)", strategy_ps), + strategy_bb); + + // crosses antimeridian + tester::apply("bb-anti1", "BOX(170 15, -160 25)", box1, + ps_distance("POINT(20 20)", + "SEGMENT(170 15, 170 25)", strategy_ps), + strategy_bb); + + tester::apply("bb-anti2", "BOX(170 15, -160 25)", "BOX(160 10, -170 20)", + pp_distance("POINT(20 20)", + "POINT(20 20)", strategy_pp), + strategy_bb); + + tester::apply("bb-anti3", "BOX(170 15, -160 25)", "BOX(160 10, 170 20)", + pp_distance("POINT(20 20)", + "POINT(20 20)", strategy_pp), + strategy_bb); + + tester::apply("bb-anti4", "BOX(170 10, -160 20)", "BOX(160 30, -170 40)", + pp_distance("POINT(180 20)", + "POINT(180 30)", strategy_pp), + strategy_bb); + + // South hemisphere + + tester::apply("bb-south1", "BOX(10 -20, 20 -10)", "BOX(30 -15, 40 -12)", + ps_distance("POINT(30 -15)", + "SEGMENT(20 -10, 20 -20)", strategy_ps), + strategy_bb); + + tester::apply("bb-south2", "BOX(10 -20, 20 -10)", "BOX(30 -30, 40 -25)", + pp_distance("POINT(30 -25)", + "POINT(20 -20)", strategy_pp), + strategy_bb); + + tester::apply("bb-south3", "BOX(10 -20, 20 -10)", "BOX(30 -25, 40 -15)", + ps_distance("POINT(20 -20)", + "SEGMENT(30 -15, 30 -25)", strategy_ps), + strategy_bb); + + tester::apply("bb-south4", "BOX(10 -20, 20 -10)", "BOX(5 -30, 30 -25)", + pp_distance("POINT(10 -25)", + "POINT(10 -20)", strategy_pp), + strategy_bb); + + tester::apply("bb-south4", "BOX(10 -20, 20 -10)", "BOX(5 -7, 30 -5)", + pp_distance("POINT(10 -7)", + "POINT(10 -10)", strategy_pp), + strategy_bb); + + + // Crosses equator + + tester::apply("bb-eq1", "BOX(30 -15, 40 30)", "BOX(10 -20, 20 25)", + ps_distance("POINT(20 25)", + "SEGMENT(30 -15, 30 30)", strategy_ps), + strategy_bb); + + tester::apply("bb-eq1b", "BOX(30 -15, 40 30)", "BOX(10 -20, 20 10)", + ps_distance("POINT(30 -15)", + "SEGMENT(20 10, 20 -20)", strategy_ps), + strategy_bb); + + tester::apply("bb-eq1bm", "BOX(30 -30, 40 15)", "BOX(10 -10, 20 20)", + ps_distance("POINT(30 15)", + "SEGMENT(20 -10, 20 20)", strategy_ps), + strategy_bb); + + tester::apply("bb-eq2", "BOX(30 -15, 40 20)", "BOX(10 -20, 20 25)", + ps_distance("POINT(30 20)", + "SEGMENT(20 -20, 20 25)", strategy_ps), + strategy_bb); + + tester::apply("bb-eq3", "BOX(30 5, 40 20)", "BOX(10 -20, 20 25)", + ps_distance("POINT(30 20)", + "SEGMENT(20 -20, 20 25)", strategy_ps), + strategy_bb); + + tester::apply("bb-eq4", "BOX(5 -30, 40 -25)", "BOX(10 -20, 20 25)", + pp_distance("POINT(10 -25)", + "POINT(10 -20)", strategy_pp), + strategy_bb); + + tester::apply("bb-eq5", "BOX(30 5, 40 20)", "BOX(10 -20, 50 25)", + pp_distance("POINT(30 20)", + "POINT(30 20)", strategy_pp), + strategy_bb); + + tester::apply("bb-eq6", "BOX(30 5, 40 20)", "BOX(10 -20, 35 25)", + pp_distance("POINT(30 20)", + "POINT(30 20)", strategy_pp), + strategy_bb); + + // One box in the north and one in the south hemisphere + + tester::apply("bb-ns1", "BOX(30 15, 40 20)", "BOX(10 -20, 20 -15)", + pp_distance("POINT(30 15)", + "POINT(20 -15)", strategy_pp), + strategy_bb); + + tester::apply("bb-ns2", "BOX(30 15, 40 20)", "BOX(25 -20, 50 -15)", + pp_distance("POINT(30 15)", + "POINT(30 -15)", strategy_pp), + strategy_bb); + + //negative coordinates + + std::string const box1neg = "BOX(-20 10,-10 20)"; + + // case 1 + tester::apply("bb1", box1neg, "BOX(-40 0,-30 5)", + pp_distance("POINT(-20 10)", + "POINT(-30 5)", strategy_pp), + strategy_bb); + + // case 2 + tester::apply("bb2-a", box1neg, "BOX(-40 12, -30 17)", + ps_distance("POINT(-30 17)", + "SEGMENT(-20 10,-20 20)", strategy_ps), + strategy_bb); + + tester::apply("bb2-b", box1neg, "BOX(-40 10, -30 17)", + ps_distance("POINT(-30 17)", + "SEGMENT(-20 10,-20 20)", strategy_ps), + strategy_bb); + + tester::apply("bb2-c", box1neg, "BOX(-40 8, -30 17)", + ps_distance("POINT(-30 17)", + "SEGMENT(-20 10,-20 20)", strategy_ps), + strategy_bb); + + + // case 3 + tester::apply("bb3-a", box1neg, "BOX(-40 15, -30 25)", + ps_distance("POINT(-20 20)", + "SEGMENT(-30 15,-30 25)", strategy_ps), + strategy_bb); + + tester::apply("bb3-b", box1neg, "BOX(-40 20, -30 40)", + ps_distance("POINT(-20 20)", + "SEGMENT(-30 20,-30 40)", strategy_ps), + strategy_bb); + + // case 4 + tester::apply("bb4", box1neg, "BOX(-40 25, -30 40)", + pp_distance("POINT(-20 20)", + "POINT(-30 25)", strategy_pp), + strategy_bb); + + // case 5 + tester::apply("bb5", box1neg, "BOX(-17 2,-12 7)", + pp_distance("POINT(-17 7)", + "POINT(-17 10)", strategy_pp), + strategy_bb); + + // case 6, boxes intersect thus distance is 0 + tester::apply("bb6-a", box1neg, "BOX(-17 2, -12 10)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-b", box1neg, "BOX(-17 2, -12 17)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-c", box1neg, "BOX(-30 2, -20 10)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-d", box1neg, "BOX(-30 11, -20 15)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-e", box1neg, "BOX(-30 20, -20 30)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-f", box1neg, "BOX(-17 20, -15 30)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-g", box1neg, "BOX(-10 20, -8 25)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-h", box1neg, "BOX(-10 15 , -8 17)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-i", box1neg, "BOX(-10 8, -8 10)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + tester::apply("bb6-j", box1neg, "BOX(-17 8, -15 10)", + pp_distance("POINT(0 0)", "POINT(0 0)", strategy_pp), + strategy_bb); + + // case 7 + tester::apply("bb7", box1neg, "BOX(-17 22, -12 27)", + pp_distance("POINT(-17 20)", + "POINT(-17 22)", strategy_pp), + strategy_bb); + + // case 8 + tester::apply("bb8", box1neg, "BOX(-8 4, -4 8)", + pp_distance("POINT(-8 8)", + "POINT(-10 10)", strategy_pp), + strategy_bb); + + // case 9 + tester::apply("bb9-a", box1neg, "BOX(-8 14, -4 18)", + ps_distance("POINT(-8 18)", + "SEGMENT(-10 10, -10 20)", strategy_ps), + strategy_bb); + + tester::apply("bb9-b", box1neg, "BOX(-8 10, -4 18)", + ps_distance("POINT(-8 18)", + "SEGMENT(-10 10, -10 20)", strategy_ps), + strategy_bb); + + tester::apply("bb9-c", box1neg, "BOX(-8 8, -4 18)", + ps_distance("POINT(-8 18)", + "SEGMENT(-10 10, -10 20)", strategy_ps), + strategy_bb); + + // case 10 + tester::apply("bb10", box1neg, "BOX(-8 18, -4 22)", + ps_distance("POINT(-10 20)", + "SEGMENT(-8 18, -8 22)", strategy_ps), + strategy_bb); + + tester::apply("bb10", box1neg, "BOX(-8 20, -4 22)", + ps_distance("POINT(-10 20)", + "SEGMENT(-8 20, -8 22)", strategy_ps), + strategy_bb); + + // case 11 + tester::apply("bb11", box1neg, "BOX(-8 22, -4 24)", + pp_distance("POINT(-8 22)", + "POINT(-10 20)", strategy_pp), + strategy_bb); + + + //Degenerate cases + + //1st box degenerates to a meridian segment + std::string const box1deg = "BOX(0 10,0 20)"; + + //2nd box generic + tester::apply("pbd1", box1deg, "BOX(1 15, 2 25)", + ps_distance("POINT(0 20)", + "SEGMENT(1 15, 1 25)", strategy_ps), + strategy_bb); + + //2nd box degenerates to a meridian segment + tester::apply("pbd2", box1deg, "BOX(1 15, 1 25)", + ps_distance("POINT(0 20)", + "SEGMENT(1 15, 1 25)", strategy_ps), + strategy_bb); + + //2nd box degenerates to a horizontal line + //test fails for thomas strategy; test only for andoyer + tester::apply("pbd3", box1deg, "BOX(1 15, 2 15)", + pp_distance("POINT(1 15)", + "POINT(0 15)", andoyer_pp()), + andoyer_bb()); + + //2nd box degenerates to a point + tester::apply("pbd4", box1deg, "BOX(1 15, 1 15)", + ps_distance("POINT(1 15)", + "SEGMENT(0 10, 0 20)", strategy_ps), + strategy_bb); + + //--- + //1st box degenerates to a horizontal line; that is not a geodesic segment + std::string const box2deg = "BOX(10 10,20 10)"; + + //2nd box generic + tester::apply("pbd5", box2deg, "BOX(15 15, 25 20)", + pp_distance("POINT(15 15)", + "POINT(15 10)", strategy_pp), + strategy_bb); + + //2nd box degenerates to a horizontal line + tester::apply("pbd6", box2deg, "BOX(15 15, 25 15)", + pp_distance("POINT(15 15)", + "POINT(15 10)", strategy_pp), + strategy_bb); + + //2nd box degenerates to a point + tester::apply("pbd7", box2deg, "BOX(15 15, 15 15)", + pp_distance("POINT(15 15)", + "POINT(15 10)", strategy_pp), + strategy_bb); + + //--- + //1st box degenerates to a point + std::string const box3deg = "BOX(0 6,0 6)"; + + //2nd box generic + tester::apply("pbd8", box3deg, "BOX(15 15, 25 20)", + ps_distance("POINT(0 6)", + "SEGMENT(15 15, 15 20)", strategy_ps), + strategy_bb); + + //2nd box degenerates to a point + tester::apply("pbd9", box3deg, "BOX(15 15, 15 15)", + pp_distance("POINT(0 6)", + "POINT(15 15)", strategy_pp), + strategy_bb); +} + +//=========================================================================== + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps, + typename Strategy_bb, + typename Strategy_sb +> +void test_all_ar_ar(Strategy_pp pp_strategy, + Strategy_ps ps_strategy, + Strategy_bb bb_strategy, + Strategy_sb sb_strategy) +{ + test_distance_ring_ring(pp_strategy, ps_strategy); + + test_distance_ring_polygon(pp_strategy, ps_strategy); + test_distance_polygon_polygon(pp_strategy, ps_strategy); + + test_distance_ring_multi_polygon(pp_strategy, ps_strategy); + test_distance_polygon_multi_polygon(pp_strategy, ps_strategy); + test_distance_multi_polygon_multi_polygon(pp_strategy, ps_strategy); + + test_distance_polygon_box(pp_strategy, ps_strategy, sb_strategy); + test_distance_multi_polygon_box(pp_strategy, ps_strategy, sb_strategy); + test_distance_ring_box(pp_strategy, ps_strategy, sb_strategy); + test_distance_box_box(pp_strategy, ps_strategy, bb_strategy); + + test_more_empty_input_areal_areal(ps_strategy); +} + +BOOST_AUTO_TEST_CASE( test_all_areal_areal ) +{ + typedef bg::model::point + < + double, 2, + bg::cs::spherical_equatorial + > sph_point; + + test_all_ar_ar(spherical_pp(), spherical_ps(), spherical_bb(), spherical_sb()); + + typedef bg::model::point + < + double, 2, + bg::cs::geographic + > geo_point; + + test_all_ar_ar(vincenty_pp(), vincenty_ps(), vincenty_bb(), vincenty_sb()); + test_all_ar_ar(thomas_pp(), thomas_ps(), thomas_bb(), thomas_sb()); + test_all_ar_ar(andoyer_pp(), andoyer_ps(), andoyer_bb(), andoyer_sb()); + + // test with different spheroid + stype spheroid(6372000, 6370000); + test_all_ar_ar(andoyer_pp(spheroid), andoyer_ps(spheroid), + andoyer_bb(spheroid), andoyer_sb(spheroid)); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_l_ar.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_l_ar.cpp new file mode 100644 index 000000000..ae332a0da --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_l_ar.cpp @@ -0,0 +1,651 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2017, 2018 Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_geographic_linear_areal +#endif + +#include +#include + +#include +#include +#include + +#include "test_distance_geo_common.hpp" +#include "test_empty_geometry.hpp" + + +template +void test_distance_segment_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/polygon distance tests" << std::endl; +#endif + typedef bg::model::segment segment_type; + typedef bg::model::polygon polygon_type; + typedef test_distance_of_geometries tester; + + std::string const polygon = "POLYGON((10 10,0 20,15 30,20 15,15 10,10 10))"; + + tester::apply("s-p-1", "SEGMENT(0 0, 0 10)", polygon, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); + + tester::apply("s-p-2", "SEGMENT(9 0, 10 9)", polygon, + pp_distance("POINT(10 10)", "POINT(10 9)", strategy_pp), + strategy_ps, true, false, false); + + tester::apply("s-p-3", "SEGMENT(9 0, 10 10)", polygon, + 0, strategy_ps, true, false, false); + + tester::apply("s-p-4", "SEGMENT(9 0, 10 11)", polygon, + 0, strategy_ps, true, false, false); +} + +template +void test_distance_linestring_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/polygon distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::polygon polygon_type; + typedef test_distance_of_geometries tester; + + std::string const polygon = "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("l-p-1", "LINESTRING(0 0,0 10)", polygon, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); + + tester::apply("l-p-2", "LINESTRING(9 0,10 9,11 8,15 8,20 9)", polygon, + pp_distance("POINT(10 10)", "POINT(10 9)", strategy_pp), + strategy_ps, true, false, false); + + tester::apply("l-p-3", "LINESTRING(9 0,10 1,10 10,11 9)", polygon, + 0, strategy_ps, true, false, false); + + tester::apply("l-p-4", "LINESTRING(9 0,10 11,10 9,11 9)", polygon, + 0, strategy_ps, true, false, false); +} + +template +void test_distance_multi_linestring_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multilinestring/polygon distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::multi_linestring multi_linestring_type; + typedef bg::model::polygon polygon_type; + typedef test_distance_of_geometries tester; + + std::string const polygon = "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("ml-p-1", "MULTILINESTRING((0 0,0 10)\ + (0 0,1 0,2 0,3 0,4 0,10 0,15 0,20 0))", polygon, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); + + tester::apply("ml-p-2", "MULTILINESTRING((9 0,10 9,11 8,15 8,20 9)\ + (0 0,1 0,2 0,3 0,4 0,10 0,15 0,20 0))", polygon, + pp_distance("POINT(10 10)", "POINT(10 9)", strategy_pp), + strategy_ps, true, false, false); + + tester::apply("ml-p-3", "MULTILINESTRING((9 0,10 1,10 10,11 9)\ + (0 0,1 0,2 0,3 0,4 0,10 0,15 0,20 0))", polygon, + 0, strategy_ps, true, false, false); + + tester::apply("ml-p-4", "MULTILINESTRING((9 0,10 11,10 9,11 9)\ + (0 0,1 0,2 0,3 0,4 0,10 0,15 0,20 0))", polygon, + 0, strategy_ps, true, false, false); +} + +//===================================================================== + +template +void test_distance_segment_multi_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/multi_polygon distance tests" << std::endl; +#endif + typedef bg::model::segment segment_type; + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multi_polygon_type; + typedef test_distance_of_geometries tester; + + std::string const mp = "MULTIPOLYGON(((20 20, 20 30, 30 40, 20 20)),\ + ((10 10,0 20, 15 30, 20 15, 15 10, 10 10)))"; + + tester::apply("s-mp-1", "SEGMENT(0 0, 0 10)", mp, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); + + tester::apply("s-mp-2", "SEGMENT(9 0, 10 9)", mp, + pp_distance("POINT(10 10)", "POINT(10 9)", strategy_pp), + strategy_ps, true, false, false); + + tester::apply("s-mp-3", "SEGMENT(9 0, 10 10)", mp, + 0, strategy_ps, true, false, false); + + tester::apply("s-mp-4", "SEGMENT(9 0, 10 11)", mp, + 0, strategy_ps, true, false, false); +} + +template +void test_distance_linestring_multi_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/multi_polygon distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multi_polygon_type; + typedef test_distance_of_geometries tester; + + std::string const mp = "MULTIPOLYGON(((20 20, 20 30, 30 40, 20 20)),\ + ((10 10,0 20, 15 30, 20 15, 15 10, 10 10)))"; + + tester::apply("l-mp-1", "LINESTRING(0 0, 0 10)", mp, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); + + tester::apply("l-mp-2", "LINESTRING(9 0,10 9,11 8,15 8,20 9)", mp, + pp_distance("POINT(10 10)", "POINT(10 9)", strategy_pp), + strategy_ps, true, false, false); + + tester::apply("l-mp-3", "LINESTRING(9 0,10 1,10 10,11 9)", mp, + 0, strategy_ps, true, false, false); + + tester::apply("l-mp-4", "LINESTRING(9 0,10 11,10 9,11 9)", mp, + 0, strategy_ps, true, false, false); + +} + +template +void test_distance_multi_linestring_multi_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multilinestring/multi_polygon distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::multi_linestring multi_linestring_type; + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multi_polygon_type; + typedef test_distance_of_geometries tester; + + std::string const mp = "MULTIPOLYGON(((20 20, 20 30, 30 40, 20 20)),\ + ((10 10,0 20, 15 30, 20 15, 15 10, 10 10)))"; + + tester::apply("ml-mp-1", "MULTILINESTRING((0 0, 0 10)(0 0, 10 0))", mp, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); + + tester::apply("ml-mp-2", "MULTILINESTRING((9 0,10 9,11 8,15 8,20 9)\ + (0 0,1 0,2 0,3 0,4 0,10 0,15 0,20 0))", mp, + pp_distance("POINT(10 10)", "POINT(10 9)", strategy_pp), + strategy_ps, true, false, false); + + tester::apply("ml-mp-3", "MULTILINESTRING((9 0,10 1,10 10,11 9)\ + (0 0,1 0,2 0,3 0,4 0,10 0,15 0,20 0))", mp, + 0, strategy_ps, true, false, false); + + tester::apply("ml-mp-4", "MULTILINESTRING((9 0,10 11,10 9,11 9)\ + (0 0,1 0,2 0,3 0,4 0,10 0,15 0,20 0))", mp, + 0, strategy_ps, true, false, false); +} + +//===================================================================== + +template +void test_distance_segment_ring(Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/ring distance tests" << std::endl; +#endif + typedef bg::model::segment segment_type; + typedef bg::model::ring ring_type; + typedef test_distance_of_geometries tester; + + std::string const ring = "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("s-r-1", "SEGMENT(0 0, 0 10)", ring, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); +} + +template +void test_distance_linestring_ring(Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/ring distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::ring ring_type; + typedef test_distance_of_geometries tester; + + std::string const ring = "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("l-r-1", "LINESTRING(0 0, 0 10)", ring, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); +} + +template +void test_distance_multi_linestring_ring(Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multilinestring/ring distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::multi_linestring multi_linestring_type; + typedef bg::model::ring ring_type; + typedef test_distance_of_geometries tester; + + std::string const ring = "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("ml-r-1", "MULTILINESTRING((0 0, 0 10)(0 0, 10 0))", ring, + ps_distance("POINT(0 10)", "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, false, false); +} + +//====================================================================== + +template +void test_distance_segment_box(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps, + Strategy_sb const& strategy_sb) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/box distance tests" << std::endl; +#endif + typedef bg::model::segment segment_type; + typedef bg::model::box box_type; + typedef test_distance_of_geometries tester; + + std::string const box_north = "BOX(10 10,20 20)"; + + tester::apply("sb1-1a", "SEGMENT(0 0, 0 20)", box_north, + pp_distance("POINT(0 20)", "POINT(10 20)", strategy_pp), + strategy_sb); + //segment with slope + tester::apply("sb1-1b", "SEGMENT(10 5, 20 6)", box_north, + pp_distance("POINT(20 6)", "POINT(20 10)", strategy_pp), + strategy_sb); + tester::apply("sb1-2", "SEGMENT(0 0, 0 10)", box_north, + ps_distance("POINT(0 10)", "SEGMENT(10 10,10 20)", strategy_ps), + strategy_sb); + tester::apply("sb1-3", "SEGMENT(0 0, 0 15)", box_north, + ps_distance("POINT(0 15)", "SEGMENT(10 10,10 20)", strategy_ps), + strategy_sb); + tester::apply("sb1-4", "SEGMENT(0 0, 0 25)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(0 0,0 25)", strategy_ps), + strategy_sb); + tester::apply("sb1-5", "SEGMENT(0 10, 0 25)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(0 0,0 25)", strategy_ps), + strategy_sb); + + tester::apply("sb2-2", "SEGMENT(0 5, 15 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5,15 5)", strategy_ps), + strategy_sb); + tester::apply("sb2-3a", "SEGMENT(0 5, 20 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5,20 5)", strategy_ps), + strategy_sb); + + // Test segments below box + tester::apply("test_b1", "SEGMENT(0 5, 9 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5, 9 5)", strategy_ps), + strategy_sb); + tester::apply("test_b2", "SEGMENT(0 5, 10 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5, 10 5)", strategy_ps), + strategy_sb); + tester::apply("test_b3", "SEGMENT(0 5, 11 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5, 11 5)", strategy_ps), + strategy_sb); + tester::apply("test_b4", "SEGMENT(0 5, 20 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5,20 5)", strategy_ps), + strategy_sb); + tester::apply("test_b5", "SEGMENT(0 5, 22 5)", box_north, + ps_distance("POINT(11 10)", "SEGMENT(0 5,22 5)", strategy_ps), + strategy_sb); + tester::apply("test_b6", "SEGMENT(10 5, 20 5)", box_north, + ps_distance("POINT(15 10)", "SEGMENT(10 5,20 5)", strategy_ps), + strategy_sb); + tester::apply("test_b7", "SEGMENT(10 5, 22 5)", box_north, + ps_distance("POINT(16 10)", "SEGMENT(10 5,22 5)", strategy_ps), + strategy_sb); + tester::apply("test_b8", "SEGMENT(12 5, 22 5)", box_north, + ps_distance("POINT(17 10)", "SEGMENT(12 5,22 5)", strategy_ps), + strategy_sb); + tester::apply("test_b9", "SEGMENT(18 5, 22 5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(18 5,22 5)", strategy_ps), + strategy_sb); + tester::apply("test_b10", "SEGMENT(18 5, 24 5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(18 5,24 5)", strategy_ps), + strategy_sb); + tester::apply("test_b11", "SEGMENT(20 5, 24 5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(20 5,24 5)", strategy_ps), + strategy_sb); + tester::apply("test_b12", "SEGMENT(22 5, 24 5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(22 5,24 5)", strategy_ps), + strategy_sb); + tester::apply("test_b13", "SEGMENT(0 5, 125 5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(0 5, 125 5)", strategy_ps), + strategy_sb); + + // Test segments above box + tester::apply("test_a1", "SEGMENT(0 25, 9 25)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(0 25, 9 25)", strategy_ps), + strategy_sb); + tester::apply("test_a2", "SEGMENT(0 25, 10 25)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(0 25, 10 25)", strategy_ps), + strategy_sb); + tester::apply("test_a3", "SEGMENT(0 25, 11 25)", box_north, + ps_distance("POINT(11 20)", "SEGMENT(0 25, 11 25)", strategy_ps), + strategy_sb); + tester::apply("test_a4", "SEGMENT(0 25, 20 25)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(0 25, 20 25)", strategy_ps), + strategy_sb); + tester::apply("test_a5", "SEGMENT(0 25, 22 25)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(0 25, 22 25)", strategy_ps), + strategy_sb); + tester::apply("test_a6", "SEGMENT(10 25, 20 25)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(10 25, 20 25)", strategy_ps), + strategy_sb); + tester::apply("test_a7", "SEGMENT(10 25, 22 25)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(10 25, 22 25)", strategy_ps), + strategy_sb); + tester::apply("test_a8", "SEGMENT(12 25, 22 25)", box_north, + ps_distance("POINT(12 20)", "SEGMENT(12 25, 22 25)", strategy_ps), + strategy_sb); + tester::apply("test_a9", "SEGMENT(18 25, 22 25)", box_north, + ps_distance("POINT(18 20)", "SEGMENT(18 25, 22 25)", strategy_ps), + strategy_sb); + tester::apply("test_a10", "SEGMENT(18 25, 24 25)", box_north, + ps_distance("POINT(18 20)", "SEGMENT(18 25, 24 25)", strategy_ps), + strategy_sb); + tester::apply("test_a11", "SEGMENT(20 25, 24 25)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(20 25, 24 25)", strategy_ps), + strategy_sb); + tester::apply("test_a12", "SEGMENT(22 25, 24 25)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(22 25, 24 25)", strategy_ps), + strategy_sb); + + // Segments left-right of box + tester::apply("test_l1", "SEGMENT(0 5, 9 5)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(0 5, 9 5)", strategy_ps), + strategy_sb); + tester::apply("test_l2", "SEGMENT(0 10, 9 10)", box_north, + ps_distance("POINT(9 10)", "SEGMENT(10 10, 10 20)", strategy_ps), + strategy_sb); + tester::apply("test_l3", "SEGMENT(0 10, 9 15)", box_north, + ps_distance("POINT(9 15)", "SEGMENT(10 10, 10 20)", strategy_ps), + strategy_sb); + tester::apply("test_l4", "SEGMENT(0 10, 0 15)", box_north, + ps_distance("POINT(0 15)", "SEGMENT(10 10, 10 20)", strategy_ps), + strategy_sb); + tester::apply("test_l5", "SEGMENT(1 10, 0 15)", box_north, + ps_distance("POINT(1 10)", "SEGMENT(10 10, 10 20)", strategy_ps), + strategy_sb); + tester::apply("test_l6", "SEGMENT(0 20, 9 21)", box_north, + ps_distance("POINT(9 21)", "SEGMENT(10 10, 10 20)", strategy_ps), + strategy_sb); + tester::apply("test_r1", "SEGMENT(21 5, 29 5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(21 5, 29 5)", strategy_ps), + strategy_sb); + tester::apply("test_r2", "SEGMENT(21 10, 29 10)", box_north, + ps_distance("POINT(21 10)", "SEGMENT(20 10, 20 20)", strategy_ps), + strategy_sb); + tester::apply("test_r3", "SEGMENT(21 10, 29 15)", box_north, + ps_distance("POINT(21 10)", "SEGMENT(20 10, 20 20)", strategy_ps), + strategy_sb); + tester::apply("test_r4", "SEGMENT(21 10, 21 15)", box_north, + ps_distance("POINT(21 15)", "SEGMENT(20 10, 20 20)", strategy_ps), + strategy_sb); + tester::apply("test_r5", "SEGMENT(21 10, 22 15)", box_north, + ps_distance("POINT(21 10)", "SEGMENT(20 10, 20 20)", strategy_ps), + strategy_sb); + tester::apply("test_r6", "SEGMENT(29 20, 21 21)", box_north, + ps_distance("POINT(21 21)", "SEGMENT(20 10, 20 20)", strategy_ps), + strategy_sb); + + //Segments on corners of box + //left-top corner + //generic + tester::apply("test_c1", "SEGMENT(9 19.5, 11 21)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(9 19.5, 11 21)", strategy_ps), + strategy_sb); + //degenerate + tester::apply("test_c2", "SEGMENT(9 19, 11 21)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(9 19, 11 21)", strategy_ps), + strategy_sb); + //left-bottom corner + //generic + tester::apply("test_c3", "SEGMENT(8.5 11, 11 9)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(8.5 11, 11 9)", strategy_ps), + strategy_sb); + //degenerate + tester::apply("test_c4", "SEGMENT(9 11, 11 9)", box_north, + 0, + strategy_sb); + //right-top corner + //generic + tester::apply("test_c5", "SEGMENT(19 21, 21 19.5)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(19 21, 21 19.5)", strategy_ps), + strategy_sb); + //degenerate + tester::apply("test_c6", "SEGMENT(19 21, 21 19)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(19 21, 21 19)", strategy_ps), + strategy_sb); + //right-bottom corner + //generic + tester::apply("test_c7", "SEGMENT(19 9, 21 10.5)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(19 9, 21 10.5)", strategy_ps), + strategy_sb); + tester::apply("test_c7", "SEGMENT(19 9, 21 11)", box_north, + 0, + strategy_sb); + + //Segment and box on different hemispheres + std::string const box_south = "BOX(10 -20,20 -10)"; + + tester::apply("test_ns1", "SEGMENT(10 20, 15 30)", box_south, + ps_distance("POINT(10 -10)", "SEGMENT(10 20, 15 30)", strategy_ps), + strategy_sb); + tester::apply("test_ns2", "SEGMENT(0 10, 12 10)", box_south, + pp_distance("POINT(12 10)", "POINT(12 -10)", strategy_pp), + strategy_sb); + tester::apply("test_ns3", "SEGMENT(10 10, 20 10)", box_south, + pp_distance("POINT(10 10)", "POINT(10 -10)", strategy_pp), + strategy_sb); + tester::apply("test_ns4", "SEGMENT(0 -10, 12 -10)", box_north, + pp_distance("POINT(12 10)", "POINT(12 -10)", strategy_pp), + strategy_sb); + tester::apply("test_ns5", "SEGMENT(10 -10, 20 -10)", box_north, + pp_distance("POINT(10 -10)", "POINT(10 10)", strategy_pp), + strategy_sb); + + //Box crossing equator + std::string const box_crossing_eq = "BOX(10 -10,20 10)"; + + tester::apply("test_cr1", "SEGMENT(10 20, 15 30)", box_crossing_eq, + pp_distance("POINT(10 10)", "POINT(10 20)", strategy_pp), + strategy_sb); + tester::apply("test_cr2", "SEGMENT(10 -20, 15 -30)", box_crossing_eq, + pp_distance("POINT(10 10)", "POINT(10 20)", strategy_pp), + strategy_sb); + + //Box crossing prime meridian + + std::string const box_crossing_mer = "BOX(-10 10,15 20)"; + + tester::apply("test_cr3", "SEGMENT(-5 25, 10 30)", box_crossing_mer, + pp_distance("POINT(-5 25)", "POINT(-5 20)", strategy_pp), + strategy_sb); + tester::apply("test_cr4", "SEGMENT(-5 5, 10 7)", box_crossing_mer, + pp_distance("POINT(10 7)", "POINT(10 10)", strategy_pp), + strategy_sb); + tester::apply("test_cr5", "SEGMENT(-5 5, 10 5)", box_crossing_mer, + ps_distance("POINT(2.5 10)", "SEGMENT(-5 5, 10 5)", strategy_ps), + strategy_sb); + + + //Geometries in south hemisphere + tester::apply("test_south1", "SEGMENT(10 -30, 15 -30)", box_south, + ps_distance("POINT(10 -20)", "SEGMENT(10 -30, 15 -30)", strategy_ps), + strategy_sb); + + //Segments in boxes corner + tester::apply("corner1", "SEGMENT(17 21, 25 20)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(17 21, 25 20)", strategy_ps), + strategy_sb); + tester::apply("corner2", "SEGMENT(17 21, 0 20)", box_north, + ps_distance("POINT(10 20)", "SEGMENT(17 21, 0 20)", strategy_ps), + strategy_sb); + tester::apply("corner3", "SEGMENT(17 5, 0 10)", box_north, + ps_distance("POINT(10 10)", "SEGMENT(17 5, 0 10)", strategy_ps), + strategy_sb); + tester::apply("corner4", "SEGMENT(17 5, 25 9)", box_north, + ps_distance("POINT(20 10)", "SEGMENT(17 5, 25 9)", strategy_ps), + strategy_sb); +} + +template +void test_distance_linestring_box(Strategy_ps const& strategy_ps, + Strategy_sb const& strategy_sb) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/box distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::box box_type; + typedef test_distance_of_geometries tester; + + std::string const box_north = "BOX(10 10,20 20)"; + + tester::apply("sl1", "LINESTRING(0 20, 15 21, 25 19.9, 21 5, 15 5, 0 10)", box_north, + ps_distance("POINT(20 20)", "SEGMENT(15 21, 25 19.9)", strategy_ps), + strategy_sb, true, false, false); + + tester::apply("sl2", "LINESTRING(0 20, 15 21, 25 19.9, 21 5, 15 5, 15 15)", box_north, + 0, strategy_sb, true, false, false); + + tester::apply("sl3", "LINESTRING(0 20, 15 21, 25 19.9, 21 5, 15 5, 2 20)", box_north, + 0, strategy_sb, true, false, false); +} + +template +void test_distance_multi_linestring_box(Strategy_ps const& strategy_ps, + Strategy_sb const& strategy_sb) +{ + + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multi_linestring/box distance tests" << std::endl; +#endif + typedef bg::model::linestring linestring_type; + typedef bg::model::multi_linestring multi_linestring_type; + typedef bg::model::box box_type; + typedef test_distance_of_geometries tester; + + std::string const box_north = "BOX(10 10,20 20)"; + + tester::apply("sl1", "MULTILINESTRING((0 20, 15 21, 25 19.9, 21 5, 15 5, 0 10)(25 20, 22 4, 0 0))", box_north, + ps_distance("POINT(20 20)", "SEGMENT(15 21, 25 19.9)", strategy_ps), + strategy_sb, true, false, false); +} + +//=========================================================================== +//=========================================================================== +//=========================================================================== + + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps, + typename Strategy_sb +> +void test_all_l_ar(Strategy_pp pp_strategy, + Strategy_ps ps_strategy, + Strategy_sb sb_strategy) +{ + test_distance_segment_polygon(pp_strategy, ps_strategy); + test_distance_linestring_polygon(pp_strategy, ps_strategy); + test_distance_multi_linestring_polygon(pp_strategy, ps_strategy); + + test_distance_segment_multi_polygon(pp_strategy, ps_strategy); + test_distance_linestring_multi_polygon(pp_strategy, ps_strategy); + test_distance_multi_linestring_multi_polygon(pp_strategy, ps_strategy); + + test_distance_segment_ring(ps_strategy); + test_distance_linestring_ring(ps_strategy); + test_distance_multi_linestring_ring(ps_strategy); + + test_distance_segment_box(pp_strategy, ps_strategy, sb_strategy); + test_distance_linestring_box(ps_strategy, sb_strategy); + test_distance_multi_linestring_box(ps_strategy, sb_strategy); + + test_more_empty_input_linear_areal(ps_strategy); +} + +BOOST_AUTO_TEST_CASE( test_all_linear_areal ) +{ + typedef bg::model::point + < + double, 2, + bg::cs::spherical_equatorial + > sph_point; + + test_all_l_ar(spherical_pp(), spherical_ps(), spherical_sb()); + + typedef bg::model::point + < + double, 2, + bg::cs::geographic + > geo_point; + + test_all_l_ar(vincenty_pp(), vincenty_ps(), vincenty_sb()); + test_all_l_ar(thomas_pp(), thomas_ps(), thomas_sb()); + test_all_l_ar(andoyer_pp(), andoyer_ps(), andoyer_sb()); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_l_l.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_l_l.cpp new file mode 100644 index 000000000..f287f5264 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_l_l.cpp @@ -0,0 +1,286 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2018 Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_geographic_linear_linear +#endif + +#include +#include + +#include +#include +#include + +#include "test_distance_geo_common.hpp" +#include "test_empty_geometry.hpp" + +//=========================================================================== + +template +void test_distance_segment_segment(Strategy const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/segment distance tests" << std::endl; +#endif + + typedef bg::model::segment segment_type; + + typedef test_distance_of_geometries tester; + + tester::apply("s-s-01", + "SEGMENT(0 0,1 1)", + "SEGMENT(2 0,3 0)", + ps_distance("POINT(2 0)", + "SEGMENT(0 0,1 1)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("s-s-02", + "SEGMENT(2 1,3 1)", + "SEGMENT(2 0,3 0)", + ps_distance("POINT(2 0)", + "SEGMENT(2 1,3 1)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("s-s-03", + "SEGMENT(2.5 1,3.5 1)", + "SEGMENT(2 0,3 0)", + ps_distance("POINT(2.5 0)", + "SEGMENT(2.5 1,3.5 1)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("s-s-04", + "SEGMENT(2.5 1,3.5 1)", + "SEGMENT(2 2,3 2)", + ps_distance("POINT(3 2)", + "SEGMENT(2.5 1,3.5 1)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("s-s-05", + "SEGMENT(2.5 2.1,3.5 1)", + "SEGMENT(2 2,3 2)", + 0, strategy_ps, true, true, false); + tester::apply("s-s-06", + "SEGMENT(2.5 2.1,3.5 1)", + "SEGMENT(2 2,3.5 1)", + 0, strategy_ps, true, true, false); +} + +//=========================================================================== + +template +void test_distance_segment_linestring(Strategy const& strategy_ps) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/linestring distance tests" << std::endl; +#endif + + typedef bg::model::segment segment_type; + typedef bg::model::linestring linestring_type; + + typedef test_distance_of_geometries tester; + + tester::apply("s-l-01", + "SEGMENT(0 0,1 1)", + "LINESTRING(2 0,3 0)", + ps_distance("POINT(2 0)", + "SEGMENT(0 0,1 1)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("s-l-02", + "SEGMENT(0 0,1 1)", + "LINESTRING(2 0,3 0,2 2,0.5 0.7)", + ps_distance("POINT(1 1)", + "SEGMENT(0.5 0.7,2 2)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("s-l-03", + "SEGMENT(0 0,2 2)", + "LINESTRING(2 0,3 0,2 2,0.5 0.7)", + 0, strategy_ps, true, true, false); +} + +//=========================================================================== + +template +void test_distance_linestring_linestring(Strategy const& strategy_ps) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/linestring distance tests" << std::endl; +#endif + + typedef bg::model::linestring linestring_type; + + typedef test_distance_of_geometries + < + linestring_type, linestring_type + > tester; + + tester::apply("l-l-01", + "LINESTRING(0 0,1 1)", + "LINESTRING(2 0,3 0)", + ps_distance("POINT(2 0)", + "SEGMENT(0 0,1 1)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("l-l-02", + "LINESTRING(0 0,1 1,2 2)", + "LINESTRING(2 0,3 0,4 1)", + ps_distance("POINT(2 0)", + "SEGMENT(1 1,2 2)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("l-l-03", + "LINESTRING(0 0,1 1,2 2)", + "LINESTRING(2 0)", + ps_distance("POINT(2 0)", + "SEGMENT(1 1,2 2)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("l-l-04", + "LINESTRING(0 0,1 1,2 2)", + "LINESTRING(3 3,1 1)", + 0, strategy_ps, true, true, false); +} + +//=========================================================================== + +template +void test_distance_segment_multilinestring(Strategy const& strategy_ps) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "segment/multilinestring distance tests" << std::endl; +#endif + + typedef bg::model::segment segment_type; + typedef bg::model::linestring linestring_type; + typedef bg::model::multi_linestring multi_linestring_type; + + typedef test_distance_of_geometries + < + segment_type, multi_linestring_type + > tester; + + tester::apply("s-ml-01", + "SEGMENT(0 0,1 1)", + "MULTILINESTRING((2 0,3 0)(2 5, 5 5, 2 -1))", + ps_distance("POINT(2 0)", + "SEGMENT(0 0,1 1)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("s-ml-02", + "SEGMENT(0 0,1 1)", + "MULTILINESTRING((2 0,3 0))", + ps_distance("POINT(2 0)", + "SEGMENT(0 0,1 1)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("s-ml-03", + "SEGMENT(0 0,2 0)", + "MULTILINESTRING((2 0,3 0)(2 5, 5 5, 2 -1))", + 0, strategy_ps, true, true, false); +} + +//=========================================================================== + +template +void test_distance_linestring_multilinestring(Strategy const& strategy_ps) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/multilinestring distance tests" << std::endl; +#endif + + typedef bg::model::linestring linestring_type; + typedef bg::model::multi_linestring multi_linestring_type; + + typedef test_distance_of_geometries + < + linestring_type, multi_linestring_type + > tester; + + tester::apply("l-ml-01", + "LINESTRING(0 0,1 1,2 2,3 3,4 4,6 6)", + "MULTILINESTRING((2 0,3 0)(2 1, 5 5))", + ps_distance("POINT(5 5)", + "SEGMENT(4 4,6 6)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("l-ml-02", + "LINESTRING(0 0,1 1,2 2,3 3,4 4,6 6)", + "MULTILINESTRING((2 0,3 0)(2 5, 5 5))", + 0, + strategy_ps, true, true, false); + +} + +//=========================================================================== + +template +void test_distance_multilinestring_multilinestring(Strategy const& strategy_ps) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multilinestring/multilinestring distance tests" << std::endl; +#endif + + typedef bg::model::linestring linestring_type; + typedef bg::model::multi_linestring multi_linestring_type; + + typedef test_distance_of_geometries + < + multi_linestring_type, multi_linestring_type + > tester; + + tester::apply("s-ml-01", + "MULTILINESTRING((0 0,1 1)(-1 0, -1 -1))", + "MULTILINESTRING((2 0,3 0)(2 5, 5 5))", + ps_distance("POINT(2 0)", + "SEGMENT(0 0,1 1)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("s-ml-02", + "MULTILINESTRING((0 0,1 1)(-1 0, -1 -1)(5 0, 5 6))", + "MULTILINESTRING((2 0,3 0)(2 5, 5 5))", + 0, + strategy_ps, true, true, false); +} + +//=========================================================================== +//=========================================================================== +//=========================================================================== + +template +void test_all_l_l(Strategy ps_strategy) +{ + test_distance_segment_segment(ps_strategy); + test_distance_segment_linestring(ps_strategy); + test_distance_linestring_linestring(ps_strategy); + test_distance_segment_multilinestring(ps_strategy); + test_distance_linestring_multilinestring(ps_strategy); + test_distance_multilinestring_multilinestring(ps_strategy); + + test_more_empty_input_linear_linear(ps_strategy); +} + +BOOST_AUTO_TEST_CASE( test_all_linear_linear ) +{ + typedef bg::model::point + < + double, 2, + bg::cs::spherical_equatorial + > sph_point; + + test_all_l_l(spherical_ps()); + + typedef bg::model::point + < + double, 2, + bg::cs::geographic + > geo_point; + + test_all_l_l(vincenty_ps()); + test_all_l_l(thomas_ps()); + test_all_l_l(andoyer_ps()); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_pl_ar.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_pl_ar.cpp new file mode 100644 index 000000000..3a9d5f277 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_pl_ar.cpp @@ -0,0 +1,687 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2017-2018, Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_geographic_pointlike_areal +#endif + +#include +#include + +#include +#include +#include + +#include "test_distance_geo_common.hpp" +#include "test_empty_geometry.hpp" + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps +> +void test_distance_point_ring(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/ring distance tests" << std::endl; +#endif + typedef bg::model::ring ring_type; + typedef test_distance_of_geometries tester; + + std::string const ring = "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("pr1", "POINT(0 10)", ring, + ps_distance("POINT(0 10)", + "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("pr2", "POINT(10 0)", ring, + pp_distance("POINT(10 10)", "POINT(10 0)", strategy_pp), + strategy_ps, true, true, false); + tester::apply("pr3", "POINT(0 20)", ring, + 0, strategy_ps, true, true, false); + tester::apply("pr4", "POINT(10 10)", ring, + 0, strategy_ps, true, true, false); + tester::apply("pr4", "POINT(10 11)", ring, + 0, strategy_ps, true, true, false); +} + +//=========================================================================== + +template +< + typename Point, + typename Strategy_ps +> +void test_distance_multipoint_ring(Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/ring distance tests" << std::endl; +#endif + typedef bg::model::ring ring_type; + typedef bg::model::multi_point multi_point_type; + typedef test_distance_of_geometries tester; + + std::string const ring = "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("pr1", "MULTIPOINT(0 10,10 0,0 0)", ring, + ps_distance("POINT(0 10)", + "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, true, false); +} + + +//=========================================================================== + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps +> +void test_distance_point_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/polygon distance tests" << std::endl; +#endif + typedef bg::model::polygon polygon_type; + typedef test_distance_of_geometries tester; + + std::string const polygon = + "POLYGON((10 10,0 20, 15 30, 20 15, 15 10, 10 10))"; + + tester::apply("pr1", "POINT(0 10)", polygon, + ps_distance("POINT(0 10)", + "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, true, false); + tester::apply("pr2", "POINT(10 0)", polygon, + pp_distance("POINT(10 10)", "POINT(10 0)", strategy_pp), + strategy_ps, true, true, false); + tester::apply("pr3", "POINT(0 20)", polygon, + 0, strategy_ps, true, true, false); + tester::apply("pr4", "POINT(10 10)", polygon, + 0, strategy_ps, true, true, false); + tester::apply("pr5", "POINT(10 10.1)", polygon, + 0, strategy_ps, false, false, false); +} + +//=========================================================================== + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps +> +void test_distance_multipoint_polygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/polygon distance tests" << std::endl; +#endif + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_point multi_point_type; + typedef test_distance_of_geometries tester; + + std::string const polygon = "POLYGON((10 10,0 20,15 30,20 15,15 10,10 10))"; + + tester::apply("mpp1", "MULTIPOINT(0 10,10 0,0 0)", polygon, + ps_distance("POINT(0 10)", + "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, true, false); + + tester::apply("mpp2", "MULTIPOINT(0 10,10 0,0 0,20.1 15)", polygon, + pp_distance("POINT(20 15)", + "POINT(20.1 15)", strategy_pp), + strategy_ps, true, true, false); + + tester::apply("mpp3", "MULTIPOINT(0 10,10 0,0 0,20.1 15,10 10)", polygon, + 0, strategy_ps, true, true, false); + + tester::apply("mpp4", "MULTIPOINT(0 10,10 0,0 0,20.1 15,10 11)", polygon, + 0, strategy_ps, true, true, false); +} + + +//=========================================================================== + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps +> +void test_distance_point_multipolygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/multipolygon distance tests" << std::endl; +#endif + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multipolygon_type; + typedef test_distance_of_geometries tester; + + std::string const mpoly = "MULTIPOLYGON(((20 20, 20 30, 30 40, 20 20)),\ + ((10 10,0 20, 15 30, 20 15, 15 10, 10 10)))"; + + tester::apply("pmp1", "POINT(0 10)", mpoly, + ps_distance("POINT(0 10)", + "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, true, false); + + + tester::apply("pmp2", "POINT(10 9.9)", mpoly, + pp_distance("POINT(10 9.9)", + "POINT(10 10)", strategy_pp), + strategy_ps, true, true, false); + + tester::apply("pmp3", "POINT(10 11)", mpoly, + 0, strategy_ps, true, true, false); +} + +//=========================================================================== + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps +> +void test_distance_multipoint_multipolygon(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/multipolygon distance tests" << std::endl; +#endif + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multipolygon_type; + typedef bg::model::multi_point multi_point_type; + typedef test_distance_of_geometries tester; + + std::string const mpoly = "MULTIPOLYGON(((20 20, 20 30, 30 40, 20 20)),\ + ((10 10,0 20, 15 30, 20 15, 15 10, 10 10)))"; + + tester::apply("pr1", "MULTIPOINT(0 10,10 0,0 0)", mpoly, + ps_distance("POINT(0 10)", + "SEGMENT(0 20, 10 10)", strategy_ps), + strategy_ps, true, true, false); + + tester::apply("pmp2", "MULTIPOINT(0 10,10 0,0 0,10 9.9)", mpoly, + pp_distance("POINT(10 9.9)", + "POINT(10 10)", strategy_pp), + strategy_ps, true, true, false); + + tester::apply("pmp3", "MULTIPOINT(0 10,10 0,0 0,10 9.9,10 11)", mpoly, + 0, strategy_ps, true, true, false); +} + + +//=========================================================================== +// Cases for relative location of a point wrt to a box +// +// | | +// | 3 | +// | | +// +---------+ +// | | +// 1 | 5 | 2 +// | | +// +---------+ +// | | +// | 4 | +// | | +// +// and also the following cases +// +// | | +// A B +// | | +// +----C----+ +// | | +// D E +// | | +// +----F----+ +// | | +// G H +// | | +// +// and finally we have the corners +// +// | | +// | | +// | | +// a---------b +// | | +// | | +// | | +// c---------d +// | | +// | | +// | | +// +// for each relative position we also have to test the shifted point +// (this is due to the fact that boxes have longitudes in the +// range [-180, 540) +//=========================================================================== + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps, + typename Strategy_pb +> +void test_distance_point_box(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps, + Strategy_pb const& strategy_pb) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/box distance tests" << std::endl; +#endif + typedef bg::model::box box_type; + typedef test_distance_of_geometries tester; + + std::string const box1 = "BOX(10 10,20 20)"; + + // case 1 + tester::apply("pb1-1a", "POINT(5 25)", box1, + pp_distance("POINT(5 25)", "POINT(10 20)", strategy_pp), + strategy_pb); + + // case 1 + tester::apply("pb1-1b", "POINT(3 12)", box1, + ps_distance("POINT(3 12)", + "SEGMENT(10 10,10 20)", strategy_ps), + strategy_pb); + + // case 1 + tester::apply("pb1-1c", "POINT(3 17)", box1, + ps_distance("POINT(3 17)", + "SEGMENT(10 10,10 20)", strategy_ps), + strategy_pb); + + // case 1 + tester::apply("pb1-1d", "POINT(5 4)", box1, + pp_distance("POINT(5 4)", "POINT(10 10)", strategy_pp), + strategy_pb); + + // case 1 + tester::apply("pb1-1e", "POINT(-100 20)", box1, + pp_distance("POINT(-100 20)", + "POINT(10 20)", strategy_pp), + strategy_pb); + + // case 1 + tester::apply("pb1-1g", "POINT(-100 10)", box1, + ps_distance("POINT(-100 10)", + "SEGMENT(10 10,10 20)", strategy_ps), + strategy_pb); + + // case 2 + tester::apply("pb1-2a", "POINT(31 25)", box1, + pp_distance("POINT(31 25)", + "POINT(20 20)", strategy_pp), + strategy_pb); + + // case 2 + tester::apply("pb1-2b", "POINT(23 17)", box1, + ps_distance("POINT(23 17)", + "SEGMENT(20 10,20 20)", strategy_ps), + strategy_pb); + + // case 2 + tester::apply("pb1-2c", "POINT(29 3)", box1, + pp_distance("POINT(29 3)", + "POINT(20 10)", strategy_pp), + strategy_pb); + + // case 2 + tester::apply("pb1-2d", "POINT(131 65)", box1, + pp_distance("POINT(131 65)", + "POINT(20 20)", strategy_pp), + strategy_pb); + + // case 2 + tester::apply("pb1-2e", "POINT(110 10)", box1, + ps_distance("POINT(110 10)", + "SEGMENT(20 10,20 20)", strategy_ps), + strategy_pb); + + // case 2 + tester::apply("pb1-2f", "POINT(150 20)", box1, + pp_distance("POINT(150 20)", + "POINT(20 20)", strategy_pp), + strategy_pb); + + // case 3 + tester::apply("pb1-3a", "POINT(11 25)", box1, + pp_distance("POINT(11 25)", + "POINT(11 20)", strategy_pp), + strategy_pb); + + // case 3 + tester::apply("pb1-3b", "POINT(15 25)", box1, + pp_distance("POINT(15 25)", + "POINT(15 20)", strategy_pp), + strategy_pb); + + // case 3 + tester::apply("pb1-3c", "POINT(18 25)", box1, + pp_distance("POINT(18 25)", + "POINT(18 20)", strategy_pp), + strategy_pb); + + // case 4 + tester::apply("pb1-4a", "POINT(13 4)", box1, + pp_distance("POINT(13 4)", + "POINT(13 10)", strategy_pp), + strategy_pb); + + // case 4 + tester::apply("pb1-4b", "POINT(19 4)", box1, + pp_distance("POINT(19 4)", + "POINT(19 10)", strategy_pp), + strategy_pb); + + // case 5 + tester::apply("pb1-5", "POINT(15 14)", box1, 0, strategy_pb); + + // case A + tester::apply("pb1-A", "POINT(10 28)", box1, + pp_distance("POINT(10 28)", + "POINT(10 20)", strategy_pp), + strategy_pb); + + // case B + tester::apply("pb1-B", "POINT(20 28)", box1, + pp_distance("POINT(20 28)", + "POINT(20 20)", strategy_pp), + strategy_pb); + + + // case C + tester::apply("pb1-C", "POINT(14 20)", box1, 0, strategy_pb); + + // case D + tester::apply("pb1-D", "POINT(10 17)", box1, 0, strategy_pb); + + // case E + tester::apply("pb1-E", "POINT(20 11)", box1, 0, strategy_pb); + + // case F + tester::apply("pb1-F", "POINT(19 10)", box1, 0, strategy_pb); + + // case G + tester::apply("pb1-G", "POINT(10 -40)", box1, + pp_distance("POINT(10 -40)", + "POINT(10 10)", strategy_pp), + strategy_pb); + + // case H + tester::apply("pb1-H", "POINT(20 -50)", box1, + pp_distance("POINT(20 -50)", + "POINT(20 10)", strategy_pp), + strategy_pb); + + // case a + tester::apply("pb1-a", "POINT(10 20)", box1, 0, strategy_pb); + // case b + tester::apply("pb1-b", "POINT(20 20)", box1, 0, strategy_pb); + // case c + tester::apply("pb1-c", "POINT(10 10)", box1, 0, strategy_pb); + // case d + tester::apply("pb1-d", "POINT(20 10)", box1, 0, strategy_pb); + + + std::string const box2 = "BOX(170 -60,400 80)"; + + // case 1 - point is closer to western meridian + tester::apply("pb2-1a", "POINT(160 0)", box2, + ps_distance("POINT(160 0)", + "SEGMENT(170 -60,170 80)", strategy_ps), + strategy_pb); + + // case 1 - point is closer to eastern meridian + tester::apply("pb2-1b", "POINT(50 0)", box2, + ps_distance("POINT(50 0)", + "SEGMENT(40 -60,40 80)", strategy_ps), + strategy_pb); + + // case 3 - equivalent point POINT(390 85) is above the box + tester::apply("pb2-3", "POINT(30 85)", box2, + pp_distance("POINT(30 85)", + "POINT(30 80)", strategy_pp), + strategy_pb); + + // case 4 - equivalent point POINT(390 -75) is below the box + tester::apply("pb2-4", "POINT(30 -75)", box2, + pp_distance("POINT(30 -75)", + "POINT(30 -60)", strategy_pp), + strategy_pb); + + // case 5 - equivalent point POINT(390 0) is inside box + tester::apply("pb2-5", "POINT(30 0)", box2, 0, strategy_pb); + + + std::string const box3 = "BOX(-150 -50,-40 70)"; + + // case 1 - point is closer to western meridian + tester::apply("pb3-1a", "POINT(-170 10)", box3, + ps_distance("POINT(-170 10)", + "SEGMENT(-150 -50,-150 70)", strategy_ps), + strategy_pb); + + // case 2 - point is closer to eastern meridian + tester::apply("pb3-2a", "POINT(5 10)", box3, + ps_distance("POINT(5 10)", + "SEGMENT(-40 -50,-40 70)", strategy_ps), + strategy_pb); + + // case 2 - point is closer to western meridian + tester::apply("pb3-2a", "POINT(160 10)", box3, + ps_distance("POINT(160 10)", + "SEGMENT(-150 -50,-150 70)", strategy_ps), + strategy_pb); + + // case 2 - point is at equal distance from eastern and western meridian + tester::apply("pb3-2c1", "POINT(85 20)", box3, + ps_distance("POINT(85 20)", + "SEGMENT(-150 -50,-150 70)", strategy_ps), + strategy_pb); + + // case 2 - point is at equal distance from eastern and western meridian + tester::apply("pb3-2c2", "POINT(85 20)", box3, + ps_distance("POINT(85 20)", + "SEGMENT(-40 -50,-40 70)", strategy_ps), + strategy_pb); + + // box that is symmetric wrt the prime meridian + std::string const box4 = "BOX(-75 -45,75 65)"; + + // case 1 - point is closer to western meridian + tester::apply("pb4-1a", "POINT(-100 10)", box4, + ps_distance("POINT(-100 10)", + "SEGMENT(-75 -45,-75 65)", strategy_ps), + strategy_pb); + + // case 2 - point is closer to eastern meridian + tester::apply("pb4-2a", "POINT(90 15)", box4, + ps_distance("POINT(90 15)", + "SEGMENT(75 -45,75 65)", strategy_ps), + strategy_pb); + + // case 2 - point is at equal distance from eastern and western meridian + tester::apply("pb4-2c1", "POINT(-180 20)", box4, + ps_distance("POINT(-180 20)", + "SEGMENT(-75 -45,-75 65)", strategy_ps), + strategy_pb); + + // case 2 - point is at equal distance from eastern and western meridian + tester::apply("pb4-2c2", "POINT(-180 20)", box4, + ps_distance("POINT(-180 20)", + "SEGMENT(75 -45,75 65)", strategy_ps), + strategy_pb); + + + //box degenerates to a meridian segment + std::string const boxdeg1 = "BOX(0 10,0 20)"; + + tester::apply("pbd1", "POINT(1 10)", boxdeg1, + ps_distance("POINT(1 10)", + "SEGMENT(0 10, 0 20)", strategy_ps), + strategy_pb); + tester::apply("pbd2", "POINT(1 5)", boxdeg1, + ps_distance("POINT(1 5)", + "SEGMENT(0 10, 0 20)", strategy_ps), + strategy_pb); + tester::apply("pbd3", "POINT(1 15)", boxdeg1, + ps_distance("POINT(1 15)", + "SEGMENT(0 10, 0 20)", strategy_ps), + strategy_pb); + tester::apply("pbd4", "POINT(1 25)", boxdeg1, + ps_distance("POINT(1 25)", + "SEGMENT(0 10, 0 20)", strategy_ps), + strategy_pb); + + //box degenerates to a horizontal line; that is not a geodesic segment + std::string const boxdeg2 = "BOX(10 10,20 10)"; + + tester::apply("pbd5", "POINT(15 15)", boxdeg2, + pp_distance("POINT(15 15)", + "POINT(15 10)", strategy_pp), + strategy_pb); + tester::apply("pbd6", "POINT(5 15)", boxdeg2, + pp_distance("POINT(5 15)", + "POINT(10 10)", strategy_pp), + strategy_pb); + tester::apply("pbd7", "POINT(25 15)", boxdeg2, + pp_distance("POINT(25 15)", + "POINT(20 10)", strategy_pp), + strategy_pb); + + //box degenerates to a point + std::string const boxdeg3 = "BOX(0 10,0 10)"; + + tester::apply("pbd8", "POINT(1 11)", boxdeg3, + pp_distance("POINT(1 11)", + "POINT(0 10)", strategy_pp), + strategy_pb); +} + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps, + typename Strategy_pb +> +void test_distance_multipoint_box(Strategy_pp const& strategy_pp, + Strategy_ps const& strategy_ps, + Strategy_pb const& strategy_pb) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/box distance tests" << std::endl; +#endif + typedef bg::model::box box_type; + typedef bg::model::multi_point multi_point_type; + typedef test_distance_of_geometries tester; + + std::string const box1 = "BOX(10 10,20 20)"; + + tester::apply("mpb1", "MULTIPOINT(5 25,25 26)", box1, + pp_distance("POINT(5 25)", "POINT(10 20)", strategy_pp), + strategy_pb, true, false, false); + + tester::apply("mpb2", "MULTIPOINT(110 10,110 9,110 0)", box1, + ps_distance("POINT(110 10)", + "SEGMENT(20 10,20 20)", strategy_ps), + strategy_pb, true, false, false); + + tester::apply("mpb3", "MULTIPOINT(110 10,110 9,110 0,10 20)", box1, + 0, strategy_pb, true, false, false); + + tester::apply("mpb3", "MULTIPOINT(110 10,110 9,110 0,15 15)", box1, + 0, strategy_pb, true, false, false); +} + +//=========================================================================== +//=========================================================================== +//=========================================================================== + +template +< + typename Point, + typename Strategy_pp, + typename Strategy_ps, + typename Strategy_pb +> +void test_all_pl_ar(Strategy_pp pp_strategy, + Strategy_ps ps_strategy, + Strategy_pb pb_strategy) +{ + test_distance_point_ring(pp_strategy, ps_strategy); + test_distance_multipoint_ring(ps_strategy); + + test_distance_point_polygon(pp_strategy, ps_strategy); + test_distance_multipoint_polygon(pp_strategy, ps_strategy); + + test_distance_point_multipolygon(pp_strategy, ps_strategy); + test_distance_multipoint_multipolygon(pp_strategy, ps_strategy); + + test_distance_point_box(pp_strategy, ps_strategy, pb_strategy); + test_distance_multipoint_box(pp_strategy, ps_strategy, pb_strategy); + + test_more_empty_input_pointlike_areal(ps_strategy); +} + +BOOST_AUTO_TEST_CASE( test_all_pointlike_areal ) +{ + typedef bg::model::point + < + double, 2, + bg::cs::spherical_equatorial + > sph_point; + + test_all_pl_ar(spherical_pp(), spherical_ps(), spherical_pb()); + + typedef bg::model::point + < + double, 2, + bg::cs::geographic + > geo_point; + + test_all_pl_ar(vincenty_pp(), vincenty_ps(), vincenty_pb()); + test_all_pl_ar(thomas_pp(), thomas_ps(), thomas_pb()); + test_all_pl_ar(andoyer_pp(), andoyer_ps(), andoyer_pb()); + + // test with different spheroid + stype spheroid(6372000, 6370000); + test_all_pl_ar(andoyer_pp(spheroid), andoyer_ps(spheroid), andoyer_pb(spheroid)); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_pl_pl.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_pl_pl.cpp new file mode 100644 index 000000000..3027bf4d5 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_pl_pl.cpp @@ -0,0 +1,122 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2017, 2018, Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_geographic_pointlike_pointlike +#endif + +#include + +#include "test_distance_geo_common.hpp" +#include "test_empty_geometry.hpp" + +//=========================================================================== + +template +void test_distance_point_point(Strategy const& strategy) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/point distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("p-p-01", + "POINT(1 1)", + "POINT(0 0)", + strategy.apply(Point(1,1), Point(0,0)), + strategy, true, false, false); +} + +//=========================================================================== + +template +void test_distance_multipoint_point(Strategy const& strategy) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/point distance tests" << std::endl; +#endif + typedef bg::model::multi_point multi_point_type; + + typedef test_distance_of_geometries tester; + + tester::apply("mp-p-01", + "MULTIPOINT(1 1,1 2,2 3)", + "POINT(0 0)", + pp_distance("POINT(0 0)","POINT(1 1)",strategy), + strategy, true, false, false); + + tester::apply("mp-p-01", + "MULTIPOINT(0 0,0 2,2 0,2 2)", + "POINT(1.1 1.1)", + pp_distance("POINT(1.1 1.1)","POINT(2 2)",strategy), + strategy, true, false, false); +} + +//=========================================================================== + +template +void test_distance_multipoint_multipoint(Strategy const& strategy) +{ + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/multipoint distance tests" << std::endl; +#endif + typedef bg::model::multi_point multi_point_type; + + typedef test_distance_of_geometries tester; + + tester::apply("mp-mp-01", + "MULTIPOINT(1 1,1 2,2 3)", + "MULTIPOINT(0 0, 0 -1)", + pp_distance("POINT(0 0)","POINT(1 1)",strategy), + strategy, true, false, false); +} + +//=========================================================================== +//=========================================================================== +//=========================================================================== + +template +void test_all_pl_pl(Strategy pp_strategy) +{ + test_distance_point_point(pp_strategy); + test_distance_multipoint_point(pp_strategy); + test_distance_multipoint_multipoint(pp_strategy); + + test_more_empty_input_pointlike_pointlike(pp_strategy); +} + +BOOST_AUTO_TEST_CASE( test_all_pointlike_pointlike ) +{ + typedef bg::model::point + < + double, 2, + bg::cs::spherical_equatorial + > sph_point; + + test_all_pl_pl(spherical_pp()); + + typedef bg::model::point + < + double, 2, + bg::cs::geographic + > geo_point; + + test_all_pl_pl(vincenty_pp()); + test_all_pl_pl(thomas_pp()); + test_all_pl_pl(andoyer_pp()); + + test_all_pl_pl(andoyer_pp(stype(5000000,6000000))); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_se_pl_l.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_se_pl_l.cpp new file mode 100644 index 000000000..948e35a6a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_se_pl_l.cpp @@ -0,0 +1,556 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014-2018, 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 +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_spherical_equatorial_pointlike_linear +#endif + +#include + +#include "test_distance_se_common.hpp" +#include "test_empty_geometry.hpp" + +typedef bg::cs::spherical_equatorial cs_type; +typedef bg::model::point point_type; +typedef bg::model::segment segment_type; +typedef bg::model::multi_point multi_point_type; +typedef bg::model::segment segment_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_linestring multi_linestring_type; + +namespace services = bg::strategy::distance::services; +typedef bg::default_distance_result::type return_type; + +typedef bg::strategy::distance::haversine point_point_strategy; +typedef bg::strategy::distance::cross_track<> point_segment_strategy; + + +//=========================================================================== + +template +inline bg::default_distance_result::type +pp_distance(std::string const& wkt1, + std::string const& wkt2, + Strategy const& strategy) +{ + point_type p1, p2; + bg::read_wkt(wkt1, p1); + bg::read_wkt(wkt2, p2); + return bg::distance(p1, p2) * strategy.radius(); +} + +template +inline bg::default_comparable_distance_result::type +pp_comparable_distance(std::string const& wkt1, + std::string const& wkt2, + Strategy const&) +{ + point_type p1, p2; + bg::read_wkt(wkt1, p1); + bg::read_wkt(wkt2, p2); + return bg::comparable_distance(p1, p2); +} + +template +inline bg::default_distance_result::type +ps_distance(std::string const& wkt1, + std::string const& wkt2, + Strategy const& strategy) +{ + point_type p; + segment_type s; + bg::read_wkt(wkt1, p); + bg::read_wkt(wkt2, s); + return bg::distance(p, s, strategy); +} + +template +inline bg::default_comparable_distance_result::type +ps_comparable_distance(std::string const& wkt1, + std::string const& wkt2, + Strategy const& strategy) +{ + point_type p; + segment_type s; + bg::read_wkt(wkt1, p); + bg::read_wkt(wkt2, s); + return bg::comparable_distance(p, s, strategy); +} + +template +T to_comparable(Strategy const& strategy, T const& distance) +{ + namespace services = bg::strategy::distance::services; + + typedef typename services::comparable_type + < + Strategy + >::type comparable_strategy; + + typedef typename services::result_from_distance + < + comparable_strategy, + point_type, + bg::point_type::type + > get_comparable_distance; + + comparable_strategy cstrategy = services::get_comparable + < + Strategy + >::apply(strategy); + + return get_comparable_distance::apply(cstrategy, distance); +} + +//=========================================================================== + +template +void test_distance_point_segment(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/segment distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + double const d2r = bg::math::d2r(); + + tester::apply("p-s-01", + "POINT(0 0)", + "SEGMENT(2 0,3 0)", + 2.0 * d2r * strategy.radius(), + to_comparable(strategy, 2.0 * d2r * strategy.radius()), + strategy); + tester::apply("p-s-02", + "POINT(2.5 3)", + "SEGMENT(2 0,3 0)", + 3.0 * d2r * strategy.radius(), + to_comparable(strategy, 3.0 * d2r * strategy.radius()), + strategy); + tester::apply("p-s-03", + "POINT(2 0)", + "SEGMENT(2 0,3 0)", + 0, + strategy); + tester::apply("p-s-04", + "POINT(3 0)", + "SEGMENT(2 0,3 0)", + 0, + strategy); + tester::apply("p-s-05", + "POINT(2.5 0)", + "SEGMENT(2 0,3 0)", + 0, + strategy); + tester::apply("p-s-06", + "POINT(3.5 3)", + "SEGMENT(2 0,3 0)", + pp_distance("POINT(3 0)", "POINT(3.5 3)", strategy), + pp_comparable_distance("POINT(3 0)", + "POINT(3.5 3)", + strategy), + strategy); + tester::apply("p-s-07", + "POINT(0 0)", + "SEGMENT(0 10,10 10)", + ps_distance("POINT(0 0)", "SEGMENT(10 10,0 10)", strategy), + pp_comparable_distance("POINT(0 0)", + "POINT(0 10)", + strategy), + strategy); + // very small distances to segment + tester::apply("p-s-07", + "POINT(90 1e-3)", + "SEGMENT(0.5 0,175.5 0)", + 1e-3 * d2r * strategy.radius(), + to_comparable(strategy, 1e-3 * d2r * strategy.radius()), + strategy); + tester::apply("p-s-08", + "POINT(90 1e-4)", + "SEGMENT(0.5 0,175.5 0)", + 1e-4 * d2r * strategy.radius(), + to_comparable(strategy, 1e-4 * d2r * strategy.radius()), + strategy); + tester::apply("p-s-09", + "POINT(90 1e-5)", + "SEGMENT(0.5 0,175.5 0)", + 1e-5 * d2r * strategy.radius(), + to_comparable(strategy, 1e-5 * d2r * strategy.radius()), + strategy); + tester::apply("p-s-10", + "POINT(90 1e-6)", + "SEGMENT(0.5 0,175.5 0)", + 1e-6 * d2r * strategy.radius(), + to_comparable(strategy, 1e-6 * d2r * strategy.radius()), + strategy); + tester::apply("p-s-11", + "POINT(90 1e-7)", + "SEGMENT(0.5 0,175.5 0)", + 1e-7 * d2r * strategy.radius(), + to_comparable(strategy, 1e-7 * d2r * strategy.radius()), + strategy); + tester::apply("p-s-12", + "POINT(90 1e-8)", + "SEGMENT(0.5 0,175.5 0)", + 1e-8 * d2r * strategy.radius(), + to_comparable(strategy, 1e-8 * d2r * strategy.radius()), + strategy); +} + +//=========================================================================== + +template +void test_distance_point_linestring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/linestring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + double const r = strategy.radius(); + double const d2r = bg::math::d2r(); + + tester::apply("p-l-01", + "POINT(0 0)", + "LINESTRING(2 0,2 0)", + 2.0 * d2r * r, + to_comparable(strategy, 2.0 * d2r * r), + strategy); + tester::apply("p-l-02", + "POINT(0 0)", + "LINESTRING(2 0,3 0)", + 2.0 * d2r * r, + to_comparable(strategy, 2.0 * d2r * r), + strategy); + tester::apply("p-l-03", + "POINT(2.5 3)", + "LINESTRING(2 0,3 0)", + 3.0 * d2r * r, + to_comparable(strategy, 3.0 * d2r * r), + strategy); + tester::apply("p-l-04", + "POINT(2 0)", + "LINESTRING(2 0,3 0)", + 0, + strategy); + tester::apply("p-l-05", + "POINT(3 0)", + "LINESTRING(2 0,3 0)", + 0, + strategy); + tester::apply("p-l-06", + "POINT(2.5 0)", + "LINESTRING(2 0,3 0)", + 0, + strategy); + tester::apply("p-l-07", + "POINT(7.5 10)", + "LINESTRING(1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 0)", + 10.0 * d2r * r, + to_comparable(strategy, 10.0 * d2r * r), + strategy); + tester::apply("p-l-08", + "POINT(7.5 10)", + "LINESTRING(1 1,2 1,3 1,4 1,5 1,6 1,7 1,20 2,21 2)", + ps_distance("POINT(7.5 10)", "SEGMENT(7 1,20 2)", strategy), + ps_comparable_distance("POINT(7.5 10)", + "SEGMENT(7 1,20 2)", + strategy), + strategy); + + // https://svn.boost.org/trac/boost/ticket/11982 + tester::apply("p-l-09", + "POINT(10.4 63.43)", + "LINESTRING(10.733557 59.911923, 10.521812 59.887214)", + 0.06146397739758279 * r, + 0.000944156107132969, + strategy); + + //https://github.com/boostorg/geometry/issues/557 + tester::apply("p-l-issue557", + "POINT(51.99999790563572 43.71656981636763)", + "LINESTRING(52.0000243071011 43.716569742012496,\ + 52.0000121532845 43.71656942616241,\ + 52.0 43.7165690998572,\ + 51.999987847203 43.7165687638793)", + 1.35062e-08 * r, + 4.5604e-17, + strategy); + +} + +//=========================================================================== + +template +void test_distance_point_multilinestring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/multilinestring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + point_type, multi_linestring_type + > tester; + + double const d2r = bg::math::d2r(); + + tester::apply("p-ml-01", + "POINT(0 0)", + "MULTILINESTRING((-5 0,-3 0),(2 0,3 0))", + 2.0 * d2r * strategy.radius(), + to_comparable(strategy, 2.0 * d2r * strategy.radius()), + strategy); + tester::apply("p-ml-02", + "POINT(2.5 3)", + "MULTILINESTRING((-5 0,-3 0),(2 0,3 0))", + 3.0 * d2r * strategy.radius(), + to_comparable(strategy, 3.0 * d2r * strategy.radius()), + strategy); + tester::apply("p-ml-03", + "POINT(2 0)", + "MULTILINESTRING((-5 0,-3 0),(2 0,3 0))", + 0, + strategy); + tester::apply("p-ml-04", + "POINT(3 0)", + "MULTILINESTRING((-5 0,-3 0),(2 0,3 0))", + 0, + strategy); + tester::apply("p-ml-05", + "POINT(2.5 0)", + "MULTILINESTRING((-5 0,-3 0),(2 0,3 0))", + 0, + strategy); + tester::apply("p-ml-06", + "POINT(7.5 10)", + "MULTILINESTRING((-5 0,-3 0),(2 0,3 0,4 0,5 0,6 0,20 1,21 1))", + ps_distance("POINT(7.5 10)", "SEGMENT(6 0,20 1)", strategy), + ps_comparable_distance("POINT(7.5 10)", + "SEGMENT(6 0,20 1)", + strategy), + strategy); + tester::apply("p-ml-07", + "POINT(-8 10)", + "MULTILINESTRING((-20 10,-19 11,-18 10,-6 0,-5 0,-3 0),(2 0,6 0,20 1,21 1))", + ps_distance("POINT(-8 10)", "SEGMENT(-6 0,-18 10)", strategy), + ps_comparable_distance("POINT(-8 10)", + "SEGMENT(-6 0,-18 10)", + strategy), + strategy); +} + +//=========================================================================== + +template +void test_distance_linestring_multipoint(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "linestring/multipoint distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + linestring_type, multi_point_type + > tester; + + tester::apply("l-mp-01", + "LINESTRING(2 0,0 2,100 80)", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + ps_distance("POINT(1 1)", "SEGMENT(2 0,0 2)", strategy), + ps_comparable_distance("POINT(1 1)", + "SEGMENT(2 0,0 2)", + strategy), + strategy); + tester::apply("l-mp-02", + "LINESTRING(4 0,0 4,100 80)", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + ps_distance("POINT(1 1)", "SEGMENT(0 4,4 0)", strategy), + ps_comparable_distance("POINT(1 1)", + "SEGMENT(0 4,4 0)", + strategy), + strategy); + tester::apply("l-mp-03", + "LINESTRING(1 1,2 2,100 80)", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + 0, + strategy); + tester::apply("l-mp-04", + "LINESTRING(3 3,4 4,100 80)", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + pp_distance("POINT(1 1)", "POINT(3 3)", strategy), + pp_comparable_distance("POINT(1 1)", "POINT(3 3)", strategy), + strategy); + tester::apply("l-mp-05", + "LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "MULTIPOINT(1 -1,80 80,5 0,150 90)", + 0, + strategy); +} + +//=========================================================================== + +template +void test_distance_multipoint_multilinestring(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/multilinestring distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + multi_point_type, multi_linestring_type + > tester; + + tester::apply("mp-ml-01", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "MULTILINESTRING((2 0,0 2),(2 2,3 3))", + ps_distance("POINT(1 1)", "SEGMENT(2 0,0 2)", strategy), + ps_comparable_distance("POINT(1 1)", + "SEGMENT(2 0,0 2)", + strategy), + strategy); + tester::apply("mp-ml-02", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "MULTILINESTRING((3 0,0 3),(4 4,5 5))", + ps_distance("POINT(1 1)", "SEGMENT(3 0,0 3)", strategy), + ps_comparable_distance("POINT(1 1)", + "SEGMENT(3 0,0 3)", + strategy), + strategy); + tester::apply("mp-ml-03", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "MULTILINESTRING((4 4,5 5),(1 1,2 2))", + 0, + strategy); + tester::apply("mp-ml-04", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "MULTILINESTRING((4 4,3 3),(4 4,5 5))", + pp_distance("POINT(1 1)", "POINT(3 3)", strategy), + pp_comparable_distance("POINT(1 1)", "POINT(3 3)", strategy), + strategy); +} + +//=========================================================================== + +template +void test_distance_multipoint_segment(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/segment distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + double d2r = bg::math::d2r(); + + tester::apply("mp-s-01", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "SEGMENT(2 0,0 2)", + ps_distance("POINT(1 1)", "SEGMENT(2 0,0 2)", strategy), + ps_comparable_distance("POINT(1 1)", + "SEGMENT(2 0,0 2)", + strategy), + strategy); + tester::apply("mp-s-02", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "SEGMENT(0 -3,1 -10)", + 3.0 * d2r * strategy.radius(), + to_comparable(strategy, 3.0 * d2r * strategy.radius()), + strategy); + tester::apply("mp-s-03", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "SEGMENT(1 1,2 2)", + 0, + strategy); + tester::apply("mp-s-04", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "SEGMENT(3 3,4 4)", + pp_distance("POINT(1 1)", "POINT(3 3)", strategy), + pp_comparable_distance("POINT(1 1)", "POINT(3 3)", strategy), + strategy); + tester::apply("mp-s-05", + "MULTIPOINT(0 0,1 0,0 1,1 1)", + "SEGMENT(0.5 -3,1 -10)", + pp_distance("POINT(1 0)", "POINT(0.5 -3)", strategy), + pp_comparable_distance("POINT(1 0)", + "POINT(0.5 -3)", + strategy), + strategy); +} + +//=========================================================================== +//=========================================================================== +//=========================================================================== + +BOOST_AUTO_TEST_CASE( test_all_pointlike_linear ) +{ + test_distance_point_segment(point_segment_strategy()); + test_distance_point_segment(point_segment_strategy(earth_radius_km)); + test_distance_point_segment(point_segment_strategy(earth_radius_miles)); +} + +BOOST_AUTO_TEST_CASE( test_all_point_linestring ) +{ + test_distance_point_linestring(point_segment_strategy()); + test_distance_point_linestring(point_segment_strategy(earth_radius_km)); + test_distance_point_linestring(point_segment_strategy(earth_radius_miles)); +} + +BOOST_AUTO_TEST_CASE( test_all_point_multilinestring ) +{ + test_distance_point_multilinestring(point_segment_strategy()); + test_distance_point_multilinestring(point_segment_strategy(earth_radius_km)); + test_distance_point_multilinestring(point_segment_strategy(earth_radius_miles)); +} + +BOOST_AUTO_TEST_CASE( test_all_linestring_multipoint ) +{ + test_distance_linestring_multipoint(point_segment_strategy()); + test_distance_linestring_multipoint(point_segment_strategy(earth_radius_km)); + test_distance_linestring_multipoint(point_segment_strategy(earth_radius_miles)); +} + +BOOST_AUTO_TEST_CASE( test_all_multipoint_multilinestring ) +{ + test_distance_multipoint_multilinestring(point_segment_strategy()); + test_distance_multipoint_multilinestring(point_segment_strategy(earth_radius_km)); + test_distance_multipoint_multilinestring(point_segment_strategy(earth_radius_miles)); +} + +BOOST_AUTO_TEST_CASE( test_all_multipoint_segment ) +{ + test_distance_multipoint_segment(point_segment_strategy()); + test_distance_multipoint_segment(point_segment_strategy(earth_radius_km)); + test_distance_multipoint_segment(point_segment_strategy(earth_radius_miles)); +} + +BOOST_AUTO_TEST_CASE( test_all_empty_input_pointlike_linear ) +{ + test_more_empty_input_pointlike_linear + < + point_type + >(point_segment_strategy()); + + test_more_empty_input_pointlike_linear + < + point_type + >(point_segment_strategy(earth_radius_km)); + + test_more_empty_input_pointlike_linear + < + point_type + >(point_segment_strategy(earth_radius_miles)); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/distance_se_pl_pl.cpp b/src/boost/libs/geometry/test/algorithms/distance/distance_se_pl_pl.cpp new file mode 100644 index 000000000..56c0a6e46 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/distance_se_pl_pl.cpp @@ -0,0 +1,299 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014-2018, 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 +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_distance_spherical_equatorial_pointlike_pointlike +#endif + +#include + +#include +#include + +#include "test_distance_se_common.hpp" +#include "test_empty_geometry.hpp" + +typedef bg::cs::spherical_equatorial cs_type; +typedef bg::model::point point_type; +typedef bg::model::multi_point multi_point_type; + +namespace distance = bg::strategy::distance; +namespace services = distance::services; +typedef bg::default_distance_result::type return_type; + +typedef distance::haversine point_point_strategy; +typedef distance::comparable::haversine comparable_point_point_strategy; + +//=========================================================================== + +template +inline typename bg::distance_result::type +distance_from_wkt(std::string const& wkt1, + std::string const& wkt2, + Strategy const& strategy) +{ + point_type p1, p2; + bg::read_wkt(wkt1, p1); + bg::read_wkt(wkt2, p2); + return bg::distance(p1, p2, strategy); +} + +inline bg::default_comparable_distance_result::type +comparable_distance_from_wkt(std::string const& wkt1, + std::string const& wkt2) +{ + point_type p1, p2; + bg::read_wkt(wkt1, p1); + bg::read_wkt(wkt2, p2); + return bg::comparable_distance(p1, p2); +} + +//=========================================================================== + +template +void test_distance_point_point(Strategy const& strategy, + bool is_comparable_strategy = false) +{ + double pi = bg::math::pi(); + double r = strategy.radius(); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/point distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("p-p-01", + "POINT(10 10)", + "POINT(0 0)", + (is_comparable_strategy + ? 0.0150768448035229 + : (0.24619691677893202 * r)), + 0.0150768448035229, + strategy); + tester::apply("p-p-02", + "POINT(10 10)", + "POINT(10 10)", + 0, + strategy); + + // antipodal points + tester::apply("p-p-03", + "POINT(0 10)", + "POINT(180 -10)", + (is_comparable_strategy + ? 1.0 + : (pi * r)), + 1.0, + strategy); + tester::apply("p-p-04", + "POINT(0 0)", + "POINT(180 0)", + (is_comparable_strategy + ? 1.0 + : (pi * r)), + 1.0, + strategy); + + // https://svn.boost.org/trac/boost/ticket/11982 + tester::apply("p-p-05", + "POINT(10.521812 59.887214)", + "POINT(10.4 63.43)", + (is_comparable_strategy + ? 0.00095578716185788 + : (0.06184146915711819 * r)), + 0.00095578716185788, + strategy); + tester::apply("p-p-06", + "POINT(10.733557 59.911923)", + "POINT(10.4 63.43)", + (is_comparable_strategy + ? 0.0009441561071329 + : (0.0614639773975828 * r)), + 0.000944156107132969, + strategy); +} + +//=========================================================================== + +template +void test_distance_point_multipoint(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "point/multipoint distance tests" << std::endl; +#endif + typedef test_distance_of_geometries tester; + + tester::apply("p-mp-01", + "POINT(10 10)", + "MULTIPOINT(10 10,20 10,20 20,10 20)", + 0, + strategy); + tester::apply("p-mp-02", + "POINT(10 10)", + "MULTIPOINT(20 20,20 30,30 20,30 30)", + distance_from_wkt("POINT(10 10)", "POINT(20 20)", strategy), + comparable_distance_from_wkt("POINT(10 10)", "POINT(20 20)"), + strategy); + tester::apply("p-mp-03", + "POINT(3 0)", + "MULTIPOINT(20 20,20 40,40 20,40 40)", + distance_from_wkt("POINT(3 0)", "POINT(20 20)", strategy), + comparable_distance_from_wkt("POINT(3 0)", "POINT(20 20)"), + strategy); + + // almost antipodal points + tester::apply("p-mp-04", + "POINT(179 2)", + "MULTIPOINT(3 3,4 3,4 4,3 4)", + distance_from_wkt("POINT(179 2)", "POINT(4 4)", strategy), + comparable_distance_from_wkt("POINT(179 2)", "POINT(4 4)"), + strategy); + + // minimum distance across the dateline + tester::apply("p-mp-05", + "POINT(355 5)", + "MULTIPOINT(10 10,20 10,20 20,10 20)", + distance_from_wkt("POINT(355 5)", "POINT(10 10)", strategy), + comparable_distance_from_wkt("POINT(355 5)", "POINT(10 10)"), + strategy); + tester::apply("p-mp-06", + "POINT(-5 5)", + "MULTIPOINT(10 10,20 10,20 20,10 20)", + distance_from_wkt("POINT(-5 5)", "POINT(10 10)", strategy), + comparable_distance_from_wkt("POINT(-5 5)", "POINT(10 10)"), + strategy); +} + +//=========================================================================== + +template +void test_distance_multipoint_multipoint(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "multipoint/multipoint distance tests" << std::endl; +#endif + typedef test_distance_of_geometries + < + multi_point_type, multi_point_type + > tester; + + tester::apply("mp-mp-01", + "MULTIPOINT(10 10,11 10,10 11,11 11)", + "MULTIPOINT(11 11,12 11,12 12,11 12)", + 0, + strategy); + tester::apply("mp-mp-02", + "MULTIPOINT(10 10,11 10,10 11,11 11)", + "MULTIPOINT(12 12,12 13,13 12,13 13)", + distance_from_wkt("POINT(11 11)", "POINT(12 12)", strategy), + comparable_distance_from_wkt("POINT(11 11)", "POINT(12 12)"), + strategy); + + // example with many points in each multi-point so that the r-tree + // does some splitting. + tester::apply("mp-mp-03", + "MULTIPOINT(1 1,1 2,1 3,1 4,1 5,1 6,1 7,1 8,1 9,1 10,\ + 2 1,2 2,2 3,2 4,2 5,2 6,2 7,2 8,2 9,2 10,\ + 3 1,3 2,3 3,3 4,3 5,3 6,3 7,3 8,3 9,3 10,\ + 10 1,10 10)", + "MULTIPOINT(11 11,11 12,11 13,11 14,11 15,\ + 11 16,11 17,11 18,11 19,11 20,\ + 12 11,12 12,12 13,12 24,12 15,\ + 12 16,12 17,12 18,12 29,12 20,\ + 13 11,13 12,13 13,13 24,13 15,\ + 13 16,13 17,13 18,13 29,13 20,\ + 20 11,20 20)", + distance_from_wkt("POINT(10 10)", "POINT(11 11)", strategy), + comparable_distance_from_wkt("POINT(10 10)", "POINT(11 11)"), + strategy); + +} + +//=========================================================================== + +BOOST_AUTO_TEST_CASE( test_all_pointlike_pointlike ) +{ + test_distance_point_point(point_point_strategy()); + test_distance_point_point(point_point_strategy(earth_radius_km)); + test_distance_point_point(point_point_strategy(earth_radius_miles)); + + test_distance_point_point(comparable_point_point_strategy(), true); + test_distance_point_point + (comparable_point_point_strategy(earth_radius_km), true); + test_distance_point_point + (comparable_point_point_strategy(earth_radius_miles), true); +} + +BOOST_AUTO_TEST_CASE( test_all_point_multipoint ) +{ + test_distance_point_multipoint(point_point_strategy()); + test_distance_point_multipoint(point_point_strategy(earth_radius_km)); + test_distance_point_multipoint(point_point_strategy(earth_radius_miles)); + + test_distance_point_multipoint(comparable_point_point_strategy()); + test_distance_point_multipoint + (comparable_point_point_strategy(earth_radius_km)); + test_distance_point_multipoint + (comparable_point_point_strategy(earth_radius_miles)); +} + +BOOST_AUTO_TEST_CASE( test_all_multipoint_multipoint ) +{ + test_distance_multipoint_multipoint(point_point_strategy()); + test_distance_multipoint_multipoint(point_point_strategy(earth_radius_km)); + test_distance_multipoint_multipoint + (point_point_strategy(earth_radius_miles)); + + test_distance_multipoint_multipoint(comparable_point_point_strategy()); + test_distance_multipoint_multipoint + (comparable_point_point_strategy(earth_radius_km)); + test_distance_multipoint_multipoint + (comparable_point_point_strategy(earth_radius_miles)); +} + +BOOST_AUTO_TEST_CASE( test_all_empty_input_pointlike_pointlike ) +{ + test_more_empty_input_pointlike_pointlike + < + point_type + >(point_point_strategy()); + + test_more_empty_input_pointlike_pointlike + < + point_type + >(point_point_strategy(earth_radius_km)); + + test_more_empty_input_pointlike_pointlike + < + point_type + >(point_point_strategy(earth_radius_miles)); + + test_more_empty_input_pointlike_pointlike + < + point_type + >(comparable_point_point_strategy()); + + test_more_empty_input_pointlike_pointlike + < + point_type + >(comparable_point_point_strategy(earth_radius_km)); + + test_more_empty_input_pointlike_pointlike + < + point_type + >(comparable_point_point_strategy(earth_radius_miles)); +} diff --git a/src/boost/libs/geometry/test/algorithms/distance/test_distance.hpp b/src/boost/libs/geometry/test/algorithms/distance/test_distance.hpp new file mode 100644 index 000000000..cfda00e29 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/test_distance.hpp @@ -0,0 +1,138 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef BOOST_GEOMETRY_TEST_DISTANCE_HPP +#define BOOST_GEOMETRY_TEST_DISTANCE_HPP + +#include + +#include +#include +#include + +// Define a custom distance strategy +// For this one, the "taxicab" distance, +// see http://en.wikipedia.org/wiki/Taxicab_geometry + +// For a point-point-distance operation, one typename Point is enough. +// For a point-segment-distance operation, there is some magic inside +// using another point type and casting if necessary. Therefore, +// two point-types are necessary. +struct taxicab_distance +{ + template + static inline typename bg::coordinate_type::type apply( + P1 const& p1, P2 const& p2) + { + using bg::get; + using bg::math::abs; + return abs(get<0>(p1) - get<1>(p2)) + + abs(get<1>(p1) - get<1>(p2)); + } +}; + + + +namespace boost { namespace geometry { namespace strategy { namespace distance { namespace services +{ + +template <> +struct tag +{ + typedef strategy_tag_distance_point_point type; +}; + + +template +struct return_type +{ + typedef typename coordinate_type::type type; +}; + + +template <> +struct comparable_type +{ + typedef taxicab_distance type; +}; + +template <> +struct get_comparable +{ + static inline taxicab_distance apply(taxicab_distance const& input) + { + return input; + } +}; + +template +struct result_from_distance +{ + template + static inline typename coordinate_type::type apply(taxicab_distance const& , T const& value) + { + return value; + } +}; + + +}}}}} // namespace bg::strategy::distance::services + + + + + +template +void test_distance(Geometry1 const& geometry1, + Geometry2 const& geometry2, + long double expected_distance) +{ + typename bg::default_distance_result::type distance = bg::distance(geometry1, geometry2); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::ostringstream out; + out << typeid(typename bg::coordinate_type::type).name() + << std::endl + << typeid(typename bg::default_distance_result::type).name() + << std::endl + << "distance : " << bg::distance(geometry1, geometry2) + << std::endl; + std::cout << out.str(); +#endif + + BOOST_CHECK_CLOSE(distance, expected_distance, 0.0001); +} + + +template +void test_geometry(std::string const& wkt1, std::string const& wkt2, double expected_distance) +{ + Geometry1 geometry1; + bg::read_wkt(wkt1, geometry1); + Geometry2 geometry2; + bg::read_wkt(wkt2, geometry2); + + test_distance(geometry1, geometry2, expected_distance); +} + +template +void test_empty_input(Geometry1 const& geometry1, Geometry2 const& geometry2) +{ + try + { + bg::distance(geometry1, geometry2); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "A empty_input_exception should have been thrown" ); +} + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/distance/test_distance_common.hpp b/src/boost/libs/geometry/test/algorithms/distance/test_distance_common.hpp new file mode 100644 index 000000000..bed7afe5f --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/test_distance_common.hpp @@ -0,0 +1,611 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_TEST_DISTANCE_COMMON_HPP +#define BOOST_GEOMETRY_TEST_DISTANCE_COMMON_HPP + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include +#include + + +#ifndef BOOST_GEOMETRY_TEST_DISTANCE_HPP + +namespace bg = ::boost::geometry; + +// function copied from BG's test_distance.hpp + +template +void test_empty_input(Geometry1 const& geometry1, Geometry2 const& geometry2) +{ + try + { + bg::distance(geometry1, geometry2); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "A empty_input_exception should have been thrown" ); +} +#endif // BOOST_GEOMETRY_TEST_DISTANCE_HPP + +//======================================================================== + + + +#ifdef BOOST_GEOMETRY_TEST_DEBUG +// pretty print geometry -- START +template +struct pretty_print_geometry_dispatch +{ + template + static inline Stream& apply(Geometry const& geometry, Stream& os) + { + os << bg::wkt(geometry); + return os; + } +}; + +template +struct pretty_print_geometry_dispatch +{ + template + static inline Stream& apply(Geometry const& geometry, Stream& os) + { + os << "SEGMENT" << bg::dsv(geometry); + return os; + } +}; + +template +struct pretty_print_geometry_dispatch +{ + template + static inline Stream& apply(Geometry const& geometry, Stream& os) + { + os << "BOX" << bg::dsv(geometry); + return os; + } +}; + + +template +struct pretty_print_geometry +{ + template + static inline Stream& apply(Geometry const& geometry, Stream& os) + { + return pretty_print_geometry_dispatch + < + Geometry, typename bg::tag::type + >::apply(geometry, os); + } +}; +// pretty print geometry -- END +#endif // BOOST_GEOMETRY_TEST_DEBUG + + +//======================================================================== + + +template +struct check_equal +{ + static inline void apply(T const& detected, T const& expected, + bool is_finite) + { + if (is_finite) + { + BOOST_CHECK(detected == expected); + } + else + { + BOOST_CHECK(! boost::math::isfinite(detected)); + } + } +}; + +template <> +struct check_equal +{ + static inline void apply(double detected, double expected, + bool is_finite) + { + if (is_finite) + { + BOOST_CHECK_CLOSE(detected, expected, 0.0001); + } + else + { + BOOST_CHECK(! boost::math::isfinite(detected)); + } + } +}; + + +//======================================================================== + +template +< + typename Geometry1, typename Geometry2, + int id1 = bg::geometry_id::value, + int id2 = bg::geometry_id::value +> +struct test_distance_of_geometries + : public test_distance_of_geometries +{}; + +#ifdef BOOST_GEOMETRY_TEST_DEBUG +#define ENABLE_IF_DEBUG(ID) ID +#else +#define ENABLE_IF_DEBUG(ID) +#endif + +template +class test_distance_of_geometries +{ +private: + template + < + typename G1, + typename G2, + typename DistanceType, + typename ComparableDistanceType, + typename Strategy + > + static inline + void base_test(std::string const& ENABLE_IF_DEBUG(header), + G1 const& g1, G2 const& g2, + DistanceType const& expected_distance, + ComparableDistanceType const& expected_comparable_distance, + Strategy const& strategy, + bool is_finite) + { + typedef typename bg::default_distance_result + < + G1, G2 + >::type default_distance_result; + + typedef typename bg::strategy::distance::services::return_type + < + Strategy, G1, G2 + >::type distance_result_from_strategy; + + static const bool same_regular = boost::is_same + < + default_distance_result, + distance_result_from_strategy + >::type::value; + + BOOST_CHECK( same_regular ); + + + typedef typename bg::default_comparable_distance_result + < + G1, G2 + >::type default_comparable_distance_result; + + typedef typename bg::strategy::distance::services::return_type + < + typename bg::strategy::distance::services::comparable_type + < + Strategy + >::type, + G1, + G2 + >::type comparable_distance_result_from_strategy; + + static const bool same_comparable = boost::is_same + < + default_comparable_distance_result, + comparable_distance_result_from_strategy + >::type::value; + + BOOST_CHECK( same_comparable ); + + + // check distance with default strategy + default_distance_result dist_def = bg::distance(g1, g2); + + check_equal + < + default_distance_result + >::apply(dist_def, expected_distance, is_finite); + + + // check distance with passed strategy + distance_result_from_strategy dist = bg::distance(g1, g2, strategy); + + check_equal + < + default_distance_result + >::apply(dist, expected_distance, is_finite); + + + // check comparable distance with default strategy + default_comparable_distance_result cdist_def = + bg::comparable_distance(g1, g2); + + check_equal + < + default_comparable_distance_result + >::apply(cdist_def, expected_comparable_distance, is_finite); + + + // check comparable distance with passed strategy + comparable_distance_result_from_strategy cdist = + bg::comparable_distance(g1, g2, strategy); + + check_equal + < + default_comparable_distance_result + >::apply(cdist, expected_comparable_distance, is_finite); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << string_from_type::type>::name() + << string_from_type::type>::name() + << " -> " + << string_from_type::name() + << string_from_type::name() + << std::endl; + + std::cout << "distance" << header + << " (def. strategy) = " << dist_def << " ; " + << "distance" << header + <<" (passed strategy) = " << dist << " ; " + << "comp. distance" << header <<" (def. strategy) = " + << cdist_def << " ; " + << "comp. distance" << header <<" (passed strategy) = " + << cdist << std::endl; +#endif + } + +public: + template + < + typename DistanceType, + typename ComparableDistanceType, + typename Strategy + > + static inline + void apply(std::string const& wkt1, + std::string const& wkt2, + DistanceType const& expected_distance, + ComparableDistanceType const& expected_comparable_distance, + Strategy const& strategy, + bool is_finite = true) + { + Geometry1 geometry1 = from_wkt(wkt1); + Geometry2 geometry2 = from_wkt(wkt2); + + apply(geometry1, geometry2, + expected_distance, expected_comparable_distance, + strategy, is_finite); + } + + + template + < + typename DistanceType, + typename ComparableDistanceType, + typename Strategy + > + static inline + void apply(Geometry1 const& geometry1, + Geometry2 const& geometry2, + DistanceType const& expected_distance, + ComparableDistanceType const& expected_comparable_distance, + Strategy const& strategy, + bool is_finite = true) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + typedef pretty_print_geometry PPG1; + typedef pretty_print_geometry PPG2; + PPG1::apply(geometry1, std::cout); + std::cout << " - "; + PPG2::apply(geometry2, std::cout); + std::cout << std::endl; +#endif + + base_test("", geometry1, geometry2, + expected_distance, expected_comparable_distance, + strategy, is_finite); + + base_test("[reversed args]", geometry2, geometry1, + expected_distance, expected_comparable_distance, + strategy, is_finite); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; +#endif + } +}; + + +//======================================================================== + +template +struct test_distance_of_geometries +< + Segment, Polygon, + 92 /* segment */, 3 /* polygon */ +> + : public test_distance_of_geometries +{ + typedef test_distance_of_geometries base; + + typedef typename bg::ring_type::type ring_type; + + template + < + typename DistanceType, + typename ComparableDistanceType, + typename Strategy + > + static inline + void apply(std::string const& wkt_segment, + std::string const& wkt_polygon, + DistanceType const& expected_distance, + ComparableDistanceType const& expected_comparable_distance, + Strategy const& strategy, + bool is_finite = true) + { + Segment segment = from_wkt(wkt_segment); + Polygon polygon = from_wkt(wkt_polygon); + apply(segment, + polygon, + expected_distance, + expected_comparable_distance, + strategy, + is_finite); + } + + + template + < + typename DistanceType, + typename ComparableDistanceType, + typename Strategy + > + static inline + void apply(Segment const& segment, + Polygon const& polygon, + DistanceType const& expected_distance, + ComparableDistanceType const& expected_comparable_distance, + Strategy const& strategy, + bool is_finite = true) + { + base::apply(segment, polygon, expected_distance, + expected_comparable_distance, strategy, is_finite); + + if ( bg::num_interior_rings(polygon) == 0 ) { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "... testing also exterior ring ..." << std::endl; +#endif + test_distance_of_geometries + < + Segment, ring_type + >::apply(segment, + bg::exterior_ring(polygon), + expected_distance, + expected_comparable_distance, + strategy, + is_finite); + } + } +}; + +//======================================================================== + +template +struct test_distance_of_geometries +< + Box, Segment, + 94 /* box */, 92 /* segment */ +> +{ + template + < + typename DistanceType, + typename ComparableDistanceType, + typename Strategy + > + static inline + void apply(std::string const& wkt_box, + std::string const& wkt_segment, + DistanceType const& expected_distance, + ComparableDistanceType const& expected_comparable_distance, + Strategy const& strategy, + bool is_finite = true) + { + test_distance_of_geometries + < + Segment, Box, 92, 94 + >::apply(wkt_segment, + wkt_box, + expected_distance, + expected_comparable_distance, + strategy, + is_finite); + } +}; + + +template +struct test_distance_of_geometries +< + Segment, Box, + 92 /* segment */, 94 /* box */ +> + : public test_distance_of_geometries +{ + typedef test_distance_of_geometries base; + + template + < + typename DistanceType, + typename ComparableDistanceType, + typename Strategy + > + static inline + void apply(std::string const& wkt_segment, + std::string const& wkt_box, + DistanceType const& expected_distance, + ComparableDistanceType const& expected_comparable_distance, + Strategy const& strategy, + bool is_finite = true) + { + Segment segment = from_wkt(wkt_segment); + Box box = from_wkt(wkt_box); + apply(segment, + box, + expected_distance, + expected_comparable_distance, + strategy, + is_finite); + } + + + template + < + typename DistanceType, + typename ComparableDistanceType, + typename Strategy + > + static inline + void apply(Segment const& segment, + Box const& box, + DistanceType const& expected_distance, + ComparableDistanceType const& expected_comparable_distance, + Strategy const& strategy, + bool is_finite = true) + { + typedef typename bg::strategy::distance::services::return_type + < + Strategy, Segment, Box + >::type distance_result_type; + + typedef typename bg::strategy::distance::services::comparable_type + < + Strategy + >::type comparable_strategy; + + typedef typename bg::strategy::distance::services::return_type + < + comparable_strategy, Segment, Box + >::type comparable_distance_result_type; + + + base::apply(segment, box, expected_distance, + expected_comparable_distance, strategy, is_finite); + + comparable_strategy cstrategy = + bg::strategy::distance::services::get_comparable + < + Strategy + >::apply(strategy); + + distance_result_type distance_generic = + bg::detail::distance::segment_to_box_2D_generic + < + Segment, Box, Strategy + >::apply(segment, box, strategy); + + comparable_distance_result_type comparable_distance_generic = + bg::detail::distance::segment_to_box_2D_generic + < + Segment, Box, comparable_strategy + >::apply(segment, box, cstrategy); + + + check_equal + < + distance_result_type + >::apply(distance_generic, expected_distance, is_finite); + + check_equal + < + comparable_distance_result_type + >::apply(comparable_distance_generic, + expected_comparable_distance, + is_finite); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "... testing with naive seg-box distance algorithm..." + << std::endl; + std::cout << "distance (generic algorithm) = " + << distance_generic << " ; " + << "comp. distance (generic algorithm) = " + << comparable_distance_generic + << std::endl; + std::cout << std::endl << std::endl; +#endif + } +}; + +//======================================================================== + + +template +void test_empty_input(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) +{ + try + { + bg::distance(geometry1, geometry2, strategy); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "A empty_input_exception should have been thrown" ); + + try + { + bg::distance(geometry2, geometry1, strategy); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "A empty_input_exception should have been thrown" ); +} + +#endif // BOOST_GEOMETRY_TEST_DISTANCE_COMMON_HPP diff --git a/src/boost/libs/geometry/test/algorithms/distance/test_distance_geo_common.hpp b/src/boost/libs/geometry/test/algorithms/distance/test_distance_geo_common.hpp new file mode 100644 index 000000000..dfb4c7e64 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/test_distance_geo_common.hpp @@ -0,0 +1,577 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2016-2017, Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_TEST_DISTANCE_GEO_COMMON_HPP +#define BOOST_GEOMETRY_TEST_DISTANCE_GEO_COMMON_HPP + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include +#include + +#include "distance_brute_force.hpp" + +namespace bg = ::boost::geometry; + +typedef bg::srs::spheroid stype; + +// Spherical strategy for point-point distance + +typedef bg::strategy::distance::haversine spherical_pp; + +// Geo strategies for point-point distance + +typedef bg::strategy::distance::andoyer andoyer_pp; +typedef bg::strategy::distance::thomas thomas_pp; +typedef bg::strategy::distance::vincenty vincenty_pp; + +// Spherical strategy for point-segment distance + +typedef bg::strategy::distance::cross_track<> spherical_ps; + +// Geo strategies for point-segment distance + +typedef bg::strategy::distance::geographic_cross_track + andoyer_ps; + +typedef bg::strategy::distance::geographic_cross_track + thomas_ps; + +typedef bg::strategy::distance::geographic_cross_track + vincenty_ps; + +typedef bg::strategy::distance::detail::geographic_cross_track + vincenty_ps_bisection; + +// Spherical strategy for point-box distance + +typedef bg::strategy::distance::cross_track_point_box<> spherical_pb; + +// Geo strategies for point-box distance + +typedef bg::strategy::distance::geographic_cross_track_point_box +< + bg::strategy::andoyer, + stype, + double +> andoyer_pb; + +typedef bg::strategy::distance::geographic_cross_track_point_box +< + bg::strategy::thomas, + stype, + double +> thomas_pb; + +typedef bg::strategy::distance::geographic_cross_track_point_box +< + bg::strategy::vincenty, + stype, + double +> vincenty_pb; + +// Spherical strategy for segment-box distance + +typedef bg::strategy::distance::spherical_segment_box<> spherical_sb; + +// Geo strategies for segment-box distance + +typedef bg::strategy::distance::geographic_segment_box + andoyer_sb; + +typedef bg::strategy::distance::geographic_segment_box + thomas_sb; + +typedef bg::strategy::distance::geographic_segment_box + vincenty_sb; + +// Strategies for box-box distance + +typedef bg::strategy::distance::cross_track_box_box<> spherical_bb; + +typedef bg::strategy::distance::geographic_cross_track_box_box + < + bg::strategy::andoyer, + stype, + double + > andoyer_bb; + +typedef bg::strategy::distance::geographic_cross_track_box_box + < + bg::strategy::thomas, + stype, + double + > thomas_bb; + +typedef bg::strategy::distance::geographic_cross_track_box_box + < + bg::strategy::vincenty, + stype, + double + > vincenty_bb; + +//=========================================================================== + +template +inline typename bg::default_distance_result::type +pp_distance(std::string const& wkt1, + std::string const& wkt2, + Strategy const& strategy) +{ + Point p1, p2; + bg::read_wkt(wkt1, p1); + bg::read_wkt(wkt2, p2); + return bg::distance(p1, p2, strategy); +} + +//=========================================================================== + +template +inline typename bg::default_distance_result::type +ps_distance(std::string const& wkt1, + std::string const& wkt2, + Strategy const& strategy) +{ + Point p; + typedef bg::model::segment segment_type; + segment_type s; + bg::read_wkt(wkt1, p); + bg::read_wkt(wkt2, s); + return bg::distance(p, s, strategy); +} + +//=========================================================================== + +template +inline typename bg::default_distance_result::type +sb_distance(std::string const& wkt1, + std::string const& wkt2, + Strategy const& strategy) +{ + typedef bg::model::segment segment_type; + typedef bg::model::box box_type; + segment_type s; + box_type b; + bg::read_wkt(wkt1, s); + bg::read_wkt(wkt2, b); + return bg::distance(s, b, strategy); +} + +//=================================================================== + +template struct dispatch +{ + //tag dispatching for swaping arguments in segments + template + static inline T swap(T const& t) + { + return t; + } + + // mirror geometry w.r.t. equator + template + static inline T mirror(T const& t) + { + return t; + } +}; + +// Specialization for segments +template <> struct dispatch +{ + template + static inline Segment swap(Segment const& s) + { + Segment s_swaped; + + bg::set<0, 0>(s_swaped, bg::get<1, 0>(s)); + bg::set<0, 1>(s_swaped, bg::get<1, 1>(s)); + bg::set<1, 0>(s_swaped, bg::get<0, 0>(s)); + bg::set<1, 1>(s_swaped, bg::get<0, 1>(s)); + + return s_swaped; + } + + template + static inline Segment mirror(Segment const& s) + { + Segment s_mirror; + + bg::set<0, 0>(s_mirror, bg::get<0, 0>(s)); + bg::set<0, 1>(s_mirror, bg::get<0, 1>(s) * -1); + bg::set<1, 0>(s_mirror, bg::get<1, 0>(s)); + bg::set<1, 1>(s_mirror, bg::get<1, 1>(s) * -1); + + return s_mirror; + } +}; + +// Specialization for boxes +template <> struct dispatch +{ + template + static inline T swap(T const& t) + { + return t; + } + + template + static inline Box mirror(Box const& b) + { + Box b_mirror; + + bg::set<0, 0>(b_mirror, bg::get(b)); + bg::set<0, 1>(b_mirror, bg::get(b) * -1); + bg::set<1, 0>(b_mirror, bg::get(b)); + bg::set<1, 1>(b_mirror, bg::get(b) * -1); + + return b_mirror; + } +}; + + +// Specialization for points +template <> struct dispatch +{ + template + static inline T swap(T const& t) + { + return t; + } + + template + static inline Point mirror(Point const& p) + { + Point p_mirror; + + bg::set<0>(p_mirror, bg::get<0>(p)); + bg::set<1>(p_mirror, bg::get<1>(p) * -1); + + return p_mirror; + } +}; + +//======================================================================== + + +template +struct check_equal +{ + template + struct equal_to + { + static inline void apply(Value const& x, Value const& y) + { + BOOST_CHECK(x == y); + } + }; + + template + struct equal_to + { + static inline void apply(double x, double y) + { + BOOST_CHECK_CLOSE(x, y, 0.001); + } + }; + + template + static inline void apply(std::string const& /*case_id*/, + std::string const& /*subcase_id*/, + Geometry1 const& /*geometry1*/, + Geometry2 const& /*geometry2*/, + T const& detected, + T const& expected) + { + equal_to::apply(expected, detected); + } +}; + +//======================================================================== + +template +< + typename Geometry1, typename Geometry2, + int id1 = bg::geometry_id::value, + int id2 = bg::geometry_id::value +> +struct test_distance_of_geometries + : public test_distance_of_geometries +{}; + + +template +struct test_distance_of_geometries +{ + template + static inline + void apply(std::string const& case_id, + std::string const& wkt1, + std::string const& wkt2, + DistanceType const& expected_distance, + Strategy const& strategy, + bool test_reversed = true, + bool swap_geometry_args = false, + bool mirror_geometry = true) + { + Geometry1 geometry1 = from_wkt(wkt1); + Geometry2 geometry2 = from_wkt(wkt2); + + apply(case_id, geometry1, geometry2, + expected_distance, + strategy, test_reversed, swap_geometry_args, + mirror_geometry); + } + + + template + < + typename DistanceType, + typename Strategy + > + static inline + void apply(std::string const& case_id, + Geometry1 const& geometry1, + Geometry2 const& geometry2, + DistanceType const& expected_distance, + Strategy const& strategy, + bool test_reversed = true, + bool swap_geometry_args = false, + bool mirror_geometry = true) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "case ID: " << case_id << "; " + << "G1: " << bg::wkt(geometry1) + << " - " + << "G2: " << bg::wkt(geometry2) + << std::endl; +#endif + namespace services = bg::strategy::distance::services; + + using bg::unit_test::distance_brute_force; + + typedef typename bg::default_distance_result + < + Geometry1, Geometry2 + >::type default_distance_result; + + typedef typename services::return_type + < + Strategy, Geometry1, Geometry2 + >::type distance_result_from_strategy; + + static const bool same_regular = boost::is_same + < + default_distance_result, + distance_result_from_strategy + >::type::value; + + BOOST_CHECK(same_regular); + + // check distance with passed strategy + distance_result_from_strategy dist = + bg::distance(geometry1, geometry2, strategy); + + check_equal + < + distance_result_from_strategy + >::apply(case_id, "a", geometry1, geometry2, + dist, expected_distance); + + // check against the comparable distance computed in a + // brute-force manner + default_distance_result dist_brute_force + = distance_brute_force(geometry1, geometry2, strategy); + + check_equal + < + default_distance_result + >::apply(case_id, "b", geometry1, geometry2, + dist_brute_force, expected_distance); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << string_from_type::type>::name() + << string_from_type::type>::name() + << " -> " + << string_from_type::name() + << std::endl; + std::cout << "expected distance = " << std::setprecision(10) + << expected_distance << " ; " + << std::endl; + std::cout << "distance = " << std::setprecision(10) + << dist << " ; " + << std::endl; + + if ( !test_reversed ) + { + std::cout << std::endl; + } +#endif + + if ( test_reversed ) + { + // check distance with given strategy + dist = bg::distance(geometry2, geometry1, strategy); + + check_equal + < + default_distance_result + >::apply(case_id, "ra", geometry2, geometry1, + dist, expected_distance); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "distance[reversed args] = " << std::setprecision(10) + << dist + << std::endl; +#endif + } + + if (swap_geometry_args) + { + Geometry1 g1 = dispatch + < + typename boost::geometry::tag::type + >::swap(geometry1); + + Geometry2 g2 = dispatch + < + typename boost::geometry::tag::type + >::swap(geometry2); + + // check distance with given strategy + dist = bg::distance(g1, g2, strategy); + + check_equal + < + default_distance_result + >::apply(case_id, "swap", g1, g2, + dist, expected_distance); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "distance[swap geometry args] = " << std::setprecision(10) + << dist + << std::endl; + std::cout << std::endl; +#endif + } + if (mirror_geometry) + { + Geometry1 g1 = dispatch + < + typename boost::geometry::tag::type + >::mirror(geometry1); + + Geometry2 g2 = dispatch + < + typename boost::geometry::tag::type + >::mirror(geometry2); + + // check distance with given strategy + dist = bg::distance(g1, g2, strategy); + + check_equal + < + default_distance_result + >::apply(case_id, "mirror", g1, g2, + dist, expected_distance); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "distance[mirror geometries] = " << std::setprecision(10) + << dist + << std::endl; + std::cout << std::endl; +#endif + } +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; +#endif + + } +}; + + +//======================================================================== + + +template +void test_empty_input(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) +{ + try + { + bg::distance(geometry1, geometry2); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, + "A empty_input_exception should have been thrown"); + + try + { + bg::distance(geometry2, geometry1); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, + "A empty_input_exception should have been thrown"); + + try + { + bg::distance(geometry1, geometry2, strategy); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, + "A empty_input_exception should have been thrown"); + + try + { + bg::distance(geometry2, geometry1, strategy); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, + "A empty_input_exception should have been thrown"); +} + +#endif // BOOST_GEOMETRY_TEST_DISTANCE_GEO_COMMON_HPP diff --git a/src/boost/libs/geometry/test/algorithms/distance/test_distance_se_common.hpp b/src/boost/libs/geometry/test/algorithms/distance/test_distance_se_common.hpp new file mode 100644 index 000000000..1909c27f9 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/test_distance_se_common.hpp @@ -0,0 +1,381 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_TEST_DISTANCE_SE_COMMON_HPP +#define BOOST_GEOMETRY_TEST_DISTANCE_SE_COMMON_HPP + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include "distance_brute_force.hpp" + +namespace bg = ::boost::geometry; + +static const double earth_radius_km = 6371.0; +static const double earth_radius_miles = 3959.0; + + +//======================================================================== + + +template +struct check_equal +{ + template + struct equal_to + { + static inline void apply(Value const& x, Value const& y) + { + BOOST_CHECK(x == y); + } + }; + + template + struct equal_to + { + static inline void apply(double x, double y) + { + BOOST_CHECK_CLOSE(x, y, 0.001); + } + }; + + template + static inline void apply(std::string const& /*case_id*/, + std::string const& /*subcase_id*/, + Geometry1 const& /*geometry1*/, + Geometry2 const& /*geometry2*/, + T const& detected, + T const& expected) + { + equal_to::apply(expected, detected); + /* + TODO: + Ideally we would want the following, but it does not work well + approximate equality test. + + BOOST_CHECK_MESSAGE(equal_to::apply(expected, detected), + "case ID: " << case_id << "-" << subcase_id << "; " + << "G1: " << bg::wkt(geometry1) + << " - " + << "G2: " << bg::wkt(geometry2) + << " -> Detected: " << detected + << "; Expected: " << expected); + */ + } +}; + +//======================================================================== + +template +< + typename Geometry1, typename Geometry2, + int id1 = bg::geometry_id::value, + int id2 = bg::geometry_id::value +> +struct test_distance_of_geometries + : public test_distance_of_geometries +{}; + + +template +struct test_distance_of_geometries +{ + template + < + typename DistanceType, + typename ComparableDistanceType, + typename Strategy + > + static inline + void apply(std::string const& case_id, + std::string const& wkt1, + std::string const& wkt2, + DistanceType const& expected_distance, + ComparableDistanceType const& expected_comparable_distance, + Strategy const& strategy, + bool test_reversed = true) + { + Geometry1 geometry1 = from_wkt(wkt1); + Geometry2 geometry2 = from_wkt(wkt2); + + apply(case_id, geometry1, geometry2, + expected_distance, expected_comparable_distance, + strategy, test_reversed); + } + + template + static inline + void apply(std::string const& case_id, + std::string const& wkt1, + std::string const& wkt2, + DistanceType const& expected_distance, + Strategy const& strategy, + bool test_reversed = true) + { + Geometry1 geometry1 = from_wkt(wkt1); + Geometry2 geometry2 = from_wkt(wkt2); + + apply(case_id, geometry1, geometry2, + expected_distance, expected_distance, + strategy, test_reversed); + } + + + template + < + typename DistanceType, + typename ComparableDistanceType, + typename Strategy + > + static inline + void apply(std::string const& case_id, + Geometry1 const& geometry1, + Geometry2 const& geometry2, + DistanceType const& expected_distance, + ComparableDistanceType const& expected_comparable_distance, + Strategy const& strategy, + bool test_reversed = true) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "case ID: " << case_id << "; " + << "G1: " << bg::wkt(geometry1) + << " - " + << "G2: " << bg::wkt(geometry2) + << std::endl; +#endif + namespace services = bg::strategy::distance::services; + + using bg::unit_test::distance_brute_force; + + typedef typename bg::default_distance_result + < + Geometry1, Geometry2 + >::type default_distance_result; + + typedef typename services::return_type + < + Strategy, Geometry1, Geometry2 + >::type distance_result_from_strategy; + + static const bool same_regular = boost::is_same + < + default_distance_result, + distance_result_from_strategy + >::type::value; + + BOOST_CHECK(same_regular); + + typedef typename bg::default_comparable_distance_result + < + Geometry1, Geometry2 + >::type default_comparable_distance_result; + + typedef typename services::return_type + < + typename services::comparable_type::type, + Geometry1, + Geometry2 + >::type comparable_distance_result_from_strategy; + + static const bool same_comparable = boost::is_same + < + default_comparable_distance_result, + comparable_distance_result_from_strategy + >::type::value; + + BOOST_CHECK( same_comparable ); + + // check distance with passed strategy + distance_result_from_strategy dist = + bg::distance(geometry1, geometry2, strategy); + + check_equal + < + distance_result_from_strategy + >::apply(case_id, "a", geometry1, geometry2, + dist, expected_distance); + + // check against the comparable distance computed in a + // brute-force manner + default_distance_result dist_brute_force + = distance_brute_force(geometry1, geometry2, strategy); + + check_equal + < + default_distance_result + >::apply(case_id, "b", geometry1, geometry2, + dist_brute_force, expected_distance); + + // check comparable distance with passed strategy + comparable_distance_result_from_strategy cdist = + bg::comparable_distance(geometry1, geometry2, strategy); + + check_equal + < + default_comparable_distance_result + >::apply(case_id, "c", geometry1, geometry2, + cdist, expected_comparable_distance); + + // check against the comparable distance computed in a + // brute-force manner + default_comparable_distance_result cdist_brute_force + = distance_brute_force(geometry1, + geometry2, + services::get_comparable + < + Strategy + >::apply(strategy)); + + check_equal + < + default_comparable_distance_result + >::apply(case_id, "d", geometry1, geometry2, + cdist_brute_force, expected_comparable_distance); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << string_from_type::type>::name() + << string_from_type::type>::name() + << " -> " + << string_from_type::name() + << string_from_type::name() + << std::endl; + std::cout << "strategy radius: " << strategy.radius() << std::endl; + std::cout << "expected distance = " + << expected_distance << " ; " + << "expected comp. distance = " + << expected_comparable_distance + << std::endl; + std::cout << "distance = " + << dist << " ; " + << "comp. distance = " + << cdist + << std::endl; + + if ( !test_reversed ) + { + std::cout << std::endl; + } +#endif + + if ( test_reversed ) + { + // check distance with given strategy + dist = bg::distance(geometry2, geometry1, strategy); + + check_equal + < + default_distance_result + >::apply(case_id, "ra", geometry2, geometry1, + dist, expected_distance); + + // check comparable distance with given strategy + cdist = bg::comparable_distance(geometry2, geometry1, strategy); + + check_equal + < + default_comparable_distance_result + >::apply(case_id, "rc", geometry2, geometry1, + cdist, expected_comparable_distance); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "distance[reversed args] = " + << dist << " ; " + << "comp. distance[reversed args] = " + << cdist + << std::endl; + std::cout << std::endl; +#endif + } + } +}; + + +//======================================================================== + + +template +void test_empty_input(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) +{ + try + { + bg::distance(geometry1, geometry2); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, + "A empty_input_exception should have been thrown"); + + try + { + bg::distance(geometry2, geometry1); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, + "A empty_input_exception should have been thrown"); + + try + { + bg::distance(geometry1, geometry2, strategy); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, + "A empty_input_exception should have been thrown"); + + try + { + bg::distance(geometry2, geometry1, strategy); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, + "A empty_input_exception should have been thrown"); +} + +#endif // BOOST_GEOMETRY_TEST_DISTANCE_SE_COMMON_HPP diff --git a/src/boost/libs/geometry/test/algorithms/distance/test_empty_geometry.hpp b/src/boost/libs/geometry/test/algorithms/distance/test_empty_geometry.hpp new file mode 100644 index 000000000..5aa0a43e1 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/distance/test_empty_geometry.hpp @@ -0,0 +1,213 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2018, Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#ifndef BOOST_GEOMETRY_TEST_EMPTY_GEOMETRY_HPP +#define BOOST_GEOMETRY_TEST_EMPTY_GEOMETRY_HPP + +template +void test_more_empty_input_pointlike_pointlike(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "testing on empty inputs... " << std::flush; +#endif + bg::model::multi_point multipoint_empty; + + Point point = from_wkt("point(0 0)"); + + // 1st geometry is empty + test_empty_input(multipoint_empty, point, strategy); + + // 2nd geometry is empty + test_empty_input(point, multipoint_empty, strategy); + + // both geometries are empty + test_empty_input(multipoint_empty, multipoint_empty, strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "done!" << std::endl; +#endif +} + + +template +void test_more_empty_input_pointlike_linear(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "testing on empty inputs... " << std::flush; +#endif + bg::model::linestring line_empty; + bg::model::multi_point multipoint_empty; + bg::model::multi_linestring > multiline_empty; + + Point point = from_wkt("POINT(0 0)"); + bg::model::linestring line = + from_wkt >("LINESTRING(0 0,1 1,2 2)"); + + // 1st geometry is empty + test_empty_input(multipoint_empty, line, strategy); + + // 2nd geometry is empty + test_empty_input(line, multipoint_empty, strategy); + test_empty_input(point, line_empty, strategy); + test_empty_input(point, multiline_empty, strategy); + + // both geometries are empty + test_empty_input(multipoint_empty, line_empty, strategy); + test_empty_input(multipoint_empty, multiline_empty, strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "done!" << std::endl; +#endif +} + + +template +void test_more_empty_input_pointlike_areal(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "testing on empty inputs... " << std::flush; +#endif + bg::model::multi_point multipoint_empty; + + bg::model::polygon polygon_empty; + bg::model::multi_polygon > multipolygon_empty; + + Point point = from_wkt("POINT(0 0)"); + bg::model::polygon polygon = + from_wkt >("POLYGON((0 0,1 0,1 1,0 1,0 0))"); + + // 1st geometry is empty + test_empty_input(multipoint_empty, polygon, strategy); + test_empty_input(polygon_empty, point, strategy); + test_empty_input(multipolygon_empty, point, strategy); + + // 2nd geometry is empty + test_empty_input(point, polygon_empty, strategy); + test_empty_input(point, multipolygon_empty, strategy); + test_empty_input(polygon, multipoint_empty, strategy); + + // both geometries are empty + test_empty_input(multipoint_empty, polygon_empty, strategy); + test_empty_input(multipoint_empty, multipolygon_empty, strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "done!" << std::endl; +#endif +} + + +template +void test_more_empty_input_linear_linear(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "testing on empty inputs... " << std::flush; +#endif + bg::model::linestring line_empty; + bg::model::multi_linestring > multiline_empty; + + bg::model::linestring line = + from_wkt >("LINESTRING(0 0,1 1)"); + + // 1st geometry is empty + test_empty_input(line_empty, line, strategy); + test_empty_input(multiline_empty, line, strategy); + + // 2nd geometry is empty + test_empty_input(line, line_empty, strategy); + test_empty_input(line, multiline_empty, strategy); + + // both geometries are empty + test_empty_input(line_empty, line_empty, strategy); + test_empty_input(multiline_empty, line_empty, strategy); + test_empty_input(multiline_empty, multiline_empty, strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "done!" << std::endl; +#endif +} + + +template +void test_more_empty_input_linear_areal(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "testing on empty inputs... " << std::flush; +#endif + bg::model::linestring line_empty; + bg::model::multi_linestring > multiline_empty; + + bg::model::polygon polygon_empty; + bg::model::multi_polygon > multipolygon_empty; + + bg::model::linestring line = + from_wkt >("LINESTRING(0 0,1 1)"); + bg::model::polygon polygon = + from_wkt >("POLYGON((0 0,1 0,1 1,0 1,0 0))"); + + // 1st geometry is empty + test_empty_input(line_empty, polygon, strategy); + test_empty_input(multiline_empty, polygon, strategy); + test_empty_input(polygon_empty, line, strategy); + test_empty_input(multipolygon_empty, line, strategy); + + // 2nd geometry is empty + test_empty_input(line, polygon_empty, strategy); + test_empty_input(line, multipolygon_empty, strategy); + test_empty_input(polygon, line_empty, strategy); + test_empty_input(polygon, multiline_empty, strategy); + + // both geometries are empty + test_empty_input(line_empty, polygon_empty, strategy); + test_empty_input(line_empty, multipolygon_empty, strategy); + test_empty_input(multiline_empty, polygon_empty, strategy); + test_empty_input(multiline_empty, multipolygon_empty, strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "done!" << std::endl; +#endif +} + + +template +void test_more_empty_input_areal_areal(Strategy const& strategy) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "testing on empty inputs... " << std::flush; +#endif + bg::model::polygon polygon_empty; + bg::model::multi_polygon > multipolygon_empty; + + bg::model::polygon polygon = + from_wkt >("POLYGON((0 0,1 0,1 1,0 1,0 0))"); + + // 1st geometry is empty + test_empty_input(polygon_empty, polygon, strategy); + test_empty_input(multipolygon_empty, polygon, strategy); + + // 2nd geometry is empty + test_empty_input(polygon, polygon_empty, strategy); + test_empty_input(polygon, multipolygon_empty, strategy); + + // both geometries are empty + test_empty_input(polygon_empty, multipolygon_empty, strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "done!" << std::endl; +#endif +} + +#endif // BOOST_GEOMETRY_TEST_EMPTY_GEOMETRY_HPP diff --git a/src/boost/libs/geometry/test/algorithms/envelope_expand/Jamfile b/src/boost/libs/geometry/test/algorithms/envelope_expand/Jamfile new file mode 100644 index 000000000..da8382806 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/envelope_expand/Jamfile @@ -0,0 +1,24 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2016. +# Modifications copyright (c) 2014-2016, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-envelope_expand + : + [ run envelope.cpp : : : : algorithms_envelope ] + [ run envelope_multi.cpp : : : : algorithms_envelope_multi ] + [ run envelope_on_spheroid.cpp : : : : algorithms_envelope_on_spheroid ] + [ run expand.cpp : : : : algorithms_expand ] + [ run expand_on_spheroid.cpp : : : : algorithms_expand_on_spheroid ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/envelope_expand/envelope.cpp b/src/boost/libs/geometry/test/algorithms/envelope_expand/envelope.cpp new file mode 100644 index 000000000..7418b27c6 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/envelope_expand/envelope.cpp @@ -0,0 +1,235 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2015, 2016. +// Modifications copyright (c) 2015, 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 + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include + +#include "test_envelope.hpp" + +#include +#include +#include +#include +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +template +void test_2d() +{ + test_envelope

("POINT(1 1)", 1, 1, 1, 1); + test_envelope >("LINESTRING(1 1,2 2)", 1, 2, 1, 2); + test_envelope >("POLYGON((1 1,1 3,3 3,3 1,1 1))", 1, 3, 1, 3); + + test_envelope >("POLYGON((1 1,1 3,3 3,3 1,1 1))", 1, 3, 1, 3); + test_envelope >("BOX(1 1,3 3)", 1, 3, 1, 3); + + // Triangle, closed and open, and CCW. + // Note that for the envelope algorithm, + // these combinations should theoretically not differ + test_envelope >("POLYGON((4 1,0 7,7 9,4 1))", 0, 7, 1, 9); + test_envelope >("POLYGON((4 1,0 7,7 9))", 0, 7, 1, 9); + test_envelope >("POLYGON((4 1,7 9,0 7,4 1))", 0, 7, 1, 9); + test_envelope >("POLYGON((4 1,7 9,0 7))", 0, 7, 1, 9); + + typedef std::pair segment_type; + test_envelope("SEGMENT(1 1,3 3)", 1, 3, 1, 3); +} + +template +void test_3d() +{ + test_envelope

("POINT(1 2 3)", 1, 1, 2, 2, 3, 3); + test_envelope

("POINT(3 2 1)", 3, 3, 2, 2, 1, 1); + test_envelope >("LINESTRING(1 1 1,2 2 2)", 1, 2, 1, 2, 1, 2); + test_envelope >("BOX(1 1 1,3 3 3)", 1, 3, 1, 3, 1, 3); +} + +template +void test_empty_geometry(std::string const& wkt) +{ + typedef typename bg::coordinate_type::type ct; + ct high_val = boost::numeric::bounds::highest(); + ct low_val = boost::numeric::bounds::lowest(); + + test_envelope(wkt, high_val, low_val, high_val, low_val); +} + +template +void test_empty() +{ + test_empty_geometry >("LINESTRING()"); + test_empty_geometry >("POLYGON(())"); + + test_empty_geometry >("POLYGON(())"); + + test_empty_geometry >("MULTIPOINT()"); + + test_empty_geometry + < + bg::model::multi_linestring > + >("MULTILINESTRING()"); + + test_empty_geometry + < + bg::model::multi_polygon > + >("MULTIPOLYGON()"); +} + +template +void test_invalid() +{ + // polygon with empty exterior and interior rings + test_empty_geometry >("POLYGON((),(),())"); + + // polygon with empty interior rings + test_envelope + < + bg::model::polygon

+ >("POLYGON((1 2,1 20,22 20,22 2,1 2),(),())", + 1, 22, 2, 20); + + // another polygon with empty interior rings + test_envelope + < + bg::model::polygon

+ >("POLYGON((1 2,1 20,22 20,22 2,1 2),(),(3 4,19 4,19 18,3 18,3 4),())", + 1, 22, 2, 20); + + // polygon with empty exterior ring + test_envelope + < + bg::model::polygon

+ >("POLYGON((),(),(3 4,19 4,19 18,3 18,3 4),())", + 3, 19, 4, 18); + + // another polygon with empty exterior ring + test_envelope + < + bg::model::polygon

+ >("POLYGON((),(),(3 4,19 4,19 18,3 18,3 4),(4 5,18 5,18 17,4 17,4 5))", + 3, 19, 4, 18); + + // yet one more polygon with empty exterior ring + test_envelope + < + bg::model::polygon

+ >("POLYGON((),(),(4 5,18 5,18 17,4 17,4 5),(3 4,19 4,19 18,3 18,3 4))", + 3, 19, 4, 18); + + // multilinestring with empty linestrings + test_empty_geometry + < + bg::model::multi_linestring > + >("MULTILINESTRING((),(),())"); + + // multilinestring with empty and non-empty linestrings + test_envelope + < + bg::model::multi_linestring > + >("MULTILINESTRING((),(10 20),())", 10, 10, 20, 20); + + // multipolygon with empty polygon + test_empty_geometry + < + bg::model::multi_polygon > + >("MULTIPOLYGON((()))"); + + // multipolygon with many empty polygons + test_empty_geometry + < + bg::model::multi_polygon > + >("MULTIPOLYGON(((),(),()),(()),((),(),(),(),()))"); + + // multipolygon with empty polygons and non-empty (valid) polygon + test_envelope + < + bg::model::multi_polygon > + >("MULTIPOLYGON(((),(),()),((10 30,10 40,20 30,10 30)),\ + ((),(),()),(()))", 10, 20, 30, 40); + + // multipolygon with empty polygons and non-empty (valid) polygon + // that has an interior ring + test_envelope + < + bg::model::multi_polygon > + >("MULTIPOLYGON(((),(),()),(()),\ + ((1 2,1 20,22 20,22 2,1 2),(3 4,19 4,19 18,3 18,3 4)),(()))", + 1, 22, 2, 20); + + // multipolygon with empty polygons and non-empty (invalid) polygon + // that has an interior ring but empty exterior ring + test_envelope + < + bg::model::multi_polygon > + >("MULTIPOLYGON(((),(),()),(()),((),(3 4,19 4,19 18,3 18,3 4)),(()))", + 3, 19, 4, 18); + + // multipolygon with empty polygons and non-empty (invalid) polygon + // that has an interior ring but empty exterior ring + test_envelope + < + bg::model::multi_polygon > + >("MULTIPOLYGON(((),(),()),((),(),(3 4,19 4,19 18,3 18,3 4),()),(()))", + 3, 19, 4, 18); + + // multipolygon with empty polygons and non-empty (invalid) polygon + // that has two non-empty interior rings but empty exterior ring + test_envelope + < + bg::model::multi_polygon > + >("MULTIPOLYGON(((),(),()),\ + ((),(),(3 4,19 4,19 18,3 18,3 4),(4 5,18 5,18 17,4 17,4 5),()),\ + (()))", + 3, 19, 4, 18); +} + +int test_main(int, char* []) +{ + //test_2d(); + //test_2d(); + //test_2d(); + test_2d >(); + test_2d >(); + test_2d >(); + test_2d >(); + + test_3d(); + test_3d >(); + + test_empty >(); + test_empty >(); + test_empty >(); + test_empty >(); + + test_invalid >(); + test_invalid >(); + test_invalid >(); + test_invalid >(); + +#ifdef HAVE_TTMATH + test_2d >(); + test_3d >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/envelope_expand/envelope_multi.cpp b/src/boost/libs/geometry/test/algorithms/envelope_expand/envelope_multi.cpp new file mode 100644 index 000000000..7efebb96b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/envelope_expand/envelope_multi.cpp @@ -0,0 +1,63 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include "test_envelope.hpp" + +#include +#include +#include +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +template +void test_2d() +{ + /*test_envelope >( + "MULTIPOINT((1 1),(1 0),(1 2))", 1, 1, 0, 2); + test_envelope > >( + "MULTILINESTRING((0 0,1 1),(1 1,2 2),(2 2,3 3))", 0, 3, 0, 3); +*/ + test_envelope > >( + "MULTIPOLYGON(((1 1,1 3,3 3,3 1,1 1)),((4 4,4 6,6 6,6 4,4 4)))", 1, 6, 1, 6); +} + + +template +void test_3d() +{ + //typedef bg::model::multi_point

mp; +} + + +int test_main( int , char* [] ) +{ + test_2d >(); + test_2d >(); + test_2d >(); + + test_3d >(); + test_3d >(); + +#ifdef HAVE_TTMATH + test_2d >(); + test_2d >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/envelope_expand/envelope_on_spheroid.cpp b/src/boost/libs/geometry/test/algorithms/envelope_expand/envelope_on_spheroid.cpp new file mode 100644 index 000000000..cbc5e536e --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/envelope_expand/envelope_on_spheroid.cpp @@ -0,0 +1,2709 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2015-2018, 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 +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_envelope_on_sphere_or_spheroid +#endif + +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include + +#include +#include + +#include +#include +#include + +#include + +#include "test_envelope_expand_on_spheroid.hpp" + + +template +struct test_envelope +{ + template + static inline void apply(Geometry& geometry, Box& detected) + { + bg::envelope(geometry, detected); + } +}; + +template +struct test_envelope +{ + template + static inline void apply(Geometry& geometry, + Box& detected) + { + typedef bg::strategy::envelope::spherical_point point_strategy_t; + typedef bg::strategy::envelope::spherical_multipoint multi_point_strategy_t; + typedef bg::strategy::envelope::spherical_box box_strategy_t; + typedef bg::strategy::envelope::geographic, double> strategy_t; + + typename boost::mpl::if_c + < + boost::is_same::type, bg::point_tag>::value, + point_strategy_t, + typename boost::mpl::if_c + < + boost::is_same::type, bg::multi_point_tag>::value, + multi_point_strategy_t, + typename boost::mpl::if_c + < + boost::is_same::type, bg::box_tag>::value, + box_strategy_t, + strategy_t + >::type + >::type + >::type strategy; + + bg::envelope(geometry, detected, strategy); + } +}; + +template +class envelope_on_spheroid_basic_tester +{ +private: + template + < + typename Geometry, + typename Tag = typename bg::tag::type + > + struct write_geometry + { + template + static inline OutputStream& apply(OutputStream& os, + Geometry const& geometry) + { + os << bg::wkt(geometry); + return os; + } + }; + + template + struct write_geometry + { + template + static inline OutputStream& apply(OutputStream& os, + Segment const& segment) + { + os << "SEGMENT" << bg::dsv(segment); + return os; + } + }; + + template + struct write_geometry + { + template + static inline OutputStream& apply(OutputStream& os, + Box const& box) + { + os << "BOX" << bg::dsv(box); + return os; + } + }; + + template + static inline void check_message(bool same_boxes, + std::string const& case_id, + std::string const& units_str, + Geometry const& geometry, + Box const& expected, + Box const& detected) + { + std::ostringstream stream; + stream << "case ID: " << case_id << ", " + << "MBR units: " << units_str << "; " + << "geometry: "; + + write_geometry::apply(stream, geometry); + + stream << std::setprecision(17); + + stream << "; " << "expected: " << bg::dsv(expected) + << ", " << "detected: " << bg::dsv(detected); + + BOOST_CHECK_MESSAGE(same_boxes, stream.str()); + } + + template + < + typename Geometry, typename Box, + typename T1, typename T2, typename T3, typename T4 + > + static inline void check_message(bool same_boxes, + std::string const& case_id, + std::string const& units_str, + Geometry const& geometry, + T1 const& lon_min, T2 const& lat_min, double height_min, + T3 const& lon_max, T4 const& lat_max, double height_max, + Box const& detected) + { + std::ostringstream stream; + stream << "case ID: " << case_id << ", " + << "MBR units: " << units_str << "; " + << "geometry: "; + + write_geometry::apply(stream, geometry); + + stream << std::setprecision(17); + + stream << "; " << "expected: "; + + if (BOOST_GEOMETRY_CONDITION(bg::dimension::value == 2)) + { + stream << "(" << lon_min << " " << lat_min + << ", " << lon_max << " " << lat_max << ")"; + } + else + { + stream << "(" << lon_min << " " << lat_min << " " << height_min + << ", " << lon_max << " " << lat_max << " " << height_max << ")"; + } + stream << ", " << "detected: " << bg::dsv(detected); + + BOOST_CHECK_MESSAGE(same_boxes, stream.str()); + } + + template + < + typename Box, typename Geometry, + typename T1, typename T2, typename T3, typename T4 + > + static inline void base_test(std::string const& case_id, + Geometry const& geometry, + T1 const& lon_min, T2 const& lat_min, double height_min, + T3 const& lon_max, T4 const& lat_max, double height_max, + double tolerance) + { + typedef typename bg::coordinate_system::type::units box_units_type; + + std::string const units_str = units2string(); + + Box detected; + test_envelope::type> + ::apply(geometry, detected); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "geometry: "; + write_geometry::apply(std::cout, geometry); + + std::cout << std::endl + << "MBR units: " << units_str + << std::endl; + std::cout << "expected: "; + if (BOOST_GEOMETRY_CONDITION(bg::dimension::value == 2)) + { + std::cout << "(" << lon_min << " " << lat_min + << ", " << lon_max << " " << lat_max << ")"; + } + else + { + std::cout << "(" << lon_min << " " << lat_min << " " << height_min + << ", " << lon_max << " " << lat_max << " " << height_max << ")"; + } + std::cout << std::endl + << "detected: " << bg::dsv(detected) + << std::endl << std::endl; +#endif + + bool check = box_check_equals::apply(detected, + lon_min, lat_min, height_min, + lon_max, lat_max, height_max, + tolerance); + + check_message(check, + case_id, units_str, + geometry, + lon_min, lat_min, height_min, + lon_max, lat_max, height_max, + detected); + + // if valid box is expected, check the validity + if (lon_min <= lon_max && lat_min <= lat_max && height_min <= height_max) + { + BOOST_CHECK_MESSAGE(bg::index::detail::is_valid(detected), + "Case ID: " << case_id << ", " + << "MBR units: " << units_str << "; " + << "Invalid Box: " << bg::dsv(detected)); + } + } + +public: + template + < + typename Geometry, + typename T1, typename T2, typename T3, typename T4 + > + static inline void apply(std::string const& case_id, + Geometry const& geometry, + T1 const& lon_min, T2 const& lat_min, double height_min, + T3 const& lon_max, T4 const& lat_max, double height_max, + double tolerance) + { + typedef other_system_info + < + typename bg::coordinate_system::type + > other; + + typedef bg::model::box + < + bg::model::point + < + typename bg::coordinate_type::type, + bg::dimension::value, + typename other::type + > + > other_mbr_type; + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "case ID: " << case_id << std::endl << std::endl; +#endif + + base_test(case_id, geometry, + lon_min, lat_min, height_min, + lon_max, lat_max, height_max, + tolerance); + + if (lon_max < lon_min) + { + // we are in the case were a special MBR is returned; + // makes no sense to change units + base_test(case_id, geometry, + lon_min, lat_min, height_min, + lon_max, lat_max, height_max, + tolerance); + } + else + { + base_test(case_id, geometry, + other::convert(lon_min), + other::convert(lat_min), + height_min, + other::convert(lon_max), + other::convert(lat_max), + height_max, + tolerance); + } + } +}; + + +// test the reverse of a geometry if it is either linear or ring +template ::type> +struct test_reverse_geometry +{ + static bool const is_linear = + boost::is_same::value + || boost::is_same::value + || boost::is_same::value; + + // currently disable rings + static bool const is_ring = false; + // static bool const is_ring = boost::is_same::value; + + typedef typename boost::mpl::if_c + < + is_linear || is_ring, + boost::true_type, + boost::false_type + >::type type; + + static bool const value = type::value; +}; + +template +< + typename Geometry, + typename MBR, + typename Tag = typename bg::tag::type, + bool TestReverse = test_reverse_geometry::value, + typename FormulaPolicy = bg::strategy::thomas +> +struct test_envelope_on_sphere_or_spheroid +{ + template + static inline void apply(std::string const& case_id, + Geometry const& geometry, + T1 const& lon_min1, T2 const& lat_min1, double height_min1, + T3 const& lon_max1, T4 const& lat_max1, double height_max1, + T5 const& lon_min2, T6 const& lat_min2, double height_min2, + T7 const& lon_max2, T8 const& lat_max2, double height_max2, + double tolerance = std::numeric_limits::epsilon()) + { + envelope_on_spheroid_basic_tester + < + MBR, FormulaPolicy + >::apply(case_id, geometry, + lon_min1, lat_min1, height_min1, + lon_max1, lat_max1, height_max1, + tolerance); + + if (BOOST_GEOMETRY_CONDITION(TestReverse)) + { + std::string reversed_case_id = case_id + "-reverse"; + + Geometry reversed_geometry = geometry; + bg::reverse(reversed_geometry); + envelope_on_spheroid_basic_tester + < + MBR, FormulaPolicy + >::apply(reversed_case_id, reversed_geometry, + lon_min2, lat_min2, height_min2, + lon_max2, lat_max2, height_max2, + tolerance); + } + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "==================" + << std::endl << std::endl; +#endif + } + + template + static inline void apply(std::string const& case_id, + Geometry const& geometry, + T1 const& lon_min1, T2 const& lat_min1, + T3 const& lon_max1, T4 const& lat_max1, + T5 const& lon_min2, T6 const& lat_min2, + T7 const& lon_max2, T8 const& lat_max2, + double tolerance = std::numeric_limits::epsilon()) + { + apply(case_id, geometry, + lon_min1, lat_min1, 0, lon_max1, lat_max1, 0, + lon_min2, lat_min2, 0, lon_max2, lat_max2, 0, + tolerance); + } + + template + static inline void apply(std::string const& case_id, + Geometry const& geometry, + T1 const& lon_min, T2 const& lat_min, double height_min, + T3 const& lon_max, T4 const& lat_max, double height_max, + double tolerance = std::numeric_limits::epsilon()) + { + apply(case_id, geometry, + lon_min, lat_min, height_min, + lon_max, lat_max, height_max, + lon_min, lat_min, height_min, + lon_max, lat_max, height_max, + tolerance); + } + + template + static inline void apply(std::string const& case_id, + Geometry const& geometry, + T1 const& lon_min, T2 const& lat_min, + T3 const& lon_max, T4 const& lat_max, + double tolerance = std::numeric_limits::epsilon()) + { + apply(case_id, geometry, + lon_min, lat_min, 0, lon_max, lat_max, 0, + tolerance); + } +}; + + +// special tester for rings +template +struct test_envelope_on_sphere_or_spheroid +{ + template + static inline void apply(std::string const& case_id, + Geometry const& geometry, + T1 const& lon_min1, T2 const& lat_min1, + T3 const& lon_max1, T4 const& lat_max1, + T5 const& lon_min2, T6 const& lat_min2, + T7 const& lon_max2, T8 const& lat_max2, + double const& tolerance = std::numeric_limits::epsilon()) + { + envelope_on_spheroid_basic_tester + < + MBR + >::apply(case_id, geometry, + lon_min1, lat_min1, 0, + lon_max1, lat_max1, 0, + tolerance); + + std::string ccw_case_id = case_id + "-2ccw"; + + bg::model::ring + < + typename bg::point_type::type, false + > ccw_ring; + bg::convert(geometry, ccw_ring); + + envelope_on_spheroid_basic_tester + < + MBR + >::apply(ccw_case_id, ccw_ring, + lon_min2, lat_min2, 0, + lon_max2, lat_max2, 0, + tolerance); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "==================" + << std::endl << std::endl; +#endif + } + + template + static inline void apply(std::string const& case_id, + Geometry const& geometry, + T1 const& lon_min, T2 const& lat_min, + T3 const& lon_max, T4 const& lat_max, + double tolerance = std::numeric_limits::epsilon()) + { + apply(case_id, geometry, + lon_min, lat_min, lon_max, lat_max, + lon_min, lat_min, lon_max, lat_max, + tolerance); + } +}; + + +template +void test_empty_geometry(std::string const& case_id, std::string const& wkt) +{ + std::size_t const dim = bg::dimension::value; + + typedef bg::model::point point_type; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + typedef typename bg::coordinate_type::type ct; + ct high_val = boost::numeric::bounds::highest(); + ct low_val = boost::numeric::bounds::lowest(); + + if (BOOST_GEOMETRY_CONDITION(dim == 2)) + { + tester::apply(case_id, + from_wkt(wkt), + high_val, high_val, low_val, low_val); + } + else + { + tester::apply(case_id, + from_wkt(wkt), + high_val, high_val, high_val, low_val, low_val, low_val); + } +} + + +template +void test_envelope_point() +{ + typedef bg::model::point point_type; + typedef point_type G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + tester::apply("p01", + from_wkt("POINT(10 10)"), + 10, 10, 10, 10); + + tester::apply("p02", + from_wkt("POINT(370 10)"), + 10, 10, 10, 10); + +#ifdef BOOST_GEOMETRY_NORMALIZE_LATITUDE + tester::apply("p03", + from_wkt("POINT(370 -350)"), + 10, 10, 10, 10); +#endif + + // north and south poles + tester::apply("p04", + from_wkt("POINT(0 90)"), + 0, 90, 0, 90); + + tester::apply("p04a", + from_wkt("POINT(10 90)"), + 0, 90, 0, 90); + + tester::apply("p04b", + from_wkt("POINT(270 90)"), + 0, 90, 0, 90); + +#ifdef BOOST_GEOMETRY_NORMALIZE_LATITUDE + tester::apply("p04c", + from_wkt("POINT(270 450)"), + 0, 90, 0, 90); +#endif + + tester::apply("p04d", + from_wkt("POINT(190 90)"), + 0, 90, 0, 90); + + tester::apply("p04e", + from_wkt("POINT(-100 90)"), + 0, 90, 0, 90); + + tester::apply("p05", + from_wkt("POINT(0 -90)"), + 0, -90, 0, -90); + + tester::apply("p05a", + from_wkt("POINT(10 -90)"), + 0, -90, 0, -90); + + tester::apply("p05b", + from_wkt("POINT(270 -90)"), + 0, -90, 0, -90); + +#ifdef BOOST_GEOMETRY_NORMALIZE_LATITUDE + tester::apply("p05c", + from_wkt("POINT(270 -450)"), + 0, -90, 0, -90); +#endif + + tester::apply("p05d", + from_wkt("POINT(190 -90)"), + 0, -90, 0, -90); + + tester::apply("p05e", + from_wkt("POINT(-100 -90)"), + 0, -90, 0, -90); + + tester::apply("p05f", + from_wkt("POINT(-100 -90)"), + 0, -90, 0, -90); +} + +BOOST_AUTO_TEST_CASE( envelope_point ) +{ + test_envelope_point >(); + test_envelope_point >(); +} + + +template +void test_envelope_point_with_height() +{ + typedef bg::model::point point_type; + typedef point_type G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + tester::apply("ph01", + from_wkt("POINT(10 10 1256)"), + 10, 10, 1256, 10, 10, 1256); +} + +BOOST_AUTO_TEST_CASE( envelope_point_with_height ) +{ + test_envelope_point_with_height + < + bg::cs::spherical_equatorial + >(); + test_envelope_point_with_height >(); +} + + +BOOST_AUTO_TEST_CASE( envelope_segment_sphere ) +{ + typedef bg::cs::spherical_equatorial coordinate_system_type; + typedef bg::model::point P; + typedef bg::model::segment

G; + typedef bg::model::box

B; + typedef test_envelope_on_sphere_or_spheroid tester; + + double const eps = std::numeric_limits::epsilon(); + + tester::apply("s01", + from_wkt("SEGMENT(10 10,40 40)"), + 10, 10, 40, 40); + + tester::apply("s02", + from_wkt("SEGMENT(10 10,40 10)"), + 10, 10, 40, 10.345270046149988); +/* + tester::apply("s02", + from_wkt("SEGMENT(1 2,70 1)"), + 1, 1, 70, 2.01); +*/ + tester::apply("s02a", + from_wkt("SEGMENT(40 10,10 10)"), + 10, 10, 40, 10.34527004614999); + + tester::apply("s03", + from_wkt("SEGMENT(160 10,-170 10)"), + 160, 10, 190, 10.34527004614999); + + tester::apply("s03a", + from_wkt("SEGMENT(-170 10,160 10)"), + 160, 10, 190, 10.34527004614999); + + tester::apply("s03b", + from_wkt("SEGMENT(-170 -10,160 -10)"), + 160, -10.34527004614999, 190, -10); + + tester::apply("s04", + from_wkt("SEGMENT(-40 45,140 60)"), + -40, 45, 140, 90); + + tester::apply("s04a", + from_wkt("SEGMENT(-40 45,140 25)"), + -40, 25, 140, 90); + + // segment ending at the north pole + tester::apply("s05", + from_wkt("SEGMENT(40 45,80 90)"), + 40, 45, 40, 90); + + // segment starting at the north pole + tester::apply("s05a", + from_wkt("SEGMENT(80 90,40 45)"), + 40, 45, 40, 90); + + // segment ending at the north pole + tester::apply("s06", + from_wkt("SEGMENT(-40 45,80 90)"), + -40, 45, -40, 90); + + // segment starting at the north pole + tester::apply("s06a", + from_wkt("SEGMENT(70 90,-40 45)"), + -40, 45, -40, 90); + + // segment ending at the north pole + tester::apply("s07", + from_wkt("SEGMENT(40 -45,80 90)"), + 40, -45, 40, 90); + + // segment passing through the south pole + tester::apply("s08", + from_wkt("SEGMENT(-170 -45,10 -30)"), + -170, -90, 10, -30); + + tester::apply("s09", + from_wkt("SEGMENT(1 -45,179 30)"), + 1, -85.28884376852969, 179, 30, + 3 * eps); + + tester::apply("s09a", + from_wkt("SEGMENT(2 -45,181 30)"), + 2, -87.63659983704832, 181, 30); + + // very long segment + tester::apply("s10", + from_wkt("SEGMENT(0 -45,181 30)"), + -179, -87.636599837048323, 0, 30, + 2.0 * eps); + + tester::apply("s11", + from_wkt("SEGMENT(260 30,20 45)"), + -100, 30, 20, 57.93195594009233); + + tester::apply("s11a", + from_wkt("SEGMENT(260 45,20 30)"), + -100, 30, 20, 57.931955940092337); + + // segment degenerating to the north pole + tester::apply("s12", + from_wkt("SEGMENT(10 90,20 90)"), + 0, 90, 0, 90); + + // segment degenerating to the south pole + tester::apply("s13", + from_wkt("SEGMENT(10 -90,20 -90)"), + 0, -90, 0, -90); + + tester::apply("s14", + from_wkt("SEGMENT(20 20,10 30)"), + 10, 20, 20, 30);//48.87458730907602); + + tester::apply("s15", + from_wkt("SEGMENT(50 45,185 45)"), + 50, 45, 185, 69.05897952775615); + + // segment that lies on the equator + tester::apply("s16", + from_wkt("SEGMENT(0 0,50 0)"), + 0, 0, 50, 0); + + // segment that lies on the equator + tester::apply("s16a", + from_wkt("SEGMENT(-50 0,50 0)"), + -50, 0, 50, 0); + + // segment that lies on the equator and touches antimeridian + tester::apply("s16b", + from_wkt("SEGMENT(50 0,180 0)"), + 50, 0, 180, 0); + + // segment that lies on the equator and crosses antimeridian + tester::apply("s16c", + from_wkt("SEGMENT(-170 0,160 0)"), + 160, 0, 190, 0); + + tester::apply("s17", + from_wkt("SEGMENT(140 10, -140 80)"), + 140, 10, 220, 80); + + tester::apply("s17-r", + from_wkt("SEGMENT(-140 80, 140 10)"), + 140, 10, 220, 80); + + tester::apply("s18", + from_wkt("SEGMENT(20 10, 100 80)"), + 20, 10, 100, 80); + + tester::apply("s18-r", + from_wkt("SEGMENT(100 80, 20 10)"), + 20, 10, 100, 80); + + // segment connecting the north and south pole + // + // this should be forbidden actually, as it is not well-defined + // with this test we demonstrate that the algorithm still returns + // something meaningful + tester::apply("s99", + from_wkt("SEGMENT(10 90,20 -90)"), + 0, -90, 0, 90); + + // https://svn.boost.org/trac/boost/ticket/12106 + tester::apply("s100_ticket_12106", + G(P(11.488323611111111, 53.687086666666673), P(11.488324166666667, 53.687086666666673)), + 11.488323611111111, 53.687086666666673, 11.488324166666667, 53.687086666666673); + + double const heps = eps / 2; + + tester::apply("s101", + G(P(1, 1), P(1-heps, 1-heps)), + 1-heps, 1-heps, 1, 1); + tester::apply("s102", + G(P(1, 1), P(1, 1-heps)), + 1, 1-heps, 1, 1); + tester::apply("s103", + G(P(1, 1), P(1-heps, 1)), + 1-heps, 1, 1, 1); + tester::apply("s104", + G(P(2, 1), P(1, 1-heps)), + 1, 1-heps, 2, 1.000038070652770505); + tester::apply("s105", + G(P(1, 2), P(1-heps, 1)), + 1-heps, 1, 1, 2); +} + +BOOST_AUTO_TEST_CASE( envelope_segment_spherical_polar ) +{ + typedef bg::cs::spherical coordinate_system_type; + typedef bg::model::point P; + typedef bg::model::segment

G; + typedef bg::model::box

B; + typedef test_envelope_on_sphere_or_spheroid tester; + + tester::apply("s01", + from_wkt("SEGMENT(10 10,40 40)"), + 10, 10, 40, 40); + + tester::apply("s02", + from_wkt("SEGMENT(10 80,40 80)"), + 10, 90 - 10.345270046149988, 40, 80); + + tester::apply("s03", + from_wkt("SEGMENT(160 80,-170 80)"), + 160, 90 - 10.34527004614999, 190, 80); + + // segment ending at the north pole + tester::apply("s05", + from_wkt("SEGMENT(40 45,80 0)"), + 40, 0, 40, 45); +} + + +BOOST_AUTO_TEST_CASE( envelope_segment_spheroid ) +{ + typedef bg::cs::geographic coordinate_system_type; + typedef bg::model::point P; + typedef bg::model::segment

G; + typedef bg::model::box

B; + typedef test_envelope_on_sphere_or_spheroid tester; + + double const eps = std::numeric_limits::epsilon(); + + tester::apply("s01", + from_wkt("SEGMENT(10 10,40 40)"), + 10, 10, 40, 40); + + tester::apply("s02", + from_wkt("SEGMENT(10 10,40 10)"), + 10, 10, 40, 10.347587605817942); + + tester::apply("s02a", + from_wkt("SEGMENT(40 10,10 10)"), + 10, 10, 40, 10.347587605817942); + + tester::apply("s03", + from_wkt("SEGMENT(160 10,-170 10)"), + 160, 10, 190, 10.347587605817942); + + tester::apply("s03a", + from_wkt("SEGMENT(-170 10,160 10)"), + 160, 10, 190, 10.347587605817942); + + tester::apply("s03b", + from_wkt("SEGMENT(-170 -10,160 -10)"), + 160, -10.347587605817942, 190, -10); + + tester::apply("s04", + from_wkt("SEGMENT(-40 45,140 60)"), + -40, 45, 140, 90); + + tester::apply("s04a", + from_wkt("SEGMENT(-40 45,140 25)"), + -40, 25, 140, 90); + + // segment ending at the north pole + tester::apply("s05", + from_wkt("SEGMENT(40 45,80 90)"), + 40, 45, 40, 90); + + // segment starting at the north pole + tester::apply("s05a", + from_wkt("SEGMENT(80 90,40 45)"), + 40, 45, 40, 90); + + // segment ending at the north pole + tester::apply("s06", + from_wkt("SEGMENT(-40 45,80 90)"), + -40, 45, -40, 90); + + // segment starting at the north pole + tester::apply("s06a", + from_wkt("SEGMENT(70 90,-40 45)"), + -40, 45, -40, 90); + + // segment ending at the north pole + tester::apply("s07", + from_wkt("SEGMENT(40 -45,80 90)"), + 40, -45, 40, 90); + + // segment passing through the south pole + tester::apply("s08", + from_wkt("SEGMENT(-170 -45,10 -30)"), + -170, -90, 10, -30); + + tester::apply("s09", + from_wkt("SEGMENT(1 -45,179 30)"), + 1, rng(-85.392785243526134, -85.392785243525253), 179, 30); + + tester::apply("s09a", + from_wkt("SEGMENT(2 -45,181 30)"), + 2, rng(-87.689300911353811, -87.689300911353371), 181, 30); + + // very long segment + tester::apply("s10", + from_wkt("SEGMENT(0 -45,181 30)"), + -179, rng(-87.689300911353797, -87.689300911353385), 0, 30); + + tester::apply("s11", + from_wkt("SEGMENT(260 30,20 45)"), + -100, 30, 20, rng(57.990810958016482, 57.990810958016965)); + + tester::apply("s11a", + from_wkt("SEGMENT(260 45,20 30)"), + -100, 30, 20, rng(57.990810958016453, 57.990810958016965)); + + // segment degenerating to the north pole + tester::apply("s12", + from_wkt("SEGMENT(10 90,20 90)"), + 0, 90, 0, 90); + + // segment degenerating to the south pole + tester::apply("s13", + from_wkt("SEGMENT(10 -90,20 -90)"), + 0, -90, 0, -90); + + tester::apply("s14", + from_wkt("SEGMENT(20 20,10 30)"), + 10, 20, 20, 30);//48.87458730907602); + + tester::apply("s15", + from_wkt("SEGMENT(50 45,185 45)"), + 50, 45, 185, rng(69.098479073902851, 69.098479073903178)); + + // segment that lies on the equator + tester::apply("s16", + from_wkt("SEGMENT(0 0,50 0)"), + 0, 0, 50, 0); + + // segment that lies on the equator + tester::apply("s16a", + from_wkt("SEGMENT(-50 0,50 0)"), + -50, 0, 50, 0); + + // segment that lies on the equator and touches antimeridian + tester::apply("s16b", + from_wkt("SEGMENT(50 0,180 0)"), + 50, 0, 180, 0); + + // segment that lies on the equator and crosses antimeridian + tester::apply("s16c", + from_wkt("SEGMENT(-170 0,160 0)"), + 160, 0, 190, 0); + + tester::apply("s17", + from_wkt("SEGMENT(140 10, -140 80)"), + 140, 10, 220, 80); + + tester::apply("s17-r", + from_wkt("SEGMENT(-140 80, 140 10)"), + 140, 10, 220, 80); + + tester::apply("s18", + from_wkt("SEGMENT(20 10, 100 80)"), + 20, 10, 100, 80); + + tester::apply("s18-r", + from_wkt("SEGMENT(100 80, 20 10)"), + 20, 10, 100, 80); + + // segment connecting the north and south pole + // + // this should be forbidden actually, as it is not well-defined + // with this test we demonstrate that the algorithm still returns + // something meaningful + tester::apply("s99", + from_wkt("SEGMENT(10 90,20 -90)"), + 0, -90, 0, 90); + + // https://svn.boost.org/trac/boost/ticket/12106 + tester::apply("s100_ticket_12106", + G(P(11.488323611111111, 53.687086666666673), P(11.488324166666667, 53.687086666666673)), + 11.488323611111111, 53.687086666666673, 11.488324166666667, 53.687086666666673); + + double const heps = eps / 2; + + tester::apply("s101", + G(P(1, 1), P(1-heps, 1-heps)), + 1-heps, 1-heps, 1, 1); + tester::apply("s102", + G(P(1, 1), P(1, 1-heps)), + 1, 1-heps, 1, 1); + tester::apply("s103", + G(P(1, 1), P(1-heps, 1)), + 1-heps, 1, 1, 1); + tester::apply("s104", + G(P(2, 1), P(1, 1-heps)), + 1, 1-heps, 2, rng(1.0000383271568751, 1.0000383271569036)); + tester::apply("s105", + G(P(1, 2), P(1-heps, 1)), + 1-heps, 1, 1, 2); +} + +BOOST_AUTO_TEST_CASE( envelope_segment_spheroid_with_strategy_thomas ) +{ + + typedef bg::cs::geographic coordinate_system_type; + typedef bg::model::point P; + typedef bg::model::segment

G; + typedef bg::model::box

B; + typedef test_envelope_on_sphere_or_spheroid + < + G, B, + bg::tag::type, + test_reverse_geometry::value, + bg::strategy::thomas + > tester; + + tester::apply("s01", + from_wkt("SEGMENT(10 10,40 40)"), + 10, 10, 40, 40); + + tester::apply("s02", + from_wkt("SEGMENT(10 10,40 10)"), + 10, 10, 40, 10.347587605817942); + + tester::apply("s02a", + from_wkt("SEGMENT(40 10,10 10)"), + 10, 10, 40, 10.347587605817942); + + tester::apply("s03", + from_wkt("SEGMENT(160 10,-170 10)"), + 160, 10, 190, 10.347587605817942); + + tester::apply("s03a", + from_wkt("SEGMENT(-170 10,160 10)"), + 160, 10, 190, 10.347587605817942); + + tester::apply("s03b", + from_wkt("SEGMENT(-170 -10,160 -10)"), + 160, -10.347587605817942, 190, -10); + + tester::apply("s04", + from_wkt("SEGMENT(-40 45,140 60)"), + -40, 45, 140, 90); + + tester::apply("s04a", + from_wkt("SEGMENT(-40 45,140 25)"), + -40, 25, 140, 90); + + // segment ending at the north pole + tester::apply("s05", + from_wkt("SEGMENT(40 45,80 90)"), + 40, 45, 40, 90); + + // segment starting at the north pole + tester::apply("s05a", + from_wkt("SEGMENT(80 90,40 45)"), + 40, 45, 40, 90); + + // segment ending at the north pole + tester::apply("s06", + from_wkt("SEGMENT(-40 45,80 90)"), + -40, 45, -40, 90); + + // segment starting at the north pole + tester::apply("s06a", + from_wkt("SEGMENT(70 90,-40 45)"), + -40, 45, -40, 90); + + // segment ending at the north pole + tester::apply("s07", + from_wkt("SEGMENT(40 -45,80 90)"), + 40, -45, 40, 90); + + // segment passing through the south pole + tester::apply("s08", + from_wkt("SEGMENT(-170 -45,10 -30)"), + -170, -90, 10, -30); + + tester::apply("s09", + from_wkt("SEGMENT(1 -45,179 30)"), + 1, rng(-85.392785243526134, -85.392785243525253), 179, 30); + + tester::apply("s09a", + from_wkt("SEGMENT(2 -45,181 30)"), + 2, rng(-87.689300911353811, -87.689300911353371), 181, 30); + + // very long segment + tester::apply("s10", + from_wkt("SEGMENT(0 -45,181 30)"), + -179, rng(-87.689300911353797, -87.689300911353385), 0, 30); + + tester::apply("s11", + from_wkt("SEGMENT(260 30,20 45)"), + -100, 30, 20, rng(57.990810958016482, 57.990810958016965)); + + tester::apply("s11a", + from_wkt("SEGMENT(260 45,20 30)"), + -100, 30, 20, rng(57.990810958016453, 57.990810958016965)); + + // segment degenerating to the north pole + tester::apply("s12", + from_wkt("SEGMENT(10 90,20 90)"), + 0, 90, 0, 90); + + // segment degenerating to the south pole + tester::apply("s13", + from_wkt("SEGMENT(10 -90,20 -90)"), + 0, -90, 0, -90); + + tester::apply("s14", + from_wkt("SEGMENT(20 20,10 30)"), + 10, 20, 20, 30);//48.87458730907602); + + tester::apply("s15", + from_wkt("SEGMENT(50 45,185 45)"), + 50, 45, 185, rng(69.098479073902851, 69.098479073903178)); + + // segment that lies on the equator + tester::apply("s16", + from_wkt("SEGMENT(0 0,50 0)"), + 0, 0, 50, 0); + + // segment that lies on the equator + tester::apply("s16a", + from_wkt("SEGMENT(-50 0,50 0)"), + -50, 0, 50, 0); + + // segment that lies on the equator and touches antimeridian + tester::apply("s16b", + from_wkt("SEGMENT(50 0,180 0)"), + 50, 0, 180, 0); + + // segment that lies on the equator and crosses antimeridian + tester::apply("s16c", + from_wkt("SEGMENT(-170 0,160 0)"), + 160, 0, 190, 0); + + tester::apply("s17", + from_wkt("SEGMENT(140 10, -140 80)"), + 140, 10, 220, 80); + + tester::apply("s17-r", + from_wkt("SEGMENT(-140 80, 140 10)"), + 140, 10, 220, 80); + + tester::apply("s18", + from_wkt("SEGMENT(20 10, 100 80)"), + 20, 10, 100, 80); + + tester::apply("s18-r", + from_wkt("SEGMENT(100 80, 20 10)"), + 20, 10, 100, 80); + +} + +BOOST_AUTO_TEST_CASE( envelope_segment_spheroid_with_strategy_andoyer ) +{ + + typedef bg::cs::geographic coordinate_system_type; + typedef bg::model::point P; + typedef bg::model::segment

G; + typedef bg::model::box

B; + typedef test_envelope_on_sphere_or_spheroid + < + G, B, + bg::tag::type, + test_reverse_geometry::value, + bg::strategy::andoyer + > tester; + + tester::apply("s01", + from_wkt("SEGMENT(10 10,40 40)"), + 10, 10, 40, 40); + + tester::apply("s02", + from_wkt("SEGMENT(10 10,40 10)"), + 10, 10, 40, 10.34758709960203); + + tester::apply("s02a", + from_wkt("SEGMENT(40 10,10 10)"), + 10, 10, 40, 10.34758709960203); + + tester::apply("s03", + from_wkt("SEGMENT(160 10,-170 10)"), + 160, 10, 190, 10.34758709960203); + + tester::apply("s03a", + from_wkt("SEGMENT(-170 10,160 10)"), + 160, 10, 190, 10.34758709960203); + + tester::apply("s03b", + from_wkt("SEGMENT(-170 -10,160 -10)"), + 160, -10.34758709960203, 190, -10); + + tester::apply("s04", + from_wkt("SEGMENT(-40 45,140 60)"), + -40, 45, 140, 90); + + tester::apply("s04a", + from_wkt("SEGMENT(-40 45,140 25)"), + -40, 25, 140, 90); + + // segment ending at the north pole + tester::apply("s05", + from_wkt("SEGMENT(40 45,80 90)"), + 40, 45, 40, 90); + + // segment starting at the north pole + tester::apply("s05a", + from_wkt("SEGMENT(80 90,40 45)"), + 40, 45, 40, 90); + + // segment ending at the north pole + tester::apply("s06", + from_wkt("SEGMENT(-40 45,80 90)"), + -40, 45, -40, 90); + + // segment starting at the north pole + tester::apply("s06a", + from_wkt("SEGMENT(70 90,-40 45)"), + -40, 45, -40, 90); + + // segment ending at the north pole + tester::apply("s07", + from_wkt("SEGMENT(40 -45,80 90)"), + 40, -45, 40, 90); + + // segment passing through the south pole + tester::apply("s08", + from_wkt("SEGMENT(-170 -45,10 -30)"), + -170, -90, 10, -30); + + tester::apply("s09", + from_wkt("SEGMENT(1 -45,179 30)"), + 1, rng(-85.394745211091248, -85.394745211090353), 179, 30); + + tester::apply("s09a", + from_wkt("SEGMENT(2 -45,181 30)"), + 2, rng(-87.690317839849726, -87.690317839849271), 181, 30); + + // very long segment + tester::apply("s10", + from_wkt("SEGMENT(0 -45,181 30)"), + -179, rng(-87.69031783984974, -87.690317839849271), 0, 30); + + tester::apply("s11", + from_wkt("SEGMENT(260 30,20 45)"), + -100, 30, 20, rng(57.990742552279649, 57.990742552280153)); + + tester::apply("s11a", + from_wkt("SEGMENT(260 45,20 30)"), + -100, 30, 20, rng(57.99074255227962, 57.990742552280118)); + + // segment degenerating to the north pole + tester::apply("s12", + from_wkt("SEGMENT(10 90,20 90)"), + 0, 90, 0, 90); + + // segment degenerating to the south pole + tester::apply("s13", + from_wkt("SEGMENT(10 -90,20 -90)"), + 0, -90, 0, -90); + + tester::apply("s14", + from_wkt("SEGMENT(20 20,10 30)"), + 10, 20, 20, 30);//48.87458730907602); + + tester::apply("s15", + from_wkt("SEGMENT(50 45,185 45)"), + 50, 45, 185, rng(69.098446893408124, 69.09844689340845)); + + // segment that lies on the equator + tester::apply("s16", + from_wkt("SEGMENT(0 0,50 0)"), + 0, 0, 50, 0); + + // segment that lies on the equator + tester::apply("s16a", + from_wkt("SEGMENT(-50 0,50 0)"), + -50, 0, 50, 0); + + // segment that lies on the equator and touches antimeridian + tester::apply("s16b", + from_wkt("SEGMENT(50 0,180 0)"), + 50, 0, 180, 0); + + // segment that lies on the equator and crosses antimeridian + tester::apply("s16c", + from_wkt("SEGMENT(-170 0,160 0)"), + 160, 0, 190, 0); + + tester::apply("s17", + from_wkt("SEGMENT(140 10, -140 80)"), + 140, 10, 220, 80); + + tester::apply("s17-r", + from_wkt("SEGMENT(-140 80, 140 10)"), + 140, 10, 220, 80); + + tester::apply("s18", + from_wkt("SEGMENT(20 10, 100 80)"), + 20, 10, 100, 80); + + tester::apply("s18-r", + from_wkt("SEGMENT(100 80, 20 10)"), + 20, 10, 100, 80); + + // segments intersecting pole + tester::apply("s19", + from_wkt("SEGMENT(0 0, 180 0)"), + 0, 0, 180, 90); + tester::apply("s20", + from_wkt("SEGMENT(0 0, -180 0)"), + 0, 0, 180, 90); + tester::apply("s21", + from_wkt("SEGMENT(0 1, 180 1)"), + 0, 1, 180, 90, + std::numeric_limits::epsilon() * 10); + tester::apply("s22", + from_wkt("SEGMENT(0 -1, 180 -1)"), + 0, -90, 180, -1, + std::numeric_limits::epsilon() * 10); + +} + +BOOST_AUTO_TEST_CASE( envelope_segment_spheroid_with_strategy_vincenty ) +{ + + typedef bg::cs::geographic coordinate_system_type; + typedef bg::model::point P; + typedef bg::model::segment

G; + typedef bg::model::box

B; + typedef test_envelope_on_sphere_or_spheroid + < + G, B, + bg::tag::type, + test_reverse_geometry::value, + bg::strategy::vincenty + > tester; + + tester::apply("s01", + from_wkt("SEGMENT(10 10,40 40)"), + 10, 10, 40, 40); + + tester::apply("s02", + from_wkt("SEGMENT(10 10,40 10)"), + 10, 10, 40, rng(10.347587628821937, 10.347587628821941)); + + tester::apply("s02a", + from_wkt("SEGMENT(40 10,10 10)"), + 10, 10, 40, rng(10.347587628821937, 10.347587628821941)); + + tester::apply("s03", + from_wkt("SEGMENT(160 10,-170 10)"), + 160, 10, 190, rng(10.347587628821937, 10.347587628821941)); + + tester::apply("s03a", + from_wkt("SEGMENT(-170 10,160 10)"), + 160, 10, 190, rng(10.347587628821937, 10.347587628821941)); + + tester::apply("s03b", + from_wkt("SEGMENT(-170 -10,160 -10)"), + 160, rng(-10.347587628821941, -10.347587628821937), 190, -10); + + tester::apply("s04", + from_wkt("SEGMENT(-40 45,140 60)"), + -40, 45, 140, 90); + + tester::apply("s04a", + from_wkt("SEGMENT(-40 45,140 25)"), + -40, 25, 140, 90); + + // segment ending at the north pole + tester::apply("s05", + from_wkt("SEGMENT(40 45,80 90)"), + 40, 45, 40, 90); + + // segment starting at the north pole + tester::apply("s05a", + from_wkt("SEGMENT(80 90,40 45)"), + 40, 45, 40, 90); + + // segment ending at the north pole + tester::apply("s06", + from_wkt("SEGMENT(-40 45,80 90)"), + -40, 45, -40, 90); + + // segment starting at the north pole + tester::apply("s06a", + from_wkt("SEGMENT(70 90,-40 45)"), + -40, 45, -40, 90); + + // segment ending at the north pole + tester::apply("s07", + from_wkt("SEGMENT(40 -45,80 90)"), + 40, -45, 40, 90); + + // segment passing through the south pole + tester::apply("s08", + from_wkt("SEGMENT(-170 -45,10 -30)"), + -170, -90, 10, -30); + + tester::apply("s09", + from_wkt("SEGMENT(1 -45,179 30)"), + 1, rng(-85.392840929577218, -85.392840929576352), 179, 30); + + tester::apply("s09a", + from_wkt("SEGMENT(2 -45,181 30)"), + 2, rng(-87.689330275867817, -87.689330275867405), 181, 30); + + // very long segment + tester::apply("s10", + from_wkt("SEGMENT(0 -45,181 30)"), + -179, rng(-87.689330275867832, -87.689330275867405), 0, 30); + + tester::apply("s11", + from_wkt("SEGMENT(260 30,20 45)"), + -100, 30, 20, rng(57.990810647056549, 57.990810647057032)); + + tester::apply("s11a", + from_wkt("SEGMENT(260 45,20 30)"), + -100, 30, 20, rng(57.990810647056541, 57.990810647057032)); + + // segment degenerating to the north pole + tester::apply("s12", + from_wkt("SEGMENT(10 90,20 90)"), + 0, 90, 0, 90); + + // segment degenerating to the south pole + tester::apply("s13", + from_wkt("SEGMENT(10 -90,20 -90)"), + 0, -90, 0, -90); + + tester::apply("s14", + from_wkt("SEGMENT(20 20,10 30)"), + 10, 20, 20, 30);//48.87458730907602); + + tester::apply("s15", + from_wkt("SEGMENT(50 45,185 45)"), + 50, 45, 185, rng(69.098479136978156, 69.098479136978497)); + + // segment that lies on the equator + tester::apply("s16", + from_wkt("SEGMENT(0 0,50 0)"), + 0, 0, 50, 0); + + // segment that lies on the equator + tester::apply("s16a", + from_wkt("SEGMENT(-50 0,50 0)"), + -50, 0, 50, 0); + + // segment that lies on the equator and touches antimeridian + tester::apply("s16b", + from_wkt("SEGMENT(50 0,180 0)"), + 50, 0, 180, 0); + + // segment that lies on the equator and crosses antimeridian + tester::apply("s16c", + from_wkt("SEGMENT(-170 0,160 0)"), + 160, 0, 190, 0); + + tester::apply("s17", + from_wkt("SEGMENT(140 10, -140 80)"), + 140, 10, 220, 80); + + tester::apply("s17-r", + from_wkt("SEGMENT(-140 80, 140 10)"), + 140, 10, 220, 80); + + tester::apply("s18", + from_wkt("SEGMENT(20 10, 100 80)"), + 20, 10, 100, 80); + + tester::apply("s18-r", + from_wkt("SEGMENT(100 80, 20 10)"), + 20, 10, 100, 80); + +} + +BOOST_AUTO_TEST_CASE( envelope_segment_sphere_with_height ) +{ + typedef bg::cs::spherical_equatorial coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::segment G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + tester::apply("sh01", + from_wkt("SEGMENT(10 10 567,40 40 1356)"), + 10, 10, 567, 40, 40, 1356); + + tester::apply("sh02", + from_wkt("SEGMENT(10 10 1356,40 40 567)"), + 10, 10, 567, 40, 40, 1356); +} + +BOOST_AUTO_TEST_CASE( envelope_segment_spheroid_with_height ) +{ + typedef bg::cs::geographic coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::segment G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + tester::apply("sh01", + from_wkt("SEGMENT(10 10 567,40 40 1356)"), + 10, 10, 567, 40, 40, 1356); + + tester::apply("sh02", + from_wkt("SEGMENT(10 10 1356,40 40 567)"), + 10, 10, 567, 40, 40, 1356); +} + +template +void test_envelope_multipoint() +{ + typedef bg::model::point P; + typedef bg::model::multi_point

G; + typedef bg::model::box

B; + typedef test_envelope_on_sphere_or_spheroid tester; + + // empty multipoint + test_empty_geometry("mp00", "MULTIPOINT()"); + + tester::apply("mp01", + from_wkt("MULTIPOINT(0 0,10 10)"), + 0, 0, 10, 10); + + tester::apply("mp02", + from_wkt("MULTIPOINT(0 10,10 0)"), + 0, 0, 10, 10); + + tester::apply("mp03", + from_wkt("MULTIPOINT(-10 20,0 10,10 0)"), + -10, 0, 10, 20); + + tester::apply("mp04", + from_wkt("MULTIPOINT(-10 20,0 10,10 -15)"), + -10, -15, 10, 20); + + tester::apply("mp05", + from_wkt("MULTIPOINT(-85 10,85 -20)"), + -85, -20, 85, 10); + + tester::apply("mp06", + from_wkt("MULTIPOINT(-95 10,85 -20)"), + -95, -20, 85, 10); + + tester::apply("mp07", + from_wkt("MULTIPOINT(-96 10,85 -20)"), + 85, -20, -96+360, 10); + + tester::apply("mp08", + from_wkt("MULTIPOINT(175 15,-175 -20)"), + 175, -20, -175+360, 15); + + tester::apply("mp09", + from_wkt("MULTIPOINT(170 15,170 20,-175 10,-90 10,10 10)"), + 170, 10, 10+360, 20); + + // this should fail + tester::apply("mp09a", + from_wkt("MULTIPOINT(10 10,170 15,170 20,-175 10,-90 10)"), + 170, 10, 10+360, 20); + + + tester::apply("mp10", + from_wkt("MULTIPOINT(10 10,20 90,30 -90)"), + 10, -90, 10, 90); + + // this should fail + tester::apply("mp11", + from_wkt("MULTIPOINT(179 90,-179 -90,10 10)"), + 10, -90, 10, 90); + + tester::apply("mp11a", + from_wkt("MULTIPOINT(10 10,179 90,-179 -90)"), + 10, -90, 10, 90); + + // this should fail + tester::apply("mp11b", + from_wkt("MULTIPOINT(179 90,-179 -90,-90 0)"), + -90, -90, -90, 90); + + tester::apply("mp11c", + from_wkt("MULTIPOINT(-90 0,179 90,-179 -90,-90 0)"), + -90, -90, -90, 90); + + tester::apply("mp12", + from_wkt("MULTIPOINT(170 -30,175 60,-178 10)"), + 170, -30, -178+360, 60); + + tester::apply("mp13", + from_wkt("MULTIPOINT(-170 -30,-175 40,178 50)"), + 178, -30, -170+360, 50); + + tester::apply("mp13a", + from_wkt("MULTIPOINT(-170 -30,178 50)"), + 178, -30, -170+360, 50); + + tester::apply("mp13b", + from_wkt("MULTIPOINT(-170 -30,178 50,-175 40)"), + 178, -30, -170+360, 50); + + tester::apply("mp15", + from_wkt("MULTIPOINT(10 -20)"), + 10, -20, 10, -20); + + tester::apply("mp16", + from_wkt("MULTIPOINT(0 90,10 90)"), + 0, 90, 0, 90); + + tester::apply("mp17", + from_wkt("MULTIPOINT(179 80,-179 -80,10 10)"), + 10, -80, -179+360, 80); + + tester::apply("mp17a", + from_wkt("MULTIPOINT(10 10,179 80,-179 -80)"), + 10, -80, -179+360, 80); + + tester::apply("mp17b", + from_wkt("MULTIPOINT(179 80,-179 -80,-90 0)"), + 179, -80, -90+360, 80); + + tester::apply("mp17c", + from_wkt("MULTIPOINT(-90 0,179 80,-179 -80,-90 0)"), + 179, -80, -90+360, 80); + + tester::apply("mp18", + from_wkt("MULTIPOINT(-170 45,20 25,40 40)"), + 20, 25, 190, 45); + +#ifdef BOOST_GEOMETRY_NORMALIZE_LATITUDE + tester::apply("mp18a", + from_wkt("MULTIPOINT(10 135,20 25,40 40)"), + 20, 25, 190, 45); +#endif + + tester::apply("mp19", + from_wkt("MULTIPOINT(350 45,20 25,40 40)"), + -10, 25, 40, 45); + +#ifdef BOOST_GEOMETRY_NORMALIZE_LATITUDE + tester::apply("mp19a", + from_wkt("MULTIPOINT(170 135,20 25,40 40)"), + -10, 25, 40, 45); +#endif + + double eps = std::numeric_limits::epsilon(); + double heps = eps / 2; + { + G mp; + mp.push_back(P(1, 1)); + mp.push_back(P(1-heps, 1-heps)); + tester::apply("mp20", mp, 1-heps, 1-heps, 1, 1); + } +} + +BOOST_AUTO_TEST_CASE( envelope_multipoint ) +{ + test_envelope_multipoint >(); + test_envelope_multipoint >(); +} + + +template +void test_envelope_multipoint_with_height() +{ + typedef bg::model::point point_type; + typedef bg::model::multi_point G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + // empty multipoint + test_empty_geometry("mph00", "MULTIPOINT()"); + + tester::apply("mph01", + from_wkt("MULTIPOINT(0 0 567,10 10 1456)"), + 0, 0, 567, 10, 10, 1456); + + tester::apply("mph02", + from_wkt("MULTIPOINT(0 0 567,10 10 1456,20 90 967)"), + 0, 0, 567, 10, 90, 1456); +} + +BOOST_AUTO_TEST_CASE( envelope_multipoint_with_height ) +{ + test_envelope_multipoint_with_height + < + bg::cs::spherical_equatorial + >(); + test_envelope_multipoint_with_height >(); +} + + +template +void test_envelope_box() +{ + typedef bg::model::point P; + typedef bg::model::box

G; + typedef bg::model::box

B; + typedef test_envelope_on_sphere_or_spheroid tester; + + tester::apply("b01", + from_wkt("BOX(10 10,20 20)"), + 10, 10, 20, 20); + +#ifdef BOOST_GEOMETRY_NORMALIZE_LATITUDE + tester::apply("b02", + from_wkt("BOX(10 370,20 20)"), + 10, 10, 20, 20); +#endif + + // box crosses anti-meridian + tester::apply("b02a", + from_wkt("BOX(170 10,-170 20)"), + 170, 10, 190, 20); + + tester::apply("b03", + from_wkt("BOX(-170 10,170 20)"), + -170, 10, 170, 20); + + tester::apply("b04", + from_wkt("BOX(10 10,350 20)"), + 10, 10, 350, 20); + + tester::apply("b04a", + from_wkt("BOX(10 10,-10 20)"), + 10, 10, 350, 20); + + // box is a band + tester::apply("b05", + from_wkt("BOX(0 10,360 20)"), + -180, 10, 180, 20); + + tester::apply("b05a", + from_wkt("BOX(0 10,0 20)"), + 0, 10, 0, 20); + + // box is almost a band + tester::apply("b06", + from_wkt("BOX(10 10,5 20)"), + 10, 10, 365, 20); + + // initial box is a band that crosses itself + tester::apply("b07", + from_wkt("BOX(0 10,540 20)"), + -180, 10, 180, 20); + + // initial box is a band that crosses itself + tester::apply("b08", + from_wkt("BOX(0 10,720 20)"), + -180, 10, 180, 20); + + tester::apply("b09", + from_wkt("BOX(10 10,10 10)"), + 10, 10, 10, 10); + + tester::apply("b09a", + from_wkt("BOX(370 10,370 10)"), + 10, 10, 10, 10); + + // box contains north and south pole + tester::apply("b10", + from_wkt("BOX(0 -90,0 90)"), + 0, -90, 0, 90); + + // box contains north and south pole + tester::apply("b10a", + from_wkt("BOX(10 -90,10 90)"), + 10, -90, 10, 90); + + // box contains north and south pole + tester::apply("b10b", + from_wkt("BOX(0 -90,10 90)"), + 0, -90, 10, 90); + + // box contains north and south pole + tester::apply("b11", + from_wkt("BOX(0 -90,180 90)"), + 0, -90, 180, 90); + + // box contains north and south pole + tester::apply("b11a", + from_wkt("BOX(10 -90,190 90)"), + 10, -90, 190, 90); + + // box contains north and south pole + tester::apply("b11b", + from_wkt("BOX(10 -90,110 90)"), + 10, -90, 110, 90); + + // box contains north and south pole and is a band + // (box covers the entire spheroid) + tester::apply("b12", + from_wkt("BOX(0 -90,360 90)"), + -180, -90, 180, 90); + + // box contains north and south pole and is a band + // (box covers the entire spheroid) + tester::apply("b12a", + from_wkt("BOX(10 -90,370 90)"), + -180, -90, 180, 90); + + // box contains north and south pole and is a band + // (box covers the entire spheroid) + tester::apply("b12b", + from_wkt("BOX(-175 -90,185 90)"), + -180, -90, 180, 90); + + // box contains north and south pole and is a band + // (box covers the entire spheroid) + tester::apply("b12c", + from_wkt("BOX(-175 -90,185 90)"), + -180, -90, 180, 90); + + // box contains north and south pole and is a band and is self-intersecting + // (box covers the entire spheroid) + tester::apply("b12d", + from_wkt("BOX(-175 -90,186 90)"), + -180, -90, 180, 90); + + // box contains north and south pole and is a band and is self-intersecting + // (box covers the entire spheroid) + tester::apply("b12e", + from_wkt("BOX(0 -90,540 90)"), + -180, -90, 180, 90); + + // box contains north and south pole and is a band and is self-intersecting + // (box covers the entire spheroid) + tester::apply("b12f", + from_wkt("BOX(10 -90,540 90)"), + -180, -90, 180, 90); + + // box is a band + tester::apply("b13", + from_wkt("BOX(180 -10,-180 10)"), + -180, -10, 180, 10); + + // box contains north and south pole and is a band + // (box covers the entire spheroid) + tester::apply("b13a", + from_wkt("BOX(180 -90,-180 90)"), + -180, -90, 180, 90); + + tester::apply("b14", + from_wkt("BOX(0 10,30 90)"), + 0, 10, 30, 90); + + tester::apply("b15", + from_wkt("BOX(179 10,178 70)"), + 179, 10, 538, 70); + + // box contains north pole + tester::apply("b16", + from_wkt("BOX(10 40,20 90)"), + 10, 40, 20, 90); + + tester::apply("b16a", + from_wkt("BOX(170 40,-170 90)"), + 170, 40, 190, 90); + + // box contains south pole + tester::apply("b17", + from_wkt("BOX(10 -90,20 40)"), + 10, -90, 20, 40); + + tester::apply("b17a", + from_wkt("BOX(150 -90,-150 40)"), + 150, -90, 210, 40); + + // box degenerates to the north pole + tester::apply("b98", + from_wkt("BOX(10 90,20 90)"), + 0, 90, 0, 90); + + // box degenerates to the south pole + tester::apply("b99", + from_wkt("BOX(10 -90,20 -90)"), + 0, -90, 0, -90); + + double eps = std::numeric_limits::epsilon(); + double heps = eps / 2; + + tester::apply("b100", G(P(1-heps, 1-heps), P(1, 1)), 1-heps, 1-heps, 1, 1); +} + +template +void test_envelope_box_polar() +{ + typedef bg::model::point P; + typedef bg::model::box

G; + typedef bg::model::box

B; + typedef test_envelope_on_sphere_or_spheroid tester; + + tester::apply("b01", + from_wkt("BOX(10 10,20 20)"), + 10, 10, 20, 20); + + tester::apply("b02a", + from_wkt("BOX(170 10,-170 20)"), + 170, 10, 190, 20); + + tester::apply("b10b", + from_wkt("BOX(0 0,10 180)"), + 0, 0, 10, 180); + + tester::apply("b16a", + from_wkt("BOX(170 40,-170 180)"), + 170, 40, 190, 180); +} + +BOOST_AUTO_TEST_CASE( envelope_box ) +{ + test_envelope_box >(); + test_envelope_box >(); + test_envelope_box_polar >(); +} + + +template +void test_envelope_box_with_height() +{ + typedef bg::cs::spherical_equatorial coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::box G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + tester::apply("bh01", + from_wkt("BOX(10 10 567,20 20 2834)"), + 10, 10, 567, 20, 20, 2834); + + tester::apply("bh02", + from_wkt("BOX(10 10 567,20 20 567)"), + 10, 10, 567, 20, 20, 567); + + tester::apply("bh03", + from_wkt("BOX(0 10 567,170 90 1567)"), + 0, 10, 567, 170, 90, 1567); +} + +BOOST_AUTO_TEST_CASE( envelope_box_with_height ) +{ + test_envelope_box_with_height >(); + test_envelope_box_with_height >(); +} + + +BOOST_AUTO_TEST_CASE( envelope_sphere_linestring ) +{ + typedef bg::cs::spherical_equatorial coordinate_system_type; + typedef bg::model::point P; + typedef bg::model::linestring

G; + typedef bg::model::box

B; + typedef test_envelope_on_sphere_or_spheroid tester; + + // empty linestring + test_empty_geometry("l00", "LINESTRING()"); + + tester::apply("l01", + from_wkt("LINESTRING(10 15)"), + 10, 15, 10, 15); + + tester::apply("l01a", + from_wkt("LINESTRING(370 15)"), + 10, 15, 10, 15); + + tester::apply("l01b", + from_wkt("LINESTRING(370 90)"), + 0, 90, 0, 90); + + tester::apply("l02", + from_wkt("LINESTRING(10 10,20 20,10 30)"), + 10, 10, 20, 30); + + // linestring that circles the entire globe + tester::apply("l03", + from_wkt("LINESTRING(-185 0,-170 25,-50 10,10 10,20 20,100 5,180 15)"), + -180, 0, 180, 33.587539971516854, + 4.0 * std::numeric_limits::epsilon()); + + // linestring that crosses the antimeridian but staying close to it + tester::apply("l04", + from_wkt("LINESTRING(-170 10,170 45,160 5,-160 25)"), + 160, 5, 200, 45); + + // linestring that goes through the north pole (twice) + tester::apply("l05", + from_wkt("LINESTRING(-170 80,10 60,20 80,-160 30)"), + -170, 30, 20, 90); + + // linestring that goes through the north pole (three times) + tester::apply("l05a", + from_wkt("LINESTRING(-170 80,10 60,20 80,-160 30,-150 30,30 70)"), + -170, 30, 30, 90); + + // linestring that goes through the north pole (four times) + tester::apply("l05b", + from_wkt("LINESTRING(-170 80,10 60,20 80,-160 30,-150 30,30 70,40 85,-140 25)"), + -170, 25, 40, 90); + + // linestring that goes through the north pole (five times) + tester::apply("l05c", + from_wkt("LINESTRING(-170 80,10 60,20 80,-160 30,-150 30,30 70,40 85,-140 25,-130 25,50 45)"), + -170, 25, 50, 90); + + // linestring that goes through the north pole (five times) + tester::apply("l05d", + from_wkt("LINESTRING(-170 80,10 60,20 80,-160 30,-150 30,30 70,40 85,-140 25,-130 25,50 45,185 45)"), + -170, 25, 185, 90); + + // linestring that crosses the antimeridian + tester::apply("l06", + from_wkt("LINESTRING(-160 85,-170 80,170 40,160 80)"), + 160, 40, 200, 85); + + // linestring that crosses the antimeridian + tester::apply("l06a", + from_wkt("LINESTRING(-130 85,-170 84,170 40,160 80)"), + 160, 40, 230, 85.02629680862029); + + // linestring that goes through the north pole + tester::apply("l07", + from_wkt("LINESTRING(-160 40,-170 90,-140 40,-50 30)"), + -160, 30, -50, 90); + + // linestring that degenerates to the north pole + tester::apply("l08", + from_wkt("LINESTRING(-40 90,-30 90,-140 90,10 90)"), + 0, 90, 0, 90); + + // linestring with duplicate points + tester::apply("l09", + from_wkt("LINESTRING(-40 20,-40 20,-140 85,-10 5,-10 5)"), + -140, 5, -10, 86.184540574427757); + + // linestring with duplicate points + tester::apply("l09a", + from_wkt("LINESTRING(-40 20,320 20,-140 85,-10 5,350 5)"), + -140, 5, -10, 86.184540574427757); + + // linestring that lies on the equator + tester::apply("l10", + from_wkt("LINESTRING(0 0,50 0)"), + 0, 0, 50, 0); + + // linestring that lies on the equator + tester::apply("l10a", + from_wkt("LINESTRING(-50 0,50 0)"), + -50, 0, 50, 0); + + // linestring that lies on the equator and touches antimeridian + tester::apply("l10b", + from_wkt("LINESTRING(50 0,180 0)"), + 50, 0, 180, 0); + + // linestring that lies on the equator and crosses antimeridian + tester::apply("l10c", + from_wkt("LINESTRING(-170 0,160 0)"), + 160, 0, 190, 0); + + double eps = std::numeric_limits::epsilon(); + double heps = eps / 2; + + { + G l; + l.push_back(P(1, 1)); + l.push_back(P(1-heps, 1-heps)); + tester::apply("l11", l, 1-heps, 1-heps, 1, 1); + } + + { + G l; + l.push_back(P(0, 0)); + l.push_back(P(1-heps, 1-heps)); + l.push_back(P(0, 0)); + l.push_back(P(1, 1)); + tester::apply("l12", l, 0, 0, 1, 1); + } +} + +BOOST_AUTO_TEST_CASE( envelope_spheroid_linestring ) +{ + typedef bg::cs::geographic coordinate_system_type; + typedef bg::model::point P; + typedef bg::model::linestring

G; + typedef bg::model::box

B; + typedef test_envelope_on_sphere_or_spheroid tester; + + // empty linestring + test_empty_geometry("l00", "LINESTRING()"); + + tester::apply("l01", + from_wkt("LINESTRING(10 15)"), + 10, 15, 10, 15); + + tester::apply("l01a", + from_wkt("LINESTRING(370 15)"), + 10, 15, 10, 15); + + tester::apply("l01b", + from_wkt("LINESTRING(370 90)"), + 0, 90, 0, 90); + + tester::apply("l02", + from_wkt("LINESTRING(10 10,20 20,10 30)"), + 10, 10, 20, 30); + + // linestring that circles the entire globe + tester::apply("l03", + from_wkt("LINESTRING(-185 0,-170 25,-50 10,10 10,20 20,100 5,180 15)"), + -180, 0, 180, rng(33.702476580412359, 33.702476580413318)); + + // linestring that crosses the antimeridian but staying close to it + tester::apply("l04", + from_wkt("LINESTRING(-170 10,170 45,160 5,-160 25)"), + 160, 5, 200, 45); + + // linestring that goes through the north pole (twice) + tester::apply("l05", + from_wkt("LINESTRING(-170 80,10 60,20 80,-160 30)"), + -170, 30, 20, 90); + + // linestring that goes through the north pole (three times) + tester::apply("l05a", + from_wkt("LINESTRING(-170 80,10 60,20 80,-160 30,-150 30,30 70)"), + -170, 30, 30, 90); + + // linestring that goes through the north pole (four times) + tester::apply("l05b", + from_wkt("LINESTRING(-170 80,10 60,20 80,-160 30,-150 30,30 70,40 85,-140 25)"), + -170, 25, 40, 90); + + // linestring that goes through the north pole (five times) + tester::apply("l05c", + from_wkt("LINESTRING(-170 80,10 60,20 80,-160 30,-150 30,30 70,40 85,-140 25,-130 25,50 45)"), + -170, 25, 50, 90); + + // linestring that goes through the north pole (five times) + tester::apply("l05d", + from_wkt("LINESTRING(-170 80,10 60,20 80,-160 30,-150 30,30 70,40 85,-140 25,-130 25,50 45,185 45)"), + -170, 25, 185, 90); + + // linestring that crosses the antimeridian + tester::apply("l06", + from_wkt("LINESTRING(-160 85,-170 80,170 40,160 80)"), + 160, 40, 200, 85); + + // linestring that crosses the antimeridian + tester::apply("l06a", + from_wkt("LINESTRING(-130 85,-170 84,170 40,160 80)"), + 160, 40, 230, 85.02630556315151); + + // linestring that goes through the north pole + tester::apply("l07", + from_wkt("LINESTRING(-160 40,-170 90,-140 40,-50 30)"), + -160, 30, -50, 90); + + // linestring that degenerates to the north pole + tester::apply("l08", + from_wkt("LINESTRING(-40 90,-30 90,-140 90,10 90)"), + 0, 90, 0, 90); + + // linestring with duplicate points + tester::apply("l09", + from_wkt("LINESTRING(-40 20,-40 20,-140 85,-10 5,-10 5)"), + -140, 5, -10, 86.18564770636192); + + // linestring with duplicate points + tester::apply("l09a", + from_wkt("LINESTRING(-40 20,320 20,-140 85,-10 5,350 5)"), + -140, 5, -10, 86.18564770636192); + + // linestring that lies on the equator + tester::apply("l10", + from_wkt("LINESTRING(0 0,50 0)"), + 0, 0, 50, 0); + + // linestring that lies on the equator + tester::apply("l10a", + from_wkt("LINESTRING(-50 0,50 0)"), + -50, 0, 50, 0); + + // linestring that lies on the equator and touches antimeridian + tester::apply("l10b", + from_wkt("LINESTRING(50 0,180 0)"), + 50, 0, 180, 0); + + // linestring that lies on the equator and crosses antimeridian + tester::apply("l10c", + from_wkt("LINESTRING(-170 0,160 0)"), + 160, 0, 190, 0); + + double eps = std::numeric_limits::epsilon(); + double heps = eps / 2; + + { + G l; + l.push_back(P(1, 1)); + l.push_back(P(1-heps, 1-heps)); + tester::apply("l11", l, 1-heps, 1-heps, 1, 1); + } + + { + G l; + l.push_back(P(0, 0)); + l.push_back(P(1-heps, 1-heps)); + l.push_back(P(0, 0)); + l.push_back(P(1, 1)); + tester::apply("l12", l, 0, 0, 1, 1); + } +} + + +BOOST_AUTO_TEST_CASE( envelope_linestring_sphere_with_height ) +{ + typedef bg::cs::spherical_equatorial coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::linestring G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + // empty linestring + test_empty_geometry("lh00", "LINESTRING()"); + + tester::apply("lh01", + from_wkt("LINESTRING(10 15 30,20 25 434,30 35 186)"), + 10, 15, 30, 30, 35, 434); +} + +BOOST_AUTO_TEST_CASE( envelope_linestring_spheroid_with_height ) +{ + typedef bg::cs::geographic coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::linestring G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + // empty linestring + test_empty_geometry("lh00", "LINESTRING()"); + + tester::apply("lh01", + from_wkt("LINESTRING(10 15 30,20 25 434,30 35 186)"), + 10, 15, 30, 30, 35, 434); +} + +BOOST_AUTO_TEST_CASE( envelope_sphere_multilinestring ) +{ + typedef bg::cs::spherical_equatorial coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::multi_linestring > G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + // empty multilinestring + test_empty_geometry("ml00", "MULTILINESTRING()"); + + // invalid multilinestring + test_empty_geometry("ml00a", + "MULTILINESTRING(())"); + + // invalid multilinestring + test_empty_geometry("ml00b", + "MULTILINESTRING((),())"); + + // invalid multilinestring + tester::apply("ml00c", + from_wkt("MULTILINESTRING((10 15),(),())"), + 10, 15, 10, 15); + + // invalid multilinestring + tester::apply("ml00d", + from_wkt("MULTILINESTRING((),(10 15),())"), + 10, 15, 10, 15); + + tester::apply("ml01", + from_wkt("MULTILINESTRING((10 15))"), + 10, 15, 10, 15); + +#ifdef BOOST_GEOMETRY_TEST_FAILURES + tester::apply("ml01a", + from_wkt("MULTILINESTRING((),(),(10 15),())"), + 10, 15, 10, 15); +#endif + + tester::apply("ml02", + from_wkt("MULTILINESTRING((-170 40,-100 80,10 40),(-10 25,10 35,100 45),(50 30,150 45,-160 30))"), + -180, 25, 180, 81.113793608034072); + + tester::apply("ml03", + from_wkt("MULTILINESTRING((-150 40,-100 80,10 40),(-10 25,10 35,100 45),(50 30,150 45,-160 30))"), + -150, 25, 200, 81.113793608034072); + + tester::apply("ml04", + from_wkt("MULTILINESTRING((-150 40,-100 80),(10 35,100 80))"), + -150, 35, 100, 80.07385383411011); + + tester::apply("ml04a", + from_wkt("MULTILINESTRING((-150 40,-100 80),(10 35,100 80),(170 25,-160 80))"), + 10, 25, 260, 80.07385383411011); + + tester::apply("ml05", + from_wkt("MULTILINESTRING((-140 40,-100 80),(10 35,100 80))"), + -140, 35, 100, 80.07385383411011); + + tester::apply("ml05a", + from_wkt("MULTILINESTRING((-140 40,-100 80),(10 35,100 80),(170 25,-160 80))"), + 10, 25, 260, 80.07385383411011); +} + +BOOST_AUTO_TEST_CASE( envelope_spheroid_multilinestring ) +{ + typedef bg::cs::geographic coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::multi_linestring > G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + // empty multilinestring + test_empty_geometry("ml00", "MULTILINESTRING()"); + + // invalid multilinestring + test_empty_geometry("ml00a", + "MULTILINESTRING(())"); + + // invalid multilinestring + test_empty_geometry("ml00b", + "MULTILINESTRING((),())"); + + // invalid multilinestring + tester::apply("ml00c", + from_wkt("MULTILINESTRING((10 15),(),())"), + 10, 15, 10, 15); + + // invalid multilinestring + tester::apply("ml00d", + from_wkt("MULTILINESTRING((),(10 15),())"), + 10, 15, 10, 15); + + tester::apply("ml01", + from_wkt("MULTILINESTRING((10 15))"), + 10, 15, 10, 15); + +#ifdef BOOST_GEOMETRY_TEST_FAILURES + tester::apply("ml01a", + from_wkt("MULTILINESTRING((),(),(10 15),())"), + 10, 15, 10, 15); +#endif + + tester::apply("ml02", + from_wkt("MULTILINESTRING((-170 40,-100 80,10 40),(-10 25,10 35,100 45),(50 30,150 45,-160 30))"), + -180, 25, 180, 81.115885076701147); + + tester::apply("ml03", + from_wkt("MULTILINESTRING((-150 40,-100 80,10 40),(-10 25,10 35,100 45),(50 30,150 45,-160 30))"), + -150, 25, 200, 81.115885076701147); + + tester::apply("ml04", + from_wkt("MULTILINESTRING((-150 40,-100 80),(10 35,100 80))"), + -150, 35, 100, rng(80.07385383411011, 80.082544902477267)); + + tester::apply("ml04a", + from_wkt("MULTILINESTRING((-150 40,-100 80),(10 35,100 80),(170 25,-160 80))"), + 10, 25, 260, rng(80.07385383411011, 80.082544902477267)); + + tester::apply("ml05", + from_wkt("MULTILINESTRING((-140 40,-100 80),(10 35,100 80))"), + -140, 35, 100, rng(80.07385383411011, 80.082544902477267)); + + tester::apply("ml05a", + from_wkt("MULTILINESTRING((-140 40,-100 80),(10 35,100 80),(170 25,-160 80))"), + 10, 25, 260, rng(80.07385383411011, 80.082544902477267)); +} + + +BOOST_AUTO_TEST_CASE( envelope_multilinestring_sphere_with_height ) +{ + typedef bg::cs::spherical_equatorial coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::multi_linestring > G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + tester::apply("mlh01", + from_wkt("MULTILINESTRING((10 15 1000))"), + 10, 15, 1000, 10, 15, 1000); + +#ifdef BOOST_GEOMETRY_TEST_FAILURES + tester::apply("mlh01a", + from_wkt("MULTILINESTRING((),(),(10 15 1000),())"), + 10, 15, 1000, 10, 15, 1000); +#endif + + tester::apply("mlh02", + from_wkt("MULTILINESTRING((-170 40 400,-100 80 300),(-10 25 600,10 35 700,120 45 450))"), + -10, 25, 300, 260, 80, 700); +} + +BOOST_AUTO_TEST_CASE( envelope_multilinestring_spheroid_with_height ) +{ + typedef bg::cs::geographic coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::multi_linestring > G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + tester::apply("mlh01", + from_wkt("MULTILINESTRING((10 15 1000))"), + 10, 15, 1000, 10, 15, 1000); + +#ifdef BOOST_GEOMETRY_TEST_FAILURES + tester::apply("mlh01a", + from_wkt("MULTILINESTRING((),(),(10 15 1000),())"), + 10, 15, 1000, 10, 15, 1000); +#endif + + tester::apply("mlh02", + from_wkt("MULTILINESTRING((-170 40 400,-100 80 300),(-10 25 600,10 35 700,120 45 450))"), + -10, 25, 300, 260, 80, 700); +} + +//Test spherical polygons and rings (geographic should be similar) +BOOST_AUTO_TEST_CASE( envelope_polygon ) +{ + typedef bg::cs::spherical_equatorial coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::polygon G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + typedef bg::model::ring R; + typedef test_envelope_on_sphere_or_spheroid testerR; + R ring1; + bg::append(ring1, point_type(0.0, 0.0)); + bg::append(ring1, point_type(0.0, 5.0)); + bg::append(ring1, point_type(5.0, 5.0)); + bg::append(ring1, point_type(5.0, 0.0)); + bg::append(ring1, point_type(0.0, 0.0)); + + testerR::apply("r01", + ring1, + 0, 0, 5, 5.0047392446083938); + tester::apply("p01", + from_wkt("POLYGON((0 0,1 0,1 1,0 1,0 0))"), + 0, 0, 1, 1.0000380706527705); + tester::apply("p02", + from_wkt("POLYGON((0 0,1 0,1 1,0 1,0 0),(0.5 0.5,0.7 0.5,0.7 0.7,0.5 0.5))"), + 0, 0, 1, 1.0000380706527705); + tester::apply("p03", + from_wkt("POLYGON((),(0.5 0.5,0.5 0.7,0.7 0.7,0.5 0.5))"), + 0.5, 0.5, 0.7, 0.70000106605644807); + tester::apply("p04", + from_wkt("POLYGON((),(0.5 0.5,0.5 0.7,0.7 0.7,0.5 0.5),\ + (0.7 0.5,0.9 0.5,0.9 0.7,0.7 0.5))"), + 0.5, 0.5, 0.9, 0.70000106605644807); + + // https://github.com/boostorg/geometry/issues/466 + tester::apply("p5-issue466", + from_wkt("POLYGON((2.4 48.9021,2.4 48.89,2.3 48.89,2.3 48.9021,2.4 48.9021))"), + 2.3, 48.89, 2.4, 48.902110807274966); + tester::apply("p6-issue466", + from_wkt("POLYGON((2.4 48.90215,2.4 48.89,2.3 48.89,2.3 48.90215,2.4 48.90215))"), + 2.3, 48.89, 2.4, 48.902160807272381); + tester::apply("p7-issue466", + from_wkt("POLYGON((2.4 48.9022,2.4 48.89,2.3 48.89,2.3 48.9022,2.4 48.9022))"), + 2.3, 48.89, 2.4, 48.902210807269796); +} + +// unit test for rings de-activated for now (current implementation +// for area on the spherical equatorial coordinate system is not complete) +// TODO: re-activate once implementation is done +// right now implementation does not distinguish between ccw and cw rings +BOOST_AUTO_TEST_CASE( envelope_cw_ring ) +{ + typedef bg::cs::spherical_equatorial coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::polygon G; + typedef bg::model::box B; + typedef test_envelope_on_sphere_or_spheroid tester; + + //double const eps = std::numeric_limits::epsilon(); + + tester::apply("r01cw", + from_wkt("POLYGON((0 10,0 45,50 10,0 10))"), + 0, 10, 50, 45); +#if 0 + // ring that contains both the north and south poles in its interior + tester::apply("r01cw-r", + from_wkt("POLYGON((0 10,50 10,0 45,0 10))"), + -180, -90, 180, 90); + + // ring that contains the north pole in its interior + tester::apply("r02cw", + from_wkt("POLYGON((0 0,-50 0,-170 0,180 0,100 0,0 0))"), + -180, 0, 180, 90); + // -180, -90, 180, 0); + + // ring that contains the south pole in its interior + tester::apply("r02cw-r", + from_wkt("POLYGON((0 0,100 0,180 0,-170 0,-50 0,0 0))"), + -180, -90, 180, 0); + // -180, 0, 180, 90); + + // ring that contains the north pole in its interior + tester::apply("r03cw", + from_wkt("POLYGON((0 -10,-50 -10,-170 -10,180 -10,100 -10,0 -10))"), + -180, -19.42540014068282, 180, 90); + // -180, -90, 180, -10); + + // ring that contains both the south and north poles in its interior + tester::apply("r03cw-r", + from_wkt("POLYGON((0 -10,100 -10,180 -10,-170 -10,-50 -10,0 -10))"), + -180, -90, 180, -10); + // -180, -19.42540014068282, 180, 90); + + // ring that has the north pole as vertex and contains the south pole + tester::apply("r04cw", + from_wkt("POLYGON((0 0,-50 90,-50 0,0 0))"), + -180, -90, 180, 90); + + // ring that has the north pole as vertex + tester::apply("r04cw-r", + from_wkt("POLYGON((0 0,-50 0,-50 90,0 0))"), + -50, 0, 0, 90); + + // ring that crosses antimeridian but does not contain any pole + tester::apply("r05cw", + from_wkt("POLYGON((-140 0,140 10,-140 80,-140 0))"), + 140, 0, 220, 80); + + // ring that crosses antimeridian multiple times but does not + // contain any pole + tester::apply("r06cw", + from_wkt("POLYGON((-140 10,140 10,140 80,-140 80,-140 10))"), + 140, 10, 220, 82.30737118075496, + 2 * eps); + + // ring that crosses antimeridian multiple times but does not + // contain any pole + tester::apply("r07cw", + from_wkt("POLYGON((-140 10,140 10,180 80,-140 10))"), + 140, 10, 220, 80); + + // ring that goes through the north pole + tester::apply("r08cw", + from_wkt("POLYGON((0 0,-50 0,-50 90,0 0))"), + -50, 0, 0, 90); + + // ring that goes through the south pole and contains the north pole + tester::apply("r09cw", + from_wkt("POLYGON((0 0,0 -90,50 0,0 0))"), + -180, -90, 180, 90); + + // ring that goes through the south pole + tester::apply("r09cw-r", + from_wkt("POLYGON((0 0,50 0,50 -90,0 0))"), + 0, -90, 50, 0); + + // ring that goes through both south and north pole + tester::apply("r10cw", + from_wkt("POLYGON((50 0,50 -90,40 0,40 90,50 0))"), + 40, -90, 50, 90); + + // ring that goes through both south and north pole and crosses antimeridian + tester::apply("r11cw", + from_wkt("POLYGON((-170 0,-170 -90,160 0,160 90,-170 0))"), + 160, -90, 190, 90); + + // ring with edge that goes through the north pole and contains + // south pole (the bounding box is the entire globe) + tester::apply("r12cw", + from_wkt("POLYGON((-50 40,130 10,170 80,-50 40))"), + -180, -90, 180, 90); + // -180, 10, 180, 90); + + // ring with edge that goes through the north pole + tester::apply("r12cw-r", + from_wkt("POLYGON((-50 40,170 80,130 10,-50 40))"), + -180, 10, 180, 90); + // -180, -90, 180, 90); + + // ring that represents a spherical cap near the north pole + tester::apply("r13cw", + from_wkt("POLYGON((100 45,0 45,-100 45,-100 90,100 45))"), + -100, 45, 100, 90); + + // ring that represents the complement of a spherical cap + // near the north pole + tester::apply("r13cw-r", + from_wkt("POLYGON((-100 45,0 45,100 45,100 90,-100 45))"), + -180, -90, 180, 90); + + // ring that represents the complement of a spherical cap + // that touches the south pole + tester::apply("r14cw", + from_wkt("POLYGON((-100 45,0 45,100 45,100 -90,-100 45))"), + -100, -90, 100, 57.26759279038765); + + // ring that represents a spherical cap that touches the south pole + tester::apply("r14cw-r", + from_wkt("POLYGON((100 45,0 45,-100 45,-100 -90,100 45))"), + -180, -90, 180, 90); + + // ring with edge that goes through the south pole + tester::apply("r15cw", + from_wkt("POLYGON((-50 -40,130 -10,170 -80,-50 -40))"), + -180, -90, 180, -10); + + // ring with edge that goes through the south pole and contains + // north pole (the bounding box is the entire globe) + tester::apply("r15cw-r", + from_wkt("POLYGON((-50 -40,170 -80,130 -10,-50 -40))"), + -180, -90, 180, 90); + + // ring that does not contain any pole and lies in the lower hemisphere + tester::apply("r16", + from_wkt("POLYGON((-50 -80,-50 -40,-30 -40,-30 -80,-50 -80))"), + -50, -80.14892388341609, -30, -40); + + // ring that lies in the lower hemisphere and contains both poles + tester::apply("r16-r", + from_wkt("POLYGON((-50 -80,-30 -80,-30 -40,-50 -40,-50 -80))"), + -180, -90, 180, 90); + + // ring that goes through the south pole and contains the north pole + tester::apply("r17cw", + from_wkt("POLYGON((50 0,50 -90,100 0,50 0))"), + -180, -90, 180, 90); + + // ring that goes through the south pole + tester::apply("r17cw-r", + from_wkt("POLYGON((50 0,100 0,100 -90,50 0))"), + 50, -90, 100, 0); + + // ring that goes through the south pole and contains the north pole + tester::apply("r18cw", + from_wkt("POLYGON((50 0,50 -90,460 0,50 0))"), + -180, -90, 180, 90); + + // ring that goes through the south pole + tester::apply("r18cw-r", + from_wkt("POLYGON((50 0,460 0,100 -90,50 0))"), + 50, -90, 100, 0); + + // ring that goes through the south pole and contains the north pole + tester::apply("r19cw", + from_wkt("POLYGON((50 0,50 -90,-260 0,50 0))"), + -180, -90, 180, 90); + + // ring that goes through the south pole + tester::apply("r19cw-r", + from_wkt("POLYGON((50 0,-260 0,100 -90,50 0))"), + 50, -90, 100, 0); + + // ring that goes through both poles + tester::apply("r20cw", + from_wkt("POLYGON((10 0,10 90,20 0,20 -90,10 0))"), + 10, -90, 20, 90); // SUCCEEDS FOR WRONG REASON + + // ring that goes through both poles + tester::apply("r20cw-r", + from_wkt("POLYGON((10 0,10 -90,20 0,20 90,10 0))"), + -180, -90, 180, 90); // FAILS NOW + + // ring that goes through both poles and its boundary forms + // a great circle + tester::apply("r21cw", + from_wkt("POLYGON((-10 0,-10 90,170 0,170 -90,-10 0))"), + -10, -90, 170, 90); // SUCCEEDS FOR WRONG REASON + + // ring that goes through both poles and its boundary forms + // a great circle + tester::apply("r21cw-r", + from_wkt("POLYGON((-10 0,-10 -90,170 0,170 90,-10 0))"), + 170, -90, 350, 90); // FAILS NOW +#endif +} + diff --git a/src/boost/libs/geometry/test/algorithms/envelope_expand/expand.cpp b/src/boost/libs/geometry/test/algorithms/envelope_expand/expand.cpp new file mode 100644 index 000000000..9ed205027 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/envelope_expand/expand.cpp @@ -0,0 +1,164 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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. + +// 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) + +#include "test_expand.hpp" + + +#include + +#include +#include +#include +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +template +void test_point_3d() +{ + bg::model::box b = bg::make_inverse >(); + + test_expand(b, "POINT(1 2 5)", "(1,2,5),(1,2,5)"); + test_expand(b, "POINT(3 4 6)", "(1,2,5),(3,4,6)"); + + test_expand(b, "POINT(4 4 5)", "(1,2,5),(4,4,6)"); + test_expand(b, "POINT(4 5 5)", "(1,2,5),(4,5,6)"); + test_expand(b, "POINT(10 10 4)", "(1,2,4),(10,10,6)"); + test_expand(b, "POINT(9 9 4)", "(1,2,4),(10,10,6)"); + + test_expand(b, "POINT(0 2 7)", "(0,2,4),(10,10,7)"); + test_expand(b, "POINT(0 0 7)", "(0,0,4),(10,10,7)"); + test_expand(b, "POINT(-1 -1 5)", "(-1,-1,4),(10,10,7)"); + test_expand(b, "POINT(0 0 5)", "(-1,-1,4),(10,10,7)"); + + test_expand(b, "POINT(15 -1 0)", "(-1,-1,0),(15,10,7)"); + test_expand(b, "POINT(-1 15 10)", "(-1,-1,0),(15,15,10)"); +} + +template +void test_box_3d() +{ + typedef bg::model::box box_type; + box_type b = bg::make_inverse(); + + test_expand(b, "BOX(0 2 5,4 4 6)", "(0,2,5),(4,4,6)"); + test_expand(b, "BOX(0 1 5,4 6 6)", "(0,1,5),(4,6,6)"); + test_expand(b, "BOX(-1 -1 6,10 10 5)", "(-1,-1,5),(10,10,6)"); + test_expand(b, "BOX(3 3 6,3 3 5)", "(-1,-1,5),(10,10,6)"); + + test_expand(b, "BOX(3 15 7,-1 3 4)", "(-1,-1,4),(10,15,7)"); + test_expand(b, "BOX(-15 3 7,3 20 4)", "(-15,-1,4),(10,20,7)"); + test_expand(b, "BOX(3 -20 8,3 20 3)", "(-15,-20,3),(10,20,8)"); + test_expand(b, "BOX(-20 3 8,20 3 3)", "(-20,-20,3),(20,20,8)"); +} + + + +template +void test_3d() +{ + test_point_3d

(); + test_box_3d

(); +} + +template +void test_2d() +{ + typedef bg::model::box box_type; + typedef std::pair segment_type; + + box_type b = bg::make_inverse(); + + test_expand(b, "BOX(1 1,2 2)", "(1,1),(2,2)"); + + // Test an 'incorrect' box -> should also correctly update the bbox + test_expand(b, "BOX(3 4,0 1)", "(0,1),(3,4)"); + + // Test a segment + test_expand(b, "SEGMENT(5 6,7 8)", "(0,1),(7,8)"); +} + +template +void test_spherical_degree() +{ + // it doesn't work with normalization of input enabled + //bg::model::box b = bg::make_inverse >(); + Point p; + bg::read_wkt("POINT(179.73 71.56)", p); + bg::model::box b(p, p); + + test_expand(b, "POINT(179.73 71.56)", + "(179.73,71.56),(179.73,71.56)"); + test_expand(b, "POINT(177.47 71.23)", + "(177.47,71.23),(179.73,71.56)"); + + // It detects that this point is lying RIGHT of the others, + // and then it "expands" it. + test_expand(b, "POINT(-178.78 70.78)", + "(177.47,70.78),(181.22,71.56)"); +} + + +template +void test_spherical_radian() +{ + // it doesn't work with normalization of input enabled + //bg::model::box b = bg::make_inverse >(); + Point p; + bg::read_wkt("POINT(3.128 1.249)", p); + bg::model::box b(p, p); + + test_expand(b, "POINT(3.128 1.249)", + "(3.128,1.249),(3.128,1.249)"); + test_expand(b, "POINT(3.097 1.243)", + "(3.097,1.243),(3.128,1.249)"); + + // It detects that this point is lying RIGHT of the others, + // and then it "expands" it. + test_expand(b, "POINT(-3.121 1.235)", + "(3.097,1.235),(3.16219,1.249)"); +} + +int test_main(int, char* []) +{ + test_2d >(); + + + test_3d(); + test_3d >(); + test_3d >(); + test_3d >(); + + test_spherical_degree > >(); + test_spherical_radian > >(); + test_spherical_degree > >(); + test_spherical_radian > >(); + + +#if defined(HAVE_TTMATH) + test_3d >(); + test_spherical_degree > >(); + test_spherical_radian > >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/envelope_expand/expand_on_spheroid.cpp b/src/boost/libs/geometry/test/algorithms/envelope_expand/expand_on_spheroid.cpp new file mode 100644 index 000000000..b192cf7e7 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/envelope_expand/expand_on_spheroid.cpp @@ -0,0 +1,1126 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2015-2018, 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 +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_expand_on_spheroid +#endif + +#include + +#include + +#include +#include + +#include +#include + +#include + +#include +#include +#include + +#include + +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "test_envelope_expand_on_spheroid.hpp" + + +class test_expand_on_spheroid +{ +private: + template + < + typename Geometry, + typename Tag = typename bg::tag::type + > + struct write_geometry + { + template + static inline OutputStream& apply(OutputStream& os, + Geometry const& geometry) + { + os << bg::wkt(geometry); + return os; + } + }; + + template + struct write_geometry + { + template + static inline OutputStream& apply(OutputStream& os, + Segment const& segment) + { + os << "SEGMENT" << bg::dsv(segment); + return os; + } + }; + + template + struct write_geometry + { + template + static inline OutputStream& apply(OutputStream& os, + Box const& box) + { + os << "BOX" << bg::dsv(box); + return os; + } + }; + + template + static inline void check_message(bool same_boxes, + std::string const& case_id, + std::string const& units_str, + Box const& box, + Geometry const& geometry, + bool expected_are_different, + Box const& expected1, + Box const& expected2, + Box const& detected) + { + std::ostringstream stream; + stream << "case ID: " << case_id << ", " + << "MBR units: " << units_str << "; " + << "input box: BOX" << bg::dsv(box) << ", " + << "geometry: "; + + write_geometry::apply(stream, geometry); + + stream << std::setprecision(17); + + stream << "; " << "expected: " << bg::dsv(expected1); + + if (expected_are_different) + { + stream << " or: " << bg::dsv(expected2); + } + stream << ", " << "detected: " << bg::dsv(detected); + + BOOST_CHECK_MESSAGE(same_boxes, stream.str()); + } + + + template + struct basic_tester + { + template + static inline void base_test(std::string const& case_id, + Box const& box, + Geometry const& geometry, + double lon_min1, double lat_min1, + double height_min1, + double lon_max1, double lat_max1, + double height_max1, + double lon_min2, double lat_min2, + double height_min2, + double lon_max2, double lat_max2, + double height_max2, + double tolerance) + { + typedef typename bg::coordinate_system + < + Box + >::type::units box_units_type; + + std::string const units_str = units2string(); + + Box detected; + bg::convert(box, detected); + bg::expand(detected, geometry); + + bool expected_are_different = + (lon_min1 != lon_min2) || (lat_min1 != lat_min2) + || (lon_max1 != lon_max2) || (lat_max1 != lat_max2); + + Box expected1; + initialize_box::apply(expected1, + lon_min1, lat_min1, height_min1, + lon_max1, lat_max1, height_max1); + + Box expected2; + initialize_box::apply(expected2, + lon_min2, lat_min2, height_min2, + lon_max2, lat_max2, height_max2); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "input box: BOX" << bg::dsv(box) << std::endl; + + std::cout << "geometry: "; + write_geometry::apply(std::cout, geometry); + + std::cout << std::endl + << "MBR units: " << units_str + << std::endl + << "expected: " << bg::dsv(expected1); + + if (expected_are_different) + { + std::cout << " or: " << bg::dsv(expected2); + } + + std::cout << std::endl + << "detected: " << bg::dsv(detected) + << std::endl << std::endl; +#endif + bool same_boxes + = box_equals::apply(detected, expected1, tolerance); + + if (expected_are_different) + { + same_boxes = same_boxes + || box_equals::apply(detected, expected2, tolerance); + } + + check_message(same_boxes, case_id, units_str, + box, geometry, expected_are_different, + expected1, expected2, detected); + } + + template + static inline void apply(std::string const& case_id, + Box const& box, + Geometry const& geometry, + double lon_min1, double lat_min1, + double height_min1, + double lon_max1, double lat_max1, + double height_max1, + double lon_min2, double lat_min2, + double height_min2, + double lon_max2, double lat_max2, + double height_max2, + double tolerance) + { + typedef other_system_info + < + typename bg::coordinate_system::type + > other; + + typedef bg::model::box + < + bg::model::point + < + typename bg::coordinate_type::type, + bg::dimension::value, + typename other::type + > + > other_mbr_type; + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "case ID: " << case_id + << std::endl << std::endl; +#endif + + base_test(case_id, box, geometry, + lon_min1, lat_min1, height_min1, + lon_max1, lat_max1, height_max1, + lon_min2, lat_min2, height_min2, + lon_max2, lat_max2, height_max2, + tolerance); + + other_mbr_type other_box; + + //if the input box is the special one made from make_inverse + //do not convert coordinates + if (!is_inverse_spheroidal_coordinates(box)) + { + bg::detail::indexed_point_view p_min(box); + bg::detail::indexed_point_view p_max(box); + + bg::detail::indexed_point_view + < + other_mbr_type, 0 + > other_min(other_box); + + bg::detail::indexed_point_view + < + other_mbr_type, 1 + > other_max(other_box); + + bg::transform(p_min, other_min); + bg::transform(p_max, other_max); + } else { + bg::set(other_box, bg::get<0, 0>(box)); + bg::set(other_box, bg::get<0, 1>(box)); + bg::set(other_box, bg::get<1, 0>(box)); + bg::set(other_box, bg::get<1, 1>(box)); + } + + base_test(case_id, other_box, geometry, + other::convert(lon_min1), + other::convert(lat_min1), + height_min1, + other::convert(lon_max1), + other::convert(lat_max1), + height_max1, + other::convert(lon_min2), + other::convert(lat_min2), + height_min2, + other::convert(lon_max2), + other::convert(lat_max2), + height_max2, + tolerance); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "==================" + << std::endl << std::endl; +#endif + } + }; + + template + struct basic_tester + { + template + static inline void apply(std::string const& case_id, + Box const& box, + Geometry const& geometry, + double lon_min1, double lat_min1, + double height_min1, + double lon_max1, double lat_max1, + double height_max1, + double lon_min2, double lat_min2, + double height_min2, + double lon_max2, double lat_max2, + double height_max2, + double tolerance) + { + basic_tester + < + false + >::apply(case_id, box, geometry, + lon_min1, lat_min1, height_min1, + lon_max1, lat_max1, height_max1, + lon_min2, lat_min2, height_min1, + lon_max2, lat_max2, height_max2, + tolerance); + + std::string case_id_r = case_id + "[R]"; + + basic_tester + < + false + >::apply(case_id_r, geometry, box, + lon_min1, lat_min1, height_min1, + lon_max1, lat_max1, height_max1, + lon_min2, lat_min2, height_min2, + lon_max2, lat_max2, height_max2, + tolerance); + } + }; + + +public: + template + static inline void apply(std::string const& case_id, + Box const& box, + Geometry const& geometry, + double lon_min1, double lat_min1, double height_min1, + double lon_max1, double lat_max1, double height_max1, + double lon_min2, double lat_min2, double height_min2, + double lon_max2, double lat_max2, double height_max2, + double tolerance = std::numeric_limits::epsilon()) + { + + basic_tester + < + boost::is_same + < + typename bg::tag::type, + bg::box_tag + >::value + >::apply(case_id, box, geometry, + lon_min1, lat_min1, height_min1, + lon_max1, lat_max1, height_max1, + lon_min2, lat_min2, height_min2, + lon_max2, lat_max2, height_max2, + tolerance); + } + + template + static inline void apply(std::string const& case_id, + Box const& box, + Geometry const& geometry, + double lon_min1, double lat_min1, + double lon_max1, double lat_max1, + double lon_min2, double lat_min2, + double lon_max2, double lat_max2, + double tolerance = std::numeric_limits::epsilon()) + { + apply(case_id, box, geometry, + lon_min1, lat_min1, 0, lon_max1, lat_max1, 0, + lon_min2, lat_min2, 0, lon_max2, lat_max2, 0, + tolerance); + } + + template + static inline void apply(std::string const& case_id, + Box const& box, + Geometry const& geometry, + double lon_min, double lat_min, + double lon_max, double lat_max, + double tolerance = std::numeric_limits::epsilon()) + { + apply(case_id, box, geometry, + lon_min, lat_min, 0, lon_max, lat_max, 0, + lon_min, lat_min, 0, lon_max, lat_max, 0, + tolerance); + } + + template + static inline void apply(std::string const& case_id, + Box const& box, + Geometry const& geometry, + double lon_min, double lat_min, double height_min, + double lon_max, double lat_max, double height_max, + double tolerance = std::numeric_limits::epsilon()) + { + apply(case_id, box, geometry, + lon_min, lat_min, height_min, lon_max, lat_max, height_max, + lon_min, lat_min, height_min, lon_max, lat_max, height_max, + tolerance); + } +}; + + +template +void test_expand_point() +{ + typedef bg::model::point point_type; + typedef bg::model::box B; + typedef point_type G; + typedef test_expand_on_spheroid tester; + + tester::apply("p01", + from_wkt("BOX(0 0,5 5)"), + from_wkt("POINT(10 10)"), + 0, 0, 10, 10); + + tester::apply("p02", + from_wkt("BOX(0 0,5 5)"), + from_wkt("POINT(370 10)"), + 0, 0, 10, 10); + + tester::apply("p03", + from_wkt("BOX(10 10,10 10)"), + from_wkt("POINT(20 20)"), + 10, 10, 20, 20); + + tester::apply("p04", + from_wkt("BOX(10 10,10 10)"), + from_wkt("POINT(10 20)"), + 10, 10, 10, 20); + + // there are two possible valid longitude ranges: + // [10, 190] and [-170, 10] + tester::apply("p05", + from_wkt("BOX(10 10,10 10)"), + from_wkt("POINT(190 20)"), + 10, 10, 190, 20); + + // there are two possible valid longitude ranges: + // [10, 190] and [-170, 10] + tester::apply("p05a", + from_wkt("BOX(10 10,10 10)"), + from_wkt("POINT(-170 20)"), + 10, 10, 190, 20, + -170, 10, 10, 20); + + tester::apply("p06", + from_wkt("BOX(170 10,175 20)"), + from_wkt("POINT(-170 15)"), + 170, 10, 190, 20); + + tester::apply("p06a", + from_wkt("BOX(170 10,175 20)"), + from_wkt("POINT(-170 -6)"), + 170, -6, 190, 20); + + tester::apply("p06b", + from_wkt("BOX(170 10,175 20)"), + from_wkt("POINT(-170 36)"), + 170, 10, 190, 36); + + // point is inside box + tester::apply("p07", + from_wkt("BOX(-30 -45,60 55)"), + from_wkt("POINT(0 0)"), + -30, -45, 60, 55); + + // point is inside box + tester::apply("p07a", + from_wkt("BOX(-30 -45,60 55)"), + from_wkt("POINT(360 0)"), + -30, -45, 60, 55); + + tester::apply("p08", + from_wkt("BOX(-100 -45,-90 55)"), + from_wkt("POINT(80 60)"), + -100, -45, 80, 60); + + tester::apply("p09", + from_wkt("BOX(-100 -45,-90 55)"), + from_wkt("POINT(170 60)"), + 170, -45, 270, 60); + + // point is north pole + tester::apply("p10", + from_wkt("BOX(-100 -45,-90 55)"), + from_wkt("POINT(-80 90)"), + -100, -45, -90, 90); + + // point is north pole + tester::apply("p10a", + from_wkt("BOX(-100 -45,-90 55)"), + from_wkt("POINT(170 90)"), + -100, -45, -90, 90); + + tester::apply("p10b", + from_wkt("BOX(-100 -45,-90 55)"), + from_wkt("POINT(170 80)"), + 170, -45, 270, 80); + + // box is north pole + tester::apply("p11", + from_wkt("BOX(10 90,20 90)"), + from_wkt("POINT(15 89)"), + 15, 89, 15, 90); + + // box is south pole + tester::apply("p11a", + from_wkt("BOX(10 -90,20 -90)"), + from_wkt("POINT(15 89)"), + 15, -90, 15, 89); + + // point is south pole + tester::apply("p12", + from_wkt("BOX(10 80,20 85)"), + from_wkt("POINT(15 -90)"), + 10, -90, 20, 85); + + // point is south pole + tester::apply("p12a", + from_wkt("BOX(10 80,20 85)"), + from_wkt("POINT(25 -90)"), + 10, -90, 20, 85); + + // box is north pole and point is south pole + tester::apply("p13", + from_wkt("BOX(10 90,20 90)"), + from_wkt("POINT(25 -90)"), + 0, -90, 0, 90); + + // box contains north pole and point is south pole + tester::apply("p14", + from_wkt("BOX(10 80,20 90)"), + from_wkt("POINT(25 -90)"), + 10, -90, 20, 90); + + // box contains south pole and point is north pole + tester::apply("p15", + from_wkt("BOX(10 -90,30 0)"), + from_wkt("POINT(25 90)"), + 10, -90, 30, 90); + + // box and point are north pole + tester::apply("p15", + from_wkt("BOX(10 90,20 90)"), + from_wkt("POINT(25 90)"), + 0, 90, 0, 90); + + // box and point are south pole + tester::apply("p16", + from_wkt("BOX(10 -90,20 -90)"), + from_wkt("POINT(-25 -90)"), + 0, -90, 0, -90); + + // box contains both poles + tester::apply("p17", + from_wkt("BOX(10 -90,10 90)"), + from_wkt("POINT(10 80)"), + 10, -90, 10, 90); + + // box contains both poles + tester::apply("p17a", + from_wkt("BOX(10 -90,10 90)"), + from_wkt("POINT(25 80)"), + 10, -90, 25, 90); + + // box contains both poles + tester::apply("p18", + from_wkt("BOX(10 -90,100 90)"), + from_wkt("POINT(25 80)"), + 10, -90, 100, 90); + + // box contains both poles + tester::apply("p18a", + from_wkt("BOX(10 -90,100 90)"), + from_wkt("POINT(-175 80)"), + 10, -90, 185, 90); + + // box contains both poles + tester::apply("p18b", + from_wkt("BOX(10 -90,100 90)"), + from_wkt("POINT(-95 80)"), + -95, -90, 100, 90); + + // box contains both poles and point is north pole + tester::apply("p19", + from_wkt("BOX(10 -90,100 90)"), + from_wkt("POINT(-95 90)"), + 10, -90, 100, 90); + + // box contains both poles and point is south pole + tester::apply("p20", + from_wkt("BOX(10 -90,100 90)"), + from_wkt("POINT(-95 -90)"), + 10, -90, 100, 90); +} + +BOOST_AUTO_TEST_CASE( expand_point ) +{ + test_expand_point >(); + test_expand_point >(); +} + + +template +void test_expand_point_with_height() +{ + typedef bg::model::point point_type; + typedef bg::model::box B; + typedef point_type G; + typedef test_expand_on_spheroid tester; + + // deactivate this for now + tester::apply("ph01", + from_wkt("BOX(0 0 20,5 5 100)"), + from_wkt("POINT(10 10 80)"), + 0, 0, 20, 10, 10, 100); + + tester::apply("ph02", + from_wkt("BOX(0 0 20,5 5 100)"), + from_wkt("POINT(10 10 120)"), + 0, 0, 20, 10, 10, 120); + + tester::apply("ph03", + from_wkt("BOX(0 0 20,5 5 100)"), + from_wkt("POINT(10 10 5)"), + 0, 0, 5, 10, 10, 100); +} + +BOOST_AUTO_TEST_CASE( expand_point_with_height ) +{ + test_expand_point_with_height >(); + test_expand_point_with_height >(); +} + + +BOOST_AUTO_TEST_CASE( expand_segment_sphere ) +{ + typedef bg::cs::spherical_equatorial coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::box B; + typedef bg::model::segment G; + typedef test_expand_on_spheroid tester; + + tester::apply("s01", + from_wkt("BOX(20 20,50 50)"), + from_wkt("SEGMENT(10 10,40 40)"), + 10, 10, 50, 50); + + tester::apply("s02", + from_wkt("BOX(20 20,50 50)"), + from_wkt("SEGMENT(10 10,40 10)"), + 10, 10, 50, 50); + + tester::apply("s03", + from_wkt("BOX(5 5,50 10)"), + from_wkt("SEGMENT(40 10,10 10)"), + 5, 5, 50, 10.34527004614999, + 4.0 * std::numeric_limits::epsilon()); + + // segment ending at the north pole + tester::apply("s04", + from_wkt("BOX(5 15,50 50)"), + from_wkt("SEGMENT(40 45,80 90)"), + 5, 15, 50, 90); + + // segment ending at the north pole + tester::apply("s04a", + from_wkt("BOX(5 15,30 30)"), + from_wkt("SEGMENT(40 45,80 90)"), + 5, 15, 40, 90); + + // segment starting at the north pole + tester::apply("s05", + from_wkt("BOX(5 15,50 50)"), + from_wkt("SEGMENT(80 90,40 45)"), + 5, 15, 50, 90); + + // segment starting at the north pole + tester::apply("s05a", + from_wkt("BOX(5 15,30 30)"), + from_wkt("SEGMENT(80 90,40 45)"), + 5, 15, 40, 90); + + // segment passing through the south pole + tester::apply("s06", + from_wkt("BOX(5 15,30 40)"), + from_wkt("SEGMENT(-170 -45,10 -30)"), + -170, -90, 30, 40); + + // segment degenerating to the north pole + tester::apply("s07", + from_wkt("BOX(5 15,30 40)"), + from_wkt("SEGMENT(10 90,20 90)"), + 5, 15, 30, 90); + + // segment degenerating to the south pole + tester::apply("s08", + from_wkt("BOX(5 15,30 40)"), + from_wkt("SEGMENT(10 -90,20 -90)"), + 5, -90, 30, 40); + + // box degenerating to the south pole + tester::apply("s09", + from_wkt("BOX(10 -90,30 -90)"), + from_wkt("SEGMENT(10 -30,100 45)"), + 10, -90, 100, 45); + + // box degenerating to the south pole + tester::apply("s09a", + from_wkt("BOX(10 -90,130 -90)"), + from_wkt("SEGMENT(10 -30,100 45)"), + 10, -90, 100, 45); +} + +BOOST_AUTO_TEST_CASE( expand_segment_spherical_polar ) +{ + typedef bg::cs::spherical coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::box B; + typedef bg::model::segment G; + typedef test_expand_on_spheroid tester; + + tester::apply("s02", + from_wkt("BOX(20 20,50 50)"), + from_wkt("SEGMENT(10 10,40 20)"), + 10, 10, 50, 50); + + // segment ending at the north pole + tester::apply("s04", + from_wkt("BOX(5 15,50 50)"), + from_wkt("SEGMENT(40 45,80 0)"), + 5, 0, 50, 50); +} + +BOOST_AUTO_TEST_CASE( expand_segment_spheroid ) +{ + typedef bg::cs::geographic coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::box B; + typedef bg::model::segment G; + typedef test_expand_on_spheroid tester; + + tester::apply("s01", + from_wkt("BOX(20 20,50 50)"), + from_wkt("SEGMENT(10 10,40 40)"), + 10, 10, 50, 50); + + tester::apply("s02", + from_wkt("BOX(20 20,50 50)"), + from_wkt("SEGMENT(10 10,40 10)"), + 10, 10, 50, 50); + + tester::apply("s03", + from_wkt("BOX(5 5,50 10)"), + from_wkt("SEGMENT(40 10,10 10)"), + 5, 5, 50, 10.347587099602029, + 4.0 * std::numeric_limits::epsilon()); + + // segment ending at the north pole + tester::apply("s04", + from_wkt("BOX(5 15,50 50)"), + from_wkt("SEGMENT(40 45,80 90)"), + 5, 15, 50, 90); + + // segment ending at the north pole + tester::apply("s04a", + from_wkt("BOX(5 15,30 30)"), + from_wkt("SEGMENT(40 45,80 90)"), + 5, 15, 40, 90); + + // segment starting at the north pole + tester::apply("s05", + from_wkt("BOX(5 15,50 50)"), + from_wkt("SEGMENT(80 90,40 45)"), + 5, 15, 50, 90); + + // segment starting at the north pole + tester::apply("s05a", + from_wkt("BOX(5 15,30 30)"), + from_wkt("SEGMENT(80 90,40 45)"), + 5, 15, 40, 90); + + // segment passing through the south pole + tester::apply("s06", + from_wkt("BOX(5 15,30 40)"), + from_wkt("SEGMENT(-170 -45,10 -30)"), + -170, -90, 30, 40); + + // segment degenerating to the north pole + tester::apply("s07", + from_wkt("BOX(5 15,30 40)"), + from_wkt("SEGMENT(10 90,20 90)"), + 5, 15, 30, 90); + + // segment degenerating to the south pole + tester::apply("s08", + from_wkt("BOX(5 15,30 40)"), + from_wkt("SEGMENT(10 -90,20 -90)"), + 5, -90, 30, 40); + + // box degenerating to the south pole + tester::apply("s09", + from_wkt("BOX(10 -90,30 -90)"), + from_wkt("SEGMENT(10 -30,100 45)"), + 10, -90, 100, 45); + + // box degenerating to the south pole + tester::apply("s09a", + from_wkt("BOX(10 -90,130 -90)"), + from_wkt("SEGMENT(10 -30,100 45)"), + 10, -90, 100, 45); +} + +BOOST_AUTO_TEST_CASE( expand_segment_sphere_with_height ) +{ + typedef bg::cs::spherical_equatorial coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::box B; + typedef bg::model::segment G; + typedef test_expand_on_spheroid tester; + + tester::apply("sh01", + from_wkt("BOX(20 20 100,50 50 1000)"), + from_wkt("SEGMENT(10 10 150,40 40 500)"), + 10, 10, 100, 50, 50, 1000); + + tester::apply("sh02", + from_wkt("BOX(20 20 100,50 50 1000)"), + from_wkt("SEGMENT(10 10 60,40 40 1500)"), + 10, 10, 60, 50, 50, 1500); + + tester::apply("sh03", + from_wkt("BOX(20 20 100,50 50 1000)"), + from_wkt("SEGMENT(10 10 150,40 40 1500)"), + 10, 10, 100, 50, 50, 1500); + + tester::apply("sh04", + from_wkt("BOX(20 20 100,50 50 1000)"), + from_wkt("SEGMENT(10 10 60,40 40 800)"), + 10, 10, 60, 50, 50, 1000); +} + +BOOST_AUTO_TEST_CASE( expand_segment_spheroid_with_height ) +{ + typedef bg::cs::geographic coordinate_system_type; + typedef bg::model::point point_type; + typedef bg::model::box B; + typedef bg::model::segment G; + typedef test_expand_on_spheroid tester; + + tester::apply("sh01", + from_wkt("BOX(20 20 100,50 50 1000)"), + from_wkt("SEGMENT(10 10 150,40 40 500)"), + 10, 10, 100, 50, 50, 1000); + + tester::apply("sh02", + from_wkt("BOX(20 20 100,50 50 1000)"), + from_wkt("SEGMENT(10 10 60,40 40 1500)"), + 10, 10, 60, 50, 50, 1500); + + tester::apply("sh03", + from_wkt("BOX(20 20 100,50 50 1000)"), + from_wkt("SEGMENT(10 10 150,40 40 1500)"), + 10, 10, 100, 50, 50, 1500); + + tester::apply("sh04", + from_wkt("BOX(20 20 100,50 50 1000)"), + from_wkt("SEGMENT(10 10 60,40 40 800)"), + 10, 10, 60, 50, 50, 1000); +} + + +template +void test_expand_box() +{ + typedef bg::model::point point_type; + typedef bg::model::box B; + typedef bg::model::box G; + typedef test_expand_on_spheroid tester; + + tester::apply("b01", + from_wkt("BOX(11 11,19 19)"), + from_wkt("BOX(10 10,20 20)"), + 10, 10, 20, 20); + + tester::apply("b02", + from_wkt("BOX(11 11,29 29)"), + from_wkt("BOX(10 10,20 20)"), + 10, 10, 29, 29); + + tester::apply("b03", + from_wkt("BOX(21 21,29 29)"), + from_wkt("BOX(10 10,20 20)"), + 10, 10, 29, 29); + + tester::apply("b04", + from_wkt("BOX(150 -10,200 60)"), + from_wkt("BOX(-175 -20,-150 55)"), + 150, -20, 210, 60); + + tester::apply("b04a", + from_wkt("BOX(150 -10,200 60)"), + from_wkt("BOX(-175 -20,-170 55)"), + 150, -20, 200, 60); + + tester::apply("b04b", + from_wkt("BOX(150 -10,200 60)"), + from_wkt("BOX(-175 -20,-140 55)"), + 150, -20, 220, 60); + + tester::apply("b05", + from_wkt("BOX(150 -10,170 60)"), + from_wkt("BOX(179 -20,535 55)"), + 179, -20, 535, 60); + + tester::apply("b06", + from_wkt("BOX(150 -10,170 60)"), + from_wkt("BOX(179 -20,520 55)"), + 179, -20, 530, 60); + + tester::apply("b07", + from_wkt("BOX(-100 -10,170 60)"), + from_wkt("BOX(100 -20,400 55)"), + -180, -20, 180, 60); + + tester::apply("b08", + from_wkt("BOX(-100 -10,100 60)"), + from_wkt("BOX(150 -20,150 55)"), + -100, -20, 150, 60); + + tester::apply("b09", + from_wkt("BOX(100 -10,400 60)"), + from_wkt("BOX(0 -20,0 55)"), + 100, -20, 400, 60); + + // this is a border case: + // there are two possible MBRs with longitude intervals: + // [100, 430] and [70, 400] + tester::apply("b10", + from_wkt("BOX(100 -10,400 60)"), + from_wkt("BOX(70 -20,70 55)"), + 70, -20, 400, 60, + 100, -20, 430, 60); + + tester::apply("b10a", + from_wkt("BOX(100 -10,400 60)"), + from_wkt("BOX(71 -20,71 55)"), + 71, -20, 400, 60); + + tester::apply("b10b", + from_wkt("BOX(100 -10,400 60)"), + from_wkt("BOX(69 -20,69 55)"), + 100, -20, 429, 60); + + tester::apply("b11", + from_wkt("BOX(-90 -10,-90 60)"), + from_wkt("BOX(90 -20,90 55)"), + -90, -20, 90, 60); + + // first box is the south pole + tester::apply("b12", + from_wkt("BOX(-90 -90,80 -90)"), + from_wkt("BOX(90 -20,90 55)"), + 90, -90, 90, 55); + + // first box is the south pole + tester::apply("b12a", + from_wkt("BOX(-90 -90,80 -90)"), + from_wkt("BOX(90 -20,130 55)"), + 90, -90, 130, 55); + + // first box is the north pole + tester::apply("b13", + from_wkt("BOX(-90 90,80 90)"), + from_wkt("BOX(90 -20,90 55)"), + 90, -20, 90, 90); + + // first box is the north pole + tester::apply("b13a", + from_wkt("BOX(-90 90,80 90)"), + from_wkt("BOX(90 -20,190 55)"), + 90, -20, 190, 90); + + // both boxes are the north pole + tester::apply("b14", + from_wkt("BOX(-90 90,80 90)"), + from_wkt("BOX(90 90,190 90)"), + 0, 90, 0, 90); + + // both boxes are the south pole + tester::apply("b15", + from_wkt("BOX(-90 -90,80 -90)"), + from_wkt("BOX(90 -90,190 -90)"), + 0, -90, 0, -90); + + // one box is the south pole and the other the north pole + tester::apply("b16", + from_wkt("BOX(-90 -90,80 -90)"), + from_wkt("BOX(90 90,190 90)"), + 0, -90, 0, 90); + + // both boxes contain both poles but at different longitudes + tester::apply("b17", + from_wkt("BOX(10 -90,10 90)"), + from_wkt("BOX(20 -90,20 90)"), + 10, -90, 20, 90); + + // both boxes contain both poles but at different longitude ranges + tester::apply("b17", + from_wkt("BOX(10 -90,20 90)"), + from_wkt("BOX(40 -90,60 90)"), + 10, -90, 60, 90); + + + // first box is a band + tester::apply("b18", + from_wkt("BOX(0 10,360 20)"), + from_wkt("BOX(-10 -40,20 10)"), + -180, -40, 180, 20); + + // first box contains south and north pole and is a band + // (box covers the entire spheroid) + tester::apply("b19", + from_wkt("BOX(0 -90,360 90)"), + from_wkt("BOX(-10 -40,20 10)"), + -180, -90, 180, 90); + + // the envelope of the two boxes is a band + tester::apply("b20", + from_wkt("BOX(-180 -40,0 -30)"), + from_wkt("BOX(0 -10,180 50)"), + -180, -40, 180, 50); + + // the envelope of the two boxes is a band + tester::apply("b20a", + from_wkt("BOX(-180 -40,0 -30)"), + from_wkt("BOX(0 -10,185 50)"), + -180, -40, 180, 50); + + // the envelope of the two boxes is a band + tester::apply("b20b", + from_wkt("BOX(-179 -40,0 -30)"), + from_wkt("BOX(0 -10,185 50)"), + -180, -40, 180, 50); +} + +BOOST_AUTO_TEST_CASE( expand_box ) +{ + test_expand_box >(); + test_expand_box >(); +} + +template +void test_expand_make_inverse() +{ + typedef bg::model::point point_type; + typedef bg::model::box box_type; + typedef bg::model::segment segment_type; + typedef test_expand_on_spheroid tester; + + box_type box = boost::geometry::make_inverse(); + + tester::apply("bi01", + box, + from_wkt("BOX(10 10,20 20)"), + 10, 10, 20, 20); + tester::apply("bi02", + box, + from_wkt("POINT(0 0)"), + 0, 0, 0, 0); + tester::apply("bi03", + box, + from_wkt("POINT(5 0)"), + 5, 0, 5, 0); + tester::apply("bi04", + box, + from_wkt("SEGMENT(5 0,0 5)"), + 0, 0, 5, 5); +} + +BOOST_AUTO_TEST_CASE( expand_make_inverse ) +{ + test_expand_make_inverse >(); + test_expand_make_inverse >(); +} + +template +void test_expand_box_with_height() +{ + typedef bg::model::point point_type; + typedef bg::model::box B; + typedef bg::model::box G; + typedef test_expand_on_spheroid tester; + + tester::apply("bh01", + from_wkt("BOX(11 11 100,19 19 1000)"), + from_wkt("BOX(10 10 200,20 20 800)"), + 10, 10, 100, 20, 20, 1000); + + tester::apply("bh02", + from_wkt("BOX(11 11 200,19 19 1000)"), + from_wkt("BOX(10 10 100,20 20 800)"), + 10, 10, 100, 20, 20, 1000); + + tester::apply("bh03", + from_wkt("BOX(11 11 100,19 19 800)"), + from_wkt("BOX(10 10 200,20 20 1000)"), + 10, 10, 100, 20, 20, 1000); + + tester::apply("bh04", + from_wkt("BOX(11 11 200,19 19 1000)"), + from_wkt("BOX(10 10 100,20 20 800)"), + 10, 10, 100, 20, 20, 1000); +} + +BOOST_AUTO_TEST_CASE( expand_box_with_height ) +{ + test_expand_box_with_height >(); + test_expand_box_with_height >(); +} diff --git a/src/boost/libs/geometry/test/algorithms/envelope_expand/test_envelope.hpp b/src/boost/libs/geometry/test/algorithms/envelope_expand/test_envelope.hpp new file mode 100644 index 000000000..c0dc91639 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/envelope_expand/test_envelope.hpp @@ -0,0 +1,98 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef BOOST_GEOMETRY_TEST_ENVELOPE_HPP +#define BOOST_GEOMETRY_TEST_ENVELOPE_HPP + + +#include + +#include + +#include +#include +#include + +#include + + +template +struct check_result +{}; + +template +struct check_result +{ + typedef typename bg::coordinate_type::type ctype; + typedef typename boost::mpl::if_ + < + boost::is_arithmetic, + double, + ctype + >::type type; + + static void apply(Box const& b, const type& x1, const type& y1, const type& /*z1*/, + const type& x2, const type& y2, const type& /*z2*/) + { + BOOST_CHECK_CLOSE((bg::get(b)), x1, 0.001); + BOOST_CHECK_CLOSE((bg::get(b)), y1, 0.001); + + BOOST_CHECK_CLOSE((bg::get(b)), x2, 0.001); + BOOST_CHECK_CLOSE((bg::get(b)), y2, 0.001); + } +}; + +template +struct check_result +{ + typedef typename bg::coordinate_type::type ctype; + typedef typename boost::mpl::if_ + < + boost::is_arithmetic, + double, + ctype + >::type type; + + static void apply(Box const& b, const type& x1, const type& y1, const type& z1, + const type& x2, const type& y2, const type& z2) + { + BOOST_CHECK_CLOSE((bg::get(b)), x1, 0.001); + BOOST_CHECK_CLOSE((bg::get(b)), y1, 0.001); + BOOST_CHECK_CLOSE((bg::get(b)), z1, 0.001); + + BOOST_CHECK_CLOSE((bg::get(b)), x2, 0.001); + BOOST_CHECK_CLOSE((bg::get(b)), y2, 0.001); + BOOST_CHECK_CLOSE((bg::get(b)), z2, 0.001); + } +}; + + +template +void test_envelope(std::string const& wkt, + const T& x1, const T& x2, + const T& y1, const T& y2, + const T& z1 = 0, const T& z2 = 0) +{ + typedef bg::model::box::type > box_type; + box_type b; + + Geometry geometry; + bg::read_wkt(wkt, geometry); + bg::envelope(geometry, b); + check_result::type::value> + ::apply(b, x1, y1, z1, x2, y2, z2); + + boost::variant v(geometry); + bg::envelope(v, b); + check_result::type::value> + ::apply(b, x1, y1, z1, x2, y2, z2); + +} + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/envelope_expand/test_envelope_expand_on_spheroid.hpp b/src/boost/libs/geometry/test/algorithms/envelope_expand/test_envelope_expand_on_spheroid.hpp new file mode 100644 index 000000000..cd6c0e2a8 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/envelope_expand/test_envelope_expand_on_spheroid.hpp @@ -0,0 +1,360 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2015-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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_TEST_ENVELOPE_EXPAND_ON_SPHEROID_HPP +#define BOOST_GEOMETRY_TEST_ENVELOPE_EXPAND_ON_SPHEROID_HPP + + +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include + +#include + +#include + + +struct rng +{ + typedef double type; + + rng(double l, double h) + : lo(l), hi(h) + { + BOOST_GEOMETRY_ASSERT(lo <= hi); + } + + friend rng operator*(rng const& l, double v) { return rng(l.lo * v, l.hi * v); } + + friend bool operator<=(rng const& l, rng const& r) { return l.lo <= r.hi; } + friend bool operator<=(double l, rng const& r) { return l <= r.hi; } + friend bool operator<=(rng const& l, double r) { return l.lo <= r; } + + friend bool operator<(rng const& l, rng const& r) { return !operator<=(r, l); } + friend bool operator<(double l, rng const& r) { return !operator<=(r, l); } + friend bool operator<(rng const& l, double r) { return !operator<=(r, l); } + + friend bool operator==(double l, rng const& r) { return r.lo <= l && l <= r.hi; } + + friend std::ostream & operator<<(std::ostream & os, rng const& v) + { + return (os << "[" << v.lo << ", " << v.hi << "]"); + } + + double lo, hi; +}; + + +template +char const* units2string() +{ + if (BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + { + return "degrees"; + } + return "radians"; +} + +template +struct other_system_info +{}; + +template <> +struct other_system_info > +{ + typedef bg::degree units; + typedef bg::cs::spherical_equatorial type; + + static inline double convert(double value) + { + return value * bg::math::r2d(); + } + + static inline rng convert(rng const& value) + { + return value * bg::math::r2d(); + } +}; + +template <> +struct other_system_info > +{ + typedef bg::radian units; + typedef bg::cs::spherical_equatorial type; + + static inline double convert(double value) + { + return value * bg::math::d2r(); + } + + static inline rng convert(rng const& value) + { + return value * bg::math::d2r(); + } +}; + +template <> +struct other_system_info > +{ + typedef bg::degree units; + typedef bg::cs::spherical type; + + static inline double convert(double value) + { + return value * bg::math::r2d(); + } + + static inline rng convert(rng const& value) + { + return value * bg::math::r2d(); + } +}; + +template <> +struct other_system_info > +{ + typedef bg::radian units; + typedef bg::cs::spherical type; + + static inline double convert(double value) + { + return value * bg::math::d2r(); + } + + static inline rng convert(rng const& value) + { + return value * bg::math::d2r(); + } +}; + +template <> +struct other_system_info > +{ + typedef bg::degree units; + typedef bg::cs::geographic type; + + static inline double convert(double value) + { + return value * bg::math::r2d(); + } + + static inline rng convert(rng const& value) + { + return value * bg::math::r2d(); + } +}; + +template <> +struct other_system_info > +{ + typedef bg::radian units; + typedef bg::cs::geographic type; + + static inline double convert(double value) + { + return value * bg::math::d2r(); + } + + static inline rng convert(rng const& value) + { + return value * bg::math::d2r(); + } +}; + + +class equals_with_tolerance +{ +private: + double m_tolerence; + + template + static inline T const& get_max(T const& a, T const& b, T const& c) + { + return (std::max)((std::max)(a, b), c); + } + + template + static inline bool check_close(T const& a, T const& b, double tol) + { + return (a == b) + || (std::abs(a - b) <= tol * get_max(std::abs(a), std::abs(b), 1.0)); + } + +public: + equals_with_tolerance(double tolerence) : m_tolerence(tolerence) {} + + inline bool operator()(double value1, double value2) const + { + return check_close(value1, value2, m_tolerence); + } + + inline bool operator()(double l, rng const& r) const + { + return (r.lo < l && l < r.hi) + || check_close(l, r.lo, m_tolerence) + || check_close(l, r.hi, m_tolerence); + } +}; + + +bool equals_with_eps(double l, double r) +{ + return bg::math::equals(l, r); +} + +bool equals_with_eps(double l, rng r) +{ + return (r.lo < l && l < r.hi) + || bg::math::equals(l, r.lo) + || bg::math::equals(l, r.hi); +} + + +template +< + typename Box, + std::size_t DimensionCount = bg::dimension::value +> +struct box_check_equals +{ + template + static inline bool apply(Box const& box, + T1 const& lon_min, T2 const& lat_min, double, + T3 const& lon_max, T4 const& lat_max, double, + double tol) + { + equals_with_tolerance equals(tol); + +#ifndef BOOST_GEOMETRY_TEST_FAILURES + // check latitude with tolerance when necessary + return equals_with_eps(bg::get<0, 0>(box), lon_min) + && (bg::get<0, 1>(box) < 0 + ? equals(bg::get<0, 1>(box), lat_min) + : equals_with_eps(bg::get<0, 1>(box), lat_min)) + && equals_with_eps(bg::get<1, 0>(box), lon_max) + && (bg::get<1, 1>(box) > 0 + ? equals(bg::get<1, 1>(box), lat_max) + : equals_with_eps(bg::get<1, 1>(box), lat_max)); +#else + // check latitude with tolerance when necessary + return bg::get<0, 0>(box) == lon_min + && (bg::get<0, 1>(box) < 0 + ? equals(bg::get<0, 1>(box), lat_min) + : bg::get<0, 1>(box) == lat_min) + && bg::get<1, 0>(box) == lon_max + && (bg::get<1, 1>(box) > 0 + ? equals(bg::get<1, 1>(box), lat_max) + : bg::get<1, 1>(box) == lat_max); +#endif + } +}; + +template +struct box_check_equals +{ + template + static inline bool apply(Box const& box, + T1 const& lon_min, T2 const& lat_min, double height_min, + T3 const& lon_max, T4 const& lat_max, double height_max, + double tol) + { +#ifndef BOOST_GEOMETRY_TEST_FAILURES + equals_with_tolerance equals(tol); + + return box_check_equals::apply(box, + lon_min, lat_min, height_min, + lon_max, lat_max, height_max, + tol) + && equals(bg::get<0, 2>(box), height_min) + && equals(bg::get<1, 2>(box), height_max); +#else + return box_equals::apply(box, + lon_min, lat_min, height_min, + lon_max, lat_max, height_max, + tol) + && bg::get<0, 2>(box) == height_min + && bg::get<1, 2>(box) == height_max; +#endif + } +}; + + +template +< + typename Box1, + typename Box2 = Box1, + std::size_t DimensionCount = bg::dimension::value +> +struct box_equals +{ + static inline bool apply(Box1 const& box1, Box2 const& box2, double tol) + { + return box_check_equals::apply(box1, + bg::get<0, 0>(box2), bg::get<0, 1>(box2), 0.0, + bg::get<1, 0>(box2), bg::get<1, 1>(box2), 0.0, + tol); + } +}; + +template +struct box_equals +{ + static inline bool apply(Box1 const& box1, Box2 const& box2, double tol) + { + return box_check_equals::apply(box1, + bg::get<0, 0>(box2), bg::get<0, 1>(box2), bg::get<0, 2>(box2), + bg::get<1, 0>(box2), bg::get<1, 1>(box2), bg::get<1, 2>(box2), + tol); + } +}; + + +template ::value> +struct initialize_box +{ + static inline void apply(Box& box, + double lon_min, double lat_min, double, + double lon_max, double lat_max, double) + { + bg::detail::indexed_point_view p_min(box); + bg::detail::indexed_point_view p_max(box); + + bg::assign_values(p_min, lon_min, lat_min); + bg::assign_values(p_max, lon_max, lat_max); + } +}; + +template +struct initialize_box +{ + static inline void apply(Box& box, + double lon_min, double lat_min, double height_min, + double lon_max, double lat_max, double height_max) + { + bg::detail::indexed_point_view p_min(box); + bg::detail::indexed_point_view p_max(box); + + bg::assign_values(p_min, lon_min, lat_min, height_min); + bg::assign_values(p_max, lon_max, lat_max, height_max); + } +}; + +#endif // BOOST_GEOMETRY_TEST_ENVELOPE_EXPAND_ON_SPHEROID_HPP diff --git a/src/boost/libs/geometry/test/algorithms/envelope_expand/test_expand.hpp b/src/boost/libs/geometry/test/algorithms/envelope_expand/test_expand.hpp new file mode 100644 index 000000000..2e42d436d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/envelope_expand/test_expand.hpp @@ -0,0 +1,71 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef BOOST_GEOMETRY_TEST_EXPAND_HPP +#define BOOST_GEOMETRY_TEST_EXPAND_HPP + + +#include + +#include +#include +#include +#include +#include +#include + + +template +inline std::string to_dsv(const Box& box) +{ + std::ostringstream out; + out << bg::dsv(box, ",", "(", ")", ",", "", ""); + return out.str(); +} + + +template +void test_expand(Box& box, + std::string const& wkt, + std::string const& expected) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + + bg::expand(box, geometry); + + BOOST_CHECK_EQUAL(to_dsv(box), expected); + +#if !defined(BOOST_GEOMETRY_TEST_DEBUG) + bg::expand(box, boost::variant(geometry)); + + BOOST_CHECK_EQUAL(to_dsv(box), expected); +#endif +} + +template +void test_expand_other_strategy(Box& box, + std::string const& wkt, + std::string const& expected) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + + bg::expand(box, geometry); + + BOOST_CHECK_EQUAL(to_dsv(box), expected); + +#if !defined(BOOST_GEOMETRY_TEST_DEBUG) + bg::expand(box, boost::variant(geometry)); + + BOOST_CHECK_EQUAL(to_dsv(box), expected); +#endif +} + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/equals/Jamfile b/src/boost/libs/geometry/test/algorithms/equals/Jamfile new file mode 100644 index 000000000..f128597e2 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/equals/Jamfile @@ -0,0 +1,22 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2016. +# Modifications copyright (c) 2014-2016, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-equals + : + [ run equals.cpp : : : : algorithms_equals ] + [ run equals_multi.cpp : : : : algorithms_equals_multi ] + [ run equals_on_spheroid.cpp : : : : algorithms_equals_on_spheroid ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/equals/equals.cpp b/src/boost/libs/geometry/test/algorithms/equals/equals.cpp new file mode 100644 index 000000000..c96b6015f --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/equals/equals.cpp @@ -0,0 +1,318 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2013, 2014. +// Modifications copyright (c) 2013-2014 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) + +#include "test_equals.hpp" + +#include + +#include +#include + + +namespace bgm = bg::model; + +template +void test_pointlike() +{ + typedef bgm::multi_point

mpt; + + test_geometry("ptpt2d_1", "POINT(0 0)", "POINT(0 0)", true); + test_geometry("ptpt2d_2", "POINT(0 0)", "POINT(1 1)", false); + + test_geometry("ptmpt2d_1", "POINT(0 0)", "MULTIPOINT(0 0)", true); + test_geometry("ptmpt2d_1", "POINT(0 0)", "MULTIPOINT(0 0, 1 1)", false); + + test_geometry("mptpt2d_1", "MULTIPOINT(0 0)", "POINT(0 0)", true); + test_geometry("mptpt2d_1", "MULTIPOINT(0 0, 1 1)", "POINT(0 0)", false); + + test_geometry("mptmpt2d_1", "MULTIPOINT(0 0, 1 1)", "MULTIPOINT(0 0, 1 1)", true); + test_geometry("mptmpt2d_1", "MULTIPOINT(0 0, 1 1)", "MULTIPOINT(0 0, 2 2)", false); + test_geometry("mptmpt2d_1", "MULTIPOINT(0 0, 1 1)", "MULTIPOINT(2 2, 3 3)", false); +} + +template +void test_segment_segment() +{ + typedef bgm::segment

seg; + + test_geometry("seg2d_1", "LINESTRING(0 0, 3 3)", "LINESTRING(0 0, 3 3)", true); + test_geometry("seg2d_1", "LINESTRING(0 0, 3 3)", "LINESTRING(3 3, 0 0)", true); + + test_geometry("seg2d_1", "LINESTRING(0 0, 3 3)", "LINESTRING(0 0, 1 1)", false); + test_geometry("seg2d_1", "LINESTRING(0 0, 3 3)", "LINESTRING(3 3, 2 2)", false); + + test_geometry("seg2d_1", "LINESTRING(0 0, 3 3)", "LINESTRING(1 1, 4 4)", false); + test_geometry("seg2d_1", "LINESTRING(0 0, 3 3)", "LINESTRING(1 0, 2 0)", false); +} + +template +void test_linestring_linestring() +{ + typedef bgm::linestring

ls; + + test_geometry("ls2d_1", "LINESTRING(1 1, 3 3)", "LINESTRING(3 3, 1 1)", true); + test_geometry("ls2d_2", "LINESTRING(1 1, 3 3, 2 5)", "LINESTRING(1 1, 2 2, 3 3, 2 5)", true); + test_geometry("ls2d_3", "LINESTRING(1 0, 3 3, 2 5)", "LINESTRING(1 1, 2 2, 3 3, 2 5)", false); + test_geometry("ls2d_4", "LINESTRING(1 0, 3 3, 2 5)", "LINESTRING(1 1, 3 3, 2 5)", false); + test_geometry("ls2d_5", "LINESTRING(0 5,5 5,10 5,10 0,5 0,5 5,5 10,10 10,15 10,15 5,10 5,10 10,10 15)", + "LINESTRING(0 5,15 5,15 10,5 10,5 0,10 0,10 15)", true); + test_geometry("ls2d_6", "LINESTRING(0 5,5 5,10 5,10 10,5 10,5 5,5 0)", "LINESTRING(0 5,5 5,5 10,10 10,10 5,5 5,5 0)", true); + test_geometry("ls2d_7", "LINESTRING(0 5,10 5,10 10,5 10,5 0)", "LINESTRING(0 5,5 5,5 10,10 10,10 5,5 5,5 0)", true); + test_geometry("ls2d_8", "LINESTRING(0 0,5 0,5 0,6 0)", "LINESTRING(0 0,6 0)", true); + + test_geometry("ls2d_seg", "LINESTRING(1 1,2 2)", "LINESTRING(1 1,2 2)", true); + test_geometry("ls2d_rev", "LINESTRING(1 1,2 2)", "LINESTRING(2 2,1 1)", true); + + test_geometry("ls2d_spike", "LINESTRING(0 0,5 0,3 0,6 0)", "LINESTRING(0 0,6 0)", true); + + test_geometry("ls2d_ring1", "LINESTRING(0 0,5 0,5 5,0 5,0 0)", "LINESTRING(5 5,0 5,0 0,5 0,5 5)", true); + test_geometry("ls2d_ring2", "LINESTRING(0 0,5 0,5 5,0 5,0 0)", "LINESTRING(5 5,5 0,0 0,0 5,5 5)", true); + test_geometry("ls2d_overl_ring1", "LINESTRING(0 0,5 0,5 5,0 5,0 0)", "LINESTRING(5 5,0 5,0 0,5 0,5 5,0 5)", true); + test_geometry("ls2d_overl_ring2", "LINESTRING(0 0,5 0,5 5,0 5,0 0)", "LINESTRING(5 5,5 0,0 0,0 5,5 5,5 0)", true); + + // https://svn.boost.org/trac/boost/ticket/10904 + if ( BOOST_GEOMETRY_CONDITION( + boost::is_floating_point::type>::value ) ) + { + test_geometry("ls2d_small1", + "LINESTRING(5.6956521739130430148634331999347 -0.60869565217391330413931882503675,5.5 -0.50000000000000066613381477509392)", + "LINESTRING(5.5 -0.50000000000000066613381477509392,5.5 -0.5)", + false); + + test_geometry("ls2d_small2", + "LINESTRING(-3.2333333333333333925452279800083 5.5999999999999978683717927196994,-3.2333333333333333925452279800083 5.5999999999999996447286321199499)", + "LINESTRING(-3.2333333333333325043668082798831 5.5999999999999996447286321199499,-3.2333333333333333925452279800083 5.5999999999999996447286321199499)", + false); + } +} + +template +void test_linestring_multilinestring() +{ + typedef bgm::linestring

ls; + typedef bgm::multi_linestring mls; + + test_geometry("ls_mls_1", "LINESTRING(0 0,1 0,2 0)", "MULTILINESTRING((0 0,2 0))", true); + test_geometry("ls_mls_1", "LINESTRING(0 0,1 0,2 0)", "MULTILINESTRING((0 0,1 0),(1 0,2 0))", true); + test_geometry("ls_mls_1", "LINESTRING(0 0,2 0,4 0)", "MULTILINESTRING((0 0,2 0),(2 0,3 0),(3 0,4 0))", true); + test_geometry("ls_mls_1", "LINESTRING(0 0,2 0,4 0)", "MULTILINESTRING((0 0,2 0),(2 0,3 0),(2 0,3 0),(3 0,4 0))", true); + test_geometry("ls_mls_1", "LINESTRING(0 0,2 0,4 0)", "MULTILINESTRING((0 0,2 0),(3 0,4 0))", false); + + test_geometry("ls_mls_spike", "LINESTRING(0 0,2 0,2 2,2 0,4 0)", "MULTILINESTRING((0 0,4 0),(2 2,2 0))", true); + test_geometry("ls_mls_spike", "LINESTRING(0 0,2 0,2 2,2 0,4 0)", "MULTILINESTRING((0 0,4 0),(2 2,2 -1))", false); + + test_geometry("ls_mls_ring1", "LINESTRING(0 0,5 0,5 5,0 5,0 0)", "MULTILINESTRING((5 5,0 5,0 0),(0 0,5 0,5 5))", true); + test_geometry("ls_mls_ring2", "LINESTRING(0 0,5 0,5 5,0 5,0 0)", "MULTILINESTRING((5 5,5 0,0 0),(0 0,0 5,5 5))", true); + test_geometry("ls_mls_overl_ring1", "LINESTRING(0 0,5 0,5 5,0 5,0 0)", "MULTILINESTRING((5 5,0 5,0 0),(0 0,5 0,5 5,0 5))", true); + test_geometry("ls_mls_overl_ring2", "LINESTRING(0 0,5 0,5 5,0 5,0 0)", "MULTILINESTRING((5 5,5 0,0 0),(0 0,0 5,5 5,5 0))", true); +} + +template +void test_multilinestring_multilinestring() +{ + typedef bgm::linestring

ls; + typedef bgm::multi_linestring mls; + + test_geometry("ls_mls_mls", + "MULTILINESTRING((0 5,10 5,10 10,5 10),(5 10,5 0,5 2),(5 2,5 5,0 5))", + "MULTILINESTRING((5 5,0 5),(5 5,5 0),(10 10,10 5,5 5,5 10,10 10))", + true); +} + +template +void test_polygons() +{ + typedef bg::model::polygon poly_cw_c; + typedef bg::model::polygon poly_cw_o; + typedef bg::model::polygon poly_ccw_c; + typedef bg::model::polygon poly_ccw_o; + typedef bg::model::box

box; + + std::string wkt1 = "POLYGON((-18 1, -23 1, -23 -3, -18 -3))"; + std::string wkt2 = "POLYGON((-23 1, -23 -3, -18 -3, -18 1))"; + + test_geometry("polys_cw_c_cw_c", wkt1, wkt2, true, true); + test_geometry("polys_cw_c_cw_o", wkt1, wkt2, true, true); + test_geometry("polys_cw_c_ccw_c", wkt1, wkt2, true, true); + test_geometry("polys_cw_c_ccw_o", wkt1, wkt2, true, true); + test_geometry("polys_cw_c_box", wkt1, wkt2, true, true); + + test_geometry("polys_cw_o_cw_c", wkt1, wkt2, true, true); + test_geometry("polys_cw_o_cw_o", wkt1, wkt2, true, true); + test_geometry("polys_cw_o_ccw_c", wkt1, wkt2, true, true); + test_geometry("polys_cw_o_ccw_o", wkt1, wkt2, true, true); + test_geometry("polys_cw_o_box", wkt1, wkt2, true, true); + + test_geometry("polys_ccw_c_cw_c", wkt1, wkt2, true, true); + test_geometry("polys_ccw_c_cw_o", wkt1, wkt2, true, true); + test_geometry("polys_ccw_c_ccw_c", wkt1, wkt2, true, true); + test_geometry("polys_ccw_c_ccw_o", wkt1, wkt2, true, true); + test_geometry("polys_cw_o_box", wkt1, wkt2, true, true); + + test_geometry("polys_ccw_o_cw_c", wkt1, wkt2, true, true); + test_geometry("polys_ccw_o_cw_o", wkt1, wkt2, true, true); + test_geometry("polys_ccw_o_ccw_c", wkt1, wkt2, true, true); + test_geometry("polys_ccw_o_ccw_o", wkt1, wkt2, true, true); + test_geometry("polys_ccw_o_box", wkt1, wkt2, true, true); +} + +template +void test_all() +{ + typedef bg::model::box

box; + typedef bg::model::ring

ring; + typedef bg::model::polygon

polygon; + //typedef bg::model::linestring

linestring; + + std::string case_p1 = "POLYGON((0 0,0 2,2 2,0 0))"; + + test_geometry("p1", "POINT(1 1)", "POINT(1 1)", true); + test_geometry("p2", "POINT(1 1)", "POINT(1 2)", false); + test_geometry("b1", "BOX(1 1,2 2)", "BOX(1 2,2 2)", false); + test_geometry("b1", "BOX(1 2,3 4)", "BOX(1 2,3 4)", true); + + // Completely equal + test_geometry("poly_eq", case_p1, case_p1, true); + + // Shifted + test_geometry("poly_sh", "POLYGON((2 2,0 0,0 2,2 2))", case_p1, true); + test_geometry("poly_sh2", case_p1, "POLYGON((0 2,2 2,0 0,0 2))", true); + + // Extra coordinate + test_geometry("poly_extra", case_p1, "POLYGON((0 0,0 2,2 2,1 1,0 0))", true); + + // Shifted + extra (redundant) coordinate + test_geometry("poly_shifted_extra1", "POLYGON((2 2,1 1,0 0,0 2,2 2))", case_p1, true); + + // Shifted + extra (redundant) coordinate being first/last point + test_geometry("poly_shifted_extra2", "POLYGON((1 1,0 0,0 2,2 2,1 1))", case_p1, true); + + // Degenerate (duplicate) points + test_geometry("poly_degenerate", "POLYGON((0 0,0 2,2 2,2 2,0 0))", "POLYGON((0 0,0 2,0 2,2 2,0 0))", true); + + // Two different bends, same area, unequal + test_geometry("poly_bends", + "POLYGON((4 0,5 3,8 4,7 7,4 8,0 4,4 0))", + "POLYGON((4 0,7 1,8 4,5 5,4 8,0 4,4 0))", false); + + // Unequal (but same area) + test_geometry("poly_uneq", case_p1, "POLYGON((1 1,1 3,3 3,1 1))", false); + + // One having hole + test_geometry("poly_hole", "POLYGON((0 0,0 4,4 4,0 0))", "POLYGON((0 0,0 4,4 4,0 0),(1 1,2 1,2 2,1 2,1 1))", false); + + // Both having holes + test_geometry("poly_holes", + "POLYGON((0 0,0 4,4 4,0 0),(1 1,2 1,2 2,1 2,1 1))", + "POLYGON((0 0,0 4,4 4,0 0),(1 1,2 1,2 2,1 2,1 1))", true); + + // Both having holes, outer equal, inner not equal + test_geometry("poly_uneq_holes", + "POLYGON((0 0,0 4,4 4,0 0),(1 1,2 1,2 2,1 2,1 1))", + "POLYGON((0 0,0 4,4 4,0 0),(2 2,3 2,3 3,2 3,2 2))", false); + + // Both having 2 holes, equal but in different order + test_geometry("poly_holes_diff_order", + "POLYGON((0 0,0 4,4 4,0 0),(1 1,2 1,2 2,1 2,1 1),(2 2,3 2,3 3,2 3,2 2))", + "POLYGON((0 0,0 4,4 4,0 0),(2 2,3 2,3 3,2 3,2 2),(1 1,2 1,2 2,1 2,1 1))", true); + + // Both having 3 holes, equal but in different order + test_geometry("poly_holes_diff_order_3", + "POLYGON((0 0,0 10,10 10,0 0),(1 1,2 1,2 2,1 2,1 1),(4 1,5 1,5 2,4 2,4 1),(2 2,3 2,3 3,2 3,2 2))", + "POLYGON((0 0,0 10,10 10,0 0),(4 1,5 1,5 2,4 2,4 1),(2 2,3 2,3 3,2 3,2 2),(1 1,2 1,2 2,1 2,1 1))", true); + + // polygon/ring vv + test_geometry("poly_sh2_pr", case_p1, case_p1, true); + test_geometry("poly_sh2_rp", case_p1, case_p1, true); + + // box/ring/poly + test_geometry("boxring1", "BOX(1 1,2 2)", "POLYGON((1 1,1 2,2 2,2 1,1 1))", true); + test_geometry("boxring2", "POLYGON((1 1,1 2,2 2,2 1,1 1))", "BOX(1 1,2 2)", true); + test_geometry("boxpoly1", "BOX(1 1,2 2)", "POLYGON((1 1,1 2,2 2,2 1,1 1))", true); + test_geometry("boxpoly2", "POLYGON((1 1,1 2,2 2,2 1,1 1))", "BOX(1 1,2 2)", true); + + test_geometry("boxpoly2", "POLYGON((1 1,1 2,2 2,2 1,1 1))", "BOX(1 1,2 3)", false); + + test_geometry("poly_holes_shifted_points", + "POLYGON((0 0,0 3,3 3,3 0,0 0),(1 1,2 1,2 2,1 2,1 1))", + "POLYGON((0 0,0 3,3 3,3 0,0 0),(2 2,1 2,1 1,2 1,2 2))", true); + + test_pointlike

(); + test_segment_segment

(); + test_linestring_linestring

(); + test_linestring_multilinestring

(); + test_multilinestring_multilinestring

(); + test_polygons

(); +} + + +template +void verify() +{ + T dxn1, dyn1, dxn2, dyn2; + + { + T x1 = "0", y1 = "0", x2 = "3", y2 = "3"; + T dx = x2 - x1, dy = y2 - y1; + T mag = sqrt(dx * dx + dy * dy); + dxn1 = dx / mag; + dyn1 = dy / mag; + } + + { + T x1 = "0", y1 = "0", x2 = "1", y2 = "1"; + T dx = x2 - x1, dy = y2 - y1; + T mag = sqrt(dx * dx + dy * dy); + dxn2 = dx / mag; + dyn2 = dy / mag; + } + + if (dxn1 == dxn2 && dyn1 == dyn2) + { + //std::cout << "vectors are equal, using ==" << std::endl; + } + if (boost::geometry::math::equals(dxn1, dxn2) + && boost::geometry::math::equals(dyn1, dyn2)) + { + //std::cout << "vectors are equal, using bg::math::equals" << std::endl; + } + + bool equals = boost::geometry::math::equals_with_epsilon(dxn1, dxn2) + && boost::geometry::math::equals_with_epsilon(dyn1, dyn2); + + if (equals) + { + //std::cout << "vectors are equal, using bg::math::equals_with_epsilon" << std::endl; + } + + BOOST_CHECK_EQUAL(equals, true); +} + + +int test_main( int , char* [] ) +{ + //verify(); +#if defined(HAVE_TTMATH) + verify(); +#endif + + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/equals/equals_multi.cpp b/src/boost/libs/geometry/test/algorithms/equals/equals_multi.cpp new file mode 100644 index 000000000..6984f29e5 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/equals/equals_multi.cpp @@ -0,0 +1,52 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + + +#include "test_equals.hpp" + +#include + +#include +#include + + +template +void test_all() +{ + std::string case1 = "MULTIPOLYGON(((0 0,0 7,4 2,2 0,0 0)))"; + std::string case1_p = "POLYGON((0 0,0 7,4 2,2 0,0 0))"; + + typedef bg::model::polygon

polygon; + typedef bg::model::multi_polygon mp; + test_geometry("c1", case1, case1, true); + + test_geometry("c2", + "MULTIPOLYGON(((0 0,0 7.01,4 2,2 0,0 0)))", + case1, false); + + // Different order == equal + test_geometry("c3", + "MULTIPOLYGON(((0 0,0 7,4 2,2 0,0 0)),((10 10,10 12,12 10,10 10)))", + "MULTIPOLYGON(((10 10,10 12,12 10,10 10)),((0 0,0 7,4 2,2 0,0 0)))", + true); + + // check different types + test_geometry("c1_p_mp", case1_p, case1, true); + test_geometry("c1_mp_p", case1, case1_p, true); + +} + +int test_main( int , char* [] ) +{ + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/equals/equals_on_spheroid.cpp b/src/boost/libs/geometry/test/algorithms/equals/equals_on_spheroid.cpp new file mode 100644 index 000000000..5e24fdfab --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/equals/equals_on_spheroid.cpp @@ -0,0 +1,255 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit test + +// Copyright (c) 2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_equals_on_spheroid +#endif + +#include + +#include + +#include "test_equals.hpp" + +#include + +#include + +namespace bgm = bg::model; + +template +struct test_point_point +{ + static inline void apply(std::string const& header) + { + std::string const str = header + "-"; + + test_geometry(str + "pp_01", "POINT(0 0)", "POINT(0 0)", true); + test_geometry(str + "pp_02", "POINT(0 0)", "POINT(10 0)", false); + + // points whose longitudes differ by 360 degrees + test_geometry(str + "pp_03", "POINT(0 0)", "POINT(360 0)", true); + test_geometry(str + "pp_04", "POINT(10 0)", "POINT(370 0)", true); + test_geometry(str + "pp_05", "POINT(10 0)", "POINT(-350 0)", true); + test_geometry(str + "pp_06", "POINT(180 10)", "POINT(-180 10)", true); + test_geometry(str + "pp_06a", "POINT(540 10)", "POINT(-540 10)", true); + +#ifdef BOOST_GEOMETRY_NORMALIZE_LATITUDE + test_geometry(str + "pp_06b", "POINT(540 370)", "POINT(-540 -350)", true); + test_geometry(str + "pp_06c", "POINT(1260 370)", "POINT(-1260 -350)", true); + test_geometry(str + "pp_06d", "POINT(2340 370)", "POINT(-2340 -350)", true); +#endif + + test_geometry(str + "pp_06e", "POINT(-180 10)", "POINT(-540 10)", true); + test_geometry(str + "pp_06f", "POINT(180 10)", "POINT(-540 10)", true); + + // north & south pole + test_geometry(str + "pp_07", "POINT(0 90)", "POINT(0 90)", true); + +#ifdef BOOST_GEOMETRY_NORMALIZE_LATITUDE + test_geometry(str + "pp_07a", "POINT(0 450)", "POINT(10 -270)", true); + test_geometry(str + "pp_07b", "POINT(0 270)", "POINT(10 90)", false); + test_geometry(str + "pp_07c", "POINT(0 -450)", "POINT(10 90)", false); +#endif + + test_geometry(str + "pp_08", "POINT(0 90)", "POINT(10 90)", true); + test_geometry(str + "pp_09", "POINT(0 90)", "POINT(0 -90)", false); + test_geometry(str + "pp_10", "POINT(0 -90)", "POINT(0 -90)", true); + test_geometry(str + "pp_11", "POINT(0 -90)", "POINT(10 -90)", true); + test_geometry(str + "pp_11a", "POINT(0 -90)", "POINT(10 90)", false); + test_geometry(str + "pp_12", "POINT(0 -90)", "POINT(0 -85)", false); + test_geometry(str + "pp_13", "POINT(0 90)", "POINT(0 85)", false); + test_geometry(str + "pp_14", "POINT(0 90)", "POINT(10 85)", false); + + // symmetric wrt prime meridian + test_geometry(str + "pp_15", "POINT(-10 45)", "POINT(10 45)", false); + test_geometry(str + "pp_16", "POINT(-170 45)", "POINT(170 45)", false); + + // other points + test_geometry(str + "pp_17", "POINT(-10 45)", "POINT(10 -45)", false); + test_geometry(str + "pp_18", "POINT(-10 -45)", "POINT(10 45)", false); + test_geometry(str + "pp_19", "POINT(10 -135)", "POINT(10 45)", false); + +#ifdef BOOST_GEOMETRY_NORMALIZE_LATITUDE + test_geometry(str + "pp_20", "POINT(190 135)", "POINT(10 45)", true); + test_geometry(str + "pp_21", "POINT(190 150)", "POINT(10 30)", true); + test_geometry(str + "pp_21a", "POINT(-170 150)", "POINT(10 30)", true); + test_geometry(str + "pp_22", "POINT(190 -135)", "POINT(10 -45)", true); + test_geometry(str + "pp_23", "POINT(190 -150)", "POINT(10 -30)", true); + test_geometry(str + "pp_23a", "POINT(-170 -150)", "POINT(10 -30)", true); +#endif + } +}; + + +template +struct test_point_point_with_height +{ + static inline void apply(std::string const& header) + { + std::string const str = header + "-"; + + test_geometry(str + "pp_01", + "POINT(0 0 10)", + "POINT(0 0 20)", + true); + + test_geometry(str + "pp_02", + "POINT(0 0 10)", + "POINT(10 0 10)", + false); + + // points whose longitudes differ by 360 degrees + test_geometry(str + "pp_03", + "POINT(0 0 10)", + "POINT(360 0 10)", + true); + + // points whose longitudes differ by 360 degrees + test_geometry(str + "pp_04", + "POINT(10 0 10)", + "POINT(370 0 10)", + true); + + test_geometry(str + "pp_05", + "POINT(10 0 10)", + "POINT(10 0 370)", + false); + } +}; + + +template +void test_segment_segment(std::string const& header) +{ + typedef bgm::segment

seg; + + std::string const str = header + "-"; + + test_geometry(str + "ss_01", + "SEGMENT(10 0,180 0)", + "SEGMENT(10 0,-180 0)", + true); + test_geometry(str + "ss_02", + "SEGMENT(0 90,180 0)", + "SEGMENT(10 90,-180 0)", + true); + test_geometry(str + "ss_03", + "SEGMENT(0 90,0 -90)", + "SEGMENT(10 90,20 -90)", + true); + test_geometry(str + "ss_04", + "SEGMENT(10 80,10 -80)", + "SEGMENT(10 80,20 -80)", + false); + test_geometry(str + "ss_05", + "SEGMENT(170 10,-170 10)", + "SEGMENT(170 10,350 10)", + false); +} + + +BOOST_AUTO_TEST_CASE( equals_point_point_se ) +{ + typedef bg::cs::spherical_equatorial cs_type; + + test_point_point >::apply("se"); + test_point_point >::apply("se"); + test_point_point >::apply("se"); + + // mixed point types + test_point_point + < + bgm::point, bgm::point + >::apply("se"); + + test_point_point + < + bgm::point, bgm::point + >::apply("se"); + +#if defined(HAVE_TTMATH) + test_point_point >::apply("se"); +#endif +} + +BOOST_AUTO_TEST_CASE( equals_point_point_with_height_se ) +{ + typedef bg::cs::spherical_equatorial cs_type; + + test_point_point >::apply("seh"); + test_point_point >::apply("seh"); + test_point_point >::apply("seh"); + + // mixed point types + test_point_point + < + bgm::point, bgm::point + >::apply("seh"); + + test_point_point + < + bgm::point, bgm::point + >::apply("seh"); + +#if defined(HAVE_TTMATH) + test_point_point >::apply("seh"); +#endif +} + +BOOST_AUTO_TEST_CASE( equals_point_point_geo ) +{ + typedef bg::cs::geographic cs_type; + + test_point_point >::apply("geo"); + test_point_point >::apply("geo"); + test_point_point >::apply("geo"); + + // mixed point types + test_point_point + < + bgm::point, bgm::point + >::apply("se"); + + test_point_point + < + bgm::point, bgm::point + >::apply("se"); + +#if defined(HAVE_TTMATH) + test_point_point >::apply("geo"); +#endif +} + +BOOST_AUTO_TEST_CASE( equals_segment_segment_se ) +{ + typedef bg::cs::spherical_equatorial cs_type; + + test_segment_segment >("se"); + test_segment_segment >("se"); + test_segment_segment >("se"); + +#if defined(HAVE_TTMATH) + test_segment_segment >("se"); +#endif +} + +BOOST_AUTO_TEST_CASE( equals_segment_segment_geo ) +{ + typedef bg::cs::geographic cs_type; + + test_segment_segment >("geo"); + test_segment_segment >("geo"); + test_segment_segment >("geo"); + +#if defined(HAVE_TTMATH) + test_segment_segment >("geo"); +#endif +} diff --git a/src/boost/libs/geometry/test/algorithms/equals/equals_sph.cpp b/src/boost/libs/geometry/test/algorithms/equals/equals_sph.cpp new file mode 100644 index 000000000..05e8b8344 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/equals/equals_sph.cpp @@ -0,0 +1,155 @@ +// Boost.Geometry + +// Copyright (c) 2016 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) + +#include "test_equals.hpp" + +#include +#include + +#include + + +template +void test_polygon_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + + test_geometry(case_1[0], case_1[0], + true); + test_geometry(case_1[0], case_1[1], + false); + test_geometry(case_1[0], case_1[1], + false); + + test_geometry(case_1[0], case_1[1], + false); + test_geometry(case_2[0], case_2[1], + false); + test_geometry(case_3_sph[0], case_3_sph[1], + false); + test_geometry(case_3_2_sph[0], case_3_2_sph[1], + true); + test_geometry(case_4[0], case_4[1], + false); + test_geometry(case_5[0], case_5[1], + false); + test_geometry(case_6_sph[0], case_6_sph[1], + false); + + test_geometry(case_7[0], case_7[1], + false); + test_geometry(case_8_sph[0], case_8_sph[1], + false); + test_geometry(case_9_sph[0], case_9_sph[1], + false); + test_geometry(case_10_sph[0], case_10_sph[1], + false); + test_geometry(case_11_sph[0], case_11_sph[1], + false); + test_geometry(case_12[0], case_12[1], + false); + + test_geometry(case_13_sph[0], case_13_sph[1], + false); + test_geometry(case_14_sph[0], case_14_sph[1], + false); + test_geometry(case_15_sph[0], case_15_sph[1], + false); + test_geometry(case_16_sph[0], case_16_sph[1], + false); + test_geometry(case_17_sph[0], case_17_sph[1], + false); + test_geometry(case_18_sph[0], case_18_sph[1], + false); +} + +template +void test_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_1[0], case_multi_2[0], + false); + test_geometry(case_2[0], case_multi_2[0], + false); +} + +template +void test_multi_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_multi_2[0], case_multi_2[1], + false); +} + +template +void test_linestring_linestring() +{ + typedef bg::model::linestring

ls; + + test_geometry("LINESTRING(0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", true); + + test_geometry("LINESTRING(1 0,2 2,2 3)", "LINESTRING(0 0, 2 2, 3 2)", false); +} + +template +void test_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("LINESTRING(0 0,10 0)", + "MULTILINESTRING((1 0,2 0),(1 1,2 1))", + false); + + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,0 5,0 0),(0 0,5 0,5 5))", + true); +} + +template +void test_multi_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0))", + false); +} + + +template +void test_all() +{ + test_polygon_polygon

(); + test_polygon_multi_polygon

(); + test_multi_polygon_multi_polygon

(); + + test_linestring_linestring

(); + test_linestring_multi_linestring

(); + test_multi_linestring_multi_linestring

(); +} + + +int test_main( int , char* [] ) +{ + test_all > >(); + +#if defined(HAVE_TTMATH) + test_cs > >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/equals/test_equals.hpp b/src/boost/libs/geometry/test/algorithms/equals/test_equals.hpp new file mode 100644 index 000000000..5eced7f90 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/equals/test_equals.hpp @@ -0,0 +1,115 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2014-2017 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2016-2017. +// Modifications copyright (c) 2016-2017 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) + +#ifndef BOOST_GEOMETRY_TEST_EQUALS_HPP +#define BOOST_GEOMETRY_TEST_EQUALS_HPP + + +#include + +#include +#include +#include +#include +#include +#include + + +struct no_strategy {}; + +template +bool call_equals(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) +{ + return bg::equals(geometry1, geometry2, strategy); +} + +template +bool call_equals(Geometry1 const& geometry1, + Geometry2 const& geometry2, + no_strategy) +{ + return bg::equals(geometry1, geometry2); +} + +template +void check_geometry(Geometry1 const& geometry1, + Geometry2 const& geometry2, + std::string const& caseid, + std::string const& wkt1, + std::string const& wkt2, + bool expected, + Strategy const& strategy) +{ + bool detected = call_equals(geometry1, geometry2, strategy); + + BOOST_CHECK_MESSAGE(detected == expected, + "case: " << caseid + << " equals: " << wkt1 + << " to " << wkt2 + << " -> Expected: " << expected + << " detected: " << detected); + + detected = call_equals(geometry2, geometry1, strategy); + + BOOST_CHECK_MESSAGE(detected == expected, + "case: " << caseid + << " equals: " << wkt2 + << " to " << wkt1 + << " -> Expected: " << expected + << " detected: " << detected); +} + + +template +void test_geometry(std::string const& caseid, + std::string const& wkt1, + std::string const& wkt2, + bool expected, + bool correct_geometries = false) +{ + Geometry1 geometry1; + Geometry2 geometry2; + + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); + + if (correct_geometries) + { + bg::correct(geometry1); + bg::correct(geometry2); + } + + typedef typename bg::strategy::relate::services::default_strategy + < + Geometry1, Geometry2 + >::type strategy_type; + + check_geometry(geometry1, geometry2, caseid, wkt1, wkt2, expected, no_strategy()); + check_geometry(geometry1, geometry2, caseid, wkt1, wkt2, expected, strategy_type()); + check_geometry(boost::variant(geometry1), geometry2, caseid, wkt1, wkt2, expected, no_strategy()); + check_geometry(geometry1, boost::variant(geometry2), caseid, wkt1, wkt2, expected, no_strategy()); + check_geometry(boost::variant(geometry1), boost::variant(geometry2), caseid, wkt1, wkt2, expected, no_strategy()); +} + +template +void test_geometry(std::string const& wkt1, + std::string const& wkt2, + bool expected) +{ + test_geometry("", wkt1, wkt2, expected); +} + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/for_each.cpp b/src/boost/libs/geometry/test/algorithms/for_each.cpp new file mode 100644 index 000000000..5e8be1227 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/for_each.cpp @@ -0,0 +1,130 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#include + +#include + + + +template +void test_all() +{ + test_geometry

+ ( + "POINT(1 1)" + + // per point + , 1 + , "POINT(101 1)" + , "POINT(101 100)" + // per segment + , "" + , 0 + , "POINT(1 1)" + ); + test_geometry > + ( + "LINESTRING(1 1,2 2)" + + , 3 + , "LINESTRING(101 1,102 2)" + , "LINESTRING(101 100,102 200)" + + , "((1, 1), (2, 2))" + , std::sqrt(2.0) + , "LINESTRING(10 1,2 2)" + ); + test_geometry > + ( + "LINESTRING EMPTY" + + , 0 + , "LINESTRING()" + , "LINESTRING()" + + , "" + , 0 + , "LINESTRING()" + ); + test_geometry > + ( + "POLYGON((1 1,1 4,4 4,4 1,1 1))" + + , 11 + , "POLYGON((101 1,101 4,104 4,104 1,101 1))" + , "POLYGON((101 100,101 400,104 400,104 100,101 100))" + + , "((1, 1), (1, 4)) ((1, 4), (4, 4)) ((4, 4), (4, 1)) ((4, 1), (1, 1))" + , 4 * 3.0 + , "POLYGON((10 1,10 4,4 4,4 1,1 1))" + ); + test_geometry > + ( + "POLYGON EMPTY" + + , 0 + , "POLYGON(())" + , "POLYGON(())" + + , "" + , 0 + , "POLYGON(())" + ); + test_geometry > // open ring + ( + "POLYGON((1 1,1 4,4 4,4 1))" + + , 10 + , "POLYGON((101 1,101 4,104 4,104 1))" + , "POLYGON((101 100,101 400,104 400,104 100))" + + , "((1, 1), (1, 4)) ((1, 4), (4, 4)) ((4, 4), (4, 1)) ((4, 1), (1, 1))" + , 4 * 3.0 + , "POLYGON((10 1,10 4,4 4,4 1))" + ); + test_geometry > + ( + "POLYGON((1 1,1 4,4 4,4 1,1 1),(2 2,3 2,3 3,2 3,2 2))" + + , 23 + , "POLYGON((101 1,101 4,104 4,104 1,101 1),(102 2,103 2,103 3,102 3,102 2))" + , "POLYGON((101 100,101 400,104 400,104 100,101 100),(102 200,103 200,103 300,102 300,102 200))" + + , "((1, 1), (1, 4)) ((1, 4), (4, 4)) ((4, 4), (4, 1)) ((4, 1), (1, 1)) " + "((2, 2), (3, 2)) ((3, 2), (3, 3)) ((3, 3), (2, 3)) ((2, 3), (2, 2))" + , 4 * 3.0 + 4 * 1.0 + , "POLYGON((10 1,10 4,4 4,4 1,1 1,10 1),(2 2,3 2,3 3,2 3,2 2))" + ); + test_geometry > // open polygon + ( + "POLYGON((1 1,1 4,4 4,4 1),(2 2,3 2,3 3,2 3))" + + , 20 + , "POLYGON((101 1,101 4,104 4,104 1,101 1),(102 2,103 2,103 3,102 3,102 2))" + , "POLYGON((101 100,101 400,104 400,104 100,101 100),(102 200,103 200,103 300,102 300,102 200))" + + , "((1, 1), (1, 4)) ((1, 4), (4, 4)) ((4, 4), (4, 1)) ((4, 1), (1, 1)) " + "((2, 2), (3, 2)) ((3, 2), (3, 3)) ((3, 3), (2, 3)) ((2, 3), (2, 2))" + , 4 * 3.0 + 4 * 1.0 + , "POLYGON((10 1,10 4,4 4,4 1,10 1),(2 2,3 2,3 3,2 3,2 2))" + ); +} + +int test_main(int, char* []) +{ + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/for_each_multi.cpp b/src/boost/libs/geometry/test/algorithms/for_each_multi.cpp new file mode 100644 index 000000000..e9c02b685 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/for_each_multi.cpp @@ -0,0 +1,97 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + + +template +void test_all() +{ + test_geometry > + ( + "MULTIPOINT((1 1))" + + // per point + , 1 + , "MULTIPOINT((101 1))" + , "MULTIPOINT((101 100))" + // per segment + , "" + , 0 + , "MULTIPOINT((1 1))" + ); + + test_geometry > > + ( + "MULTILINESTRING((1 1,2 2))" + + , 3 + , "MULTILINESTRING((101 1,102 2))" + , "MULTILINESTRING((101 100,102 200))" + + , "((1, 1), (2, 2))" + , std::sqrt(2.0) + , "MULTILINESTRING((10 1,2 2))" + ); + + typedef bg::model::multi_polygon > mp; + test_geometry + ( + "MULTIPOLYGON(((1 1,1 4,4 4,4 1,1 1)))" + + , 11 + , "MULTIPOLYGON(((101 1,101 4,104 4,104 1,101 1)))" + , "MULTIPOLYGON(((101 100,101 400,104 400,104 100,101 100)))" + + , "((1, 1), (1, 4)) ((1, 4), (4, 4)) ((4, 4), (4, 1)) ((4, 1), (1, 1))" + , 4 * 3.0 + , "MULTIPOLYGON(((10 1,10 4,4 4,4 1,1 1,10 1)))" + ); + + // open multipolygon + typedef bg::model::multi_polygon > omp; + test_geometry + ( + "MULTIPOLYGON(((1 1,1 4,4 4,4 1)))" + + , 10 + , "MULTIPOLYGON(((101 1,101 4,104 4,104 1,101 1)))" + , "MULTIPOLYGON(((101 100,101 400,104 400,104 100,101 100)))" + + , "((1, 1), (1, 4)) ((1, 4), (4, 4)) ((4, 4), (4, 1)) ((4, 1), (1, 1))" + , 4 * 3.0 + , "MULTIPOLYGON(((10 1,10 4,4 4,4 1,10 1)))" + ); +} + +int test_main( int , char* [] ) +{ + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/intersects/Jamfile b/src/boost/libs/geometry/test/algorithms/intersects/Jamfile new file mode 100644 index 000000000..cf8800bb7 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/intersects/Jamfile @@ -0,0 +1,26 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2016. +# Modifications copyright (c) 2014-2016, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-intersects + : + [ run intersects.cpp : : : : algorithms_intersects ] + [ run intersects_box_geometry.cpp : : : : algorithms_intersects_box_geometry ] + [ run intersects_multi.cpp : : : : algorithms_intersects_multi ] + [ run intersects_self.cpp : : : : algorithms_intersects_self ] + [ run intersects_sph_geo.cpp : : : : algorithms_intersects_sph_geo ] + [ run intersects_sph.cpp : : : : algorithms_intersects_sph ] + ; + diff --git a/src/boost/libs/geometry/test/algorithms/intersects/intersects.cpp b/src/boost/libs/geometry/test/algorithms/intersects/intersects.cpp new file mode 100644 index 000000000..a24872493 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/intersects/intersects.cpp @@ -0,0 +1,227 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2013, 2015, 2016. +// Modifications copyright (c) 2013-2016, 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) + +#include "test_intersects.hpp" + + +#include +#include + +#include + +template +void test_intersects_polygon_polygon() +{ + typedef bg::model::polygon poly_ccw_o1; + typedef bg::model::polygon poly_ccw_o2; + test_geometry("POLYGON((1 1, 3 3, 2 5))", "POLYGON((0 0, 9 0, 9 9, 0 9),(5 5,5 8,8 8,8 5))", true); + test_geometry("POLYGON((6 6, 7 6, 7 7, 6 7))", "POLYGON((0 0, 9 0, 9 9, 0 9),(5 5,5 8,8 8,8 5))", false); + test_geometry("POLYGON((7 7, 9 7, 9 9, 7 9))", "POLYGON((0 0, 9 0, 9 9, 0 9),(5 5,5 8,8 8,8 5))", true); +} + +template +void test_intersects_linestring_segment() +{ + typedef bg::model::linestring ls; + typedef bg::model::segment seg; + + test_geometry("LINESTRING(1 1, 3 3, 2 5)", "SEGMENT(2 0, 2 6)", true); + test_geometry("LINESTRING(1 1, 3 3)", "SEGMENT(1 0, 1 1)", true); + test_geometry("LINESTRING(1 1, 3 3)", "SEGMENT(2 0, 2 2)", true); + test_geometry("LINESTRING(1 1, 3 3)", "SEGMENT(3 0, 4 1)", false); +} + +template +void test_intersects_linestring_linestring() +{ + typedef bg::model::linestring ls1; + typedef bg::model::linestring ls2; + + test_geometry("LINESTRING(0 0,2 0,3 0)", "LINESTRING(0 0,1 1,2 2)", true); + test_geometry("LINESTRING(0 0,2 0,3 0)", "LINESTRING(2 2,1 1,0 0)", true); + test_geometry("LINESTRING(3 0,2 0,0 0)", "LINESTRING(0 0,1 1,2 2)", true); + test_geometry("LINESTRING(3 0,2 0,0 0)", "LINESTRING(2 2,1 1,0 0)", true); + + test_geometry("LINESTRING(0 0,2 0,3 0)", "LINESTRING(1 0,4 0,5 0)", true); + test_geometry("LINESTRING(1 0,2 0)", "LINESTRING(1 0,0 0)", true); +} + +template +void test_intersects_linestring_polygon() +{ + typedef bg::model::linestring ls; + typedef bg::model::multi_linestring mls; + typedef bg::model::polygon poly_cw_c; + typedef bg::model::polygon poly_ccw_c; + typedef bg::model::polygon poly_ccw_o; + typedef bg::model::multi_polygon mpoly_ccw_c; + + test_geometry("LINESTRING(1 1,2 2)", "POLYGON((0 0,10 0,10 10,0 10,0 0))", true); + test_geometry("LINESTRING(1 0,2 2)", "POLYGON((0 0,10 0,10 10,0 10,0 0))", true); + test_geometry("LINESTRING(11 0,12 12)", "POLYGON((0 0,10 0,10 10,0 10,0 0))", false); + + test_geometry("LINESTRING(1 1, 3 3, 2 5)", "POLYGON((0 0, 9 0, 9 9, 0 9),(5 5,5 8,8 8,8 5))", true); + test_geometry("LINESTRING(6 6, 7 6, 7 7, 6 7)", "POLYGON((0 0, 9 0, 9 9, 0 9),(5 5,5 8,8 8,8 5))", false); + test_geometry("LINESTRING(7 7, 9 7, 9 9, 7 9)", "POLYGON((0 0, 9 0, 9 9, 0 9),(5 5,5 8,8 8,8 5))", true); + + test_geometry("POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))", "LINESTRING(-2 -2, 12 7)", true); + test_geometry("POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))", "LINESTRING(5 5, 15 4)", true); + test_geometry("POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))", "LINESTRING(7 6, 15 4)", true); + test_geometry("POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))", "LINESTRING(6 2, 12 1)", true); + + // MULTI + test_geometry("LINESTRING(1 1,2 2)", "MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)))", true); + test_geometry("MULTILINESTRING((1 1,2 2))", "MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)))", true); +} + +template +void test_intersects_linestring_ring() +{ + typedef bg::model::linestring ls; + typedef bg::model::multi_linestring mls; + typedef bg::model::ring ring_ccw_c; + + test_geometry("LINESTRING(1 1,2 2)", "POLYGON((0 0,10 0,10 10,0 10,0 0))", true); + test_geometry("LINESTRING(1 0,2 2)", "POLYGON((0 0,10 0,10 10,0 10,0 0))", true); + test_geometry("LINESTRING(11 0,12 12)", "POLYGON((0 0,10 0,10 10,0 10,0 0))", false); + + // MULTI + test_geometry("MULTILINESTRING((1 1,2 2))", "POLYGON((0 0,10 0,10 10,0 10,0 0))", true); +} + +template +void test_intersects_ring_polygon() +{ + typedef bg::model::ring ring_ccw_o; + typedef bg::model::polygon poly_ccw_o; + + test_geometry("POLYGON((1 1, 3 3, 2 5))", "POLYGON((0 0, 9 0, 9 9, 0 9),(5 5,5 8,8 8,8 5))", true); + test_geometry("POLYGON((6 6, 7 6, 7 7, 6 7))", "POLYGON((0 0, 9 0, 9 9, 0 9),(5 5,5 8,8 8,8 5))", false); + test_geometry("POLYGON((7 7, 9 7, 9 9, 7 9))", "POLYGON((0 0, 9 0, 9 9, 0 9),(5 5,5 8,8 8,8 5))", true); + + test_geometry("POLYGON((6 6,7 6,7 7,6 7))", "POLYGON((0 0, 9 0, 9 9, 0 9),(5 5,5 8,8 8,8 5))", false); +} + +template +void test_intersects_point_linestring() +{ + typedef bg::model::linestring ls; + typedef bg::model::multi_linestring mls; + + test_geometry("POINT(0 0)", "LINESTRING(0 0,2 2,4 0)", true); + test_geometry("POINT(1 1)", "LINESTRING(0 0,2 2,4 0)", true); + test_geometry("POINT(1 0)", "LINESTRING(0 0,2 2,4 0)", false); + + // MULTI + test_geometry("POINT(0 0)", "MULTILINESTRING((0 0,2 2,4 0))", true); +} + +template +void test_intersects_point_segment() +{ + typedef bg::model::segment seg; + + test_geometry("POINT(0 0)", "LINESTRING(0 0,2 2)", true); + test_geometry("POINT(1 1)", "LINESTRING(0 0,2 2)", true); + test_geometry("POINT(1 0)", "LINESTRING(0 0,2 2)", false); +} + +template +void test_multi_linestring_polygon() +{ + typedef bg::model::linestring ls; + typedef bg::model::multi_linestring mls; + typedef bg::model::polygon poly; + + test_geometry("MULTILINESTRING((11 11, 20 20),(5 7, 4 1))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2))", + true); + test_geometry("MULTILINESTRING((10 0, 18 12),(2 2,2 1))", + "POLYGON((5 0,0 -5,-5 0,0 5,5 0))", + true); +} + +template +void test_multi_polygon_polygon() +{ + typedef bg::model::polygon poly1; + typedef bg::model::multi_polygon mpoly; + typedef bg::model::polygon poly2; + + test_geometry("MULTIPOLYGON(((11 11,11 20,20 20,20 11,11 11)),((5 5,5 6,6 6,6 5,5 5)))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2))", + true); +} + +template +void test_point_polygon() +{ + typedef bg::model::ring ring; + typedef bg::model::polygon poly; + + test_geometry( + "POINT(0 0)", + "POLYGON((0 0,3 3,3 3,4 1))", + true); + test_geometry( + "POINT(0 0)", + "POLYGON((0 0,3 3,3 3,4 1))", + true); + + test_geometry( + "POLYGON((0 0,3 3,3 3,4 1))", + "POINT(0 0)", + true); + test_geometry( + "POLYGON((0 0,3 3,3 3,4 1))", + "POINT(0 0)", + true); +} + +template +void test_all() +{ + test_intersects_point_segment(); + test_intersects_point_linestring(); + test_intersects_polygon_polygon(); + test_intersects_linestring_polygon(); + test_intersects_linestring_ring(); + test_intersects_linestring_segment(); + test_intersects_linestring_linestring(); + test_intersects_ring_polygon(); + test_multi_linestring_polygon(); + test_multi_polygon_polygon(); + test_point_polygon(); +} + +template +void test_all() +{ + test_all(); +} + +int test_main( int , char* [] ) +{ + test_all >(); + test_all, bg::model::point >(); + +#if ! defined(BOOST_GEOMETRY_RESCALE_TO_ROBUST) + test_all > >(); +#endif + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/intersects/intersects_box_geometry.cpp b/src/boost/libs/geometry/test/algorithms/intersects/intersects_box_geometry.cpp new file mode 100644 index 000000000..692a0f691 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/intersects/intersects_box_geometry.cpp @@ -0,0 +1,172 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2013, 2015, 2016. +// Modifications copyright (c) 2013-2016, Oracle and/or its affiliates. + +// 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) + +#include "test_intersects.hpp" + + +#include +#include + +#include + + +template +void test_all() +{ + typedef bg::model::polygon polygon; + typedef bg::model::ring ring; + + // intersect <=> ! disjoint (in most cases) + // so most tests are done in disjoint test. + // We only test compilation of a few cases. + test_geometry >("POINT(1 1)", "BOX(0 0,2 2)", true); + + test_geometry >( + "POLYGON((1992 3240,1992 1440,3792 1800,3792 3240,1992 3240))", + "BOX(1941 2066, 2055 2166)", true); + + test_geometry >( + "POLYGON((1992 3240,1992 1440,3792 1800,3792 3240,1992 3240))", + "BOX(1941 2066, 2055 2166)", true); + + test_geometry >( + "POLYGON((1941 2066,2055 2066,2055 2166,1941 2166))", + "BOX(1941 2066, 2055 2166)", true); + + test_geometry >( + "POINT(0 0)", + "BOX(0 0,4 4)", + true); +} + +template +void test_all() +{ + test_all(); +} + +// Those tests won't pass for rational<> because numeric_limits<> isn't specialized for this type +template +void test_additional() +{ + test_geometry, bg::model::box

>( + "SEGMENT(0 0,3 3)", + "BOX(1 2,3 5)", + true); + test_geometry, bg::model::box

>( + "SEGMENT(1 1,2 3)", + "BOX(0 0,4 4)", + true); + test_geometry, bg::model::box

>( + "SEGMENT(1 1,1 1)", + "BOX(1 0,3 5)", + true); + test_geometry, bg::model::box

>( + "SEGMENT(0 1,0 1)", + "BOX(1 0,3 5)", + false); + test_geometry, bg::model::box

>( + "SEGMENT(2 1,2 1)", + "BOX(1 0,3 5)", + true); + test_geometry, bg::model::box

>( + "LINESTRING(0 0,1 0,10 10)", + "BOX(1 2,3 5)", + true); + test_geometry, bg::model::box

>( + "LINESTRING(1 2)", + "BOX(0 0,3 5)", + true); + + // http://stackoverflow.com/questions/32457920/boost-rtree-of-box-gives-wrong-intersection-with-segment + // http://lists.boost.org/geometry/2015/09/3476.php + typedef bg::model::point::type, 3, bg::cs::cartesian> point3d_t; + test_geometry, bg::model::box >( + "SEGMENT(2 1 0,2 1 10)", + "BOX(0 0 0,10 0 10)", + false); + test_geometry, bg::model::box >( + "SEGMENT(2 1 0,2 1 10)", + "BOX(0 -5 0,10 0 10)", + false); + // and derived from the cases above + test_geometry, bg::model::box

>( + "SEGMENT(12 0,20 10)", + "BOX(0 0,10 10)", + false); + test_geometry, bg::model::box

>( + "SEGMENT(2 0,8 6)", + "BOX(0 0,10 10)", + true); + test_geometry, bg::model::box

>( + "SEGMENT(2 0,18 8)", + "BOX(0 0,10 10)", + true); + test_geometry, bg::model::box

>( + "SEGMENT(1 0,1 10)", + "BOX(0 0,0 10)", + false); + test_geometry, bg::model::box

>( + "SEGMENT(-1 0,-1 10)", + "BOX(0 0,0 10)", + false); + test_geometry, bg::model::box

>( + "SEGMENT(2 1,2 1)", + "BOX(0 0,10 0)", + false); + test_geometry, bg::model::box

>( + "SEGMENT(2 3,2 3)", + "BOX(0 0,10 0)", + false); + test_geometry, bg::model::box

>( + "SEGMENT(0 0,10 0)", + "BOX(0 0,10 0)", + true); + test_geometry, bg::model::box

>( + "SEGMENT(10 0,10 0)", + "BOX(0 0,10 0)", + true); + test_geometry, bg::model::box

>( + "SEGMENT(1 0,1 0)", + "BOX(0 0,10 0)", + true); + test_geometry, bg::model::box

>( + "SEGMENT(0 0,0 10)", + "BOX(0 0,0 10)", + true); + test_geometry, bg::model::box

>( + "SEGMENT(0 10,0 10)", + "BOX(0 0,0 10)", + true); + test_geometry, bg::model::box

>( + "SEGMENT(0 1,0 1)", + "BOX(0 0,0 10)", + true); +} + + +int test_main( int , char* [] ) +{ + test_all, bg::model::point >(); + test_all >(); + test_additional >(); + +#if ! defined(BOOST_GEOMETRY_RESCALE_TO_ROBUST) + test_all > >(); +#endif + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/intersects/intersects_multi.cpp b/src/boost/libs/geometry/test/algorithms/intersects/intersects_multi.cpp new file mode 100644 index 000000000..d2c70d1f8 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/intersects/intersects_multi.cpp @@ -0,0 +1,63 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2016. +// Modifications copyright (c) 2016, 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) + +#include +#include + + +#include + +#include "test_intersects.hpp" + +#include + +#include +#include + +template +void test_all() +{ + typedef bg::model::polygon polygon1; + typedef bg::model::multi_polygon mp1; + typedef bg::model::polygon polygon2; + typedef bg::model::multi_polygon mp2; + + test_geometry("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + true); + + test_geometry("POINT(0 0)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + true); + +} + +template +void test_all() +{ + test_all(); +} + +int test_main(int, char* []) +{ + //test_all >(); + test_all >(); + test_all, bg::model::point >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} + diff --git a/src/boost/libs/geometry/test/algorithms/intersects/intersects_self.cpp b/src/boost/libs/geometry/test/algorithms/intersects/intersects_self.cpp new file mode 100644 index 000000000..6d6c4172a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/intersects/intersects_self.cpp @@ -0,0 +1,133 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2013, 2015. +// Modifications copyright (c) 2013-2015, Oracle and/or its affiliates. + +// 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) + +#include "test_intersects.hpp" + + +#include +#include + +#include + + +template +void test_all() +{ + typedef bg::model::linestring

linestring; + typedef bg::model::polygon

polygon; + typedef bg::model::ring

ring; + typedef bg::model::ring ring_open; + + // self-intersecting is not tested in disjoint, so that is done here. + + // Just a normal polygon + test_self_intersects("POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))", false); + + // Self intersecting + test_self_intersects("POLYGON((1 2,1 1,2 1,2 2.25,3 2.25,3 0,0 0,0 3,3 3,2.75 2,1 2))", true); + + // Self intersecting in last segment + test_self_intersects("POLYGON((0 2,2 4,2 0,4 2,0 2))", true); + + // Self tangent + test_self_intersects("POLYGON((0 0,0 4,4 4,4 0,2 4,0 0))", true); + + // Self tangent in corner + test_self_intersects("POLYGON((0 0,0 4,4 4,4 0,0 4,2 0,0 0))", true); + + // With spike + test_self_intersects("POLYGON((0 0,0 4,4 4,4 2,6 2,4 2,4 0,0 0))", true); + + // Non intersection, but with duplicate + test_self_intersects("POLYGON((0 0,0 4,4 0,4 0,0 0))", false); + + // With many duplicates + test_self_intersects( + "POLYGON((0 0,0 1,0 1,0 1,0 2,0 2,0 3,0 3,0 3,0 3,0 4,2 4,2 4,4 4,4 0,4 0,3 0,3 0,3 0,3 0,3 0,0 0))", + false); + + // Hole: interior tangent to exterior + test_self_intersects("POLYGON((0 0,0 4,4 4,4 0,0 0),(1 2,2 4,3 2,1 2))", true); + + // Hole: interior intersecting exterior + test_self_intersects("POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 3,5 4,1 1))", true); + + // Hole: two intersecting holes + test_self_intersects( + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 3,3 3,3 1,1 1),(2 2,2 3.5,3.5 3.5,3.5 2,2 2))", true); + + // Mail Akira T on [Boost-users] at 27-7-2011 3:17 + test_self_intersects( + "LINESTRING(0 0,0 4,4 4,2 2,2 5)", true); + + test_self_intersects( + "LINESTRING(0 4,4 4,2 2,2 5)", true); + + // Test self-intersections at last segment in close/open rings: + test_self_intersects( + "POLYGON((0 0,3 3,4 1,0 0))", false); + + test_self_intersects( + "POLYGON((0 0,3 3,4 1))", false); + + test_self_intersects( + "POLYGON((0 0,3 3,4 1,0 1,0 0))", true); + + test_self_intersects( + "POLYGON((0 0,3 3,4 1,0 1))", true); + + // Duplicates in first or last + test_self_intersects( + "POLYGON((0 0,3 3,4 1,0 1,0 1,0 0))", true); + test_self_intersects( + "POLYGON((0 0,3 3,4 1,0 1,0 0,0 0))", true); + test_self_intersects( + "POLYGON((0 0,3 3,4 1,0 1,0 1))", true); + test_self_intersects( + "POLYGON((0 0,0 0,3 3,4 1,0 1,0 1,0 0))", true); + test_self_intersects( + "POLYGON((0 0,0 0,3 3,4 1,0 1,0 1))", true); + test_self_intersects( + "POLYGON((0 0,3 3,3 3,4 1,0 1,0 1,0 0))", true); + test_self_intersects( + "POLYGON((0 0,3 3,3 3,4 1,0 1,0 1))", true); + + test_self_intersects( + "POLYGON((0 0,3 3,4 1,0 0,0 0))", false); + test_self_intersects( + "POLYGON((0 0,3 3,4 1,4 1,0 0))", false); + test_self_intersects( + "POLYGON((0 0,3 3,4 1,4 1))", false); + test_self_intersects( + "POLYGON((0 0,0 0,3 3,4 1,0 0))", false); + test_self_intersects( + "POLYGON((0 0,0 0,3 3,4 1))", false); + test_self_intersects( + "POLYGON((0 0,3 3,3 3,4 1,0 0))", false); + test_self_intersects( + "POLYGON((0 0,3 3,3 3,4 1))", false); +} + +int test_main( int , char* [] ) +{ + test_all >(); + +#if ! defined(BOOST_GEOMETRY_RESCALE_TO_ROBUST) + test_all > >(); +#endif + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/intersects/intersects_sph.cpp b/src/boost/libs/geometry/test/algorithms/intersects/intersects_sph.cpp new file mode 100644 index 000000000..0981c0af4 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/intersects/intersects_sph.cpp @@ -0,0 +1,269 @@ +// Boost.Geometry + +// Copyright (c) 2016 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) + +#include "test_intersects.hpp" + +#include +#include + +#include + + +template +void test_polygon_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + + test_geometry(case_1[0], case_1[1], + true); + test_geometry(case_1[0], case_1[1], + true); + + test_geometry(case_1[0], case_1[1], + true); + test_geometry(case_2[0], case_2[1], + true); + test_geometry(case_3_sph[0], case_3_sph[1], + true); + test_geometry(case_3_2_sph[0], case_3_2_sph[1], + true); + test_geometry(case_4[0], case_4[1], + true); + test_geometry(case_5[0], case_5[1], + true); + test_geometry(case_6_sph[0], case_6_sph[1], + true); + + test_geometry(case_7[0], case_7[1], + true); + test_geometry(case_8_sph[0], case_8_sph[1], + true); + test_geometry(case_9_sph[0], case_9_sph[1], + true); + test_geometry(case_10_sph[0], case_10_sph[1], + true); + test_geometry(case_11_sph[0], case_11_sph[1], + true); + test_geometry(case_12[0], case_12[1], + true); + + test_geometry(case_13_sph[0], case_13_sph[1], + true); + test_geometry(case_14_sph[0], case_14_sph[1], + true); + test_geometry(case_15_sph[0], case_15_sph[1], + true); + test_geometry(case_16_sph[0], case_16_sph[1], + true); + test_geometry(case_17_sph[0], case_17_sph[1], + true); + test_geometry(case_17_sph[1], case_17_sph[0], + true); + test_geometry(case_18_sph[0], case_18_sph[1], + true); + test_geometry(case_18_sph[1], case_18_sph[0], + true); +} + +template +void test_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_1[0], case_multi_2[0], + true); + test_geometry(case_2[0], case_multi_2[0], + true); +} + +template +void test_multi_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_multi_2[0], case_multi_2[1], + true); +} + +template +void test_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::polygon

ring; + + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(0 0,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_geometry("LINESTRING(5 0,5 5,10 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_geometry("LINESTRING(5 1,5 5,9 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_geometry("LINESTRING(11 1,11 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + true); + + test_geometry("LINESTRING(9 1,10 5,9 9,1 9,1 1,9 1)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + true); + + test_geometry("LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + true); +} + +template +void test_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("LINESTRING(10 1,10 5,10 9)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)))", + true); +} + +template +void test_multi_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((11 11, 20 20),(5 7, 4 1))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2))", + true); + + test_geometry("MULTILINESTRING((6 6,15 15),(0 0, 7 7))", + "POLYGON((5 5,5 15,15 15,15 5,5 5))", + true); + + test_geometry("MULTILINESTRING((3 10.031432746397092, 1 5, 1 10.013467818052765, 3 4, 7 8, 6 10.035925377760330, 10 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + true); +} + +template +void test_multi_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_linestring mls; + typedef bg::model::multi_polygon mpoly; + + test_geometry("MULTILINESTRING((0 0,10 0,10 10,0 10,0 0),(2 2,5 5,2 8,2 2))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(2 2,5 5,2 8,2 2)))", + true); + + test_geometry("MULTILINESTRING((0 0,10 0,10 10),(10 10,0 10,0 0),(20 20,50 50,20 80,20 20))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + true); + + test_geometry("MULTILINESTRING((5 -2,4 -2,5 0),(5 -2,6 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + true); +} + +template +void test_linestring_linestring() +{ + typedef bg::model::linestring

ls; + + test_geometry("LINESTRING(0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", true); + + test_geometry("LINESTRING(1 0,2 2,2 3)", "LINESTRING(0 0, 2 2, 3 2)", true); +} + +template +void test_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("LINESTRING(0 0,10 0)", + "MULTILINESTRING((1 0,2 0),(1 1,2 1))", + true); + + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,0 5,0 0),(0 0,5 0,5 5))", + true); +} + +template +void test_multi_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0))", + true); +} + +template +void test_point_polygon() +{ + typedef bg::model::polygon

poly; + + // https://svn.boost.org/trac/boost/ticket/9162 + test_geometry("POINT(0 90)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(-120 21)", + "POLYGON((30 0,30 30,90 30, 90 0, 30 0))", + false); + // extended + test_geometry("POINT(0 -90)", + "POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))", + true); + test_geometry("POINT(0 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(-180 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); +} + + +template +void test_all() +{ + test_polygon_polygon

(); + test_polygon_multi_polygon

(); + test_multi_polygon_multi_polygon

(); + + test_linestring_polygon

(); + test_linestring_multi_polygon

(); + test_multi_linestring_polygon

(); + test_multi_linestring_multi_polygon

(); + + test_linestring_linestring

(); + test_linestring_multi_linestring

(); + test_multi_linestring_multi_linestring

(); + + test_point_polygon

(); +} + + +int test_main( int , char* [] ) +{ + test_all > >(); + +#if defined(HAVE_TTMATH) + test_cs > >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/intersects/intersects_sph_geo.cpp b/src/boost/libs/geometry/test/algorithms/intersects/intersects_sph_geo.cpp new file mode 100644 index 000000000..c4cd283da --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/intersects/intersects_sph_geo.cpp @@ -0,0 +1,86 @@ +// Boost.Geometry + +// Copyright (c) 2016 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) + +#include "test_intersects.hpp" + + +#include + + +template +void test_point_box() +{ + typedef bg::model::box

box_t; + + test_geometry("POINT(0 0)", "BOX(0 0, 1 1)", true); + test_geometry("POINT(1 1)", "BOX(0 0, 2 2)", true); + + test_geometry("POINT(180 1)", "BOX(170 0, 190 2)", true); + test_geometry("POINT(-180 1)", "BOX(170 0, 190 2)", true); + test_geometry("POINT(180 1)", "BOX(170 0, 180 2)", true); + test_geometry("POINT(-180 1)", "BOX(170 0, 180 2)", true); + test_geometry("POINT(179 1)", "BOX(170 0, 190 2)", true); + test_geometry("POINT(-179 1)", "BOX(170 0, 190 2)", true); + test_geometry("POINT(179 1)", "BOX(170 0, 180 2)", true); + test_geometry("POINT(-179 1)", "BOX(170 0, 180 2)", false); + test_geometry("POINT(169 1)", "BOX(170 0, 180 2)", false); +} + +template +void test_box_box() +{ + typedef bg::model::box

box_t; + + test_geometry("BOX(0 0, 1 1)", "BOX(0 0, 1 1)", true); + + test_geometry("BOX(-170 0,-160 1)", "BOX(-180 0, 180 1)", true); + test_geometry("BOX(-170 0,-160 1)", "BOX(170 0, 200 1)", true); + test_geometry("BOX(-170 0,-150 1)", "BOX(170 0, 200 1)", true); + test_geometry("BOX(201 0,202 1)", "BOX(170 0, 200 1)", false); // invalid g1? + test_geometry("BOX(-159 0,-158 1)", "BOX(170 0, 200 1)", false); + test_geometry("BOX(160 0,169 1)", "BOX(170 0, 200 1)", false); + test_geometry("BOX(-159 0,169 1)", "BOX(170 0, 200 1)", false); + test_geometry("BOX(0 0,1 1)", "BOX(170 0, 370 1)", true); + test_geometry("BOX(0 0,10 1)", "BOX(170 0, 370 1)", true); + test_geometry("BOX(-180 0,10 1)", "BOX(170 0, 370 1)", true); + test_geometry("BOX(-180 0,20 1)", "BOX(170 0, 370 1)", true); + test_geometry("BOX(10 0,20 1)", "BOX(170 0, 370 1)", true); + test_geometry("BOX(160 0,180 1)", "BOX(170 0, 370 1)", true); + test_geometry("BOX(160 0,165 1)", "BOX(170 0, 370 1)", false); + test_geometry("BOX(15 0,20 1)", "BOX(170 0, 370 1)", false); + test_geometry("BOX(375 0,380 1)", "BOX(170 0, 370 1)", false); // invalid g1? + + test_geometry("BOX(-180 0,-170 1)", "BOX(180 0, 190 1)", true); // invalid? + test_geometry("BOX(-180 0,-170 1)", "BOX(180 0, 191 1)", true); // invalid? + test_geometry("BOX(-180 0,-170 1)", "BOX(179 0, 190 1)", true); + test_geometry("BOX(-180 0,-170 1)", "BOX(181 0, 190 1)", true); // invalid? + test_geometry("BOX(-180 0,-170 1)", "BOX(180 0, 189 1)", true); // invalid? +} + + +template +void test_cs() +{ + test_point_box

(); + test_box_box

(); +} + + +int test_main( int , char* [] ) +{ + test_cs > >(); + test_cs > >(); + +#if defined(HAVE_TTMATH) + test_cs > >(); + test_cs > >();; +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/intersects/test_intersects.hpp b/src/boost/libs/geometry/test/algorithms/intersects/test_intersects.hpp new file mode 100644 index 000000000..c9ffe5579 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/intersects/test_intersects.hpp @@ -0,0 +1,115 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. + +// 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 + +// 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) + +#ifndef BOOST_GEOMETRY_TEST_INTERSECTS_HPP +#define BOOST_GEOMETRY_TEST_INTERSECTS_HPP + + +#include + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +struct no_strategy {}; + +template +bool call_intersects(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) +{ + return bg::intersects(geometry1, geometry2, strategy); +} + +template +bool call_intersects(Geometry1 const& geometry1, + Geometry2 const& geometry2, + no_strategy) +{ + return bg::intersects(geometry1, geometry2); +} + +template +void check_intersects(std::string const& wkt1, + std::string const& wkt2, + G1 const& g1, + G2 const& g2, + bool expected, + Strategy const& strategy) +{ + bool detected = call_intersects(g1, g2, strategy); + + BOOST_CHECK_MESSAGE(detected == expected, + "intersects: " << wkt1 + << " with " << wkt2 + << " -> Expected: " << expected + << " detected: " << detected); +} + +template +void test_geometry(std::string const& wkt1, + std::string const& wkt2, bool expected) +{ + Geometry1 geometry1; + Geometry2 geometry2; + + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); + + check_intersects(wkt1, wkt2, geometry1, geometry2, expected, no_strategy()); + check_intersects(wkt2, wkt1, geometry2, geometry1, expected, no_strategy()); + + typedef typename bg::strategy::disjoint::services::default_strategy + < + Geometry1, Geometry2 + >::type strategy12_type; + typedef typename bg::strategy::disjoint::services::default_strategy + < + Geometry2, Geometry1 + >::type strategy21_type; + + check_intersects(wkt1, wkt2, geometry1, geometry2, expected, strategy12_type()); + check_intersects(wkt2, wkt1, geometry2, geometry1, expected, strategy21_type()); +} + + +template +void test_self_intersects(std::string const& wkt, bool expected) +{ + Geometry geometry; + + bg::read_wkt(wkt, geometry); + + bool detected = bg::intersects(geometry); + + BOOST_CHECK_MESSAGE(detected == expected, + "intersects: " << wkt + << " -> Expected: " << expected + << " detected: " << detected); +} + + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/is_convex.cpp b/src/boost/libs/geometry/test/algorithms/is_convex.cpp new file mode 100644 index 000000000..7fcc8a913 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/is_convex.cpp @@ -0,0 +1,61 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include + + +template +void test_one(std::string const& case_id, std::string const& wkt, bool expected) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + bg::correct(geometry); + + bool detected = bg::is_convex(geometry); + BOOST_CHECK_MESSAGE(detected == expected, + "Not as expected, case: " << case_id + << " / expected: " << expected + << " / detected: " << detected); +} + + +template +void test_all() +{ + // rectangular, with concavity + std::string const concave1 = "polygon((1 1, 1 4, 3 4, 3 3, 4 3, 4 4, 5 4, 5 1, 1 1))"; + std::string const triangle = "polygon((1 1, 1 4, 5 1, 1 1))"; + + test_one >("triangle", triangle, true); + test_one >("concave1", concave1, false); + test_one >("triangle", triangle, true); + test_one >("concave1", concave1, false); + + test_one >("box", "box(0 0,2 2)", true); +} + + +int test_main(int, char* []) +{ + test_all >(); + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/is_empty.cpp b/src/boost/libs/geometry/test/algorithms/is_empty.cpp new file mode 100644 index 000000000..089f09067 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/is_empty.cpp @@ -0,0 +1,335 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2015, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_is_empty +#endif + +#include + +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace bg = boost::geometry; + + +typedef bg::model::point point; +typedef bg::model::linestring linestring; +typedef bg::model::segment segment; +typedef bg::model::box box; +typedef bg::model::ring ring_cw_closed; +typedef bg::model::ring ring_cw_open; +typedef bg::model::ring ring_ccw_closed; +typedef bg::model::ring ring_ccw_open; +typedef bg::model::polygon polygon_cw_closed; +typedef bg::model::polygon polygon_cw_open; +typedef bg::model::polygon polygon_ccw_closed; +typedef bg::model::polygon polygon_ccw_open; +typedef bg::model::multi_point multi_point; +typedef bg::model::multi_linestring multi_linestring; +typedef bg::model::multi_polygon multi_polygon_cw_closed; +typedef bg::model::multi_polygon multi_polygon_cw_open; +typedef bg::model::multi_polygon multi_polygon_ccw_closed; +typedef bg::model::multi_polygon multi_polygon_ccw_open; + +template +struct box_dD +{ + typedef boost::geometry::model::box + < + boost::geometry::model::point + > type; +}; + +template ::type> +struct test_is_empty +{ + static inline void apply(Geometry const& geometry, bool expected) + { + bool detected = bg::is_empty(geometry); + BOOST_CHECK_MESSAGE( detected == expected, + std::boolalpha + << "Expected: " << expected + << " detected: " << detected + << " wkt: " << bg::wkt(geometry) + << std::noboolalpha ); + BOOST_CHECK_EQUAL(detected, bg::num_points(geometry) == 0); + } + + static inline void apply(std::string const& wkt, bool expected) + { + Geometry geometry; + bg::read_wkt(wkt, geometry); + apply(geometry, expected); + } +}; + +template +struct test_is_empty +{ + static inline void apply(Box const& box, bool expected) + { + bool detected = bg::is_empty(box); + BOOST_CHECK_MESSAGE( detected == expected, + std::boolalpha + << "Expected: " << expected + << " detected: " << detected + << " dsv: " << bg::dsv(box) + << std::noboolalpha ); + BOOST_CHECK_EQUAL(detected, bg::num_points(box) == 0); + } + + static inline void apply(std::string const& wkt, bool expected) + { + Box box; + bg::read_wkt(wkt, box); + apply(box, expected); + } +}; + +BOOST_AUTO_TEST_CASE( test_point ) +{ + test_is_empty::apply("POINT(0 0)", false); + test_is_empty::apply("POINT(1 1)", false); +} + +BOOST_AUTO_TEST_CASE( test_segment ) +{ + test_is_empty::apply("SEGMENT(0 0,0 0)", false); + test_is_empty::apply("SEGMENT(0 0,1 1)", false); +} + +BOOST_AUTO_TEST_CASE( test_box ) +{ + test_is_empty::apply("BOX(0 0,1 1)", false); + + // test higher-dimensional boxes + test_is_empty::type>::apply("BOX(0 0 0,1 1 1)", false); + test_is_empty::type>::apply("BOX(0 0 0 0,1 1 1 1)", false); + test_is_empty::type>::apply("BOX(0 0 0 0 0,1 1 1 1 1)", false); +} + +BOOST_AUTO_TEST_CASE( test_linestring ) +{ + typedef test_is_empty tester; + + tester::apply("LINESTRING()", true); + tester::apply("LINESTRING(0 0)", false); + tester::apply("LINESTRING(0 0,0 0)", false); + tester::apply("LINESTRING(0 0,0 0,1 1)", false); + tester::apply("LINESTRING(0 0,0 0,0 0,1 1)", false); +} + +BOOST_AUTO_TEST_CASE( test_multipoint ) +{ + typedef test_is_empty tester; + + tester::apply("MULTIPOINT()", true); + tester::apply("MULTIPOINT(0 0)", false); + tester::apply("MULTIPOINT(0 0,0 0)", false); + tester::apply("MULTIPOINT(0 0,0 0,1 1)", false); +} + +BOOST_AUTO_TEST_CASE( test_multilinestring ) +{ + typedef test_is_empty tester; + + tester::apply("MULTILINESTRING()", true); + tester::apply("MULTILINESTRING(())", true); + tester::apply("MULTILINESTRING((),())", true); + tester::apply("MULTILINESTRING((),(0 0))", false); + tester::apply("MULTILINESTRING((),(0 0),())", false); + tester::apply("MULTILINESTRING((0 0))", false); + tester::apply("MULTILINESTRING((0 0,1 0))", false); + tester::apply("MULTILINESTRING((),(),(0 0,1 0))", false); + tester::apply("MULTILINESTRING((0 0,1 0,0 1),(0 0,1 0,0 1,0 0))", false); +} + +template +void test_open_ring() +{ + typedef test_is_empty tester; + + tester::apply("POLYGON(())", true); + tester::apply("POLYGON((0 0))", false); + tester::apply("POLYGON((0 0,1 0))", false); + tester::apply("POLYGON((0 0,1 0,0 1))", false); + tester::apply("POLYGON((0 0,0 0,1 0,0 1))", false); +} + +template +void test_closed_ring() +{ + typedef test_is_empty tester; + + tester::apply("POLYGON(())", true); + tester::apply("POLYGON((0 0))", false); + tester::apply("POLYGON((0 0,0 0))", false); + tester::apply("POLYGON((0 0,1 0,0 0))", false); + tester::apply("POLYGON((0 0,1 0,0 1,0 0))", false); + tester::apply("POLYGON((0 0,1 0,1 0,0 1,0 0))", false); +} + +BOOST_AUTO_TEST_CASE( test_ring ) +{ + test_open_ring(); + test_open_ring(); + test_closed_ring(); + test_closed_ring(); +} + +template +void test_open_polygon() +{ + typedef test_is_empty tester; + + tester::apply("POLYGON(())", true); + tester::apply("POLYGON((),())", true); + tester::apply("POLYGON((),(),())", true); + tester::apply("POLYGON((),(0 0,0 1,1 0))", false); + tester::apply("POLYGON((),(0 0,0 1,1 0),())", false); + tester::apply("POLYGON((),(),(0 0,0 1,1 0))", false); + tester::apply("POLYGON((0 0))", false); + tester::apply("POLYGON((0 0,10 0),(0 0))", false); + tester::apply("POLYGON((0 0,10 0),(1 1,2 1))", false); + tester::apply("POLYGON((0 0,10 0,0 10))", false); + tester::apply("POLYGON((0 0,10 0,0 10),())", false); + tester::apply("POLYGON((0 0,10 0,0 10),(1 1))", false); + tester::apply("POLYGON((0 0,10 0,0 10),(1 1,2 1))", false); + tester::apply("POLYGON((0 0,10 0,0 10),(1 1,2 1,1 2))", false); + tester::apply("POLYGON((0 0,10 0,10 10,0 10),(1 1,2 1,1 2))", false); +} + +template +void test_closed_polygon() +{ + typedef test_is_empty tester; + + tester::apply("POLYGON(())", true); + tester::apply("POLYGON((),())", true); + tester::apply("POLYGON((),(),())", true); + tester::apply("POLYGON((),(0 0,0 1,1 0,0 0))", false); + tester::apply("POLYGON((),(0 0,0 1,1 0,0 0),())", false); + tester::apply("POLYGON((),(),(0 0,0 1,1 0,0 0))", false); + tester::apply("POLYGON((0 0))", false); + tester::apply("POLYGON((0 0,10 0,0 0),(0 0))", false); + tester::apply("POLYGON((0 0,10 0,0 0),(1 1,2 1,1 1))", false); + tester::apply("POLYGON((0 0,10 0,0 10,0 0))", false); + tester::apply("POLYGON((0 0,10 0,0 10,0 0),())", false); + tester::apply("POLYGON((0 0,10 0,0 10,0 0),(1 1))", false); + tester::apply("POLYGON((0 0,10 0,0 10,0 0),(1 1,2 1,1 1))", false); + tester::apply("POLYGON((0 0,10 0,0 10,0 0),(1 1,2 1,1 2,1 1))", false); + tester::apply("POLYGON((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,1 2,1 1))", false); +} + +BOOST_AUTO_TEST_CASE( test_polygon ) +{ + test_open_polygon(); + test_open_polygon(); + test_closed_polygon(); + test_closed_polygon(); +} + +template +void test_open_multipolygon() +{ + typedef test_is_empty tester; + + tester::apply("MULTIPOLYGON()", true); + tester::apply("MULTIPOLYGON((()))", true); + tester::apply("MULTIPOLYGON(((),()))", true); + tester::apply("MULTIPOLYGON(((),()),((),(),()))", true); + tester::apply("MULTIPOLYGON(((),()),((),(0 0,10 0,10 10,0 10),()))", false); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10),(1 1,2 1,1 2)))", false); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10),(1 1,2 1,2 2,1 2),(5 5,6 5,6 6,5 6)))", false); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10),(1 1,2 1,1 2)),((100 100,110 100,110 110),(101 101,102 101,102 102)))", false); +} + +template +void test_closed_multipolygon() +{ + typedef test_is_empty tester; + + tester::apply("MULTIPOLYGON()", true); + tester::apply("MULTIPOLYGON((()))", true); + tester::apply("MULTIPOLYGON(((),()))", true); + tester::apply("MULTIPOLYGON(((),()),((),(),()))", true); + tester::apply("MULTIPOLYGON(((),()),((),(0 0,10 0,10 10,0 10,0 0),()))", false); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,1 2,1 1)))", false); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,2 2,1 2,1 1),(5 5,6 5,6 6,5 6,5 5)))", false); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,1 2,1 1)),((100 100,110 100,110 110,100 100),(101 101,102 101,102 102,101 101)))", false); +} + +BOOST_AUTO_TEST_CASE( test_multipolygon ) +{ + test_open_multipolygon(); + test_open_multipolygon(); + test_closed_multipolygon(); + test_closed_multipolygon(); +} + +BOOST_AUTO_TEST_CASE( test_variant ) +{ + typedef boost::variant + < + linestring, polygon_cw_open, polygon_cw_closed, multi_point + > variant_geometry_type; + + typedef test_is_empty tester; + + linestring ls_empty; + bg::read_wkt("LINESTRING()", ls_empty); + + linestring ls; + bg::read_wkt("LINESTRING(1 1,2 2,5 6)", ls); + + polygon_cw_open p_open; + bg::read_wkt("POLYGON((0 0,0 1,1 0))", p_open); + + polygon_cw_closed p_closed; + bg::read_wkt("POLYGON(())", p_closed); + + multi_point mp; + bg::read_wkt("MULTIPOINT((1 10))", mp); + + multi_point mp_empty; + bg::read_wkt("MULTIPOINT((1 10))", mp); + + variant_geometry_type variant_geometry; + + variant_geometry = ls_empty; + tester::apply(variant_geometry, true); + + variant_geometry = p_open; + tester::apply(variant_geometry, false); + + variant_geometry = p_closed; + tester::apply(variant_geometry, true); + + variant_geometry = mp; + tester::apply(variant_geometry, false); + + variant_geometry = mp_empty; + tester::apply(variant_geometry, true); + + variant_geometry = ls; + tester::apply(variant_geometry, false); +} diff --git a/src/boost/libs/geometry/test/algorithms/is_simple.cpp b/src/boost/libs/geometry/test/algorithms/is_simple.cpp new file mode 100644 index 000000000..41cef5ed5 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/is_simple.cpp @@ -0,0 +1,314 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_is_simple +#endif + +#include "test_is_simple.hpp" + + +namespace bg = ::boost::geometry; + +typedef bg::model::point point_type; +typedef bg::model::segment segment_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_linestring multi_linestring_type; +// ccw open and closed polygons +typedef bg::model::polygon open_ccw_polygon_type; +typedef bg::model::polygon closed_ccw_polygon_type; +// multi-geometries +typedef bg::model::multi_point multi_point_type; +typedef bg::model::multi_polygon multi_polygon_type; +// box +typedef bg::model::box box_type; + + +BOOST_AUTO_TEST_CASE( test_is_simple_point ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_simple: POINT " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef point_type G; + + test_simple(from_wkt("POINT(0 0)"), true); +} + +BOOST_AUTO_TEST_CASE( test_is_simple_multipoint ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_simple: MULTIPOINT " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef multi_point_type G; + + test_simple(from_wkt("MULTIPOINT(0 0)"), true); + test_simple(from_wkt("MULTIPOINT(0 0,1 0,1 1,0 1)"), true); + test_simple(from_wkt("MULTIPOINT(0 0,1 0,1 1,1 0,0 1)"), false); + + // empty multipoint + test_simple(from_wkt("MULTIPOINT()"), true); +} + +BOOST_AUTO_TEST_CASE( test_is_simple_segment ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_simple: SEGMENT " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef segment_type G; + + test_simple(from_wkt("SEGMENT(0 0,1 0)"), true); +} + +BOOST_AUTO_TEST_CASE( test_is_simple_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_simple: LINESTRING " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef linestring_type G; + + // valid linestrings with multiple points + test_simple(from_wkt("LINESTRING(0 0,0 0,1 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,0 0,1 0,0 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,0 0,1 0,1 0,1 1,0 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,1 0,2 0,1 1,1 0,1 -1)"), false); + + // simple open linestrings + test_simple(from_wkt("LINESTRING(0 0,1 2)"), true); + test_simple(from_wkt("LINESTRING(0 0,1 2,2 3)"), true); + + // simple closed linestrings + test_simple(from_wkt("LINESTRING(0 0,1 0,1 1,0 0)"), true); + test_simple(from_wkt("LINESTRING(0 0,1 0,1 1,0 1,0 0)"), true); + test_simple(from_wkt("LINESTRING(0 0,10 0,10 10,0 10,0 0)"), true); + + // non-simple linestrings + test_simple(from_wkt("LINESTRING(0 0,1 0,0 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,1 0,2 10,0.5 -1)"), false); + test_simple(from_wkt("LINESTRING(0 0,1 0,2 1,1 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,1 0,2 1,0.5 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,2 0,1 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,3 0,5 0,1 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,3 0,5 0,4 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,3 0,5 0,4 0,2 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,3 0,2 0,5 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,2 0,2 2,1 0,0 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,1 0,2 0,2 2,1 0,0 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,10 0,10 10,0 10,0 0,0 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,0 10,5 10,0 0,10 10,10 5,10 0,0 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,0 0,10 0,10 10,0 10,0 0,0 0)"), + false); + test_simple(from_wkt("LINESTRING(0 0,0 0,0 0,10 0,10 10,0 10,0 0,0 0,0 0,0 0)"), + false); + test_simple(from_wkt("LINESTRING(0 0,0 0,10 0,10 10,10 10,10 10,10 10,10 10,0 10,0 0,0 0)"), + false); + test_simple(from_wkt("LINESTRING(0 0,1 0,2 0,2 2,1 0)"), false); + test_simple(from_wkt("LINESTRING(1 0,2 2,2 0,1 0,0 0)"), false); + test_simple(from_wkt("LINESTRING(0 0,1 0,2 0,2 2,1 0,1 4,0 0)"), false); + test_simple(from_wkt("LINESTRING(4 1,10 8,4 6,4 1,10 5,10 3)"), + false); + test_simple(from_wkt("LINESTRING(10 3,10 5,4 1,4 6,10 8,4 1)"), + false); + + // empty linestring + // the simplicity result is irrelevant since an empty linestring + // is considered as invalid + test_simple(from_wkt("LINESTRING()"), false, false); +} + +BOOST_AUTO_TEST_CASE( test_is_simple_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_simple: MULTILINESTRING " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef multi_linestring_type G; + + // multilinestrings with linestrings with spikes + test_simple(from_wkt("MULTILINESTRING((0 0,1 0,0 0),(5 0,6 0,7 0))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,1 0,0 0),(5 0,1 0,4 1))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,1 0,0 0),(5 0,1 0,4 0))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,1 0,0 0),(1 0,2 0))"), + false); + + // simple multilinestrings + test_simple(from_wkt("MULTILINESTRING((0 0,1 1),(1 1,1 0))"), true); + test_simple(from_wkt("MULTILINESTRING((0 0,1 1),(1 1,1 0),(0 1,1 1))"), + true); + test_simple(from_wkt("MULTILINESTRING((0 0,2 2),(0 0,1 0,2 0,2 2))"), true); + test_simple(from_wkt("MULTILINESTRING((0 0,2 2),(2 2,2 0,1 0,0 0))"), true); + test_simple(from_wkt("MULTILINESTRING((0 0,1 0),(0 0,-1 0),(1 0,2 0))"), + true); + test_simple(from_wkt("MULTILINESTRING((0 0,1 0),(-1 0,0 0),(2 0,1 0))"), + true); + test_simple(from_wkt("MULTILINESTRING((0 0,1 0),(0 0,0 1),(0 0,-1 0),(0 0,0 -1))"), + true); + test_simple(from_wkt("MULTILINESTRING((0 0,10 0,10 10,0 10,0 0))"), true); + + // non-simple multilinestrings + test_simple(from_wkt("MULTILINESTRING((0 0,2 2),(0 0,2 2))"), false); + test_simple(from_wkt("MULTILINESTRING((0 0,2 2),(2 2,0 0))"), false); + test_simple(from_wkt("MULTILINESTRING((0 0,2 2),(0 0,1 0,1 1,2 0,2 2))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,1 1,2 2),(0 0,1 0,1 1,2 0,2 2))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,1 1,2 2),(2 2,0 0))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,2 2,4 4),(0 0,1 1))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,2 2,4 4),(0 0,3 3))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,2 2,4 4),(1 1,3 3))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,2 2,4 4),(1 1,2 2))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,2 2,4 4),(2 2,3 3))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,2 2,4 4),(2 2,4 4))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,2 2,4 4),(4 4,2 2))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,1 1),(0 1,1 0))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,2 0),(1 0,0 1))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,1 1),(1 1,1 0),(1 1,0 1,0.5,0.5))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,1 0,1 1,0 1,0 0),(1 0,1 -1))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,1 0,1 1,0 1,0 0),(-1 0,0 0))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,1 0,1 1,0 1,0 0),(0 0,-1 0,-1 -1,0 -1,0 0))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,1 0,1 1,0 1,0 0),(-1 -1,-1 0,0 0,0 -1,-1 -1))"), + false); + test_simple(from_wkt("MULTILINESTRING((0 0,0 10,5 10,0 0,10 10,10 5,10 0,0 0))"), + false); + test_simple(from_wkt("MULTILINESTRING((4 1,10 8,4 6,4 1,10 5,10 3))"), + false); + test_simple(from_wkt("MULTILINESTRING((10 3,10 5,4 1,4 6,10 8,4 1))"), + false); + + // empty multilinestring + test_simple(from_wkt("MULTILINESTRING()"), true); +} + +BOOST_AUTO_TEST_CASE( test_is_simple_areal ) +{ + typedef box_type b; + typedef open_ccw_polygon_type o_ccw_p; + typedef multi_polygon_type mpl; + + // check that is_simple compiles for boxes + test_simple(from_wkt("BOX(0 0,1 1)"), true); + + // simple polygons and multi-polygons + test_simple(from_wkt("POLYGON((0 0,1 0,1 1))"), true); + test_simple(from_wkt("POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1))"), + true); + test_simple(from_wkt("MULTIPOLYGON(((0 0,1 0,1 1)),((10 0,20 0,20 10,10 10)))"), + true); + + // non-simple polygons & multi-polygons (have duplicate points) + test_simple(from_wkt("POLYGON((0 0,1 0,1 0,1 1))"), false); + test_simple(from_wkt("POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 9,9 1))"), + false); + test_simple(from_wkt("MULTIPOLYGON(((0 0,1 0,1 1,1 1)),((10 0,20 0,20 0,20 10,10 10)))"), + false); + + // empty polygon + // the simplicity result is irrelevant since an empty polygon + // is considered as invalid + test_simple(from_wkt("POLYGON(())"), false, false); + + // empty multipolygon + test_simple(from_wkt("MULTIPOLYGON()"), true); +} + +BOOST_AUTO_TEST_CASE( test_geometry_with_NaN_coordinates ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: geometry with NaN coordinates" << std::endl; + std::cout << "************************************" << std::endl; +#endif + + linestring_type ls1, ls2; + bg::read_wkt("LINESTRING(1 1,1.115235e+308 1.738137e+308)", ls1); + bg::read_wkt("LINESTRING(-1 1,1.115235e+308 1.738137e+308)", ls2); + + // the intersection of the two linestrings is a new linestring + // (multilinestring with a single element) that has NaN coordinates + multi_linestring_type mls; + bg::intersection(ls1, ls2, mls); + + test_simple(mls, true, false); +} + +BOOST_AUTO_TEST_CASE( test_is_simple_variant ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_simple: variant support" << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef bg::model::polygon polygon_type; // cw, closed + typedef boost::variant + < + linestring_type, multi_linestring_type, polygon_type + > variant_geometry; + + variant_geometry vg; + + linestring_type simple_linestring = + from_wkt("LINESTRING(0 0,1 0)"); + multi_linestring_type non_simple_multi_linestring = from_wkt + < + multi_linestring_type + >("MULTILINESTRING((0 0,1 0,1 1,0 0),(10 0,1 1))"); + polygon_type simple_polygon = + from_wkt("POLYGON((0 0,1 1,1 0,0 0))"); + polygon_type non_simple_polygon = + from_wkt("POLYGON((0 0,1 1,1 0,1 0,0 0))"); + + vg = simple_linestring; + test_simple(vg, true); + vg = non_simple_multi_linestring; + test_simple(vg, false); + vg = simple_polygon; + test_simple(vg, true); + vg = non_simple_polygon; + test_simple(vg, false); +} diff --git a/src/boost/libs/geometry/test/algorithms/is_simple_geo.cpp b/src/boost/libs/geometry/test/algorithms/is_simple_geo.cpp new file mode 100644 index 000000000..28405c030 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/is_simple_geo.cpp @@ -0,0 +1,128 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014-2017, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_is_simple_geo +#endif + +#include "test_is_simple.hpp" + + +inline bg::srs::spheroid sph(double a, double rf) +{ + double b = a - a / rf; + return bg::srs::spheroid(a, b); +} + +typedef bg::model::point > point_type; +typedef bg::model::segment segment_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_linestring multi_linestring_type; +// ccw open and closed polygons +typedef bg::model::polygon open_ccw_polygon_type; +typedef bg::model::polygon closed_ccw_polygon_type; +// multi-geometries +typedef bg::model::multi_point multi_point_type; +typedef bg::model::multi_polygon multi_polygon_type; +// box +typedef bg::model::box box_type; + + +BOOST_AUTO_TEST_CASE( test_is_simple_geo_multipoint ) +{ + typedef multi_point_type G; + + bg::strategy::intersection::geographic_segments<> s; + + test_simple_s(from_wkt("MULTIPOINT(0 90, 0 90)"), s, false); + test_simple_s(from_wkt("MULTIPOINT(0 90, 1 90)"), s, false); + test_simple_s(from_wkt("MULTIPOINT(0 -90, 0 -90)"), s, false); + test_simple_s(from_wkt("MULTIPOINT(0 -90, 1 -90)"), s, false); + test_simple_s(from_wkt("MULTIPOINT(0 80, 1 80)"), s, true); +} + +BOOST_AUTO_TEST_CASE( test_is_simple_geo_linestring ) +{ + typedef linestring_type G; + + bg::srs::spheroid sph_wgs84; + bg::srs::spheroid sph_4053(6371228, 6371228); + bg::srs::spheroid sph_near_4053(6371228, 6371227); + + bg::strategy::intersection::geographic_segments<> s(sph_wgs84); + bg::strategy::intersection::geographic_segments<> s_4053(sph_4053); + bg::strategy::intersection::geographic_segments<> s_near_4053(sph_near_4053); + + // Two cases which in Cartesian would be a spike, but in Geographic + // they go over the equator (first segment) and then over the pole + // (second segment) + test_simple_s(from_wkt("LINESTRING(0 0, -90 0, 90 0)"), s, true); + test_simple_s(from_wkt("LINESTRING(0 0, 90 0, -90 0)"), s, true); + + // Two similar cases, but these do not go over the pole back, but + // over the equator, and therefore make a spike + test_simple_s(from_wkt("LINESTRING(0 0, -80 0, 80 0)"), s, false); + test_simple_s(from_wkt("LINESTRING(0 0, 80 0, -80 0)"), s, false); + + // Going over the equator in a normal way, eastwards and westwards + test_simple_s(from_wkt("LINESTRING(-90 0, 0 0, 90 0)"), s, true); + test_simple_s(from_wkt("LINESTRING(90 0, 0 0, -90 0)"), s, true); + + test_simple_s(from_wkt("LINESTRING(0 90, -90 0, 90 0)"), s, false); + test_simple_s(from_wkt("LINESTRING(0 90, -90 50, 90 0)"), s, false); + test_simple_s(from_wkt("LINESTRING(0 90, -90 -50, 90 0)"), s, true); + + // invalid linestrings + test_simple_s(from_wkt("LINESTRING(0 90, 0 90)"), s, false, false); + test_simple_s(from_wkt("LINESTRING(0 -90, 0 -90)"), s, false, false); + test_simple_s(from_wkt("LINESTRING(0 90, 1 90)"), s, false, false); + test_simple_s(from_wkt("LINESTRING(0 -90, 1 -90)"), s, false, false); + + // FAILING + //test_simple_s(from_wkt("LINESTRING(0 90, 0 80, 1 80, 0 90)"), s, false); + //test_simple_s(from_wkt("LINESTRING(0 -90, 0 -80, 1 -80, 0 -90)"), s, false); + //test_simple_s(from_wkt("LINESTRING(0 90, 0 80, 1 80, 1 90)"), s, false); + //test_simple_s(from_wkt("LINESTRING(0 -90, 0 -80, 1 -80, 1 -90)"), s, false); + + test_simple_s(from_wkt("LINESTRING(35 0, 110 36, 159 0, 82 30)"), s, false); + test_simple_s(from_wkt("LINESTRING(135 0, -150 36, -101 0, -178 30)"), s, false); + test_simple_s(from_wkt("LINESTRING(45 0, 120 36, 169 0, 92 30)"), s, false); + test_simple_s(from_wkt("LINESTRING(179 0, -179 1, -179 0, 179 1)"), s, false); + + test_simple_s(from_wkt("LINESTRING(-121 -19,37 8,-19 -15,-104 -58)"), s, false); + test_simple_s(from_wkt("LINESTRING(-121 -19,37 8,-19 -15,-104 -58)"), s_4053, false); + test_simple_s(from_wkt("LINESTRING(-121 -19,37 8,-19 -15,-104 -58)"), s_near_4053, false); + + // The segments are very close to each other, in WGS84 they cross, + // in spherical or nearly spherical they don't cross + test_simple_s(from_wkt("LINESTRING(106 22,21 39,40 -12,-91 68)"), s, false); + test_simple_s(from_wkt("LINESTRING(106 22,21 39,40 -12,-91 68)"), s_4053, true); + test_simple_s(from_wkt("LINESTRING(106 22,21 39,40 -12,-91 68)"), s_near_4053, true); +} + +BOOST_AUTO_TEST_CASE( test_is_simple_geo_multilinestring ) +{ + typedef multi_linestring_type G; + + bg::strategy::intersection::geographic_segments<> s_wgs84; // EPSG 4326 + bg::strategy::intersection::geographic_segments<> s_bessel((sph(6377397.155,299.1528128))); // EPSG 4804, 4813, 4820 + + // FAILING + //test_simple_s(from_wkt("MULTILINESTRING((0 90, 0 80),(1 90, 1 80))"), s_wgs84, false); + //test_simple_s(from_wkt("MULTILINESTRING((0 -90, 0 -80),(1 -90, 1 -80))"), s_wgs84, false); + + test_simple_s(from_wkt("MULTILINESTRING((35 0, 110 36),(159 0, 82 30))"), s_wgs84, false); + test_simple_s(from_wkt("MULTILINESTRING((135 0, -150 36),(-101 0, -178 30))"), s_wgs84, false); + test_simple_s(from_wkt("MULTILINESTRING((45 0, 120 36),(169 0, 92 30))"), s_wgs84, false); + test_simple_s(from_wkt("MULTILINESTRING((179 0, -179 1),(-179 0, 179 1))"), s_wgs84, false); + + test_simple_s(from_wkt("MULTILINESTRING((35 2,110 36),(72 51,67 28,16 53,159 3,82 30))"), s_wgs84, false); + test_simple_s(from_wkt("MULTILINESTRING((35 2,110 36),(72 51,67 28,16 53,159 3,82 30))"), s_bessel, false); +} diff --git a/src/boost/libs/geometry/test/algorithms/is_valid.cpp b/src/boost/libs/geometry/test/algorithms/is_valid.cpp new file mode 100644 index 000000000..9c9ca4dde --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/is_valid.cpp @@ -0,0 +1,1416 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014-2018, 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_is_valid +#endif + +#include +#include + +#include + +#include "test_is_valid.hpp" +#include "overlay/overlay_cases.hpp" + +#include + +#include +#include +#include + +BOOST_AUTO_TEST_CASE( test_is_valid_point ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: POINT " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef point_type G; + typedef default_validity_tester tester; + typedef test_valid test; + + test::apply("p01", "POINT(0 0)", true); +} + +BOOST_AUTO_TEST_CASE( test_is_valid_multipoint ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: MULTIPOINT " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef multi_point_type G; + typedef default_validity_tester tester; + typedef test_valid test; + + test::apply("mp01", "MULTIPOINT()", true); + test::apply("mp02", "MULTIPOINT(0 0,0 0)", true); + test::apply("mp03", "MULTIPOINT(0 0,1 0,1 1,0 1)", true); + test::apply("mp04", "MULTIPOINT(0 0,1 0,1 1,1 0,0 1)", true); +} + +BOOST_AUTO_TEST_CASE( test_is_valid_segment ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: SEGMENT " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef segment_type G; + typedef default_validity_tester tester; + typedef test_valid test; + + test::apply("s01", "SEGMENT(0 0,0 0)", false); + test::apply("s02", "SEGMENT(0 0,1 0)", true); +} + +BOOST_AUTO_TEST_CASE( test_is_valid_box ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: BOX " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef box_type G; + typedef default_validity_tester tester; + typedef test_valid test; + + // boxes where the max corner and below and/or to the left of min corner + test::apply("b01", "BOX(0 0,-1 0)", false); + test::apply("b02", "BOX(0 0,0 -1)", false); + test::apply("b03", "BOX(0 0,-1 -1)", false); + + // boxes of zero area; they are not 2-dimensional, so invalid + test::apply("b04", "BOX(0 0,0 0)", false); + test::apply("b05", "BOX(0 0,1 0)", false); + test::apply("b06", "BOX(0 0,0 1)", false); + + test::apply("b07", "BOX(0 0,1 1)", true); +} + +template +void test_linestrings() +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "SPIKES ALLOWED? " + << std::boolalpha + << AllowSpikes + << std::noboolalpha + << std::endl; +#endif + + typedef validity_tester_linear tester; + typedef test_valid test; + + // empty linestring + test::apply("l01", "LINESTRING()", false); + + // 1-point linestrings + test::apply("l02", "LINESTRING(0 0)", false); + test::apply("l03", "LINESTRING(0 0,0 0)", false); + test::apply("l04", "LINESTRING(0 0,0 0,0 0)", false); + + // 2-point linestrings + test::apply("l05", "LINESTRING(0 0,1 2)", true); + test::apply("l06", "LINESTRING(0 0,1 2,1 2)", true); + test::apply("l07", "LINESTRING(0 0,0 0,1 2,1 2)", true); + test::apply("l08", "LINESTRING(0 0,0 0,0 0,1 2,1 2)", true); + + // 3-point linestrings + test::apply("l09", "LINESTRING(0 0,1 0,2 10)", true); + test::apply("l10", "LINESTRING(0 0,1 0,2 10,0 0)", true); + test::apply("l11", "LINESTRING(0 0,10 0,10 10,5 0)", true); + + // linestrings with spikes + test::apply("l12", "LINESTRING(0 0,1 2,0 0)", AllowSpikes); + test::apply("l13", "LINESTRING(0 0,1 2,1 2,0 0)", AllowSpikes); + test::apply("l14", "LINESTRING(0 0,0 0,1 2,1 2,0 0)", AllowSpikes); + test::apply("l15", "LINESTRING(0 0,0 0,0 0,1 2,1 2,0 0,0 0)", AllowSpikes); + test::apply("l16", "LINESTRING(0 0,10 0,5 0)", AllowSpikes); + test::apply("l17", "LINESTRING(0 0,10 0,10 10,5 0,0 0)", AllowSpikes); + test::apply("l18", "LINESTRING(0 0,10 0,10 10,5 0,4 0,6 0)", AllowSpikes); + test::apply("l19", "LINESTRING(0 0,1 0,1 1,5 5,4 4)", AllowSpikes); + test::apply("l20", "LINESTRING(0 0,1 0,1 1,5 5,4 4,6 6)", AllowSpikes); + test::apply("l21", "LINESTRING(0 0,1 0,1 1,5 5,4 4,4 0)", AllowSpikes); + test::apply("l22", + "LINESTRING(0 0,0 0,1 0,1 0,1 0,0 0,0 0,2 0)", + AllowSpikes); + test::apply("l23", + "LINESTRING(0 0,1 0,0 0,2 0,0 0,3 0,0 0,4 0)", + AllowSpikes); + test::apply("l24", + "LINESTRING(0 0,1 0,0 0,2 0,0 0,3 0,0 0,4 0,0 0)", + AllowSpikes); + + // other examples + test::apply("l25", "LINESTRING(0 0,10 0,10 10,5 0,4 0)", true); + test::apply("l26", "LINESTRING(0 0,10 0,10 10,5 0,4 0,3 0)", true); + test::apply("l27", "LINESTRING(0 0,10 0,10 10,5 0,4 0,-1 0)", true); + test::apply("l28", "LINESTRING(0 0,1 0,1 1,-1 1,-1 0,0 0)", true); + test::apply("l29", "LINESTRING(0 0,1 0,1 1,-1 1,-1 0,0.5 0)", true); +} + +BOOST_AUTO_TEST_CASE( test_is_valid_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: LINESTRING " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + bool const allow_spikes = true; + bool const do_not_allow_spikes = !allow_spikes; + + test_linestrings(); + test_linestrings(); +} + +template +void test_multilinestrings() +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "SPIKES ALLOWED? " + << std::boolalpha + << AllowSpikes + << std::noboolalpha + << std::endl; +#endif + + typedef validity_tester_linear tester; + typedef test_valid test; + + // empty multilinestring + test::apply("mls01", "MULTILINESTRING()", true); + + // multilinestring with empty linestring(s) + test::apply("mls02", "MULTILINESTRING(())", false); + test::apply("mls03", "MULTILINESTRING((),(),())", false); + test::apply("mls04", "MULTILINESTRING((),(0 1,1 0))", false); + + // multilinestring with invalid linestrings + test::apply("mls05", "MULTILINESTRING((0 0),(0 1,1 0))", false); + test::apply("mls06", "MULTILINESTRING((0 0,0 0),(0 1,1 0))", false); + test::apply("mls07", "MULTILINESTRING((0 0),(1 0))", false); + test::apply("mls08", "MULTILINESTRING((0 0,0 0),(1 0,1 0))", false); + test::apply("mls09", "MULTILINESTRING((0 0),(0 0))", false); + test::apply("mls10", "MULTILINESTRING((0 0,1 0,0 0),(5 0))", false); + + // multilinstring that has linestrings with spikes + test::apply("mls11", + "MULTILINESTRING((0 0,1 0,0 0),(5 0,1 0,4 1))", + AllowSpikes); + test::apply("mls12", + "MULTILINESTRING((0 0,1 0,0 0),(1 0,2 0))", + AllowSpikes); + + // valid multilinestrings + test::apply("mls13", "MULTILINESTRING((0 0,1 0,2 0),(5 0,1 0,4 1))", true); + test::apply("mls14", "MULTILINESTRING((0 0,1 0,2 0),(1 0,2 0))", true); + test::apply("mls15", "MULTILINESTRING((0 0,1 1),(0 1,1 0))", true); + test::apply("mls16", "MULTILINESTRING((0 0,1 1,2 2),(0 1,1 0,2 2))", true); +} + +BOOST_AUTO_TEST_CASE( test_is_valid_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: MULTILINESTRING " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + bool const allow_spikes = true; + bool const do_not_allow_spikes = !allow_spikes; + + test_multilinestrings(); + test_multilinestrings(); +} + +template +inline void test_open_rings() +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: RING (open) " << std::endl; + std::cout << "************************************" << std::endl; + std::cout << "DUPLICATES ALLOWED? " + << std::boolalpha + << AllowDuplicates + << std::noboolalpha + << std::endl; +#endif + + typedef bg::model::ring OG; // ccw, open ring + typedef bg::model::ring CG; // ccw, closed ring + typedef bg::model::ring CW_OG; // cw, open ring + typedef bg::model::ring CW_CG; // cw, closed ring + + typedef validity_tester_areal tester; + typedef test_valid test; + + // not enough points + test::apply("r01", "POLYGON(())", false); + test::apply("r02", "POLYGON((0 0))", false); + test::apply("r03", "POLYGON((0 0,1 0))", false); + + // duplicate points + test::apply("r04", "POLYGON((0 0,0 0,0 0))", false); + test::apply("r05", "POLYGON((0 0,1 0,1 0))", false); + test::apply("r06", "POLYGON((0 0,1 0,0 0))", false); + test::apply("r07", "POLYGON((0 0,1 0,1 1,0 0,0 0))", AllowDuplicates); + test::apply("r08", "POLYGON((0 0,1 0,1 0,1 1))", AllowDuplicates); + test::apply("r09", "POLYGON((0 0,1 0,1 0,1 1,0 0))", AllowDuplicates); + + // with spikes + test::apply("r10", "POLYGON((0 0,2 0,2 2,0 2,1 2))", false); + test::apply("r11", "POLYGON((0 0,2 0,1 0,2 2))", false); + test::apply("r12", "POLYGON((0 0,1 0,2 0,1 0,4 0,4 4))", false); + test::apply("r13", "POLYGON((0 0,2 0,2 2,1 0))", false); + test::apply("r14", "POLYGON((0 0,2 0,1 0))", false); + test::apply("r15", "POLYGON((0 0,5 0,5 5,4 4,5 5,0 5))", false); + test::apply("r16", "POLYGON((0 0,5 0,5 5,4 4,3 3,5 5,0 5))", false); + + // with spikes and duplicate points + test::apply("r17", "POLYGON((0 0,0 0,2 0,2 0,1 0,1 0))", false); + + // with self-crossings + test::apply("r18", "POLYGON((0 0,5 0,5 5,3 -1,0 5))", false); + + // with self-crossings and duplicate points + test::apply("r19", "POLYGON((0 0,5 0,5 5,5 5,3 -1,0 5,0 5))", false); + + // with self-intersections + test::apply("r20", "POLYGON((0 0,5 0,5 5,3 5,3 0,2 0,2 5,0 5))", false); + + test::apply("r21", "POLYGON((0 0,5 0,5 5,3 5,3 0,2 5,0 5))", false); + + test::apply("r22", + "POLYGON((0 0,5 0,5 1,1 1,1 2,2 2,3 1,4 2,5 2,5 5,0 5))", + false); + + // with self-intersections and duplicate points + test::apply("r23", + "POLYGON((0 0,5 0,5 5,3 5,3 5,3 0,3 0,2 0,2 0,2 5,2 5,0 5))", + false); + + // next two suggested by Adam Wulkiewicz + test::apply("r24", + "POLYGON((0 0,5 0,5 5,0 5,4 4,2 2,0 5))", + false); + test::apply("r25", + "POLYGON((0 0,5 0,5 5,1 4,4 4,4 1,0 5))", + false); + + // and a few more + test::apply("r26", + "POLYGON((0 0,5 0,5 5,4 4,1 4,1 1,4 1,4 4,0 5))", + false); + test::apply("r27", + "POLYGON((0 0,5 0,5 5,4 4,4 1,1 1,1 4,4 4,0 5))", + false); + + // valid rings + test::apply("r28", "POLYGON((0 0,1 0,1 1))", true); + test::apply("r29", "POLYGON((1 0,1 1,0 0))", true); + test::apply("r30", "POLYGON((0 0,1 0,1 1,0 1))", true); + test::apply("r31", "POLYGON((1 0,1 1,0 1,0 0))", true); + + // test cases coming from buffer + test::apply("r32", + "POLYGON((1.1713032141645456 -0.9370425713316364,\ + 5.1713032141645456 4.0629574286683638,\ + 4.7808688094430307 4.3753049524455756,\ + 4.7808688094430307 4.3753049524455756,\ + 0.7808688094430304 -0.6246950475544243,\ + 0.7808688094430304 -0.6246950475544243))", + AllowDuplicates); + + // wrong orientation + test::apply("r33", "POLYGON((0 0,0 1,1 1))", false); + + // Normal case, plus spikes formed in two different ways + test::apply("r34", "POLYGON((0 0,4 0,4 4,0 4,0 0))", true); + test::apply("r35", "POLYGON((0 0,5 0,4 0,4 4,0 4,0 0))", false); + test::apply("r36", "POLYGON((0 0,4 0,4 -1,4 4,0 4,0 0))", false); +} + + +template +inline void test_closed_rings() +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: RING (closed) " << std::endl; + std::cout << "************************************" << std::endl; + std::cout << "DUPLICATES ALLOWED? " + << std::boolalpha + << AllowDuplicates + << std::noboolalpha + << std::endl; +#endif + + typedef bg::model::ring CG; // ccw, closed ring + typedef bg::model::ring CW_CG; // cw, closed ring + + typedef validity_tester_areal tester; + typedef test_valid test; + + // not enough points + test::apply("r01c", "POLYGON(())", false); + test::apply("r02c", "POLYGON((0 0))", false); + test::apply("r03c", "POLYGON((0 0,0 0))", false); + test::apply("r04c", "POLYGON((0 0,1 0))", false); + test::apply("r05c", "POLYGON((0 0,1 0,1 0))", false); + test::apply("r06c", "POLYGON((0 0,1 0,2 0))", false); + test::apply("r07c", "POLYGON((0 0,1 0,1 0,2 0))", false); + test::apply("r08c", "POLYGON((0 0,1 0,2 0,2 0))", false); + + // boundary not closed + test::apply("r09c", "POLYGON((0 0,1 0,1 1,1 2))", false); + test::apply("r10c", "POLYGON((0 0,1 0,1 0,1 1,1 1,1 2))", false); + + // with spikes + test::apply("r11c", "POLYGON((0 0,1 0,1 0,2 0,0 0))", false); + test::apply("r12c", "POLYGON((0 0,1 0,1 1,2 2,0.5 0.5,0 1,0 0))", false); + + // wrong orientation + test::apply("r13c", "POLYGON((0 0,0 1,1 1,2 0,0 0))", false); +} + +BOOST_AUTO_TEST_CASE( test_is_valid_ring ) +{ + bool const allow_duplicates = true; + bool const do_not_allow_duplicates = !allow_duplicates; + + test_open_rings(); + test_open_rings(); + + test_closed_rings(); + test_closed_rings(); +} + +template +inline void test_open_polygons() +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: POLYGON (open) " << std::endl; + std::cout << "************************************" << std::endl; + std::cout << "DUPLICATES ALLOWED? " + << std::boolalpha + << AllowDuplicates + << std::noboolalpha + << std::endl; +#endif + + typedef bg::model::polygon OG; // ccw, open + typedef bg::model::polygon CG; // ccw, closed + typedef bg::model::polygon CW_OG; // cw, open + typedef bg::model::polygon CW_CG; // cw, closed + + typedef validity_tester_areal tester; + typedef test_valid test; + + // not enough points in exterior ring + test::apply("pg001", "POLYGON(())", false); + test::apply("pg002", "POLYGON((0 0))", false); + test::apply("pg003", "POLYGON((0 0,1 0))", false); + + // not enough points in interior ring + test::apply("pg004", "POLYGON((0 0,10 0,10 10,0 10),())", false); + test::apply("pg005", "POLYGON((0 0,10 0,10 10,0 10),(1 1))", false); + test::apply("pg006", "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 2))", false); + + // duplicate points in exterior ring + test::apply("pg007", "POLYGON((0 0,0 0,0 0))", false); + test::apply("pg008", "POLYGON((0 0,1 0,1 0))", false); + test::apply("pg009", "POLYGON((0 0,1 0,0 0))", false); + test::apply("pg010", "POLYGON((0 0,1 0,1 1,0 0,0 0))", AllowDuplicates); + test::apply("pg011", "POLYGON((0 0,1 0,1 0,1 1))", AllowDuplicates); + test::apply("pg012", "POLYGON((0 0,1 0,1 0,1 1,0 0))", AllowDuplicates); + + // duplicate points in interior ring + test::apply("pg013", "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 1,1 1))", false); + test::apply("pg014", "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 1,2 1))", false); + test::apply("pg015", "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 1,1 1))", false); + test::apply("pg016", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 2,2 1,1 1,1 1))", + AllowDuplicates); + test::apply("pg017", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 2,2 2,2 1))", + AllowDuplicates); + test::apply("pg018", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 2,2 1,2 1,1 1))", + AllowDuplicates); + + // with spikes in exterior ring + test::apply("pg019", "POLYGON((0 0,2 0,2 2,0 2,1 2))", false); + test::apply("pg020", "POLYGON((0 0,2 0,1 0,2 2))", false); + test::apply("pg021", "POLYGON((0 0,1 0,2 0,1 0,4 0,4 4))", false); + test::apply("pg022", "POLYGON((0 0,2 0,2 2,1 0))", false); + test::apply("pg023", "POLYGON((0 0,2 0,1 0))", false); + test::apply("pg024", "POLYGON((0 0,5 0,5 5,4 4,5 5,0 5))", false); + test::apply("pg025", "POLYGON((0 0,5 0,5 5,4 4,3 3,5 5,0 5))", false); + + // with spikes in interior ring + test::apply("pg026", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,3 1,3 3,1 3,2 3))", + false); + test::apply("pg027", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,3 1,2 1,3 3))", + false); + test::apply("pg028", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 1,3 1,2 1,4 1,4 4))", + false); + test::apply("pg029", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,3 1,3 3,2 1))", + false); + test::apply("pg030", "POLYGON((0 0,10 0,10 10,0 10),(1 1,3 1,2 1))", false); + + // with self-crossings in exterior ring + test::apply("pg031", "POLYGON((0 0,5 0,5 5,3 -1,0 5))", false); + + // example from Norvald Ryeng + test::apply("pg032", + "POLYGON((100 1300,140 1300,140 170,100 1700))", + false); + // and with point order reversed + test::apply("pg033", + "POLYGON((100 1300,100 1700,140 170,140 1300))", + false); + + // with self-crossings in interior ring + test::apply("pg034", + "POLYGON((0 0,10 0,10 10,0 10),(3 3,3 7,4 6,2 6))", + false); + + // with self-crossings between rings + test::apply("pg035", "POLYGON((0 0,5 0,5 5,0 5),(1 1,2 1,1 -1))", false); + + // with self-intersections in exterior ring + test::apply("pg036", "POLYGON((0 0,5 0,5 5,3 5,3 0,2 0,2 5,0 5))", false); + test::apply("pg037", "POLYGON((0 0,5 0,5 5,3 5,3 0,2 5,0 5))", false); + test::apply("pg038", + "POLYGON((0 0,5 0,5 1,1 1,1 2,2 2,3 1,4 2,5 2,5 5,0 5))", + false); + + // next two suggested by Adam Wulkiewicz + test::apply("pg039", "POLYGON((0 0,5 0,5 5,0 5,4 4,2 2,0 5))", false); + test::apply("pg040", "POLYGON((0 0,5 0,5 5,1 4,4 4,4 1,0 5))", false); + test::apply("pg041", + "POLYGON((0 0,5 0,5 5,4 4,1 4,1 1,4 1,4 4,0 5))", + false); + test::apply("pg042", + "POLYGON((0 0,5 0,5 5,4 4,4 1,1 1,1 4,4 4,0 5))", + false); + + // with self-intersections in interior ring + test::apply("pg043", + "POLYGON((-10 -10,10 -10,10 10,-10 10),(0 0,5 0,5 5,3 5,3 0,2 0,2 5,0 5))", + false); + test::apply("pg044", + "POLYGON((-10 -10,10 -10,10 10,-10 10),(0 0,5 0,5 5,3 5,3 0,2 5,0 5))", + false); + + test::apply("pg045", + "POLYGON((-10 -10,10 -10,10 10,-10 10),(0 0,5 0,5 1,1 1,1 2,2 2,3 1,4 2,5 2,5 5,0 5))", + false); + + // with self-intersections between rings + // hole has common segment with exterior ring + test::apply("pg046", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 10,2 10,2 1))", + false); + test::apply("pg047", + "POLYGON((0 0,0 0,10 0,10 10,0 10,0 10),(1 1,1 10,1 10,2 10,2 10,2 1))", + false); + // hole touches exterior ring at one point + test::apply("pg048", "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 10,2 1))", true); + + // "hole" is outside the exterior ring, but touches it + test::apply("pg049", + "POLYGON((0 0,10 0,10 10,0 10),(5 10,4 11,6 11))", + false); + + // hole touches exterior ring at vertex + test::apply("pg050", "POLYGON((0 0,10 0,10 10,0 10),(0 0,1 4,4 1))", true); + + // "hole" is completely outside the exterior ring + test::apply("pg051", + "POLYGON((0 0,10 0,10 10,0 10),(20 20,20 21,21 21,21 20))", + false); + + // two "holes" completely outside the exterior ring, that touch + // each other + test::apply("pg052", + "POLYGON((0 0,10 0,10 10,0 10),(20 0,25 10,21 0),(30 0,25 10,31 0))", + false); + + // example from Norvald Ryeng + test::apply("pg053", + "POLYGON((58 31,56.57 30,62 33),(35 9,28 14,31 16),(23 11,29 5,26 4))", + false); + // and with points reversed + test::apply("pg054", + "POLYGON((58 31,62 33,56.57 30),(35 9,31 16,28 14),(23 11,26 4,29 5))", + false); + + // "hole" is completely inside another "hole" + test::apply("pg055", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,2 8,8 8,8 2))", + false); + test::apply("pg056", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,8 2,8 8,2 8))", + false); + + // "hole" is inside another "hole" (touching) + test::apply("pg057", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,2 8,8 8,9 6,8 2))", + false); + test::apply("pg058", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,2 8,8 8,9 6,8 2))", + false); + test::apply("pg058a", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,8 2,9 6,8 8,2 8))", + false); + test::apply("pg059", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,2 8,8 8,9 6,8 2))", + false); + test::apply("pg059a", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,9 1,9 9,1 9),(2 2,2 8,8 8,9 6,8 2))", + false); + test::apply("pg060", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,2 8,8 8,9 6,8 2))", + false); + test::apply("pg060a", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,9 1,9 9,1 9),(2 2,8 2,9 6,8 8,2 8))", + false); + // hole touches exterior ring at two points + test::apply("pg061", "POLYGON((0 0,10 0,10 10,0 10),(5 0,0 5,5 5))", false); + + // cases with more holes + // two holes, touching the exterior at the same point + test::apply("pg062", + "POLYGON((0 0,10 0,10 10,0 10),(0 0,1 9,2 9),(0 0,9 2,9 1))", + true); + test::apply("pg063", + "POLYGON((0 0,0 0,10 0,10 10,0 10,0 0),(0 0,0 0,1 9,2 9),(0 0,0 0,9 2,9 1))", + AllowDuplicates); + test::apply("pg063", + "POLYGON((0 10,0 0,0 0,0 0,10 0,10 10),(2 9,0 0,0 0,1 9),(9 1,0 0,0 0,9 2))", + AllowDuplicates); + // two holes, one inside the other + test::apply("pg064", + "POLYGON((0 0,10 0,10 10,0 10),(0 0,1 9,9 1),(0 0,4 5,5 4))", + false); + // 1st hole touches has common segment with 2nd hole + test::apply("pg066", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 5,5 5,5 1),(5 4,5 8,8 8,8 4))", + false); + // 1st hole touches 2nd hole at two points + test::apply("pg067", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 8,2 8,2 1),(2 5,5 8,5 5))", + false); + // polygon with many holes, where the last two touch at two points + test::apply("pg068", + "POLYGON((0 0,20 0,20 20,0 20),(1 18,1 19,2 19,2 18),(3 18,3 19,4 19,4 18),(5 18,5 19,6 19,6 18),(7 18,7 19,8 19,8 18),(9 18,9 19,10 19,10 18),(11 18,11 19,12 19,12 18),(13 18,13 19,14 19,14 18),(15 18,15 19,16 19,16 18),(17 18,17 19,18 19,18 18),(1 1,1 9,9 9,9 8,2 8,2 1),(2 5,5 8,5 5))", + false); + // two holes completely inside exterior ring but touching each + // other at a point + test::apply("pg069", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,2 9),(1 1,9 2,9 1))", + true); + // four holes, each two touching at different points + test::apply("pg070", + "POLYGON((0 0,10 0,10 10,0 10),(0 10,2 1,1 1),(0 10,4 1,3 1),(10 10,9 1,8 1),(10 10,7 1,6 1))", + true); + // five holes, with two pairs touching each at some point, and + // fifth hole creating a disconnected component for the interior + test::apply("pg071", + "POLYGON((0 0,10 0,10 10,0 10),(0 10,2 1,1 1),(0 10,4 1,3 1),(10 10,9 1,8 1),(10 10,7 1,6 1),(4 1,4 4,6 4,6 1))", + false); + // five holes, with two pairs touching each at some point, and + // fifth hole creating three disconnected components for the interior + test::apply("pg072", + "POLYGON((0 0,10 0,10 10,0 10),(0 10,2 1,1 1),(0 10,4 1,3 1),(10 10,9 1,8 1),(10 10,7 1,6 1),(4 1,4 4,6 4,6 1,5 0))", + false); + + // both examples: a polygon with one hole, where the hole contains + // the exterior ring + test::apply("pg073", + "POLYGON((0 0,1 0,1 1,0 1),(-10 -10,-10 10,10 10,10 -10))", + false); + test::apply("pg074", + "POLYGON((-10 -10,1 0,1 1,0 1),(-10 -10,-10 10,10 10,10 -10))", + false); + + test::apply + ("pg075", + "POLYGON((-6 -10,-6.6923076923076925 -6.711538461538462,\ + -9 -7,-8.824742268041238 -6.123711340206185,\ + -10 -6,-8.583333333333332 -4.916666666666667,\ + -8.094117647058823 -2.4705882352941173,-10 -3,\ + -8.526315789473683 -0.05263157894736803,-10 1,\ + -10 10,-7.764705882352941 8.509803921568627,\ + -7.65090909090909 7.789090909090909,-10 10,\ + -7.574468085106383 7.304964539007091,-7.4375 6.4375,\ + -6.5 5.5,-6.4 6,-7.574468085106383 7.304964539007091,\ + -7.65090909090909 7.789090909090909,\ + -6.297029702970297 6.514851485148515,\ + 0 0,-6.297029702970297 6.514851485148515,\ + -4.848484848484849 5.151515151515151,-4 6,\ + -6.117647058823529 7.411764705882352,\ + 0 0,-6.11764705882353 7.411764705882353,\ + -7.764705882352941 8.509803921568627,-8 10,\ + -2.9473684210526314 7.052631578947368,-2 8,\ + -0.17821782178217824 6.633663366336634,1 10,\ + 1.8095238095238098 5.142857142857142,\ + 3.2038834951456314 4.097087378640777,7 7,\ + 3.7142857142857144 3.7142857142857144,\ + 4.4 3.1999999999999997,8 2,\ + 6.540540540540541 1.5945945945945947,10 -1,\ + 7.454545454545455 -4.393939393939394,8 -5,\ + 7.320754716981132 -4.716981132075472,7 -6,\ + 6.062068965517241 -5.117241379310345,\ + 4.9504132231404965 -5.256198347107438,\ + 6.1506849315068495 -7.123287671232877,9 -8,\ + 6.548387096774194 -7.741935483870968,8 -10,\ + 5.906976744186046 -7.674418604651163,\ + 3.9107142857142856 -7.464285714285714,4 -8,\ + 2.8043478260869565 -7.3478260869565215,\ + 1.7829457364341086 -7.24031007751938,2 -8,\ + 1.0728476821192054 -7.1655629139072845,\ + -4.3583617747440275 -6.593856655290103,-5 -9,\ + -5.2020725388601035 -7.720207253886011,-6 -10),\ + (5.127659574468085 -6.808510638297872,\ + 3.72972972972973 -6.378378378378379,\ + 3.571428571428571 -5.428571428571429,\ + 3.8539325842696632 -5.393258426966292,\ + 5.127659574468085 -6.808510638297872),\ + (-5.5 4.5,-6.5 5.5,-6.4 6,\ + -5.263157894736842 4.736842105263158,-5.5 4.5))", + false); + + // test cases coming from buffer + test::apply + ("pg076", + "POLYGON((1.1713032141645456 -0.9370425713316364,\ + 5.1713032141645456 4.0629574286683638,\ + 4.7808688094430307 4.3753049524455756,\ + 4.7808688094430307 4.3753049524455756,\ + 0.7808688094430304 -0.6246950475544243,\ + 0.7808688094430304 -0.6246950475544243))", + AllowDuplicates); + + + // MySQL report on Sep 30, 2015 + test::apply + ("pg077", + "POLYGON((72.8714768817168 -167.0048853643874,9274.40641550926 3433.5957427942167,-58.09039811390054 187.50989457746405,-81.09039811390053 179.50989457746405,-207.99999999999997 135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,49.8714768817168 -176.0048853643874))", + true); + + test::apply("pg077-simplified", + "POLYGON((-200 0,-207.99999999999997 135.36742435621204,-208 1,-208 0,-208 -276.9111154485375))", + true); + + test::apply + ("pg078", + "POLYGON((0 10,-10 0,0 0,10 0))", + true); + + test::apply + ("pg078spike1", + "POLYGON((0 10,-10 0,0 0,-10 0,10 0))", + false); + + test::apply + ("pg078spike2", + "POLYGON((0 10,-10 0,0 0,-8 0,10 0))", + false); + + test::apply + ("pg078spike3", + "POLYGON((0 10,-10 0,0 0,-11 0,10 0))", + false); + + test::apply + ("pg078reversed", + "POLYGON((0 10,10 0,0 0,-10 0))", + false); + + test::apply + ("pg079", + "POLYGON((10 0,0 10,0 0,0 -10))", + true); + + test::apply + ("pg079spike1", + "POLYGON((10 0,0 10,0 0,0 10,0 -10))", + false); + + test::apply + ("pg079spike2", + "POLYGON((10 0,0 10,0 0,0 8,0 -10))", + false); + + test::apply + ("pg079spike3", + "POLYGON((10 0,0 10,0 0,0 11,0 -10))", + false); + + test::apply + ("pg079reversed", + "POLYGON((10 0,0 -10,0 0,0 10))", + false); +} + + +template +inline void test_doc_example_polygon() +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: doc example polygon " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef bg::model::polygon ClockwiseClosedPolygon; + typedef validity_tester_areal tester; + typedef test_valid test; + + test::apply("pg-doc", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 2,0 0),(0 0,2 9,1 9,0 0),(2 9,9 2,9 9,2 9))", + false); + + // Containing a self touching point, which should be valid + test::apply("ggl_list_20190307_matthieu_2", ggl_list_20190307_matthieu_2[1], true); +} + +BOOST_AUTO_TEST_CASE( test_is_valid_polygon ) +{ + bool const allow_duplicates = true; + bool const do_not_allow_duplicates = !allow_duplicates; + + test_open_polygons(); + test_open_polygons(); + test_doc_example_polygon(); +} + +template +inline void test_open_multipolygons() +{ + // WKT of multipolygons should be defined as ccw, open + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: MULTIPOLYGON (open) " << std::endl; + std::cout << "************************************" << std::endl; + std::cout << "DUPLICATES ALLOWED? " + << std::boolalpha + << AllowDuplicates + << std::noboolalpha + << std::endl; +#endif + + // cw, ccw, open and closed polygons + typedef bg::model::polygon ccw_open_polygon_type; + typedef bg::model::polygon ccw_closed_polygon_type; + typedef bg::model::polygon cw_open_polygon_type; + typedef bg::model::polygon cw_closed_polygon_type; + + typedef bg::model::multi_polygon OG; + typedef bg::model::multi_polygon CG; + typedef bg::model::multi_polygon CW_OG; + typedef bg::model::multi_polygon CW_CG; + + typedef validity_tester_areal tester; + typedef test_valid test; + + // not enough points + test::apply("mpg01", "MULTIPOLYGON()", true); + test::apply("mpg02", "MULTIPOLYGON((()))", false); + test::apply("mpg03", "MULTIPOLYGON(((0 0)),(()))", false); + test::apply("mpg04", "MULTIPOLYGON(((0 0,1 0)))", false); + + // two disjoint polygons + test::apply("mpg05", + "MULTIPOLYGON(((0 0,1 0,1 1,0 1)),((2 2,3 2,3 3,2 3)))", + true); + + // two disjoint polygons with multiple points + test::apply("mpg06", + "MULTIPOLYGON(((0 0,1 0,1 0,1 1,0 1)),((2 2,3 2,3 3,3 3,2 3)))", + AllowDuplicates); + + // two polygons touch at a point + test::apply("mpg07", + "MULTIPOLYGON(((0 0,1 0,1 1,0 1)),((1 1,2 1,2 2,1 2)))", + true); + + // two polygons share a segment at a point + test::apply("mpg08", + "MULTIPOLYGON(((0 0,1.5 0,1.5 1,0 1)),((1 1,2 1,2 2,1 2)))", + false); + + // one polygon inside another and boundaries touching + test::apply("mpg09", + "MULTIPOLYGON(((0 0,10 0,10 10,0 10)),((0 0,9 1,9 2)))", + false); + test::apply("mpg09_2", + "MULTIPOLYGON(((0 0,5 1,10 0,10 10,0 10)),((1 1,9 1,9 2)))", + false); + + // one polygon inside another and boundaries not touching + test::apply("mpg10", + "MULTIPOLYGON(((0 0,10 0,10 10,0 10)),((1 1,9 1,9 2)))", + false); + + // free space is disconnected + test::apply("mpg11", + "MULTIPOLYGON(((0 0,1 0,1 1,0 1)),((1 1,2 1,2 2,1 2)),((0 1,0 2,-1 2,-1 -1)),((1 2,1 3,0 3,0 2)))", + true); + + // multi-polygon with a polygon inside the hole of another polygon + test::apply("mpg12", + "MULTIPOLYGON(((0 0,100 0,100 100,0 100),(1 1,1 99,99 99,99 1)),((2 2,98 2,98 98,2 98)))", + true); + test::apply("mpg13", + "MULTIPOLYGON(((0 0,100 0,100 100,0 100),(1 1,1 99,99 99,99 1)),((1 1,98 2,98 98,2 98)))", + true); + + // test case suggested by Barend Gehrels: take two valid polygons P1 and + // P2 with holes H1 and H2, respectively, and consider P2 to be + // fully inside H1; now invalidate the multi-polygon by + // considering H2 as a hole of P1 and H1 as a hole of P2; this + // should be invalid + // + // first the valid case: + test::apply("mpg14", + "MULTIPOLYGON(((0 0,100 0,100 100,0 100),(1 1,1 99,99 99,99 1)),((2 2,98 2,98 98,2 98),(3 3,3 97,97 97,97 3)))", + true); + // and the invalid case: + test::apply("mpg15", + "MULTIPOLYGON(((0 0,100 0,100 100,0 100),(3 3,3 97,97 97,97 3)),((2 2,98 2,98 98,2 98),(1 1,1 99,99 99,99 1)))", + false); + + test::apply + ("mpg16", + "MULTIPOLYGON(((-1 4,8 -10,-10 10,7 -6,8 -2,\ + -10 10,-10 1,-3 -4,4 1,-1 2,4 3,-8 10,-5 -9,-1 6,-5 0)),\ + ((-10 -3,-8 1,2 -8,-2 6,-4 0,8 -5,-1 5,8 2)),\ + ((-6 -10,1 10,4 -8,-7 -2,2 0,-4 3,-10 9)),\ + ((10 -1,-2 8,-7 3,-6 8,-9 -7,7 -5)),\ + ((7 7,-4 -4,9 -8,-10 -6)))", + false); + + test::apply + ("mpg17", + "MULTIPOLYGON(((-1 4,8 -10,-10 10,7 -6,8 -2,\ + -10 10,-10 1,-3 -4,4 1,-1 2,4 3,-8 10,-5 -9,-1 6,-5 0)),\ + ((-10 -3,-8 1,2 -8,-2 6,-4 0,8 -5,-1 5,8 2)),\ + ((-6 -10,-10 9,-4 3,2 0,-7 -2,4 -8,1 10)),\ + ((10 -1,-2 8,-7 3,-6 8,-9 -7,7 -5)),\ + ((7 7,-10 -6,9 -8,-4 -4)))", + false); + + // test cases coming from buffer + { + std::string wkt = "MULTIPOLYGON(((1.1713032141645456 -0.9370425713316364,5.1713032141645456 4.0629574286683638,4.7808688094430307 4.3753049524455756,4.7808688094430307 4.3753049524455756,0.7808688094430304 -0.6246950475544243,0.7808688094430304 -0.6246950475544243,1.1713032141645456 -0.9370425713316364)))"; + + OG open_mpgn = from_wkt(wkt); + bg::reverse(open_mpgn); + + test::apply("mpg18", open_mpgn, false); + } + { + std::string wkt = "MULTIPOLYGON(((5.2811206375710933 9.9800205994776228,5.2446420208654896 10.0415020265598844,5.1807360092909640 10.1691699739962242,5.1261005500004773 10.3010716408018013,5.0810140527710059 10.4365348863171388,5.0457062680576819 10.5748694208940446,5.0203571162381344 10.7153703234534277,5.0050957707794934 10.8573216336015328,5.0000000000000000 10.9999999999999964,5.0050957707794925 11.1426783663984619,5.0203571162381344 11.2846296765465670,5.0457062680576801 11.4251305791059501,5.0810140527710042 11.5634651136828559,5.1261005500004755 11.6989283591981934,5.1807360092909622 11.8308300260037704,5.2446420208654869 11.9584979734401102,5.3174929343376363 12.0812816349111927,5.3989175181512774 12.1985553330226910,5.4885008512914810 12.3097214678905669,5.5857864376269024 12.4142135623730923,5.6902785321094269 12.5114991487085145,5.8014446669773028 12.6010824818487190,5.9187183650888020 12.6825070656623602,6.0415020265598844 12.7553579791345104,6.1691699739962260 12.8192639907090360,6.3010716408018030 12.8738994499995236,6.4365348863171405 12.9189859472289950,6.5748694208940472 12.9542937319423199,6.7153703234534312 12.9796428837618656,6.8573216336015381 12.9949042292205075,7.0000000000000036 13.0000000000000000,7.1426783663984690 12.9949042292205075,7.2846296765465750 12.9796428837618656,7.4251305791059590 12.9542937319423181,7.5634651136828657 12.9189859472289932,7.6989283591982032 12.8738994499995201,7.8308300260037802 12.8192639907090324,7.9584979734401209 12.7553579791345069,8.0812816349112033 12.6825070656623566,8.1985553330227017 12.6010824818487137,8.3097214678905793 12.5114991487085092,8.4142135623731029 12.4142135623730869,8.5114991487085252 12.3097214678905598,8.6010824818487297 12.1985553330226821,8.6825070656623708 12.0812816349111838,8.7553579791345193 11.9584979734400996,8.8192639907090431 11.8308300260037580,8.8738994499995290 11.6989283591981810,8.9189859472290003 11.5634651136828417,8.9542937319423235 11.4251305791059359,8.9796428837618691 11.2846296765465510,8.9949042292205093 11.1426783663984441,9.0000000000000000 11.0000000000000000,8.9949042292205075 10.8573216336015346,8.9796428837618656 10.7153703234534294,8.9542937319423181 10.5748694208940464,8.9189859472289950 10.4365348863171405,8.8738994499995236 10.3010716408018030,8.8192639907090360 10.1691699739962278,8.7553579791345122 10.0415020265598862,8.7188787869375428 9.9800200826281831,8.8573216336015381 9.9949042292205075,9.0000000000000036 10.0000000000000000,9.1426783663984690 9.9949042292205075,9.2846296765465759 9.9796428837618656,9.4251305791059590 9.9542937319423181,9.5634651136828648 9.9189859472289932,9.6989283591982041 9.8738994499995201,9.8308300260037793 9.8192639907090324,9.9584979734401209 9.7553579791345069,10.0812816349112033 9.6825070656623566,10.1985553330227017 9.6010824818487137,10.3097214678905793 9.5114991487085092,10.4142135623731029 9.4142135623730869,10.5114991487085252 9.3097214678905598,10.6010824818487297 9.1985553330226821,10.6825070656623708 9.0812816349111838,10.7553579791345193 8.9584979734400996,10.8192639907090431 8.8308300260037580,10.8738994499995290 8.6989283591981810,10.9189859472290003 8.5634651136828417,10.9542937319423235 8.4251305791059359,10.9796428837618691 8.2846296765465510,10.9949042292205093 8.1426783663984441,11.0000000000000000 8.0000000000000000,10.9949042292205075 7.8573216336015355,10.9796428837618656 7.7153703234534294,10.9542937319423181 7.5748694208940464,10.9189859472289950 7.4365348863171405,10.8738994499995236 7.3010716408018030,10.8192639907090360 7.1691699739962269,10.7553579791345122 7.0415020265598862,10.6825070656623620 6.9187183650888047,10.6010824818487208 6.8014446669773063,10.5114991487085163 6.6902785321094296,10.4142135623730958 6.5857864376269051,10.3097214678905704 6.4885008512914837,10.1985553330226946 6.3989175181512792,10.0812816349111962 6.3174929343376380,9.9584979734401138 6.2446420208654887,9.8308300260037740 6.1807360092909640,9.6989283591981970 6.1261005500004764,9.5634651136828595 6.0810140527710050,9.4251305791059536 6.0457062680576810,9.2846296765465706 6.0203571162381344,9.1426783663984654 6.0050957707794925,9.0000000000000018 6.0000000000000000,8.8573216336015363 6.0050957707794925,8.7153703234534312 6.0203571162381344,8.5748694208940481 6.0457062680576810,8.4365348863171423 6.0810140527710050,8.3010716408018048 6.1261005500004764,8.1691699739962278 6.1807360092909622,8.0415020265598880 6.2446420208654878,7.9187183650888064 6.3174929343376363,7.8014446669773072 6.3989175181512783,7.6902785321094314 6.4885008512914819,7.5857864376269060 6.5857864376269033,7.4885008512914846 6.6902785321094278,7.3989175181512810 6.8014446669773045,7.3174929343376389 6.9187183650888029,7.2446420208654896 7.0415020265598844,7.1807360092909640 7.1691699739962251,7.1261005500004773 7.3010716408018013,7.0810140527710059 7.4365348863171379,7.0457062680576819 7.5748694208940437,7.0203571162381344 7.7153703234534268,7.0050957707794934 7.8573216336015328,7.0000000000000000 7.9999999999999973,7.0050957707794925 8.1426783663984619,7.0203571162381344 8.2846296765465670,7.0457062680576801 8.4251305791059501,7.0810140527710042 8.5634651136828559,7.1261005500004755 8.6989283591981934,7.1807360092909622 8.8308300260037704,7.2446420208654869 8.9584979734401102,7.2811219724467575 9.0199799990140797,7.1426783663984654 9.0050957707794925,7.0000000000000009 9.0000000000000000,6.8573216336015363 9.0050957707794925,6.7188786030357956 9.0199806804111571,6.7553579791345184 8.9584979734400996,6.8192639907090431 8.8308300260037580,6.8738994499995290 8.6989283591981810,6.9189859472290003 8.5634651136828417,6.9542937319423235 8.4251305791059359,6.9796428837618683 8.2846296765465510,6.9949042292205084 8.1426783663984441,7.0000000000000000 8.0000000000000000,6.9949042292205075 7.8573216336015355,6.9796428837618656 7.7153703234534294,6.9542937319423190 7.5748694208940464,6.9189859472289950 7.4365348863171405,6.8738994499995236 7.3010716408018030,6.8192639907090369 7.1691699739962269,6.7553579791345113 7.0415020265598862,6.6825070656623620 6.9187183650888047,6.6010824818487208 6.8014446669773063,6.5114991487085163 6.6902785321094296,6.4142135623730949 6.5857864376269051,6.3097214678905704 6.4885008512914837,6.1985553330226946 6.3989175181512792,6.0812816349111953 6.3174929343376380,5.9584979734401138 6.2446420208654887,5.8308300260037731 6.1807360092909640,5.6989283591981970 6.1261005500004764,5.5634651136828603 6.0810140527710050,5.4251305791059536 6.0457062680576810,5.2846296765465715 6.0203571162381344,5.1426783663984654 6.0050957707794925,5.0000000000000009 6.0000000000000000,4.8573216336015363 6.0050957707794925,4.7153703234534312 6.0203571162381344,4.5748694208940481 6.0457062680576810,4.4365348863171423 6.0810140527710050,4.3010716408018048 6.1261005500004764,4.1691699739962287 6.1807360092909622,4.0415020265598880 6.2446420208654878,3.9187183650888064 6.3174929343376363,3.8014446669773077 6.3989175181512783,3.6902785321094314 6.4885008512914819,3.5857864376269064 6.5857864376269033,3.4885008512914846 6.6902785321094278,3.3989175181512805 6.8014446669773045,3.3174929343376389 6.9187183650888029,3.2446420208654896 7.0415020265598844,3.1807360092909640 7.1691699739962251,3.1261005500004773 7.3010716408018013,3.0810140527710059 7.4365348863171379,3.0457062680576819 7.5748694208940437,3.0203571162381349 7.7153703234534268,3.0050957707794934 7.8573216336015328,3.0000000000000000 7.9999999999999973,3.0050957707794925 8.1426783663984619,3.0203571162381344 8.2846296765465670,3.0457062680576801 8.4251305791059501,3.0810140527710042 8.5634651136828559,3.1261005500004755 8.6989283591981934,3.1807360092909618 8.8308300260037704,3.2446420208654869 8.9584979734401102,3.3174929343376358 9.0812816349111927,3.3989175181512770 9.1985553330226910,3.4885008512914810 9.3097214678905669,3.5857864376269024 9.4142135623730923,3.6902785321094269 9.5114991487085145,3.8014446669773028 9.6010824818487190,3.9187183650888020 9.6825070656623602,4.0415020265598844 9.7553579791345104,4.1691699739962260 9.8192639907090360,4.3010716408018030 9.8738994499995236,4.4365348863171405 9.9189859472289950,4.5748694208940472 9.9542937319423199,4.7153703234534312 9.9796428837618656,4.8573216336015381 9.9949042292205075,5.0000000000000036 10.0000000000000000,5.1426783663984690 9.9949042292205075)))"; + + OG open_mpgn = from_wkt(wkt); + bg::reverse(open_mpgn); + + // polygon has a self-touching point + test::apply("mpg19", open_mpgn, false); + } + { + std::string wkt = "MULTIPOLYGON(((-1.1713032141645421 0.9370425713316406,-1.2278293047051545 0.8616467945203863,-1.2795097139219473 0.7828504914601357,-1.3261404828502752 0.7009646351604617,-1.3675375811487496 0.6163123916860891,-1.4035376333829217 0.5292278447680804,-1.4339985637934827 0.4400546773279756,-1.4588001570043776 0.3491448151183161,-1.4778445324579732 0.2568570378324778,-1.4910565307049013 0.1635555631651331,-1.4983840100240693 0.0696086094114048,-1.4997980522022116 -0.0246130577225216,-1.4952930766608652 -0.1187375883622537,-1.4848868624803642 -0.2123935159867641,-1.4686204782339323 -0.3052112234370423,-1.4465581199087858 -0.3968244016261590,-1.4187868575539013 -0.4868714951938814,-1.3854162916543107 -0.5749971294005020,-1.3465781205880585 -0.6608535126285795,-1.3024256208728704 -0.7441018089575634,-1.2531330422537639 -0.8244134753943718,-1.1988949200189114 -0.9014715584824893,-1.1399253072577331 -0.9749719451724563,-1.0764569300911435 -1.0446245630171400,-1.0087402692078766 -1.1101545249551616,-0.9370425713316382 -1.1713032141645441,-0.8616467945203836 -1.2278293047051563,-0.7828504914601331 -1.2795097139219491,-0.7009646351604588 -1.3261404828502767,-0.6163123916860862 -1.3675375811487509,-0.5292278447680773 -1.4035376333829228,-0.4400546773279725 -1.4339985637934838,-0.3491448151183129 -1.4588001570043785,-0.2568570378324746 -1.4778445324579736,-0.1635555631651299 -1.4910565307049017,-0.0696086094114016 -1.4983840100240695,0.0246130577225248 -1.4997980522022114,0.1187375883622569 -1.4952930766608650,0.2123935159867673 -1.4848868624803639,0.3052112234370455 -1.4686204782339316,0.3968244016261621 -1.4465581199087849,0.4868714951938845 -1.4187868575539002,0.5749971294005050 -1.3854162916543096,0.6608535126285824 -1.3465781205880569,0.7441018089575662 -1.3024256208728686,0.8244134753943745 -1.2531330422537621,0.9014715584824917 -1.1988949200189096,0.9749719451724583 -1.1399253072577313,1.0446245630171418 -1.0764569300911420,1.1101545249551634 -1.0087402692078746,1.1713032141645456 -0.9370425713316364,5.1713032141645456 4.0629574286683638,5.1713032141645439 4.0629574286683621,5.2278293047051561 4.1383532054796159,5.2795097139219491 4.2171495085398671,5.3261404828502767 4.2990353648395407,5.3675375811487509 4.3836876083139131,5.4035376333829230 4.4707721552319217,5.4339985637934838 4.5599453226720268,5.4588001570043785 4.6508551848816859,5.4778445324579739 4.7431429621675241,5.4910565307049017 4.8364444368348689,5.4983840100240693 4.9303913905885972,5.4997980522022116 5.0246130577225232,5.4952930766608645 5.1187375883622552,5.4848868624803639 5.2123935159867658,5.4686204782339320 5.3052112234370439,5.4465581199087856 5.3968244016261604,5.4187868575539007 5.4868714951938822,5.3854162916543107 5.5749971294005025,5.3465781205880578 5.6608535126285799,5.3024256208728699 5.7441018089575637,5.2531330422537632 5.8244134753943726,5.1988949200189110 5.9014715584824895,5.1399253072577329 5.9749719451724559,5.0764569300911440 6.0446245630171394,5.0087402692078768 6.1101545249551616,4.9370425713316379 6.1713032141645439,4.8616467945203841 6.2278293047051561,4.7828504914601337 6.2795097139219482,4.7009646351604593 6.3261404828502759,4.6163123916860869 6.3675375811487509,4.5292278447680783 6.4035376333829230,4.4400546773279732 6.4339985637934838,4.3491448151183141 6.4588001570043785,4.2568570378324750 6.4778445324579739,4.1635555631651311 6.4910565307049017,4.0696086094114028 6.4983840100240693,3.9753869422774759 6.4997980522022116,3.8812624116377439 6.4952930766608645,3.7876064840132333 6.4848868624803639,3.6947887765629552 6.4686204782339320,3.6031755983738387 6.4465581199087847,3.5131285048061165 6.4187868575539007,3.4250028705994957 6.3854162916543098,3.3391464873714183 6.3465781205880578,3.2558981910424345 6.3024256208728691,3.1755865246056261 6.2531330422537623,3.0985284415175087 6.1988949200189101,3.0250280548275423 6.1399253072577320,2.9553754369828584 6.0764569300911422,2.8898454750448366 6.0087402692078751,2.8286967858354544 5.9370425713316362,-1.1713032141645456 0.9370425713316364,-1.1713032141645421 0.9370425713316406)))"; + + OG open_mpgn = from_wkt(wkt); + bg::reverse(open_mpgn); + + // polygon contains a spike + test::apply("mpg20", open_mpgn, false); + } + + // Interior ring touches exterior ring, which at that same point touches another exterior ring in (1 2) + test::apply + ("mpg21", + "MULTIPOLYGON(((2 3,1 2,1 0,2 0,2 1,4 3),(2 2,1.5 1.5,1 2)),((0 3,0 2,1 2)))", + true); + + // Two interior rings touch each other in (10 5) + test::apply + ("mpg22", + "MULTIPOLYGON(((10 5,5 10,0 5,5 0),(10 5,5 4,4 6)),((10 5,10 0,20 0,20 10,10 10),(10 5,18 8,15 3)))", + true); + + // Two polygons, one inside interior of other one, touching all at same point (0,0) + test::apply + ("mpg23", + "MULTIPOLYGON(((0 0,10 0,10 10,0 10),(0 0,1 9,9 9,9 1)),((0 0,8 2,8 8,2 8)))", + true); + + test::apply + ("ticket_12503", + "MULTIPOLYGON(((15 20,12 23,15 17,15 20)),((36 25,35 25,34 24,34 23,35 23,36 25)),((15 15,10 13,11 23,12 23,12 25,10 25,7 24,8 6,15 15)),((12 29,11 30,12 30,11 31,13 31,13 34,6 38,6 32,8 31,12 27,12 29)),((9 26,6 31,7 26,7 24,9 26)),((15 48,15 45,18 44,15 48)),((38 39,18 44,26 34,38 39)),((15 45,13 34,15 33,15 45)),((17 32,15 33,15 32,17 32)),((21 31,16 38,18 32,17 32,19 30,21 31)),((15 32,13 31,13 30,15 29,15 32)),((17 29,15 29,15 28,17 29)),((15 28,13 30,12 29,14 27,15 28)),((26 27,28 30,31 27,26 34,21 31,22 29,19 30,18 30,17 29,19 29,19 28,23 28,24 27,25 27,24 26,25 24,30 24,26 27)),((17 26,15 28,15 26,17 26)),((32 26,34 27,31 27,27 27,32 26)),((19 26,17 26,19 25,19 26)),((35 23,33 18,41 15,35 23)),((24 26,24 27,19 26,20 25,23 24,24 26)),((32 13,49 1,48 4,46 5,33 15,32 13)),((33 25,32 26,32 25,31 24,32 23,33 25)),((42 15,43 22,44 22,44 23,43 23,35 23,42 15)),((44 42,38 39,40 39,39 34,34 27,33 25,35 25,38 31,36 25,43 23,44 42)),((48 46,44 23,48 22,48 46)),((15 3,23 2,18 11,15 3)),((30 19,28 20,27 21,25 24,23 24,22 23,26 20,29 17,30 19)),((24 19,21 21,21 20,22 19,24 19)),((31 24,30 24,27 21,31 22,30 19,31 19,34 23,31 23,31 24)),((21 20,20 21,21 18,21 20)),((14 26,12 26,12 25,15 25,15 20,17 17,20 21,21 21,22 23,20 24,19 25,16 25,15 26,14 27,14 26),(17 24,20 22,20 21,17 24)),((23 18,22 19,22 17,23 18)),((28 13,31 10,32 13,30 15,28 13)),((18 17,17 17,16 16,18 17)),((16 16,15 17,15 15,16 16)),((30 17,29 17,29 16,30 15,30 17)),((33 18,31 19,30 17,33 15,33 18)),((42 13,47 7,48 4,48 22,44 22,43 14,42 13)),((42 15,41 15,42 14,43 14,42 15)),((24 2,49 1,27 11,23 13,25 6,27 10,24 2)),((29 16,24 19,23 18,28 13,29 16)),((17 13,16 15,15 15,15 11,17 13)),((20 14,23 13,22 17,20 15,21 17,21 18,18 17,19 15,17 13,18 11,20 14)),((5 3,15 3,15 11,8 5,8 6,5 3)))", + true); + + // MySQL report 12.06.2015 + { + std::string wkt = "MULTIPOLYGON(" + "((-40.314872143936725 -85.6567579487603,-53.1473643859603 -98.48925019078388,-41.29168745244485 -90.56754012573627,-40.314872143936725 -85.6567579487603))," + "((-186.91433298215597 -88.80210078879976,-192.54783347494038 -75.53420159905284,-192.7944062150986 -78.03769664281869,-186.91433298215597 -88.80210078879976))," + "((170.89089207158912 -44.35600339378721,191.8949969913326 -31.3460752560506,169.32805525181837 -43.07341636227523,170.89089207158912 -44.35600339378721))," + "((-2.6035109435630504 -13.058121512403435,26.839412016794036 43.97610638055074,26.974733141577826 43.72289807427111,26.97470368529088 43.722907009738066,-2.6035109435630504 -13.058121512403435))" + ")"; + + std::string msg; + CG mpoly = from_wkt(wkt); + BOOST_CHECK_MESSAGE(! bg::is_valid(mpoly, msg), msg); + BOOST_CHECK_MESSAGE(bg::is_valid(mpoly[0], msg), msg); + BOOST_CHECK_MESSAGE(bg::is_valid(mpoly[1], msg), msg); + BOOST_CHECK_MESSAGE(bg::is_valid(mpoly[2], msg), msg); + BOOST_CHECK_MESSAGE(! bg::is_valid(mpoly[3], msg), msg); + + // The last Polygon has wrong orientation, so correct it + bg::reverse(mpoly[3]); + BOOST_CHECK_MESSAGE(bg::is_valid(mpoly, msg), msg); + BOOST_CHECK_MESSAGE(bg::is_valid(mpoly[0], msg), msg); + BOOST_CHECK_MESSAGE(bg::is_valid(mpoly[1], msg), msg); + BOOST_CHECK_MESSAGE(bg::is_valid(mpoly[2], msg), msg); + BOOST_CHECK_MESSAGE(bg::is_valid(mpoly[3], msg), msg); + } + + // MySQL report 30.06.2015 +#ifdef BOOST_GEOMETRY_TEST_FAILURES + { + std::string wkt = "MULTIPOLYGON(((153.60036248974487 -86.4072234353084,134.8924761503673 -92.0821987136617,151.87887755950274 -92.0821987136617,153.60036248974487 -86.4072234353084)),((-162.3619975827558 -20.37135271519032,-170.42498886764488 -34.35970444494861,-168.21072335866987 -37.67358696575207,-162.3619975827558 -20.37135271519032)),((25.982352329146433 -1.793573272167862,25.81900562736861 -2.0992322130216032,24.216310496207715 -2.737558757030656,25.9822948153016 -1.7936204725604972,25.982352329146433 -1.793573272167862)))"; + + std::string msg; + CG mpoly = from_wkt(wkt); + bg::correct(mpoly); + + BOOST_CHECK_MESSAGE(bg::is_valid(mpoly, msg), msg); + BOOST_CHECK_MESSAGE(bg::is_valid(mpoly[2], msg), msg); + } + { + std::string wkt = "MULTIPOLYGON((" + "(176.37937452790632 33.81070321484654,165.31874654406195 30.429623478264823,164.22653456196667 40.57205841516082,169.96584109309163 43.760662373477935,169.96717084197783 43.76157019827226,169.96831223949295 43.76270579928938,169.96922682269394 43.76403090891733,169.96988377185227 43.76550087346144,169.97026094902066 43.767066157889666,169.97034564404004 43.768674015069664,169.97013500284808 43.77027026324768,169.96963612365553 43.77180111187144,169.9688658177501 43.773214974230235,169.9678500429876 43.77446420582984,169.96662302906125 43.775506709921984,169.96522612402566 43.77630735608547,169.96370640094523 43.77683916405498,169.96211507162087 43.777084212905194,169.96050576084875 43.777034244952155,163.96123663641703 43.03565247280777,161.69252016076334 64.10327452950632,161.69220086043657 64.10485513588213,161.69159759286657 64.10635057476519,161.6907307489143 64.1077102992874,161.68962962850455 64.10888834981994,161.68833145026844 64.10984490744038,161.6868800935278 64.11054763983988,161.68532461514377 64.11097279417753,161.68371759136113 64.11110599994278,161.68211334069463 64.1109427546887,161.68056608792585 64.11048857621772,161.67912813126807 64.10975881607614,127.83620579794024 42.81253476817878,91.03182023020634 47.701488147167275,136.39039242955064 83.14688773021612,136.39163693720113 83.14807413530517,136.39262607583518 83.14948053535137,136.39332183340986 83.15105288318968,136.39369747235173 83.15273075437446,136.3937385570669 83.15444966925705,136.39344350869288 83.15614357090246,136.39282366577314 83.15774736362043,136.39190284852347 83.15919941455623,136.39071644343446 83.1604439222067,136.38931004338824 83.16143306084076,136.38773769554993 83.16212881841544,136.38605982436513 83.16250445735731,136.38434090948257 83.16254554207251,136.38264700783714 83.16225049369845,136.38104321511918 83.1616306507787,136.37959116418338 83.16070983352907,91.00745759860087 47.70471273777429,-11.691678619246499 61.34689554994591,-33.79755445921219 85.09421525362518,-33.7987816906185 85.09530774427819,-33.80019114476049 85.09615218005024,-33.80173336063651 85.09671892773947,-33.80335421832898 85.0969880988603,-33.8049968381973 85.09695024757627,-33.80660357691587 85.09660670217643,-33.808118050311506 85.09596951846243,-33.80948711201435 85.09506105668265,-33.81066271848674 85.0939131968595,-33.81160361498191 85.09256622004571,-33.812276783268395 85.09106739476917,-33.81265860031601 85.08946931827111,-33.812735667282574 85.08782807074738,-32.830674277011205 64.15491927762633,-166.9120300852194 81.96578933819151,-166.91372994506622 81.96584876974394,-166.9154093128506 81.96557899307163,-166.91700503326308 81.96499015355748,-166.91845709668723 81.96410439545254,-166.91971089595725 81.96295502910593,-166.92071927994778 81.96158527827609,-166.92144432676722 81.96004665463211,-166.9218587698712 81.95839702057518,-166.92194702346433 81.95669841323047,-166.9217057686293 81.95501471144192,-135.70224400417752 -45.9322191166313,-138.57126185553517 -49.74180297177792,-161.44988958707904 -54.37476978072864,-161.45143808151082 -54.37523543008462,-161.45287478035848 -54.37597742789392,-161.45415085337137 -54.37697055527431,-161.4552229296195 -54.37818105799885,-161.45605457157663 -54.3795677937282,-161.45661751355206 -54.381083630348755,-161.4568926223796 -54.382677047890056,-161.4568705477121 -54.384293889575865,-161.45655203981923 -54.38587920249453,-161.4559479240874 -54.38737910532821,-161.45507873308873 -54.388742619660995,-161.45397400872366 -54.38992340262376,-161.4526712981565 -54.39088132198683,-161.45121487766946 -54.391583820166765,-161.44965424780858 -54.39200702078731,-161.44804245096856 -54.392136540185234,-141.89488089543744 -54.15502243957519,-153.27347396169714 -69.26392265746459,-153.2743589702193 -69.26537072588309,-153.2749485381606 -69.26696212522691,-153.2752205928412 -69.26863727551263,-153.27516494887718 -69.27033346122717,-153.27478368950827 -69.27198717931759,-153.27409108860425 -69.27353651666519,-153.27311307626903 -69.27492346803459,-153.2718862680504 -69.27609610771653,-153.27045659410012 -69.27701053356093,-153.268877579607 -69.27763251061793,-153.2672083408813 -69.27793875285136,-153.26551137211467 -69.27791779493838,-153.26385020567662 -69.27757042151681,-107.17294666067983 -54.86628398298008,-106.1185414985015 -57.820838687964276,-161.49299710582102 -75.80397143603332,-161.49452500826962 -75.80463385281091,-161.49590016714416 -75.80557311845463,-161.4970730084222 -75.80675537274882,-161.49800125156384 -75.8081379958174,-161.49865143371088 -75.80967114455622,-161.4990001160121 -75.81129954946056,-161.4990347285859 -75.81296450707245,-161.49875402366052 -75.81460599622092,-161.49816812055553 -75.81616484176531,-161.49729814088408 -75.81758484783957,-161.4961754471254 -75.81881482369457,-161.49484051201802 -75.81981042910776,-161.49334145953082 -75.82053577283341,-161.49173233000997 -75.82096470647024,-161.49007113204223 -75.82108176710256,-100.22898834625123 -74.30605444452195,-100.22734583448315 -74.30585777708335,-100.22576946346221 -74.30535620216963,-100.22431530761126 -74.30456756172502,-100.22303509393429 -74.30351990914377,-100.22197436199151 -74.30225051135928,-100.22117084397333 -74.30080452319054,-100.22065312249669 -74.299233381102,-100.22043961386883 -74.29759297351377,-100.2205379129852 -74.2959416527474,-100.220944523165 -74.29433815932634,-106.0959583598649 -57.83192845601232,-92.94623645293606 -53.56150642974892,0.5168968571681063 -52.42819495175221,42.552398940491486 -80.15392826171708,42.553823957605765 -80.15468988561345,42.55536450400553 -80.15517718585528,42.55696829838054 -80.15537362500162,42.55858091298275 -80.15527253652432,42.56014762073331 -80.15487735104905,42.56161525248782 -80.15420147993068,42.56293400143029 -80.15326786011391,42.56405911336014 -80.15210817572546,42.564952405509295 -80.15076178281409,42.56558356234557 -80.14927437372997,42.56593116438665 -80.14769642646958,42.56598341511011 -80.14608149161101,42.565738541290365 -80.14448437497535,42.5652048531764 -80.1429592776891,42.56440046246796 -80.14155795676808,22.856549024752262 -52.14358082479128,22.85544171929926 -52.14229333196901,22.854107064023683 -52.14124335176489,22.852595089554377 -52.14047024353326,22.850962473473096 -52.14000298785936,22.849270415709668 -52.13985910019877,0.5220842171561202 -52.41060241052812,-8.41778896463083 -46.51405003506674,2.082503817262605 -45.5265842190059,82.16974873985578 -55.61946094607285,82.17129108418781 -55.61951844683097,82.17281962817947 -55.61930470483393,82.17428704023979 -55.6188263386343,82.17564788173712 -55.61809816091227,82.17686001401307 -55.61714271979877,82.17788590321227 -55.61598960066932,87.42894995498656 -48.54817950299798,90.86025690382013 -48.842320647346625,90.86187779422266 -48.842309257891365,90.86346890919046 -48.841999792907956,90.8649759064788 -48.84140282172809,90.86634731676145 -48.84053873304434,90.86753630149138 -48.839437038563695,90.86850225260417 -48.838135365077605,90.86921217942799 -48.836678169372995,90.86964183543259 -48.83511521987464,90.8697765463347 -48.83349989687612,90.8696117112771 -48.831887369412634,90.86915295996427 -48.83033271104191,90.86841596038786 -48.82888901888599,90.8674258837091 -48.827605600175325,88.83971158165615 -46.64932716144001,92.40269805720794 -41.853630224309256,126.8456757419591 -63.47440298320586,126.84713519537095 -63.47513926788542,126.84870592800237 -63.475591947011644,126.85033338098 -63.4757452969263,126.85196102526822 -63.47559399107129,126.8535323251863 -63.47514328500498,126.85499270215635 -63.47440883385204,126.85629143047208 -63.47341614852797,126.85738339923923 -63.472199709625954,126.85823067928733 -63.47080176974498,126.85880384062692 -63.46927088585993,126.8590829746903 -63.46766023271123,126.85905838584898 -63.466025755798086,126.85873092818818 -63.46442422813017,126.85811197584037 -63.46291127823613,126.85722302790863 -63.461539457925234,126.85609496170247 -63.46035641691782,97.38483049679773 -37.827161184361024,99.87187230030216 -36.330501626203954,171.77091226660818 -29.569125763297997,171.77242885150693 -29.568846999536735,171.7738731802143 -29.568306949932698,171.77520061136264 -29.567522306359965,171.7763701166585 -29.566517320612498,171.777345548987 -29.565323054828713,171.77809675964784 -29.56397642142174,171.77860053019282 -29.562519042189095,171.77884129006245 -29.56099596186458,171.77881159784133 -29.559454255873884,165.32871350322802 30.33706888582541,176.38762884933539 33.794883447557986,176.38920864287232 33.79555326659214,176.3906277904606 33.79651785214075,176.39183197552205 33.79774028557272,176.39277510897307 33.799173779364644,176.39342109324193 33.80076346785056,176.3937452038706 33.80244850715521,176.39373503582075 33.80416440393784,176.3933909782652 33.80584548381587,176.39272619969265 33.80742740499197,176.39176614389606 33.80884962087758,176.39054755613435 33.810057697458305,176.38911707674143 33.811005396706115,176.3875294560099 33.81165644629765,176.38584545867357 33.81198592790426,176.38412953819284 33.81198123091831,176.3824473698573 33.81164253511265,176.38239992262746 33.811606862577534,176.38239393445264 33.81162601425782,176.37937452790632 33.81070321484654)," + "(31.940896057402718 -11.516674682385004,31.735090184010808 -11.433768531594366,34.28637780994461 -10.636047228893936,31.940896057402718 -11.516674682385004)," + "(30.28283959927952 -10.848748755534567,-3.4172969820295727 2.7269017301769836,-13.569154489871252 9.18584944133385,-12.274858999116972 9.628378040430327,21.92730276845213 2.385649455001494,38.84218041215776 -8.23228345814529,30.28283959927952 -10.848748755534567)," + "(-3.506381078742539 2.7627880702187406,-16.750651901766318 8.098065902036172,-13.590409501346059 9.178582205591375,-3.506381078742539 2.7627880702187406)," + "(31.709407405831065 -11.423422566994818,30.308715440626955 -10.859172493055892,38.861820878026606 -8.244612297573639,39.53325186684806 -8.666087271928937,34.579078645088416 -10.526151567651766,31.709407405831065 -11.423422566994818)," + "(31.96495469130859 -11.526366382128769,34.5846215239078 -10.542808015164859,39.883544951634676 -8.885975497800693,42.787058225913796 -10.708574699971027,37.770908594399415 -13.865217464656103,31.96495469130859 -11.526366382128769)," + "(48.77877229519879 -5.194821637047497,38.86437999888012 -8.225507106217272,21.97711163867511 2.3751018026608763,48.385785409894076 -3.2172657509225715,49.85165664674822 -4.7920077720156655,48.77877229519879 -5.194821637047497)," + "(52.035281286546805 -3.9721613339210506,48.39482899889053 -3.201249949645277,24.68775090776513 22.266150556743217,27.256969910296846 23.144584341056124,56.359252044298216 -2.1676440520591687,55.64595593834196 -2.6165186152963713,52.035281286546805 -3.9721613339210506)," + "(21.0523618078348 -15.604823171775074,20.044774220126357 -15.088996753249816,23.066991360577624 -14.144024584675869,23.763240995171685 -14.58700084866993,21.0523618078348 -15.604823171775074)," + "(49.86941225561311 -4.785336300805852,48.41562983381898 -3.2235856816187862,52.00474175020747 -3.9836250990190427,49.86941225561311 -4.785336300805852)," + "(56.52330868895917 -2.287118069864981,56.3885724075448 -2.1699191303695926,106.52503218338835 29.380766897799347,127.67871416131852 24.428460971650335,56.52330868895917 -2.287118069864981)," + "(23.783784057718577 -14.579279673235199,23.088894501216046 -14.137168734379976,31.708657690867156 -11.442032284077861,31.91659602271336 -11.525797467311321,23.783784057718577 -14.579279673235199)," + "(39.55390791690693 -8.65834200124904,38.88402046337834 -8.237835944785246,48.51602741760274 -5.293470218105426,39.55390791690693 -8.65834200124904),(56.50463609360271 -2.2941260112243,55.727564043439656 -2.5858892138401472,56.373071028355454 -2.1796740901332754,56.50463609360271 -2.2941260112243),(21.03014957321752 -15.613158799416311,10.569260752810493 -19.54075189827794,-2.9464639789869125 -22.277697151591028,20.02087042017853 -15.096466397529603,21.03014957321752 -15.613158799416311)," + "(52.47436796255111 -4.065143439019163,52.0671665340097 -3.978913434571549,55.572196226218196 -2.6629353253941694,54.16542157313718 -3.5482133364501145,52.47436796255111 -4.065143439019163)," + "(18.686422690099135 -14.3935995357972,-39.497151641780675 15.393047282556093,-15.306368432221959 10.270345844048258,-13.609365014952653 9.190640067582622,-16.778642869828406 8.10704200262427,-16.78013527405983 8.106370378455987,-16.78147692731812 8.10543319333665,-16.78262111907359 8.104263075974965,-16.78352801354702 8.10290076476696,-16.784166036618227 8.101393689462272,-16.78451297509954 8.099794319866595,-16.784556750102364 8.098158339071315,-16.784295837571545 8.09654270481052,-16.783739321346324 8.095003666440478,-16.782906576900587 8.093594806581768,-16.78182659677314 8.092365175605535,-16.780536981173654 8.091357583912956,-16.779082628906927 8.090607111463319,-3.4253378182903305 2.711229144049957,21.910296697427533 -13.408098481443034,18.686422690099135 -14.3935995357972)," + "(49.92455499029387 -4.844573589537546,49.88232772450034 -4.7992107915072495,52.03662700043225 -3.990377200254404,52.43970998904547 -4.075735073446003,49.92455499029387 -4.844573589537546)," + "(56.98298842344176 -2.6869329990186017,56.53834480149721 -2.3001960061283953,127.709423817281 24.421271512588014,132.92279324817048 23.20076594437462,122.22155101611108 17.25548653666155,56.98298842344176 -2.6869329990186017)," + "(21.93236247547395 -13.401346106262679,-3.336253671995941 2.6753427840349797,30.256146438987056 -10.856907501734277,21.93236247547395 -13.401346106262679)," + "(56.963208077106145 -2.6929774535282007,54.22943361944536 -3.5286570687708547,55.65380423765296 -2.6323059828796573,56.51967220394539 -2.3072039455782374,56.963208077106145 -2.6929774535282007)," + "(49.905901657492095 -4.850280677454471,49.047142136266274 -5.112798684502387,49.86457211628575 -4.805882263415661,49.905901657492095 -4.850280677454471)," + "(18.66231459031522 -14.40096459040753,-15.242813984693981 -24.76524114901455,-41.871025640976086 15.895732417477603,-39.56283173369286 15.406955864944898,18.66231459031522 -14.40096459040753)," + "(54.16010295741377 -4.422118945281966,57.68433962274301 -3.3201949186482835,60.493211425450355 -5.763234012884148,54.16010295741377 -4.422118945281966)," + "(50.57482090609503 -5.543124178834603,51.410616916152094 -5.2818015712411075,50.73017482548689 -5.7100012259218005,50.57482090609503 -5.543124178834603)," + "(57.7040033134621 -3.3140490007641716,120.5880728282652 16.347976841903872,68.42035360394682 -12.634786014512635,63.952222521971656 -8.748552923366702,69.34888739490755 -7.655727627757562,69.35052190979452 -7.65522664740267,69.35202819378684 -7.654418112452161,69.35334902179036 -7.65333273988165,69.35443421435205 -7.652011763978858,69.3552425440229 -7.650505369815648,69.35574330162603 -7.648870786671658,69.35591746292623 -7.647170113842091,69.35575841137785 -7.645467961429212,69.35527218949336 -7.643828995745994,69.35447726928288 -7.642315482584282,69.35340385048569 -7.640984921680917,69.35209271325485 -7.639887862250621,69.35059366888214 -7.639065982575512,69.348963667422 -7.638550506609389,60.528528122163166 -5.770712765907017,57.7040033134621 -3.3140490007641716)," + "(39.90557971777995 -8.879095683641047,50.55626153776256 -5.548932208433719,50.71506487635533 -5.719509860218734,42.803538516251564 -10.698203715094458,39.90557971777995 -8.879095683641047)," + "(54.125906762225966 -4.432808367053374,60.520474886872016 -5.78693828698986,63.91384251004383 -8.738419975604259,55.19312990789962 -10.504359876990208,50.74233508921979 -5.723075090472591,51.47603824555935 -5.261358446995118,54.125906762225966 -4.432808367053374)," + "(-39.55690832500143 15.42363240349549,-42.57305175099324 16.967718229775315,-54.529804271814804 35.22554209214185,-30.764086064128595 20.105022802970012,-30.710857834915476 18.970448449090075,-30.710636768905257 18.968861050497278,-30.71013054093483 18.96734038034394,-30.709356054150412 18.965937214390088,-30.70833916896296 18.964698404885425,-30.707113839559156 18.963665316154746,-30.70572098015804 18.962872443427244,-30.70420709886957 18.962346261027584,-30.70262274477097 18.962104338388023,-30.70102082005363 18.962154753398345,-29.249644048343924 19.141511936326765,-15.348629077210006 10.297225959678553,-39.55690832500143 15.42363240349549)," + "(21.884178079339662 2.412712542801014,-12.242463797063095 9.639454184544832,2.3975468904970114 14.644975309050857,21.884178079339662 2.412712542801014)," + "(-15.299650033147174 10.286854033424495,-29.22228439323044 19.144892967884317,-8.792850447899582 21.669506695125158,2.3784269745719975 14.656976960749958,-12.275968322130971 9.646537638677753,-15.299650033147174 10.286854033424495)," + "(21.933986962464473 2.402164887728272,2.4189169499386907 14.652281880490598,24.669574614144935 22.25993595597394,48.36498457496562 -3.1949300189490657,21.933986962464473 2.402164887728272)," + "(-39.62258841691361 15.437540985884295,-41.88466302451252 15.91655654561091,-42.55362818185854 16.938058662646,-39.62258841691361 15.437540985884295)," + "(54.12505697116883 -4.414697518592483,53.149660304654546 -4.208154364528738,54.17278878474252 -3.5643034507215816,56.978802584973195 -2.7065410644301977,57.66879568091532 -3.3066752884918813,54.12505697116883 -4.414697518592483)," + "(52.5097940270921 -4.072645352049953,54.108776779744645 -3.583859692404417,53.12503062771869 -4.202927454922124,52.5097940270921 -4.072645352049953)," + "(43.28546691270277 -26.986883767640755,42.97679823939298 -26.79048854796605,56.466941170357856 -19.295797633524103,64.08900802970163 -24.08037950217483,45.2669261914462 -28.001268064806617,43.28546691270277 -26.986883767640755)," + "(43.11812854048746 -26.90121622441705,42.940870464815944 -26.810470368231712,42.959363702902145 -26.800187467000804,43.11812854048746 -26.90121622441705)," + "(20.022491497341747 -15.077589291279075,18.708847193281812 -14.40507958111042,21.92976181239232 -13.420482809530107,23.04762685262098 -14.13170426598196,20.022491497341747 -15.077589291279075)," + "(21.073463079609297 -15.61562579933674,23.781749745311217 -14.598776706897553,26.48393818926334 -16.317995334865266,23.590120811873746 -16.904008626322792,21.073463079609297 -15.61562579933674)," + "(9.350288473315587 38.74248379268954,-6.585012056625516 55.86103593692023,70.2680521039453 37.868910337863355,40.90146758060325 27.828271548502038,24.262734733742946 25.772111264832496,9.350288473315587 38.74248379268954)," + "(73.09089007444824 -29.731095597924465,85.69919539743492 -37.64566996857491,80.88024981899486 -38.09884440280534,73.09089007444824 -29.731095597924465)," + "(73.04450471090416 -29.681265947851927,69.3379197794863 -25.699470542214453,79.58321142449617 -22.367138852695543,96.03221445150848 -36.67396648552466,85.72790431968778 -37.64297969856965,73.04450471090416 -29.681265947851927)," + "(9.46387079270287 38.62046756176968,24.239338321979417 25.769211949937343,21.716979498625832 25.45751975956489,9.46387079270287 38.62046756176968)," + "(50.56156943063165 -5.528888731813538,49.937839204058804 -4.858844205801361,52.475136061040715 -4.083236988055326,53.10370484197959 -4.216347691874761,51.46866317625423 -5.24527327754466,50.56156943063165 -5.528888731813538)," + "(9.224408992818482 38.851964794507175,-11.711265479809555 57.06114671556529,-6.615650355906411 55.86820869061986,9.224408992818482 38.851964794507175)," + "(60.55579159384646 -5.794417042185758,69.30386052897589 -7.646930246489353,63.93552683381575 -8.734031540594103,60.55579159384646 -5.794417042185758)," + "(57.688459366105995 -3.3005293657993064,56.99858293272367 -2.7004966111511806,122.14822367585627 17.214748146233596,120.66377698176358 16.39003571587255,57.688459366105995 -3.3005293657993064)," + "(73.03324406984439 -29.694914662490135,80.85821729038376 -38.100921377000205,63.342896321792594 -39.748050882541506,50.75959180753584 -31.74216343806383,67.57943285376581 -26.271427096622276,73.03324406984439 -29.694914662490135)," + "(39.86400285729009 -8.873708408777603,34.87732280230907 -10.432912187499966,39.551916707235804 -8.677803685461726,39.86400285729009 -8.873708408777603)," + "(43.44410013402389 -27.087801782144677,45.239552804641725 -28.00697030328185,44.975318735147916 -28.06201375436441,43.44410013402389 -27.087801782144677)," + "(-15.257389373944136 10.259973914784002,-12.30836353977779 9.635461489231913,-13.588110003575826 9.197907303291592,-15.257389373944136 10.259973914784002)," + "(23.069529991534154 -14.124848414588413,21.951827586412705 -13.413730431788267,30.282022284527198 -10.86733124094458,31.682974917738175 -11.431686321512942,23.069529991534154 -14.124848414588413)," + "(23.80229280523764 -14.591055529795597,31.94065465827722 -11.53548916772298,37.76851162339057 -13.883163606614682,37.770097848105024 -13.883634342409975,37.771744254525196 -13.883798801928782,37.77339225172808 -13.883651132524463,37.774983192179256 -13.883196589331225,37.77646045883184 -13.882451348248843,42.80353701408153 -10.718930933297813,45.567034652447205 -12.45365217013186,26.508719800762194 -16.312970859703256,23.80229280523764 -14.591055529795597)," + "(43.276761579565346 -27.002134145623014,44.95069160862587 -28.067143910504445,38.11630436469161 -29.49083715589638,42.92240688088259 -26.820725087652352,43.276761579565346 -27.002134145623014)," + "(126.75959213687518 -63.39967008039708,92.41319098322936 -41.83950698990248,93.78447601919933 -39.99379341951623,97.3690323884615 -37.83666821790139,126.75959213687518 -63.39967008039708)," + "(72.98685869023261 -29.645084995156807,67.60116781362723 -26.264357693619786,69.31952721664192 -25.70545281408542,72.98685869023261 -29.645084995156807)," + "(39.886037618944634 -8.866828591799006,39.57257275758669 -8.67005841496514,48.78439784949424 -5.211447043733159,49.91918587276122 -4.864551295334174,50.543010064128545 -5.534696763377852,39.886037618944634 -8.866828591799006)," + "(9.337991159717035 38.729948727398885,21.695490271536684 25.454859141680437,-8.788846562680476 21.687676810037537,-31.489294946971892 35.93737116944357,-32.81216829744508 64.1347806843964,-11.700243714994912 61.33035113568702,-6.637054435703233 55.89123580798307,-11.741701242558069 57.08628824654891,-11.743347393206076 57.086512042263855,-11.745006213819227 57.08642142961937,-11.746618193091077 57.08601965940509,-11.748125500179835 57.08532114539797,-11.749474059428762 57.084350947258365,-11.75061549036676 57.0831438714978,-11.751508843390358 57.08174322277196,-11.752122068858302 57.08019925029701,-11.752433166894022 57.07856734512509,-11.752430976646009 57.076906052953085,-11.752115576690887 57.07527497375627,-11.751498282214417 57.07373262359911,-11.750601239071592 57.07233433533203,-11.749456629289176 57.07113027348812,9.337991159717035 38.729948727398885)," + "(19.998587701357646 -15.085058937588059,-3.1132193245213102 -22.311465244718235,-15.089019545185295 -24.73657453178888,18.684739096779687 -14.412444637400831,19.998587701357646 -15.085058937588059)," + "(21.051250846321395 -15.623961427658536,23.562530114275848 -16.909590792795676,10.677531366771717 -19.518827010871995,21.051250846321395 -15.623961427658536)," + "(54.09086078489642 -4.42538694225184,51.53408460058219 -5.224830093565444,53.128334513377965 -4.221574604966094,54.09086078489642 -4.42538694225184)," + "(173.75757156169772 32.99091541934996,165.3267971738516 30.354864191440612,165.32065635283269 30.411888723916427,173.75757156169772 32.99091541934996)," + "(10.465747395220248 -19.57961137948609,-12.894911802992752 -28.350460831776864,-14.505090251111184 -25.891736822767676,-3.10897552967657 -22.328503814897203,10.465747395220248 -19.57961137948609)," + "(-27.610965806972345 -33.8756481721416,-38.00614396293315 -37.7785591589894,-43.02265457370873 -37.34856959661485,-29.167463128681774 -32.849015266607424,-27.610965806972345 -33.8756481721416)," + "(-38.04432250117674 -37.79289279162382,-43.34682819058996 -39.783739126387225,-48.515464191322366 -39.13238742407438,-43.065536969219835 -37.36249587240486,-38.04432250117674 -37.79289279162382)," + "(-43.38210310004821 -39.796974297919405,-78.87353889947534 -53.12237586126752,-78.87504724430607 -53.12311387651708,-78.87638729989119 -53.124125816073466,-78.87750994786981 -53.125374588331766,-78.87837403873353 -53.126814420827664,-78.87894790011936 -53.128392537980105,-78.87921049772773 -53.130051095526014,-78.87915220631305 -53.1317293007423,-78.87877516248726 -53.13336564074071,-78.87809318640446 -53.13490013715957,-78.87713127519739 -53.136276544608954,-78.87592468673323 -53.13744441228774,-78.87451764727265 -53.13836093320586,-78.87296173040167 -53.138992513230576,-78.87131396665488 -53.13931600244487,-78.86963475311974 -53.1393195436839,-8.445695735047487 -46.516657330884335,0.49077562272833575 -52.4109659347568,-92.89011328794561 -53.543280146805785,-48.55468477896229 -39.14512450915579,-43.38210310004821 -39.796974297919405)," + "(-27.590643470202913 -33.86803834336524,-29.146094667189693 -32.84209543970167,-19.625029335662298 -29.750071937783378,-19.62345393418427 -29.749383122488545,-19.62204318480157 -29.748400197004802,-19.620851301821823 -29.747160934607262,-19.61992408863952 -29.745712959454867,-19.619297177537277 -29.7441119164207,-19.61899466035717 -29.742419332690684,-19.619028162664783 -29.74070025330835,-19.61939639698522 -29.739020741530297,-19.620085212280053 -29.73744534005227,-19.621068137763796 -29.73603459066957,-19.622307400161336 -29.734842707689822,-19.62375537531373 -29.73391549450752,-19.6253564183479 -29.733288583405276,-19.627049002077914 -29.73298606622517,-19.628768081460247 -29.733019568532782,-19.6304475932383 -29.73338780285322,-29.164834804336436 -32.82973483928127,-31.586344616113706 -31.2325578835804,-14.522499048949383 -25.897172872851705,-12.911746604589299 -28.356773367533684,-27.590643470202913 -33.86803834336524)," + "(-15.440268307843084 -24.82560063405746,-33.11063724365916 -30.227166517161177,-35.22563117058885 -28.832160994115174,-15.440268307843084 -24.82560063405746)," + "(-110.06713343754421 -53.75156377977681,-133.70536993886762 -54.03818707453698,-134.92982691302475 -49.02232991848598,-110.98866705210969 -44.17423216097226,-107.81630674108442 -53.06352104066732,-110.06713343754421 -53.75156377977681)," + "(-33.13242765496227 -30.23380803484376,-53.47598660261661 -36.452516973556065,-67.09295594277563 -35.28529916770173,-35.25002833910638 -28.837083149550402,-33.13242765496227 -30.23380803484376)," + "(-53.520970953712265 -36.466267226310144,-58.2354762927896 -37.90741924457058,-71.67669094887043 -36.21351002448205,-67.15404194693704 -35.29766922081722,-53.520970953712265 -36.466267226310144)," + "(-58.27645089887022 -37.919936120256196,-107.79952065899286 -53.05836684358259,-110.97130478081613 -44.1706925069293,-71.73052957001556 -36.22440573167339,-58.27645089887022 -37.919936120256196)," + "(-110.1268958664014 -53.769831619846144,-132.12902100408343 -60.495532046101545,-133.70109935980145 -54.05568104535152,-110.1268958664014 -53.769831619846144)," + "(-15.266747577272781 -24.772564602869423,-35.24640100751268 -28.818461646399513,-76.15530720021192 -1.8358005614142456,-86.14108983925057 19.847703882307872,-83.40496813166878 23.48084268412572,-64.0088883758489 6.425625058377867,-64.00760096344138 6.424685804640387,-64.00616485098435 6.4239950012666585,-64.00462744803231 6.423575453351113,-64.00303950798461 6.423441011187763,-64.00145345259266 6.42359611303842,-63.99992164139084 6.4240356386149005,-63.998494643181274 6.424745078112161,-63.99721956663504 6.4257010112121415,-63.996138505120754 6.42687188024526,-63.995287147100356 6.428219031985601,-63.994693597966496 6.429697993687634,-63.99437745221531 6.431259941239379,-63.99434914658464 6.432853310964729,-65.04832015933097 20.80381197052364,-41.89536979911647 15.900886582972497,-15.260289088462184 -24.770575950704515,-15.266747577272781 -24.772564602869423)," + "(-103.34718678997828 -53.67007971050907,-54.4974791531819 -38.39617545176479,-48.5956002477636 -39.13996827390118,-92.94911174811018 -53.54399645486019,-103.34718678997828 -53.67007971050907)," + "(-31.60797852622848 -31.239302626156118,-29.186203265828524 -32.836654666187016,-43.067588267658635 -37.344718300390326,-49.39887467327895 -36.801998383222546,-31.60797852622848 -31.239302626156118)," + "(-49.44306980595738 -36.81581628610981,-43.11047066152018 -37.358644575644625,-48.55637966222821 -39.12723118950323,-54.45715723826972 -38.38357632163891,-49.44306980595738 -36.81581628610981)," + "(-103.40555982520841 -53.68833070320558,-93.00523491310064 -53.562222737803324,-106.10185774557723 -57.815397753737585,-107.15619821197518 -54.861024333167755,-103.40555982520841 -53.68833070320558)," + "(23.61518017648848 -16.91683756790308,26.50528396128093 -16.33157619705981,42.94251839317316 -26.78946994271238,42.92206386339187 -26.800842478829786,23.61518017648848 -16.91683756790308)," + "(45.291790447718896 -28.01400696853263,64.11042508815196 -24.093836502795284,67.31540237012506 -26.10568053911328,51.48947303426359 -31.186856314772136,45.291790447718896 -28.01400696853263)," + "(80.89532917461274 -38.11504345691095,85.72360464810268 -37.66099230023744,91.54967590863684 -41.31818491465435,86.63190829943045 -44.27761401903968,80.89532917461274 -38.11504345691095)," + "(55.207151814658104 -10.519422962708234,63.930538194951616 -8.75294135555174,68.40404830643757 -12.643844730861389,61.009133000867436 -16.752229759599903,55.207151814658104 -10.519422962708234)," + "(67.23698237538382 -23.44253327219278,78.19510992588658 -21.159810385859345,79.41506647143727 -22.220883708516908,69.16366426579913 -25.51226555715126,67.23698237538382 -23.44253327219278)," + "(67.22302522687737 -23.42752227367621,61.02145616510926 -16.765450706696242,68.4181386751373 -12.656083874105,78.17850565684051 -21.14535081755846,67.22302522687737 -23.42752227367621)," + "(96.07462679974704 -36.687606632181144,96.22981908999839 -36.67300010138628,96.16231350114971 -36.76386105410172,96.07462679974704 -36.687606632181144)," + "(78.21666949675688 -21.155319242128968,91.07942965547718 -18.475847420826167,79.43458494021817 -22.214616982017457,78.21666949675688 -21.155319242128968)," + "(78.20006522772039 -21.140859673826085,68.43444397509445 -12.647025156396275,120.67073097659974 16.373831825187075,138.40226861975972 21.917962128038926,139.5590597714433 21.64715021353345,115.5981191196391 -10.603717556458868,91.2383062237693 -18.424837476765795,78.20006522772039 -21.140859673826085)," + "(96.05634598878443 -36.67170655960538,79.60266151961639 -22.360812613230724,92.37994996465073 -18.204936463794787,113.16809212086675 -13.874478509513061,96.24389265779745 -36.65405740641633,96.05634598878443 -36.67170655960538)," + "(45.58859841303463 -12.467188312478434,56.44996967273963 -19.285159155930536,42.959952931426386 -26.779771024798904,26.53006557073263 -16.326551720595333,45.58859841303463 -12.467188312478434)," + "(63.3670170846453 -39.76339728257143,80.8732966434185 -38.11712042833085,86.61655030813772 -44.286856197611016,80.54514164778 -47.94052691203084,75.54588157567393 -47.51198000904026,63.3670170846453 -39.76339728257143)," + "(75.57785867637746 -47.53232486223543,80.5195359645405 -47.95593597773675,78.32209776055991 -49.27831700358555,75.57785867637746 -47.53232486223543)," + "(44.99652318342139 -28.0755150444964,45.2644170651957 -28.01970920611602,51.48470250967003 -31.204123952853422,51.48629912522756 -31.20475275015989,51.48798761440433 -31.205058644898525,51.489703348260264 -31.20502992858282,51.49138065503266 -31.20466770036407,67.3348255051565 -26.117868279807055,67.56007186320271 -26.259277902547574,50.7404020749334 -31.72995854149191,44.99652318342139 -28.0755150444964)," + "(63.338554000982406 -39.76607948751283,75.50811715621062 -47.508744406950505,26.068801349075883 -43.27092792395031,63.338554000982406 -39.76607948751283)," + "(75.54009425476244 -47.5290892587767,78.31727689644644 -49.29602159154496,78.31871625003048 -49.29676048598416,78.32026683409454 -49.297222430561355,78.32187588641662 -49.29739170654002,78.32348865525648 -49.29726255391205,78.32505026241076 -49.29683936739541,78.32650757057118 -49.296136546893635,80.54932723087974 -47.95848139128968,87.408400175649 -48.54642481376636,82.1668571223638 -55.601419868886786,2.1628596589493014 -45.519030305358946,10.670127334892323 -44.719016219466,10.478355937853271 -44.825558445303535,10.477022945408265 -44.82646895355328,10.475879396234872 -44.82760833470957,10.474964026699563 -44.82893799359257,10.474307843855296 -44.830412889591,10.473933075114516 -44.83198306235927,10.473852415322028 -44.83359532416468,10.474068596732254 -44.835195061558494,10.474574296457355 -44.83672808534152,10.475352384521349 -44.838142466158686,10.47637650411764 -44.8393902935441,10.47761196441446 -44.84042929883103,10.47901691566548 -44.841224286952674,10.480543766820137 -44.8417483286331,10.482140797613786 -44.84198367258443,10.483753910530092 -44.84192234681058,10.485328463289965 -44.841566428649095,10.940150803529534 -44.693633216985006,25.970875452212482 -43.28014013939624,75.54009425476244 -47.5290892587767)," + "(44.97189605739587 -28.080645200533002,50.71876939527397 -31.736994677353735,17.512462576017413 -42.53750991301251,15.017806026020082 -42.32364842620168,38.064721701858005 -29.51950096385712,44.97189605739587 -28.080645200533002)," + "(63.31443324277529 -39.750733090438565,25.97083832848871 -43.262530741061205,17.557355750597907 -42.54135463818072,50.737959125026705 -31.74919957485254,63.31443324277529 -39.750733090438565)," + "(85.75231357643165 -37.6583020340463,96.05049525434477 -36.68986655103241,96.15182157912969 -36.77798293714598,93.77244835997257 -39.980558168609235,91.56652005301999 -41.308048394369706,85.75231357643165 -37.6583020340463)," + "(45.61355673842014 -12.462143693709407,55.186990966922515 -10.523510597075763,60.993339532379515 -16.76100411965765,56.46747536013181 -19.27543354028412,45.61355673842014 -12.462143693709407)," + "(64.13520076257863 -24.088675402162217,67.2169128156077 -23.446714026907344,69.14521649458379 -25.51818851852844,67.33723331195878 -26.098671354979363,64.13520076257863 -24.088675402162217)," + "(64.11378371141129 -24.075218400024625,56.48444685596549 -19.286072018869127,61.00566269662134 -16.774225066753985,67.20295566340234 -23.431703029161305,64.11378371141129 -24.075218400024625)," + "(45.591992977695206 -12.448607551276503,42.82001730414031 -10.708559948596815,50.72722514027072 -5.7325837246547025,55.17296905968835 -10.508447510846764,45.591992977695206 -12.448607551276503)," + "(90.83906500907895 -48.82288432501792,87.44124588861607 -48.531629462280534,88.82907600317388 -46.66364240274166,90.83906500907895 -48.82288432501792)," + "(23.58758948005409 -16.922419734971612,42.90360027945853 -26.81109719825043,38.05849031533148 -29.502880586949516,-6.114132515913077 -38.70463297488126,-12.88506814740878 -28.365491980870296,10.5740180759243 -19.557686478564662,23.58758948005409 -16.922419734971612)," + "(-3.2757307439501204 -22.362271881443974,-14.515075742325166 -25.876489092295138,-15.231034498305647 -24.783228289527237,-3.2757307439501204 -22.362271881443974)," + "(-103.408268267121 -53.67082036628739,-107.56298077416507 -53.72117660087794,-107.79361648076426 -53.07491097499442,-58.233960524270685 -37.92529090694332,-54.5393407101279 -38.390899910893495,-103.408268267121 -53.67082036628739)," + "(-31.626870337402607 -31.22684198473644,-49.444973181371616 -36.79804691662782,-53.42912203896892 -36.45653410481242,-33.113427002687885 -30.246340465564593,-31.626870337402607 -31.22684198473644)," + "(-49.48916830524817 -36.811864820269555,-54.49901880228574 -38.378300779876625,-58.192985934280664 -37.912774029229915,-53.47410637084559 -36.47028435921391,-49.48916830524817 -36.811864820269555)," + "(-31.605236430328155 -31.220097240155404,-33.0916365938955 -30.239698946225996,-15.262540010301606 -24.789610509222257,-15.249551258319446 -24.786972494086065,-14.532484538870866 -25.881925144352813,-31.605236430328155 -31.220097240155404)," + "(-103.46664127579638 -53.6890713586619,-107.16209180873788 -54.84450985214174,-107.55674612108137 -53.73864675776175,-103.46664127579638 -53.6890713586619)," + "(-110.00462741884331 -53.750805850432336,-107.81040256225506 -53.08006517376252,-107.58151701429983 -53.72142667015059,-110.00462741884331 -53.750805850432336)," + "(-110.06438982504433 -53.76907369022695,-107.57528236121614 -53.738896827034395,-107.1788402567078 -54.84976950401287,-153.2430747370277 -69.25271687255216,-141.87272856231922 -54.15476717032229,-133.71910155050836 -54.055905624595034,-132.14385744166628 -60.508724794743074,-132.14334419803262 -60.51022379344769,-132.14256964852405 -60.511605997919794,-132.14155906878108 -60.51282630309763,-132.14034543674777 -60.513844887130325,-132.1389683565123 -60.514628510872285,-132.1374727659187 -60.51515160256623,-132.13590747012384 -60.51539709231865,-132.13432354895338 -60.51535696913649,-132.13277269002927 -60.51503254234744,-110.06438982504433 -53.76907369022695)," + "(-27.592871920864 -33.887582518965544,-19.25708965943322 -39.38568922534542,-37.965533667372725 -37.78204018761589,-27.592871920864 -33.887582518965544)," + "(-38.0037121954104 -37.796373821125144,-19.22641600937537 -39.405920919960636,-12.821155357361697 -43.63069616509796,-43.309481338204634 -39.78844570828592,-38.0037121954104 -37.796373821125144)," + "(-43.34475623878629 -39.801680880936765,-12.788017983898143 -43.65255287986782,-8.469056186486533 -46.50124926830628,-78.80591177161446 -53.11570776137347,-43.34475623878629 -39.801680880936765)," + "(-27.572549585136507 -33.87997268950195,-12.901902948535914 -28.37180451734392,-6.125539187747014 -38.71923420248274,-6.124615012752566 -38.72041215386896,-6.1235039573952275 -38.72141575980836,-6.12223839702193 -38.72221577595208,-6.120855209143663 -38.72278889041018,-6.119394698851558 -38.7231184030432,-6.11789942435578 -38.723194712092116,-6.116412956870168 -38.72301559396661,38.006907672851085 -29.531544390670412,14.986494714540797 -42.320976703350695,-19.220444896885056 -39.3888453254074,-27.572549585136507 -33.87997268950195)," + "(163.85356981584565 38.01045640606598,150.78183751989167 33.1026264373484,160.43346758187292 38.46477202131451,163.85356981584565 38.01045640606598)," + "(127.70830325425007 24.439550041637304,106.54590505913245 29.393902120191427,119.4559466211646 37.51814283753344,144.37633145980607 40.59773643801638,160.4042990486444 38.46863420514055,150.67036889056672 33.060765246572494,127.70830325425007 24.439550041637304)," + "(137.87665775262624 22.04101325621122,122.3018982810747 17.280057664991475,132.94821653533805 23.194814080812744,137.87665775262624 22.04101325621122)," + "(137.91007347628613 22.051206470998714,132.97106197457936 23.207481912287477,150.67791335246926 33.044889401030915,163.89246423334544 38.00632192281352,163.89395437188944 38.00704878327708,163.89528110506717 38.00804307603519,163.89639702613067 38.00926927308045,163.89726226105742 38.01068356001573,163.89784589332643 38.0122354016276,163.8981270686255 38.01386934760742,163.89809574001623 38.01552701389832,163.8977530269305 38.01714916887077,163.8971111751712 38.018677849783465,163.8961931193457 38.020058433904424,163.8950316633681 38.02124159028708,163.89366830831162 38.02218504246065,163.892151769495 38.02285507905031,163.8905362357896 38.02322775835002,160.45914599302486 38.479038148184,164.20988616119448 40.562819558817196,165.3016644430351 30.424412023824377,137.91007347628613 22.051206470998714)," + "(138.43525780056368 21.928255201073114,165.3116438348011 30.33174198050335,171.7604175947424 -29.552483202131402,99.90657434057331 -36.30961852717998,149.90557033770168 -6.2210711003068075,149.90688874767233 -6.220099211525472,149.9080034680365 -6.2188991402094,149.90887562498716 -6.217512736621926,149.90947480366685 -6.215988349019058,149.9097801088294 -6.214379137593647,149.90978089352305 -6.212741220612166,149.90947713038307 -6.211131717394169,149.90887941258603 -6.209606756381856,149.9080085844325 -6.20821951776467,149.90689501444066 -6.207018378918731,149.90557753630043 -6.206045227335496,149.90410209462055 -6.205333999873108,149.90252014269552 -6.204909499271364,149.90088684816726 -6.204786529202118,149.89925916915584 -6.204969378018662,113.2096851912215 -13.847909418407404,115.57854716414471 -10.659476291875812,122.98695766373115 -8.24983286863276,122.99248836987037 -8.24805714415804,122.99248165360493 -8.248036225546489,122.99252002096307 -8.24804691580876,122.99409329720051 -8.247358404482963,122.99550225424824 -8.246376525670339,122.99669287690277 -8.24513892167087,122.99761952024896 -8.243693038524139,122.99824665954954 -8.242094307069925,122.99855025215751 -8.240404017895434,122.9985186592394 -8.238686971637309,122.99815309197326 -8.237008994718828,122.99746756511585 -8.235434415761524,122.99648835971863 -8.234023599418036,122.99525301559079 -8.232830632171684,122.99380889213523 -8.231901248822297,122.99221135273041 -8.231271079150648,122.99052164226393 -8.230964281979102,122.98880453918649 -8.230992618994556,122.98712587209964 -8.231355003840502,122.98709746667338 -8.231375211028098,122.98709422100694 -8.23136523218978,122.98445994390397 -8.232210944081352,115.62680134884883 -10.59450865345169,139.5811057192091 21.647409332212078,139.58192836390296 21.648754158529584,139.58249698017912 21.650224525030524,139.58279319818183 21.651772929697092,139.58280744822028 21.653349349391526,139.58253926992927 21.65490285591575,139.58199732714186 21.65638326131015,139.58119912799356 21.65774273923798,139.5801704593002 21.65893737007465,139.5789445534828 21.659928559785786,139.5775610149529 21.660684286755505,139.57606454064265 21.661180136284507,138.43525780056368 21.928255201073114)," + "(-11.672901457713799 61.32672411402214,90.98812319335303 47.68960389094599,84.7626026713778 42.82467865599619,70.29932468799596 37.879602651101656,-6.606416144696235 55.884063056220455,-11.672901457713799 61.32672411402214)," + "(21.731752401457072 25.441649913510176,24.257151920623585 25.753718243894582,27.241673724801043 23.15789335269138,24.67466474051967 22.280215188935983,21.731752401457072 25.441649913510176)," + "(27.27614200608447 23.151139413488384,40.90533858676494 27.81105618886412,88.24260741703002 33.66087553733939,106.50102688198155 29.386386724583776,56.37475342083092 -2.1578890939673077,27.27614200608447 23.151139413488384)," + "(24.280548333299286 25.756617557996357,40.820431510930504 27.800564754617064,27.26084581815643 23.16444842429204,24.280548333299286 25.756617557996357)," + "(-8.816428652507156 21.684268290604805,-29.245606398615163 19.15968622376516,-30.746990152471433 20.114940195264964,-31.488293120007164 35.91601695199151,-8.816428652507156 21.684268290604805)," + "(-29.272966059430175 19.15630519150303,-30.693779343676994 18.980737162403244,-30.745984888163573 20.09351270989812,-29.272966059430175 19.15630519150303)," + "(-8.765268372199529 21.672915212812164,21.710263177057982 25.43898929273592,24.6564884472217 22.274000588276877,2.399797039244074 14.664283533978011,-8.765268372199529 21.672915212812164)," + "(-11.719020876527594 61.35052257161079,-32.813002816538585 64.15256868853093,-33.794092220123524 85.06475931794377,-11.719020876527594 61.35052257161079)," + "(138.36863398834245 21.92583635515323,120.74643517661659 16.41589072499998,122.22857097659741 17.23931929444039,137.91059951928324 22.033067125450867,138.36863398834245 21.92583635515323)," + "(138.40162314694612 21.936129433384743,137.94401525032401 22.043260338510414,165.30357425200395 30.40667726763579,165.30972750566778 30.349537283861128,138.40162314694612 21.936129433384743)," + "(127.7390129190668 24.432360580502113,150.56644469028546 33.00302819199967,132.94563868010746 23.21343377755938,127.7390129190668 24.432360580502113)," + "(-161.35503387993074 -54.37346556730929,-138.5871756703948 -49.76293390065463,-141.88154531641396 -54.13731498386075,-161.35503387993074 -54.37346556730929)," + "(-35.27079817688228 -28.823383801272726,-67.15508315200245 -35.279973754753655,-104.45438672212283 -32.08275635744238,-104.45608427388785 -32.08277574513043,-104.45774629244461 -32.083121797430444,-104.45931051252892 -32.08378154996377,-104.46071833276328 -32.084730285999285,-104.46191701107783 -32.08593246243208,-104.46286164062022 -32.08734304135757,-104.46351683212971 -32.088909177355255,-104.46385803974773 -32.09057219727058,-104.46387248059507 -32.0922697983248,-104.46355961366501 -32.09393838220386,-104.46293116009147 -32.09551543768267,-104.46201066403262 -32.096941882523176,-104.46083261062104 -32.09816427690997,-104.4594411340252 -32.0991368255003,-104.45788836402274 -32.099823093084304,-104.45623247302943 -32.10019736958055,-71.78503500133692 -36.217536765212955,-110.97726480920838 -44.153991877456086,-118.48907838644061 -23.105096307062404,-86.1530711337859 19.831784241114434,-76.17018886097277 -1.845422238170359,-76.16937610532348 -1.846827817505229,-76.16831819663724 -1.848059505056384,-76.1670513874113 -1.8490750932589226,-35.27079817688228 -28.823383801272726)," + "(-104.01746970265641 -32.1378111596404,-67.21616917021902 -35.29234380666436,-71.7311963690772 -36.20664105942231,-104.01746970265641 -32.1378111596404)," + "(-19.189771245865394 -39.40907702065701,14.959045315399937 -42.33622673608511,10.708277693154 -44.69782106654718,2.082853933046394 -45.50894770194591,-12.781743251109447 -43.63567754687929,-19.189771245865394 -39.40907702065701)," + "(25.87291249723667 -43.271742962131206,11.016303004296148 -44.66886433771501,17.514523291044114 -42.55528610711852,25.87291249723667 -43.271742962131206)," + "(-12.74860587593394 -43.65753426277832,2.0024981350794633 -45.51650162110258,-8.441149421139997 -46.49864196914455,-12.74860587593394 -43.65753426277832)," + "(0.5482054515958907 -52.42783142752352,22.844877876175584 -52.15747591132524,42.52338780560707 -80.11376900277862,0.5482054515958907 -52.42783142752352)," + "(70.30021875120347 37.86136945403442,88.19316357634735 33.672450869505475,40.98637445712528 27.838762914602786,70.30021875120347 37.86136945403442)," + "(70.33149133386337 37.8720617667972,84.7697194975705 42.80859204783613,84.77105909891975 42.80917893165259,84.77228255716334 42.80998025200993,91.0124858249585 47.68637930033897,127.81301147359562 42.79793866689235,119.44990642462011 37.5350680374038,88.24355226977912 33.67867053045407,70.33149133386337 37.8720617667972)," + "(144.3073988767456 40.60689326310742,119.4909083116505 37.540144098182196,127.84021527260577 42.79433164264914,144.3073988767456 40.60689326310742)," + "(88.29299612070747 33.66709519588936,119.4149447434929 37.5130667826444,106.52189974628405 29.399521939775685,88.29299612070747 33.66709519588936)," + "(144.44527145744826 40.60625585489642,163.9457022420348 43.01606879557336,164.20784624646586 40.58176249549163,160.4299774597963 38.482900332010054,144.44527145744826 40.60625585489642)," + "(144.37633892649745 40.61541268642703,127.86340960426224 42.808927748536924,161.67658544228874 64.08740831841152,163.94382395897412 43.0335107977197,144.37633892649745 40.61541268642703)," + "(-41.90900718265291 15.92171071110581,-65.04965636135107 20.822031166079725,-65.63127790159731 28.752476130223627,-42.58516701826829 16.9541990192793,-41.90900718265291 15.92171071110581)," + "(-42.60459058740299 16.983858586408623,-65.63278027468877 28.772961078412454,-66.67261586220584 42.95118235795973,-54.565741638677004 35.24839895429071,-42.60459058740299 16.983858586408623)," + "(-54.58907517986818 35.28402900387246,-66.6742146811002 42.97298235051845,-66.98910868886206 47.26628926429717,-62.12011091968531 46.783833855102905,-54.58907517986818 35.28402900387246)," + "(-54.55313781876444 35.261172150516714,-62.097702142309025 46.78161343185131,-46.30482922656958 45.2167417013382,-31.506387108397742 35.92737383993618,-30.76509132865387 20.12645029297113,-54.55313781876444 35.261172150516714)," + "(-97.83416987317577 45.238498178710174,-65.64955249400556 28.76182418273821,-65.06752232404301 20.825807527637693,-82.6206997737451 24.54292980246981,-82.62234422414674 24.543118386846405,-82.62399482199257 24.54299466157833,-82.62559278256681 24.54256303304157,-82.62708119578785 24.541838873339582,-82.62840705301502 24.540847972838158,-82.62952313490874 24.539625621662307,-83.40757403122092 23.506493075556897,-90.83289438322406 30.035664942125123,-97.83416987317577 45.238498178710174)," + "(-82.61888709171882 24.52458915191082,-65.06618612106601 20.80758831903435,-64.01341032562904 6.452926519952804,-83.39437198775232 23.49488435218103,-82.61888709171882 24.52458915191082)," + "(-65.65105486819753 28.782309145932423,-97.84873506427972 45.26564377964443,-97.85028505214999 45.266259170730656,-97.8519235011197 45.266570062288324,-97.85359117767403 45.26656521490745,-97.85522779165703 45.26624480383146,-97.85677417589265 45.26562041262175,-97.85817442520765 45.26471461438658,-97.85937791752582 45.263560155713826,-97.86034114396688 45.26219877281023,-97.86102928178767 45.260679682646156,-97.86141745330046 45.259057803654485,-97.86149162525584 45.25739177030908,-97.86124911617533 45.255741813360295,-97.86069869329278 45.254167582361575,-90.86536170723733 30.064229436755205,-122.87031432291771 58.20657846684874,-122.87160397462488 58.20751906037725,-122.87304273757687 58.20821034821862,-122.87458295968815 58.20862943479625,-122.87617362852775 58.20876243988797,-122.87776206086001 58.208604958341404,-122.87929564752282 58.20816220597348,-122.88072359585243 58.20744884682156,-122.88199861194552 58.20648850746798,-122.88307846704171 58.20531299452339,-122.88392739614764 58.203961241186136,-122.88451728257994 58.20247801776782,-122.88482858919475 58.20091244889254,-128.50870223166575 4.921332760433136,-128.50874214078485 4.920024935850124,-128.5085870504444 4.918725726527491,-128.508240412044 4.917464045229747,-118.50876745117507 -23.102116039964123,-135.68859242632564 -45.914092066443295,-166.90162006241783 81.94670439205376,-32.82983975785978 64.13713127225718,-31.507388935807747 35.94872806687944,-46.297243998766895 45.232694686742164,-46.298438120776574 45.23332182175007,-46.29971427817714 45.23375845429706,-46.30104229243783 45.233994258910144,-62.110046067823596 46.80046435131626,-67.56717234515712 55.133453500144235,-67.56820100882734 55.134741527678834,-67.56945250271089 55.1358143403073,-67.5708826237989 55.13663404607767,-67.5724408599347 55.13717169282173,-67.5740721739131 55.13740829075129,-67.57571894740512 55.137335483181175,-67.57732301604885 55.136955841689016,-67.57882772382588 55.13628277528659,-67.5801799241631 55.13534005681094,-67.58133185708003 55.13416098326309,-67.58224283608062 55.13278719975146,-67.58288068520834 55.1312672285785,-67.58322287550715 55.12965475542346,-67.58325732074876 55.12800673315368,-67.00809756718309 47.28579861360277,-74.64384103040652 48.042403137098944,-74.64551355318005 48.04240861420995,-74.64715670691223 48.04209651127949,-74.6487107421129 48.04147817720973,-74.6501191498815 48.04057609629091,-74.65133071672265 48.039423070612024,-74.65230138680663 48.03806102728863,-74.6529958639579 48.03653949388014,-74.65338889511892 48.03491379743455,-74.65346618861936 48.03324305264807,-74.6532249338596 48.0315880122958,-74.65267390351174 48.03000885809735,-74.65183313452161 48.028563012347625,-74.65073319951154 48.02730304988773,-74.64941409507755 48.02627478634224,-66.69106576546662 42.962920784577285,-65.65105486819753 28.782309145932423)," + "(-74.60894342391143 48.02131743628841,-67.00680717272054 47.268042957701205,-66.69266458534088 42.98472079049692,-74.60894342391143 48.02131743628841)," + "(-138.56127670492663 -49.7577037198288,-134.94703094520807 -49.02582406883465,-133.72337212957453 -54.038411653780486,-141.85939298329575 -54.13705971460783,-138.56127670492663 -49.7577037198288)," + "(-134.93399269617888 -49.00526523292734,-135.68321498734667 -45.93611109773349,-118.50171193441933 -23.121886343614484,-110.99462708067594 -44.15753153101153,-134.93399269617888 -49.00526523292734)," + "(-138.54536289076012 -49.736572791872405,-135.69686656519858 -45.95423814792149,-134.95119672848287 -49.00875938278158,-138.54536289076012 -49.736572791872405)," + "(88.82755353245742 -46.63627739859524,86.64413783102847 -44.29072778657896,91.56634116238342 -41.32862933986829,92.38779164183632 -41.84427969841862,88.82755353245742 -46.63627739859524)," + "(96.17559112847069 -36.775403890830276,96.2533145203432 -36.670790012864686,99.8315395547437 -36.33429989598129,97.37090375596762 -37.815068768540016,96.17559112847069 -36.775403890830276)," + "(92.39828457197696 -41.83015645846746,91.58318530508117 -41.31849282059788,93.74495703397014 -40.01757527428385,92.39828457197696 -41.83015645846746)," + "(96.16509920779882 -36.78952577205994,97.35510564997305 -37.824575800671205,93.81196732309566 -39.95677632714469,96.16509920779882 -36.78952577205994)," + "(88.81691795134695 -46.65059264343438,87.42069611419876 -48.52987476642635,80.5749329147718 -47.94307232519108,86.62877983973574 -44.29996996515029,88.81691795134695 -46.65059264343438)," + "(69.32473564139825 -25.685312296376537,69.17686596344828 -25.526450792983923,79.43054197209301 -22.234338902371594,79.56777154519035 -22.35371429782551,69.32473564139825 -25.685312296376537)," + "(79.58722163711042 -22.347388059401556,79.45006045094098 -22.22807217263994,91.24299727724733 -18.441755195353803,92.22218393874856 -18.237804190782946,79.58722163711042 -22.347388059401556)," + "(67.58180682559251 -26.252208498722716,67.35665645137476 -26.110859094265415,69.15841818541341 -25.532373756550623,69.30634307855388 -25.691294568247503,67.58180682559251 -26.252208498722716)," + "(10.713631867610786 -44.714913767695485,10.86035670084666 -44.70114019099129,10.566326319189315 -44.7967750242813,10.713631867610786 -44.714913767695485)," + "(14.990356626143694 -42.338898459344726,17.469630118109404 -42.551441381415,10.93650885434335 -44.676371327096064,10.75178223878234 -44.69371860760433,14.990356626143694 -42.338898459344726)," + "(113.19393813942808 -13.869104583916076,149.85225961536605 -6.232679296303189,99.86624158413852 -36.31341680350249,96.26738808398915 -36.65184732348474,113.19393813942808 -13.869104583916076)," + "(113.18383917989723 -13.853283334263445,92.53313651295461 -18.155111782662388,115.54974201699517 -10.668833135736556,113.18383917989723 -13.853283334263445)," + "(163.96311491920022 43.01821047323797,169.91789145903348 43.754090361605556,164.22449464723803 40.59100135183526,163.96311491920022 43.01821047323797)," + "(92.37537042521268 -18.187979529764235,91.40187377110232 -18.3907452751927,115.58013059889898 -10.627916926612096,115.56781674564326 -10.64450497131272,92.37537042521268 -18.187979529764235)," + "(-86.16139825386244 19.849866063211905,-118.49613390319635 -23.085326003412035,-128.4910459077906 4.921493651135869,-122.86916414947727 58.18220258298618,-90.8472856693717 30.0249784474685,-86.16139825386244 19.849866063211905)," + "(-86.14941695432584 19.865785693545394,-90.81481832588861 29.996413910560918,-83.41817017513736 23.49245140750158,-86.14941695432584 19.865785693545394)," + "(-106.11264211278916 -57.83736939023901,-100.24152662041178 -74.28881727173125,-161.4303237477923 -75.80205692190154,-106.11264211278916 -57.83736939023901)," + "(-67.56328532753739 55.095514517777545,-62.132454845199874 46.802684774567844,-66.99039908239888 47.28404492010701,-67.56328532753739 55.095514517777545)," + "(115.59662188220229 -10.635148141706566,115.6088128566935 -10.618708014427298,118.58211270640945 -9.664081031738045,115.59662188220229 -10.635148141706566)))"; + std::string msg; + CG mpoly = from_wkt(wkt); + bg::correct(mpoly); + + BOOST_CHECK_MESSAGE(bg::is_valid(mpoly, msg), msg); + } +#endif // BOOST_GEOMETRY_TEST_FAILURES +} + +BOOST_AUTO_TEST_CASE( test_is_valid_multipolygon ) +{ + test_open_multipolygons(); + test_open_multipolygons(); +} + + +template +inline void check_one(Geometry const& geometry) +{ + bool const is_fp = boost::is_floating_point::value; + + bg::validity_failure_type failure; + bool validity = bg::is_valid(geometry, failure); + if (BOOST_GEOMETRY_CONDITION(is_fp)) + { + BOOST_CHECK(! validity); + BOOST_CHECK(failure == bg::failure_invalid_coordinate); + } + else + { + BOOST_CHECK(failure == bg::no_failure + || failure != bg::failure_invalid_coordinate); + } +} + +template +inline void test_with_invalid_coordinate(CoordinateType invalid_value) +{ + typedef bg::model::segment

segment_t; + typedef bg::model::box

box_t; + typedef bg::model::linestring

linestring_t; + typedef bg::model::ring

ring_t; // cw, closed + typedef bg::model::polygon

polygon_t; // cw, closed + typedef bg::model::multi_point

multi_point_t; + typedef bg::model::multi_linestring multi_linestring_t; + typedef bg::model::multi_polygon multi_polygon_t; + + typedef typename bg::coordinate_type

::type coord_t; + + std::string wkt_point = "POINT(1 1)"; + std::string wkt_segment = "LINESTRING(1 1,10 20)"; + std::string wkt_box = "BOX(1 1,10 20)"; + std::string wkt_linestring = "LINESTRING(1 1,2 3,4 -5)"; + std::string wkt_ring = "POLYGON((1 1,2 2,2 1,1 1))"; + std::string wkt_polygon = "POLYGON((1 1,1 200,200 200,200 1,1 1),(50 50,50 51,49 50,50 50))"; + std::string wkt_multipoint = "MULTIPOINT(1 1,2 3,4 -5,-5 2)"; + std::string wkt_multilinestring = + "MULTILINESTRING((1 1,2 3,4 -5),(-4 -2,-8 9))"; + std::string wkt_multipolygon = "MULTIPOLYGON(((1 1,1 200,200 200,200 1,1 1),(50 50,50 51,49 50,50 50)),((500 500,550 550,550 500,500 500)))"; + + { + P p; + bg::read_wkt(wkt_point, p); + BOOST_CHECK(bg::is_valid(p)); + bg::set<1>(p, invalid_value); + check_one(p); + } + { + segment_t s; + bg::read_wkt(wkt_segment, s); + BOOST_CHECK(bg::is_valid(s)); + bg::set<1, 1>(s, invalid_value); + check_one(s); + } + { + box_t b; + bg::read_wkt(wkt_box, b); + BOOST_CHECK(bg::is_valid(b)); + bg::set<1, 0>(b, invalid_value); + check_one(b); + } + { + linestring_t ls; + bg::read_wkt(wkt_linestring, ls); + BOOST_CHECK(bg::is_valid(ls)); + bg::set<1>(ls[1], invalid_value); + check_one(ls); + } + { + ring_t r; + bg::read_wkt(wkt_ring, r); + BOOST_CHECK(bg::is_valid(r)); + bg::set<0>(r[1], invalid_value); + check_one(r); + } + { + polygon_t pgn; + bg::read_wkt(wkt_polygon, pgn); + BOOST_CHECK(bg::is_valid(pgn)); + bg::set<0>(bg::interior_rings(pgn)[0][1], invalid_value); + check_one(pgn); + } + { + multi_point_t mp; + bg::read_wkt(wkt_multipoint, mp); + BOOST_CHECK(bg::is_valid(mp)); + bg::set<0>(mp[2], invalid_value); + check_one(mp); + } + { + multi_linestring_t mls; + bg::read_wkt(wkt_multilinestring, mls); + BOOST_CHECK(bg::is_valid(mls)); + bg::set<0>(mls[1][1], invalid_value); + check_one(mls); + } + { + multi_polygon_t mpgn; + bg::read_wkt(wkt_multipolygon, mpgn); + BOOST_CHECK(bg::is_valid(mpgn)); + bg::set<0>(bg::exterior_ring(mpgn[1])[1], invalid_value); + check_one(mpgn); + } +} + +template +inline void test_with_invalid_coordinate() +{ + typedef typename bg::coordinate_type

::type coord_t; + + coord_t const q_nan = std::numeric_limits::quiet_NaN(); + coord_t const inf = std::numeric_limits::infinity(); + + test_with_invalid_coordinate(q_nan); + test_with_invalid_coordinate(inf); +} + +BOOST_AUTO_TEST_CASE( test_geometries_with_invalid_coordinates ) +{ + typedef point_type fp_point_type; + typedef bg::model::point int_point_type; + + test_with_invalid_coordinate(); + test_with_invalid_coordinate(); +} + +BOOST_AUTO_TEST_CASE( test_with_NaN_coordinates ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: geometry with NaN coordinates" << std::endl; + std::cout << "************************************" << std::endl; +#endif + + linestring_type ls1, ls2; + bg::read_wkt("LINESTRING(1 1,1.115235e+308 1.738137e+308)", ls1); + bg::read_wkt("LINESTRING(-1 1,1.115235e+308 1.738137e+308)", ls2); + + // the intersection of the two linestrings is a new linestring + // (multilinestring with a single element) that has NaN coordinates + multi_linestring_type mls; + bg::intersection(ls1, ls2, mls); + + typedef validity_tester_linear tester_allow_spikes; + typedef validity_tester_linear tester_disallow_spikes; + + test_valid + < + tester_allow_spikes, multi_linestring_type + >::apply("mls-NaN", mls, false); + + test_valid + < + tester_disallow_spikes, multi_linestring_type + >::apply("mls-NaN", mls, false); +} + +BOOST_AUTO_TEST_CASE( test_is_valid_variant ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: variant support" << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef bg::model::polygon polygon_type; // cw, closed + + typedef boost::variant + < + linestring_type, multi_linestring_type, polygon_type + > variant_geometry; + typedef test_valid_variant test; + + variant_geometry vg; + + linestring_type valid_linestring = + from_wkt("LINESTRING(0 0,1 0)"); + multi_linestring_type invalid_multi_linestring = + from_wkt("MULTILINESTRING((0 0,1 0),(0 0))"); + polygon_type valid_polygon = + from_wkt("POLYGON((0 0,1 1,1 0,0 0))"); + polygon_type invalid_polygon = + from_wkt("POLYGON((0 0,2 2,2 0,1 0))"); + + vg = valid_linestring; + test::apply("v01", vg, true); + vg = invalid_multi_linestring; + test::apply("v02", vg, false); + vg = valid_polygon; + test::apply("v03", vg, true); + vg = invalid_polygon; + test::apply("v04", vg, false); +} diff --git a/src/boost/libs/geometry/test/algorithms/is_valid_failure.cpp b/src/boost/libs/geometry/test/algorithms/is_valid_failure.cpp new file mode 100644 index 000000000..96a2af0e6 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/is_valid_failure.cpp @@ -0,0 +1,982 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2015-2018, 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_is_valid_failure +#endif + +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include + + +namespace bg = ::boost::geometry; + +typedef bg::validity_failure_type failure_type; + +typedef bg::model::point point_type; +typedef bg::model::segment segment_type; +typedef bg::model::box box_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_linestring multi_linestring_type; +typedef bg::model::multi_point multi_point_type; + + +char const* to_string(failure_type failure) +{ + switch (failure) + { + case bg::no_failure: + return "no_failure"; + case bg::failure_few_points: + return "failure_few_points"; + case bg::failure_wrong_topological_dimension: + return "failure_wrong_topological_dimension"; + case bg::failure_spikes: + return "failure_spikes"; + case bg::failure_duplicate_points: + return "failure_duplicate_points"; + case bg::failure_not_closed: + return "failure_not_closed"; + case bg::failure_self_intersections: + return "failure_self_intersections"; + case bg::failure_wrong_orientation: + return "failure_wrong_orientation"; + case bg::failure_interior_rings_outside: + return "failure_interior_rings_outside"; + case bg::failure_nested_interior_rings: + return "failure_nested_interior_rings"; + case bg::failure_disconnected_interior: + return "failure_disconnected_interior"; + case bg::failure_intersecting_interiors: + return "failure_intersecting_interiors"; + case bg::failure_wrong_corner_order: + return "failure_wrong_corner_order"; + default: + return ""; // to avoid warnings (-Wreturn-type) + } +} + + +template +struct test_failure +{ + static inline void apply(std::string const& case_id, + Geometry const& geometry, + failure_type expected) + { + failure_type detected; + bg::is_valid(geometry, detected); + std::string expected_msg = bg::validity_failure_type_message(expected); + std::string detected_msg; + bg::is_valid(geometry, detected_msg); + std::string detected_msg_short + = detected_msg.substr(0, expected_msg.length()); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "----------------------" << std::endl; + std::cout << "case id: " << case_id << std::endl; + std::cout << "Geometry: " << bg::wkt(geometry) << std::endl; + std::cout << "Expected reason: " << expected_msg << std::endl; + std::cout << "Detected reason: " << detected_msg << std::endl; + std::cout << "Expected: " << to_string(expected) << std::endl; + std::cout << "Detected: " << to_string(detected) << std::endl; + std::cout << std::endl; +#endif + + BOOST_CHECK_MESSAGE(expected == detected, + "case id: " << case_id + << ", Geometry: " << bg::wkt(geometry) + << ", expected: " << to_string(expected) + << ", detected: " << to_string(detected)); + + BOOST_CHECK(detected_msg_short == expected_msg); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "----------------------" << std::endl; + std::cout << std::endl << std::endl; +#endif + } + + static inline void apply(std::string const& case_id, + std::string const& wkt, + failure_type expected) + { + Geometry geometry = from_wkt(wkt); + apply(case_id, geometry, expected); + } +}; + + +BOOST_AUTO_TEST_CASE( test_failure_point ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid_failure: POINT " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef point_type G; + typedef test_failure test; + + test::apply("p01", "POINT(0 0)", bg::no_failure); +} + +BOOST_AUTO_TEST_CASE( test_failure_multipoint ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid_failure: MULTIPOINT " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef multi_point_type G; + typedef test_failure test; + + test::apply("mp01", "MULTIPOINT()", bg::no_failure); + test::apply("mp02", "MULTIPOINT(0 0,0 0)", bg::no_failure); + test::apply("mp03", "MULTIPOINT(0 0,1 0,1 1,0 1)", bg::no_failure); + test::apply("mp04", "MULTIPOINT(0 0,1 0,1 1,1 0,0 1)", bg::no_failure); +} + +BOOST_AUTO_TEST_CASE( test_failure_segment ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid_failure: SEGMENT " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef segment_type G; + typedef test_failure test; + + test::apply("s01", + "SEGMENT(0 0,0 0)", + bg::failure_wrong_topological_dimension); + test::apply("s02", "SEGMENT(0 0,1 0)", bg::no_failure); +} + +BOOST_AUTO_TEST_CASE( test_failure_box ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid_failure: BOX " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef box_type G; + typedef test_failure test; + + // boxes where the max corner and below and/or to the left of min corner + test::apply("b01", + "BOX(0 0,-1 0)", + bg::failure_wrong_topological_dimension); + test::apply("b02", "BOX(0 0,0 -1)", bg::failure_wrong_corner_order); + test::apply("b03", "BOX(0 0,-1 -1)", bg::failure_wrong_corner_order); + + // boxes of zero area; they are not 2-dimensional, so invalid + test::apply("b04", "BOX(0 0,0 0)", bg::failure_wrong_topological_dimension); + test::apply("b05", "BOX(0 0,1 0)", bg::failure_wrong_topological_dimension); + test::apply("b06", "BOX(0 0,0 1)", bg::failure_wrong_topological_dimension); + + test::apply("b07", "BOX(0 0,1 1)", bg::no_failure); +} + +BOOST_AUTO_TEST_CASE( test_failure_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid_failure: LINESTRING " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef linestring_type G; + typedef test_failure test; + + // empty linestring + test::apply("l01", "LINESTRING()", bg::failure_few_points); + + // 1-point linestrings + test::apply("l02", "LINESTRING(0 0)", bg::failure_few_points); + test::apply("l03", + "LINESTRING(0 0,0 0)", + bg::failure_wrong_topological_dimension); + test::apply("l04", + "LINESTRING(0 0,0 0,0 0)", + bg::failure_wrong_topological_dimension); + + // 2-point linestrings + test::apply("l05", "LINESTRING(0 0,1 2)", bg::no_failure); + test::apply("l06", "LINESTRING(0 0,1 2,1 2)", bg::no_failure); + test::apply("l07", "LINESTRING(0 0,0 0,1 2,1 2)", bg::no_failure); + test::apply("l08", "LINESTRING(0 0,0 0,0 0,1 2,1 2)", bg::no_failure); + + // 3-point linestring + test::apply("l09", "LINESTRING(0 0,1 0,2 10)", bg::no_failure); + + // linestrings with spikes + test::apply("l10", "LINESTRING(0 0,1 2,0 0)", bg::no_failure); +} + +BOOST_AUTO_TEST_CASE( test_failure_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid_failure: MULTILINESTRING " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef multi_linestring_type G; + typedef test_failure test; + + // empty multilinestring + test::apply("mls01", "MULTILINESTRING()", bg::no_failure); + + // multilinestring with empty linestring(s) + test::apply("mls02", "MULTILINESTRING(())", bg::failure_few_points); + test::apply("mls03", "MULTILINESTRING((),(),())", bg::failure_few_points); + test::apply("mls04", + "MULTILINESTRING((),(0 1,1 0))", + bg::failure_few_points); + + // multilinestring with invalid linestrings + test::apply("mls05", + "MULTILINESTRING((0 0),(0 1,1 0))", + bg::failure_few_points); + test::apply("mls06", + "MULTILINESTRING((0 0,0 0),(0 1,1 0))", + bg::failure_wrong_topological_dimension); + test::apply("mls07", "MULTILINESTRING((0 0),(1 0))", + bg::failure_few_points); + test::apply("mls08", + "MULTILINESTRING((0 0,0 0),(1 0,1 0))", + bg::failure_wrong_topological_dimension); + test::apply("mls09", + "MULTILINESTRING((0 0),(0 0))", + bg::failure_few_points); + test::apply("mls10", + "MULTILINESTRING((0 0,1 0,0 0),(5 0))", + bg::failure_few_points); + + // multilinstring that has linestrings with spikes + test::apply("mls11", + "MULTILINESTRING((0 0,1 0,0 0),(5 0,1 0,4 1))", + bg::no_failure); + test::apply("mls12", + "MULTILINESTRING((0 0,1 0,0 0),(1 0,2 0))", + bg::no_failure); + + // valid multilinestrings + test::apply("mls13", + "MULTILINESTRING((0 0,1 0,2 0),(5 0,1 0,4 1))", + bg::no_failure); + test::apply("mls14", + "MULTILINESTRING((0 0,1 0,2 0),(1 0,2 0))", + bg::no_failure); + test::apply("mls15", + "MULTILINESTRING((0 0,1 1),(0 1,1 0))", + bg::no_failure); + test::apply("mls16", + "MULTILINESTRING((0 0,1 1,2 2),(0 1,1 0,2 2))", + bg::no_failure); +} + +template +inline void test_open_rings() +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid_failure: RING (open) " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef bg::model::ring G; // ccw, open ring + typedef test_failure test; + + // not enough points + test::apply("r01", "POLYGON(())", bg::failure_few_points); + test::apply("r02", "POLYGON((0 0))", bg::failure_few_points); + test::apply("r03", "POLYGON((0 0,1 0))", bg::failure_few_points); + + // duplicate points + test::apply("r04", + "POLYGON((0 0,0 0,0 0))", + bg::failure_wrong_topological_dimension); + test::apply("r05", + "POLYGON((0 0,1 0,1 0))", + bg::failure_wrong_topological_dimension); + test::apply("r06", + "POLYGON((0 0,1 0,0 0))", + bg::failure_wrong_topological_dimension); + test::apply("r07", "POLYGON((0 0,1 0,1 1,0 0,0 0))", bg::no_failure); + test::apply("r08", "POLYGON((0 0,1 0,1 0,1 1))", bg::no_failure); + test::apply("r09", "POLYGON((0 0,1 0,1 0,1 1,0 0))", bg::no_failure); + + // with spikes + test::apply("r10", "POLYGON((0 0,2 0,2 2,0 2,1 2))", bg::failure_spikes); + test::apply("r11", "POLYGON((0 0,2 0,1 0,2 2))", bg::failure_spikes); + test::apply("r12", + "POLYGON((0 0,1 0,2 0,1 0,4 0,4 4))", + bg::failure_spikes); + test::apply("r13", "POLYGON((0 0,2 0,2 2,1 0))", bg::failure_spikes); + test::apply("r14", "POLYGON((0 0,2 0,1 0))", bg::failure_spikes); + test::apply("r15", + "POLYGON((0 0,5 0,5 5,4 4,5 5,0 5))", + bg::failure_spikes); + test::apply("r16", + "POLYGON((0 0,5 0,5 5,4 4,3 3,5 5,0 5))", + bg::failure_spikes); + + // with spikes and duplicate points + test::apply("r17", + "POLYGON((0 0,0 0,2 0,2 0,1 0,1 0))", + bg::failure_spikes); + + // with self-crossings + test::apply("r18", + "POLYGON((0 0,5 0,5 5,3 -1,0 5))", + bg::failure_self_intersections); + + // with self-crossings and duplicate points + test::apply("r19", + "POLYGON((0 0,5 0,5 5,5 5,3 -1,0 5,0 5))", + bg::failure_self_intersections); + + // with self-intersections + test::apply("r20", + "POLYGON((0 0,5 0,5 5,3 5,3 0,2 0,2 5,0 5))", + bg::failure_self_intersections); + test::apply("r21", + "POLYGON((0 0,5 0,5 5,3 5,3 0,2 5,0 5))", + bg::failure_self_intersections); + test::apply("r22", + "POLYGON((0 0,5 0,5 1,1 1,1 2,2 2,3 1,4 2,5 2,5 5,0 5))", + bg::failure_self_intersections); + + // with self-intersections and duplicate points + test::apply("r23", + "POLYGON((0 0,5 0,5 5,3 5,3 5,3 0,3 0,2 0,2 0,2 5,2 5,0 5))", + bg::failure_self_intersections); + + // next two suggested by Adam Wulkiewicz + test::apply("r24", + "POLYGON((0 0,5 0,5 5,0 5,4 4,2 2,0 5))", + bg::failure_self_intersections); + test::apply("r25", + "POLYGON((0 0,5 0,5 5,1 4,4 4,4 1,0 5))", + bg::failure_self_intersections); + + // and a few more + test::apply("r26", + "POLYGON((0 0,5 0,5 5,4 4,1 4,1 1,4 1,4 4,0 5))", + bg::failure_self_intersections); + test::apply("r27", + "POLYGON((0 0,5 0,5 5,4 4,4 1,1 1,1 4,4 4,0 5))", + bg::failure_self_intersections); + + // valid rings + test::apply("r28", "POLYGON((0 0,1 0,1 1))", bg::no_failure); + test::apply("r29", "POLYGON((1 0,1 1,0 0))", bg::no_failure); + test::apply("r30", "POLYGON((0 0,1 0,1 1,0 1))", bg::no_failure); + test::apply("r31", "POLYGON((1 0,1 1,0 1,0 0))", bg::no_failure); + + // test cases coming from buffer + test::apply("r32", + "POLYGON((1.1713032141645456 -0.9370425713316364,\ + 5.1713032141645456 4.0629574286683638,\ + 4.7808688094430307 4.3753049524455756,\ + 4.7808688094430307 4.3753049524455756,\ + 0.7808688094430304 -0.6246950475544243,\ + 0.7808688094430304 -0.6246950475544243))", + bg::no_failure); + + // wrong orientation + test::apply("r33", + "POLYGON((0 0,0 1,1 1,0 0))", + bg::failure_wrong_orientation); +} + +template +void test_closed_rings() +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid_failure: RING (closed) " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef bg::model::ring G; // ccw, closed ring + typedef test_failure test; + + // not enough points + test::apply("r01c", "POLYGON(())", bg::failure_few_points); + test::apply("r02c", "POLYGON((0 0))", bg::failure_few_points); + test::apply("r03c", "POLYGON((0 0,0 0))", bg::failure_few_points); + test::apply("r04c", "POLYGON((0 0,1 0))", bg::failure_few_points); + test::apply("r05c", "POLYGON((0 0,1 0,1 0))", bg::failure_few_points); + test::apply("r06c", "POLYGON((0 0,1 0,2 0))", bg::failure_few_points); + test::apply("r07c", + "POLYGON((0 0,1 0,1 0,2 0))", + bg::failure_wrong_topological_dimension); + test::apply("r08c", + "POLYGON((0 0,1 0,2 0,2 0))", + bg::failure_wrong_topological_dimension); + + // boundary not closed + test::apply("r09c", "POLYGON((0 0,1 0,1 1,1 2))", bg::failure_not_closed); + test::apply("r10c", + "POLYGON((0 0,1 0,1 0,1 1,1 1,1 2))", + bg::failure_not_closed); + + // with spikes + test::apply("r11c", "POLYGON((0 0,1 0,1 0,2 0,0 0))", bg::failure_spikes); + test::apply("r12c", + "POLYGON((0 0,1 0,1 1,2 2,0.5 0.5,0 1,0 0))", + bg::failure_spikes); + + // wrong orientation + test::apply("r13c", + "POLYGON((0 0,0 1,1 1,2 0,0 0))", + bg::failure_wrong_orientation); + +} + +BOOST_AUTO_TEST_CASE( test_failure_ring ) +{ + test_open_rings(); + test_closed_rings(); +} + + +template +void test_open_polygons() +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid_failure: POLYGON (open) " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef bg::model::polygon G; // ccw, open + typedef test_failure test; + + // not enough points in exterior ring + test::apply("pg001", "POLYGON(())", bg::failure_few_points); + test::apply("pg002", "POLYGON((0 0))", bg::failure_few_points); + test::apply("pg003", "POLYGON((0 0,1 0))", bg::failure_few_points); + + // not enough points in interior ring + test::apply("pg004", + "POLYGON((0 0,10 0,10 10,0 10),())", + bg::failure_few_points); + test::apply("pg005", + "POLYGON((0 0,10 0,10 10,0 10),(1 1))", + bg::failure_few_points); + test::apply("pg006", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 2))", + bg::failure_few_points); + + // duplicate points in exterior ring + test::apply("pg007", + "POLYGON((0 0,0 0,0 0))", + bg::failure_wrong_topological_dimension); + test::apply("pg008", + "POLYGON((0 0,1 0,1 0))", + bg::failure_wrong_topological_dimension); + test::apply("pg009", + "POLYGON((0 0,1 0,0 0))", + bg::failure_wrong_topological_dimension); + test::apply("pg010", "POLYGON((0 0,1 0,1 1,0 0,0 0))", bg::no_failure); + test::apply("pg011", "POLYGON((0 0,1 0,1 0,1 1))", bg::no_failure); + test::apply("pg012", "POLYGON((0 0,1 0,1 0,1 1,0 0))", bg::no_failure); + + test::apply("pg013", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 1,1 1))", + bg::failure_wrong_topological_dimension); + test::apply("pg014", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 1,2 1))", + bg::failure_wrong_topological_dimension); + test::apply("pg015", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 1,1 1))", + bg::failure_wrong_topological_dimension); + test::apply("pg016", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 2,2 1,1 1,1 1))", + bg::no_failure); + test::apply("pg017", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 2,2 2,2 1))", + bg::no_failure); + test::apply("pg018", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 2,2 1,2 1,1 1))", + bg::no_failure); + + // with spikes in exterior ring + test::apply("pg019", "POLYGON((0 0,2 0,2 2,0 2,1 2))", bg::failure_spikes); + test::apply("pg020", "POLYGON((0 0,2 0,1 0,2 2))", bg::failure_spikes); + test::apply("pg021", + "POLYGON((0 0,1 0,2 0,1 0,4 0,4 4))", + bg::failure_spikes); + test::apply("pg022", "POLYGON((0 0,2 0,2 2,1 0))", bg::failure_spikes); + test::apply("pg023", "POLYGON((0 0,2 0,1 0))", bg::failure_spikes); + test::apply("pg024", + "POLYGON((0 0,5 0,5 5,4 4,5 5,0 5))", + bg::failure_spikes); + test::apply("pg025", + "POLYGON((0 0,5 0,5 5,4 4,3 3,5 5,0 5))", + bg::failure_spikes); + + // with spikes in interior ring + test::apply("pg026", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,3 1,3 3,1 3,2 3))", + bg::failure_spikes); + test::apply("pg027", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,3 1,2 1,3 3))", + bg::failure_spikes); + test::apply("pg028", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,2 1,3 1,2 1,4 1,4 4))", + bg::failure_spikes); + test::apply("pg029", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,3 1,3 3,2 1))", + bg::failure_spikes); + test::apply("pg030", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,3 1,2 1))", + bg::failure_spikes); + + // with self-crossings in exterior ring + test::apply("pg031", + "POLYGON((0 0,5 0,5 5,3 -1,0 5))", + bg::failure_self_intersections); + + // example from Norvald Ryeng + test::apply("pg032", + "POLYGON((100 1300,140 1300,140 170,100 1700))", + bg::failure_wrong_orientation); + // and with point order reversed + test::apply("pg033", + "POLYGON((100 1300,100 1700,140 170,140 1300))", + bg::failure_self_intersections); + + // with self-crossings in interior ring + // the self-crossing causes the area of the interior ring to have + // the wrong sign, hence the "wrong orientation" failure + test::apply("pg034", + "POLYGON((0 0,10 0,10 10,0 10),(3 3,3 7,4 6,2 6))", + bg::failure_wrong_orientation); + + // with self-crossings between rings + test::apply("pg035", + "POLYGON((0 0,5 0,5 5,0 5),(1 1,2 1,1 -1))", + bg::failure_self_intersections); + + // with self-intersections in exterior ring + test::apply("pg036", + "POLYGON((0 0,5 0,5 5,3 5,3 0,2 0,2 5,0 5))", + bg::failure_self_intersections); + test::apply("pg037", + "POLYGON((0 0,5 0,5 5,3 5,3 0,2 5,0 5))", + bg::failure_self_intersections); + test::apply("pg038", + "POLYGON((0 0,5 0,5 1,1 1,1 2,2 2,3 1,4 2,5 2,5 5,0 5))", + bg::failure_self_intersections); + + // next two suggested by Adam Wulkiewicz + test::apply("pg039", + "POLYGON((0 0,5 0,5 5,0 5,4 4,2 2,0 5))", + bg::failure_self_intersections); + test::apply("pg040", + "POLYGON((0 0,5 0,5 5,1 4,4 4,4 1,0 5))", + bg::failure_self_intersections); + test::apply("pg041", + "POLYGON((0 0,5 0,5 5,4 4,1 4,1 1,4 1,4 4,0 5))", + bg::failure_self_intersections); + test::apply("pg042", + "POLYGON((0 0,5 0,5 5,4 4,4 1,1 1,1 4,4 4,0 5))", + bg::failure_self_intersections); + + // with self-intersections in interior ring + + // same comment as for pg034 + test::apply("pg043", + "POLYGON((-10 -10,10 -10,10 10,-10 10),(0 0,5 0,5 5,3 5,3 0,2 0,2 5,0 5))", + bg::failure_wrong_orientation); + + // same comment as for pg034 + test::apply("pg044", + "POLYGON((-10 -10,10 -10,10 10,-10 10),(0 0,5 0,5 5,3 5,3 0,2 5,0 5))", + bg::failure_wrong_orientation); + + // same comment as for pg034 + test::apply("pg045", + "POLYGON((-10 -10,10 -10,10 10,-10 10),(0 0,5 0,5 1,1 1,1 2,2 2,3 1,4 2,5 2,5 5,0 5))", + bg::failure_wrong_orientation); + + // with self-intersections between rings + // hole has common segment with exterior ring + test::apply("pg046", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 10,2 10,2 1))", + bg::failure_self_intersections); + test::apply("pg047", + "POLYGON((0 0,0 0,10 0,10 10,0 10,0 10),(1 1,1 10,1 10,2 10,2 10,2 1))", + bg::failure_self_intersections); + // hole touches exterior ring at one point + test::apply("pg048", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 10,2 1))", + bg::no_failure); + + // "hole" is outside the exterior ring, but touches it + // TODO: return the failure value failure_interior_rings_outside + test::apply("pg049", + "POLYGON((0 0,10 0,10 10,0 10),(5 10,4 11,6 11))", + bg::failure_self_intersections); + + // hole touches exterior ring at vertex + test::apply("pg050", + "POLYGON((0 0,10 0,10 10,0 10),(0 0,1 4,4 1))", + bg::no_failure); + + // "hole" is completely outside the exterior ring + test::apply("pg051", + "POLYGON((0 0,10 0,10 10,0 10),(20 20,20 21,21 21,21 20))", + bg::failure_interior_rings_outside); + + // two "holes" completely outside the exterior ring, that touch + // each other + test::apply("pg052", + "POLYGON((0 0,10 0,10 10,0 10),(20 0,25 10,21 0),(30 0,25 10,31 0))", + bg::failure_interior_rings_outside); + + // example from Norvald Ryeng + test::apply("pg053", + "POLYGON((58 31,56.57 30,62 33),(35 9,28 14,31 16),(23 11,29 5,26 4))", + bg::failure_interior_rings_outside); + // and with points reversed + test::apply("pg054", + "POLYGON((58 31,62 33,56.57 30),(35 9,31 16,28 14),(23 11,26 4,29 5))", + bg::failure_wrong_orientation); + + // "hole" is completely inside another "hole" + test::apply("pg055", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,2 8,8 8,8 2))", + bg::failure_nested_interior_rings); + test::apply("pg056", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,8 2,8 8,2 8))", + bg::failure_wrong_orientation); + + // "hole" is inside another "hole" (touching) + // TODO: return the failure value failure_nested_interior_rings + test::apply("pg057", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,2 8,8 8,9 6,8 2))", + bg::failure_self_intersections); + // TODO: return the failure value failure_nested_interior_rings + test::apply("pg058", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,2 8,8 8,9 6,8 2))", + bg::failure_self_intersections); + test::apply("pg058a", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,8 2,9 6,8 8,2 8))", + bg::failure_wrong_orientation); + // TODO: return the failure value failure_nested_interior_rings + test::apply("pg059", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,2 8,8 8,9 6,8 2))", + bg::failure_self_intersections); + test::apply("pg059a", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,9 1,9 9,1 9),(2 2,2 8,8 8,9 6,8 2))", + bg::failure_wrong_orientation); + // TODO: return the failure value failure_nested_interior_rings + test::apply("pg060", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 1),(2 2,2 8,8 8,9 6,8 2))", + bg::failure_self_intersections); + test::apply("pg060a", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,9 1,9 9,1 9),(2 2,8 2,9 6,8 8,2 8))", + bg::failure_wrong_orientation); + // hole touches exterior ring at two points + test::apply("pg061", + "POLYGON((0 0,10 0,10 10,0 10),(5 0,0 5,5 5))", + bg::failure_disconnected_interior); + + // cases with more holes + // two holes, touching the exterior at the same point + test::apply("pg062", + "POLYGON((0 0,10 0,10 10,0 10),(0 0,1 9,2 9),(0 0,9 2,9 1))", + bg::no_failure); + test::apply("pg063", + "POLYGON((0 0,0 0,10 0,10 10,0 10,0 0),(0 0,0 0,1 9,2 9),(0 0,0 0,9 2,9 1))", + bg::no_failure); + test::apply("pg063", + "POLYGON((0 10,0 0,0 0,0 0,10 0,10 10),(2 9,0 0,0 0,1 9),(9 1,0 0,0 0,9 2))", + bg::no_failure); + // two holes, one inside the other + // TODO: return the failure value failure_nested_interior_rings + test::apply("pg064", + "POLYGON((0 0,10 0,10 10,0 10),(0 0,1 9,9 1),(0 0,4 5,5 4))", + bg::failure_self_intersections); + // 1st hole touches has common segment with 2nd hole + test::apply("pg066", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 5,5 5,5 1),(5 4,5 8,8 8,8 4))", + bg::failure_self_intersections); + // 1st hole touches 2nd hole at two points + test::apply("pg067", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,9 9,9 8,2 8,2 1),(2 5,5 8,5 5))", + bg::failure_disconnected_interior); + // polygon with many holes, where the last two touch at two points + test::apply("pg068", + "POLYGON((0 0,20 0,20 20,0 20),(1 18,1 19,2 19,2 18),(3 18,3 19,4 19,4 18),(5 18,5 19,6 19,6 18),(7 18,7 19,8 19,8 18),(9 18,9 19,10 19,10 18),(11 18,11 19,12 19,12 18),(13 18,13 19,14 19,14 18),(15 18,15 19,16 19,16 18),(17 18,17 19,18 19,18 18),(1 1,1 9,9 9,9 8,2 8,2 1),(2 5,5 8,5 5))", + bg::failure_disconnected_interior); + // two holes completely inside exterior ring but touching each + // other at a point + test::apply("pg069", + "POLYGON((0 0,10 0,10 10,0 10),(1 1,1 9,2 9),(1 1,9 2,9 1))", + bg::no_failure); + // four holes, each two touching at different points + test::apply("pg070", + "POLYGON((0 0,10 0,10 10,0 10),(0 10,2 1,1 1),(0 10,4 1,3 1),(10 10,9 1,8 1),(10 10,7 1,6 1))", + bg::no_failure); + // five holes, with two pairs touching each at some point, and + // fifth hole creating a disconnected component for the interior + test::apply("pg071", + "POLYGON((0 0,10 0,10 10,0 10),(0 10,2 1,1 1),(0 10,4 1,3 1),(10 10,9 1,8 1),(10 10,7 1,6 1),(4 1,4 4,6 4,6 1))", + bg::failure_disconnected_interior); + // five holes, with two pairs touching each at some point, and + // fifth hole creating three disconnected components for the interior + test::apply("pg072", + "POLYGON((0 0,10 0,10 10,0 10),(0 10,2 1,1 1),(0 10,4 1,3 1),(10 10,9 1,8 1),(10 10,7 1,6 1),(4 1,4 4,6 4,6 1,5 0))", + bg::failure_disconnected_interior); + + // both examples: a polygon with one hole, where the hole contains + // the exterior ring + test::apply("pg073", + "POLYGON((0 0,1 0,1 1,0 1),(-10 -10,-10 10,10 10,10 -10))", + bg::failure_interior_rings_outside); + // TODO: return the failure value failure_interior_rings_outside + test::apply("pg074", + "POLYGON((-10 -10,1 0,1 1,0 1),(-10 -10,-10 10,10 10,10 -10))", + bg::failure_self_intersections); +} + +template +inline void test_doc_example_polygon() +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid_failure: doc example polygon " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef bg::model::polygon CCW_CG; + typedef test_failure test; + + test::apply("pg-doc", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 2,0 0),(0 0,2 9,1 9,0 0),(2 9,9 2,9 9,2 9))", + bg::failure_disconnected_interior); +} + +BOOST_AUTO_TEST_CASE( test_failure_polygon ) +{ + test_open_polygons(); + test_doc_example_polygon(); +} + + +template +void test_open_multipolygons() +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid_failure: MULTIPOLYGON (open) " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef bg::model::polygon ccw_open_polygon_type; + typedef bg::model::multi_polygon G; + + typedef test_failure test; + + // not enough points + test::apply("mpg01", "MULTIPOLYGON()", bg::no_failure); + test::apply("mpg02", "MULTIPOLYGON((()))", bg::failure_few_points); + test::apply("mpg03", "MULTIPOLYGON(((0 0)),(()))", bg::failure_few_points); + test::apply("mpg04", "MULTIPOLYGON(((0 0,1 0)))", bg::failure_few_points); + + // two disjoint polygons + test::apply("mpg05", + "MULTIPOLYGON(((0 0,1 0,1 1,0 1)),((2 2,3 2,3 3,2 3)))", + bg::no_failure); + + // two disjoint polygons with multiple points + test::apply("mpg06", + "MULTIPOLYGON(((0 0,1 0,1 0,1 1,0 1)),((2 2,3 2,3 3,3 3,2 3)))", + bg::no_failure); + + // two polygons touch at a point + test::apply("mpg07", + "MULTIPOLYGON(((0 0,1 0,1 1,0 1)),((1 1,2 1,2 2,1 2)))", + bg::no_failure); + + // two polygons share a segment at a point + test::apply("mpg08", + "MULTIPOLYGON(((0 0,1.5 0,1.5 1,0 1)),((1 1,2 1,2 2,1 2)))", + bg::failure_self_intersections); + + // one polygon inside another and boundaries touching + test::apply("mpg09", + "MULTIPOLYGON(((0 0,10 0,10 10,0 10)),((0 0,9 1,9 2)))", + bg::failure_intersecting_interiors); + test::apply("mpg09_2", + "MULTIPOLYGON(((0 0,5 1,10 0,10 10,0 10)),((1 1,9 1,9 2)))", + bg::failure_intersecting_interiors); + + // one polygon inside another and boundaries not touching + test::apply("mpg10", + "MULTIPOLYGON(((0 0,10 0,10 10,0 10)),((1 1,9 1,9 2)))", + bg::failure_intersecting_interiors); + + // free space is disconnected + test::apply("mpg11", + "MULTIPOLYGON(((0 0,1 0,1 1,0 1)),((1 1,2 1,2 2,1 2)),((0 1,0 2,-1 2,-1 -1)),((1 2,1 3,0 3,0 2)))", + bg::no_failure); + + // multi-polygon with a polygon inside the hole of another polygon + test::apply("mpg12", + "MULTIPOLYGON(((0 0,100 0,100 100,0 100),(1 1,1 99,99 99,99 1)),((2 2,98 2,98 98,2 98)))", + bg::no_failure); + test::apply("mpg13", + "MULTIPOLYGON(((0 0,100 0,100 100,0 100),(1 1,1 99,99 99,99 1)),((1 1,98 2,98 98,2 98)))", + bg::no_failure); + + // test case suggested by Barend Gehrels: take two valid polygons P1 and + // P2 with holes H1 and H2, respectively, and consider P2 to be + // fully inside H1; now invalidate the multi-polygon by + // considering H2 as a hole of P1 and H1 as a hole of P2; this + // should be invalid + // + // first the valid case: + test::apply("mpg14", + "MULTIPOLYGON(((0 0,100 0,100 100,0 100),(1 1,1 99,99 99,99 1)),((2 2,98 2,98 98,2 98),(3 3,3 97,97 97,97 3)))", + bg::no_failure); + // and the invalid case: + test::apply("mpg15", + "MULTIPOLYGON(((0 0,100 0,100 100,0 100),(3 3,3 97,97 97,97 3)),((2 2,98 2,98 98,2 98),(1 1,1 99,99 99,99 1)))", + bg::failure_interior_rings_outside); + + test::apply + ("mpg16", + "MULTIPOLYGON(((-1 4,8 -10,-10 10,7 -6,8 -2,\ + -10 10,-10 1,-3 -4,4 1,-1 2,4 3,-8 10,-5 -9,-1 6,-5 0)),\ + ((-10 -3,-8 1,2 -8,-2 6,-4 0,8 -5,-1 5,8 2)),\ + ((-6 -10,1 10,4 -8,-7 -2,2 0,-4 3,-10 9)),\ + ((10 -1,-2 8,-7 3,-6 8,-9 -7,7 -5)),\ + ((7 7,-4 -4,9 -8,-10 -6)))", + bg::failure_wrong_orientation); + + test::apply + ("mpg17", + "MULTIPOLYGON(((-1 4,8 -10,-10 10,7 -6,8 -2,\ + -10 10,-10 1,-3 -4,4 1,-1 2,4 3,-8 10,-5 -9,-1 6,-5 0)),\ + ((-10 -3,-8 1,2 -8,-2 6,-4 0,8 -5,-1 5,8 2)),\ + ((-6 -10,-10 9,-4 3,2 0,-7 -2,4 -8,1 10)),\ + ((10 -1,-2 8,-7 3,-6 8,-9 -7,7 -5)),\ + ((7 7,-10 -6,9 -8,-4 -4)))", + bg::failure_spikes); + + // test cases coming from buffer + { + std::string wkt = "MULTIPOLYGON(((1.1713032141645456 -0.9370425713316364,5.1713032141645456 4.0629574286683638,4.7808688094430307 4.3753049524455756,4.7808688094430307 4.3753049524455756,0.7808688094430304 -0.6246950475544243,0.7808688094430304 -0.6246950475544243,1.1713032141645456 -0.9370425713316364)))"; + + G open_mpgn = from_wkt(wkt); + bg::reverse(open_mpgn); + + test::apply("mpg18", open_mpgn, bg::failure_wrong_orientation); + } + { + std::string wkt = "MULTIPOLYGON(((5.2811206375710933 9.9800205994776228,5.2446420208654896 10.0415020265598844,5.1807360092909640 10.1691699739962242,5.1261005500004773 10.3010716408018013,5.0810140527710059 10.4365348863171388,5.0457062680576819 10.5748694208940446,5.0203571162381344 10.7153703234534277,5.0050957707794934 10.8573216336015328,5.0000000000000000 10.9999999999999964,5.0050957707794925 11.1426783663984619,5.0203571162381344 11.2846296765465670,5.0457062680576801 11.4251305791059501,5.0810140527710042 11.5634651136828559,5.1261005500004755 11.6989283591981934,5.1807360092909622 11.8308300260037704,5.2446420208654869 11.9584979734401102,5.3174929343376363 12.0812816349111927,5.3989175181512774 12.1985553330226910,5.4885008512914810 12.3097214678905669,5.5857864376269024 12.4142135623730923,5.6902785321094269 12.5114991487085145,5.8014446669773028 12.6010824818487190,5.9187183650888020 12.6825070656623602,6.0415020265598844 12.7553579791345104,6.1691699739962260 12.8192639907090360,6.3010716408018030 12.8738994499995236,6.4365348863171405 12.9189859472289950,6.5748694208940472 12.9542937319423199,6.7153703234534312 12.9796428837618656,6.8573216336015381 12.9949042292205075,7.0000000000000036 13.0000000000000000,7.1426783663984690 12.9949042292205075,7.2846296765465750 12.9796428837618656,7.4251305791059590 12.9542937319423181,7.5634651136828657 12.9189859472289932,7.6989283591982032 12.8738994499995201,7.8308300260037802 12.8192639907090324,7.9584979734401209 12.7553579791345069,8.0812816349112033 12.6825070656623566,8.1985553330227017 12.6010824818487137,8.3097214678905793 12.5114991487085092,8.4142135623731029 12.4142135623730869,8.5114991487085252 12.3097214678905598,8.6010824818487297 12.1985553330226821,8.6825070656623708 12.0812816349111838,8.7553579791345193 11.9584979734400996,8.8192639907090431 11.8308300260037580,8.8738994499995290 11.6989283591981810,8.9189859472290003 11.5634651136828417,8.9542937319423235 11.4251305791059359,8.9796428837618691 11.2846296765465510,8.9949042292205093 11.1426783663984441,9.0000000000000000 11.0000000000000000,8.9949042292205075 10.8573216336015346,8.9796428837618656 10.7153703234534294,8.9542937319423181 10.5748694208940464,8.9189859472289950 10.4365348863171405,8.8738994499995236 10.3010716408018030,8.8192639907090360 10.1691699739962278,8.7553579791345122 10.0415020265598862,8.7188787869375428 9.9800200826281831,8.8573216336015381 9.9949042292205075,9.0000000000000036 10.0000000000000000,9.1426783663984690 9.9949042292205075,9.2846296765465759 9.9796428837618656,9.4251305791059590 9.9542937319423181,9.5634651136828648 9.9189859472289932,9.6989283591982041 9.8738994499995201,9.8308300260037793 9.8192639907090324,9.9584979734401209 9.7553579791345069,10.0812816349112033 9.6825070656623566,10.1985553330227017 9.6010824818487137,10.3097214678905793 9.5114991487085092,10.4142135623731029 9.4142135623730869,10.5114991487085252 9.3097214678905598,10.6010824818487297 9.1985553330226821,10.6825070656623708 9.0812816349111838,10.7553579791345193 8.9584979734400996,10.8192639907090431 8.8308300260037580,10.8738994499995290 8.6989283591981810,10.9189859472290003 8.5634651136828417,10.9542937319423235 8.4251305791059359,10.9796428837618691 8.2846296765465510,10.9949042292205093 8.1426783663984441,11.0000000000000000 8.0000000000000000,10.9949042292205075 7.8573216336015355,10.9796428837618656 7.7153703234534294,10.9542937319423181 7.5748694208940464,10.9189859472289950 7.4365348863171405,10.8738994499995236 7.3010716408018030,10.8192639907090360 7.1691699739962269,10.7553579791345122 7.0415020265598862,10.6825070656623620 6.9187183650888047,10.6010824818487208 6.8014446669773063,10.5114991487085163 6.6902785321094296,10.4142135623730958 6.5857864376269051,10.3097214678905704 6.4885008512914837,10.1985553330226946 6.3989175181512792,10.0812816349111962 6.3174929343376380,9.9584979734401138 6.2446420208654887,9.8308300260037740 6.1807360092909640,9.6989283591981970 6.1261005500004764,9.5634651136828595 6.0810140527710050,9.4251305791059536 6.0457062680576810,9.2846296765465706 6.0203571162381344,9.1426783663984654 6.0050957707794925,9.0000000000000018 6.0000000000000000,8.8573216336015363 6.0050957707794925,8.7153703234534312 6.0203571162381344,8.5748694208940481 6.0457062680576810,8.4365348863171423 6.0810140527710050,8.3010716408018048 6.1261005500004764,8.1691699739962278 6.1807360092909622,8.0415020265598880 6.2446420208654878,7.9187183650888064 6.3174929343376363,7.8014446669773072 6.3989175181512783,7.6902785321094314 6.4885008512914819,7.5857864376269060 6.5857864376269033,7.4885008512914846 6.6902785321094278,7.3989175181512810 6.8014446669773045,7.3174929343376389 6.9187183650888029,7.2446420208654896 7.0415020265598844,7.1807360092909640 7.1691699739962251,7.1261005500004773 7.3010716408018013,7.0810140527710059 7.4365348863171379,7.0457062680576819 7.5748694208940437,7.0203571162381344 7.7153703234534268,7.0050957707794934 7.8573216336015328,7.0000000000000000 7.9999999999999973,7.0050957707794925 8.1426783663984619,7.0203571162381344 8.2846296765465670,7.0457062680576801 8.4251305791059501,7.0810140527710042 8.5634651136828559,7.1261005500004755 8.6989283591981934,7.1807360092909622 8.8308300260037704,7.2446420208654869 8.9584979734401102,7.2811219724467575 9.0199799990140797,7.1426783663984654 9.0050957707794925,7.0000000000000009 9.0000000000000000,6.8573216336015363 9.0050957707794925,6.7188786030357956 9.0199806804111571,6.7553579791345184 8.9584979734400996,6.8192639907090431 8.8308300260037580,6.8738994499995290 8.6989283591981810,6.9189859472290003 8.5634651136828417,6.9542937319423235 8.4251305791059359,6.9796428837618683 8.2846296765465510,6.9949042292205084 8.1426783663984441,7.0000000000000000 8.0000000000000000,6.9949042292205075 7.8573216336015355,6.9796428837618656 7.7153703234534294,6.9542937319423190 7.5748694208940464,6.9189859472289950 7.4365348863171405,6.8738994499995236 7.3010716408018030,6.8192639907090369 7.1691699739962269,6.7553579791345113 7.0415020265598862,6.6825070656623620 6.9187183650888047,6.6010824818487208 6.8014446669773063,6.5114991487085163 6.6902785321094296,6.4142135623730949 6.5857864376269051,6.3097214678905704 6.4885008512914837,6.1985553330226946 6.3989175181512792,6.0812816349111953 6.3174929343376380,5.9584979734401138 6.2446420208654887,5.8308300260037731 6.1807360092909640,5.6989283591981970 6.1261005500004764,5.5634651136828603 6.0810140527710050,5.4251305791059536 6.0457062680576810,5.2846296765465715 6.0203571162381344,5.1426783663984654 6.0050957707794925,5.0000000000000009 6.0000000000000000,4.8573216336015363 6.0050957707794925,4.7153703234534312 6.0203571162381344,4.5748694208940481 6.0457062680576810,4.4365348863171423 6.0810140527710050,4.3010716408018048 6.1261005500004764,4.1691699739962287 6.1807360092909622,4.0415020265598880 6.2446420208654878,3.9187183650888064 6.3174929343376363,3.8014446669773077 6.3989175181512783,3.6902785321094314 6.4885008512914819,3.5857864376269064 6.5857864376269033,3.4885008512914846 6.6902785321094278,3.3989175181512805 6.8014446669773045,3.3174929343376389 6.9187183650888029,3.2446420208654896 7.0415020265598844,3.1807360092909640 7.1691699739962251,3.1261005500004773 7.3010716408018013,3.0810140527710059 7.4365348863171379,3.0457062680576819 7.5748694208940437,3.0203571162381349 7.7153703234534268,3.0050957707794934 7.8573216336015328,3.0000000000000000 7.9999999999999973,3.0050957707794925 8.1426783663984619,3.0203571162381344 8.2846296765465670,3.0457062680576801 8.4251305791059501,3.0810140527710042 8.5634651136828559,3.1261005500004755 8.6989283591981934,3.1807360092909618 8.8308300260037704,3.2446420208654869 8.9584979734401102,3.3174929343376358 9.0812816349111927,3.3989175181512770 9.1985553330226910,3.4885008512914810 9.3097214678905669,3.5857864376269024 9.4142135623730923,3.6902785321094269 9.5114991487085145,3.8014446669773028 9.6010824818487190,3.9187183650888020 9.6825070656623602,4.0415020265598844 9.7553579791345104,4.1691699739962260 9.8192639907090360,4.3010716408018030 9.8738994499995236,4.4365348863171405 9.9189859472289950,4.5748694208940472 9.9542937319423199,4.7153703234534312 9.9796428837618656,4.8573216336015381 9.9949042292205075,5.0000000000000036 10.0000000000000000,5.1426783663984690 9.9949042292205075)))"; + + G open_mpgn = from_wkt(wkt); + bg::reverse(open_mpgn); + + // polygon has a self-touching point + test::apply("mpg19", open_mpgn, bg::failure_self_intersections); + } + { + std::string wkt = "MULTIPOLYGON(((-1.1713032141645421 0.9370425713316406,-1.2278293047051545 0.8616467945203863,-1.2795097139219473 0.7828504914601357,-1.3261404828502752 0.7009646351604617,-1.3675375811487496 0.6163123916860891,-1.4035376333829217 0.5292278447680804,-1.4339985637934827 0.4400546773279756,-1.4588001570043776 0.3491448151183161,-1.4778445324579732 0.2568570378324778,-1.4910565307049013 0.1635555631651331,-1.4983840100240693 0.0696086094114048,-1.4997980522022116 -0.0246130577225216,-1.4952930766608652 -0.1187375883622537,-1.4848868624803642 -0.2123935159867641,-1.4686204782339323 -0.3052112234370423,-1.4465581199087858 -0.3968244016261590,-1.4187868575539013 -0.4868714951938814,-1.3854162916543107 -0.5749971294005020,-1.3465781205880585 -0.6608535126285795,-1.3024256208728704 -0.7441018089575634,-1.2531330422537639 -0.8244134753943718,-1.1988949200189114 -0.9014715584824893,-1.1399253072577331 -0.9749719451724563,-1.0764569300911435 -1.0446245630171400,-1.0087402692078766 -1.1101545249551616,-0.9370425713316382 -1.1713032141645441,-0.8616467945203836 -1.2278293047051563,-0.7828504914601331 -1.2795097139219491,-0.7009646351604588 -1.3261404828502767,-0.6163123916860862 -1.3675375811487509,-0.5292278447680773 -1.4035376333829228,-0.4400546773279725 -1.4339985637934838,-0.3491448151183129 -1.4588001570043785,-0.2568570378324746 -1.4778445324579736,-0.1635555631651299 -1.4910565307049017,-0.0696086094114016 -1.4983840100240695,0.0246130577225248 -1.4997980522022114,0.1187375883622569 -1.4952930766608650,0.2123935159867673 -1.4848868624803639,0.3052112234370455 -1.4686204782339316,0.3968244016261621 -1.4465581199087849,0.4868714951938845 -1.4187868575539002,0.5749971294005050 -1.3854162916543096,0.6608535126285824 -1.3465781205880569,0.7441018089575662 -1.3024256208728686,0.8244134753943745 -1.2531330422537621,0.9014715584824917 -1.1988949200189096,0.9749719451724583 -1.1399253072577313,1.0446245630171418 -1.0764569300911420,1.1101545249551634 -1.0087402692078746,1.1713032141645456 -0.9370425713316364,5.1713032141645456 4.0629574286683638,5.1713032141645439 4.0629574286683621,5.2278293047051561 4.1383532054796159,5.2795097139219491 4.2171495085398671,5.3261404828502767 4.2990353648395407,5.3675375811487509 4.3836876083139131,5.4035376333829230 4.4707721552319217,5.4339985637934838 4.5599453226720268,5.4588001570043785 4.6508551848816859,5.4778445324579739 4.7431429621675241,5.4910565307049017 4.8364444368348689,5.4983840100240693 4.9303913905885972,5.4997980522022116 5.0246130577225232,5.4952930766608645 5.1187375883622552,5.4848868624803639 5.2123935159867658,5.4686204782339320 5.3052112234370439,5.4465581199087856 5.3968244016261604,5.4187868575539007 5.4868714951938822,5.3854162916543107 5.5749971294005025,5.3465781205880578 5.6608535126285799,5.3024256208728699 5.7441018089575637,5.2531330422537632 5.8244134753943726,5.1988949200189110 5.9014715584824895,5.1399253072577329 5.9749719451724559,5.0764569300911440 6.0446245630171394,5.0087402692078768 6.1101545249551616,4.9370425713316379 6.1713032141645439,4.8616467945203841 6.2278293047051561,4.7828504914601337 6.2795097139219482,4.7009646351604593 6.3261404828502759,4.6163123916860869 6.3675375811487509,4.5292278447680783 6.4035376333829230,4.4400546773279732 6.4339985637934838,4.3491448151183141 6.4588001570043785,4.2568570378324750 6.4778445324579739,4.1635555631651311 6.4910565307049017,4.0696086094114028 6.4983840100240693,3.9753869422774759 6.4997980522022116,3.8812624116377439 6.4952930766608645,3.7876064840132333 6.4848868624803639,3.6947887765629552 6.4686204782339320,3.6031755983738387 6.4465581199087847,3.5131285048061165 6.4187868575539007,3.4250028705994957 6.3854162916543098,3.3391464873714183 6.3465781205880578,3.2558981910424345 6.3024256208728691,3.1755865246056261 6.2531330422537623,3.0985284415175087 6.1988949200189101,3.0250280548275423 6.1399253072577320,2.9553754369828584 6.0764569300911422,2.8898454750448366 6.0087402692078751,2.8286967858354544 5.9370425713316362,-1.1713032141645456 0.9370425713316364,-1.1713032141645421 0.9370425713316406)))"; + + G open_mpgn = from_wkt(wkt); + bg::reverse(open_mpgn); + + // polygon contains a spike + test::apply("mpg20", open_mpgn, bg::failure_spikes); + } +} + +BOOST_AUTO_TEST_CASE( test_failure_multipolygon ) +{ + test_open_multipolygons(); +} + +BOOST_AUTO_TEST_CASE( test_failure_variant ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid_failure: variant support" << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef bg::model::polygon polygon_type; // cw, closed + + typedef boost::variant + < + linestring_type, multi_linestring_type, polygon_type + > variant_geometry; + typedef test_failure test; + + variant_geometry vg; + + linestring_type valid_linestring = + from_wkt("LINESTRING(0 0,1 0)"); + multi_linestring_type invalid_multi_linestring = + from_wkt("MULTILINESTRING((0 0,1 0),(0 0))"); + polygon_type valid_polygon = + from_wkt("POLYGON((0 0,1 1,1 0,0 0))"); + polygon_type invalid_polygon = + from_wkt("POLYGON((0 0,2 2,2 0,1 0))"); + + vg = valid_linestring; + test::apply("v01", vg, bg::no_failure); + vg = invalid_multi_linestring; + test::apply("v02", vg, bg::failure_few_points); + vg = valid_polygon; + test::apply("v03", vg, bg::no_failure); + vg = invalid_polygon; + test::apply("v04", vg, bg::failure_not_closed); +} diff --git a/src/boost/libs/geometry/test/algorithms/is_valid_geo.cpp b/src/boost/libs/geometry/test/algorithms/is_valid_geo.cpp new file mode 100644 index 000000000..67a82b2e4 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/is_valid_geo.cpp @@ -0,0 +1,76 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// Copyright (c) 2014-2018, 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_is_valid_geo +#endif + +#include +#include + +#include + +#include "test_is_valid.hpp" + +#include + +#include +#include +#include + + +BOOST_AUTO_TEST_CASE( test_is_valid_geo_polygon ) +{ + typedef bg::model::point > pt; + typedef bg::model::polygon G; + + typedef validity_tester_geo_areal tester; + typedef test_valid test; + + test::apply("p01", "POLYGON((-1 -1, 1 -1, 1 1, -1 1, -1 -1),(-0.5 -0.5, -0.5 0.5, 0.0 0.0, -0.5 -0.5),(0.0 0.0, 0.5 0.5, 0.5 -0.5, 0.0 0.0))", true); +} + +template +void test_valid_s(std::string const& wkt, + Spheroid const& sph, + bool expected_result) +{ + bg::strategy::intersection::geographic_segments<> is(sph); + bg::strategy::area::geographic<> as(sph); + + Poly p; + bg::read_wkt(wkt, p); + bg::correct(p, as); + + BOOST_CHECK(bg::is_valid(p, is) == expected_result); +} + +BOOST_AUTO_TEST_CASE( test_is_valid_epsg4053_polygon ) +{ + typedef bg::model::point > pt; + typedef bg::model::polygon po; + + bg::srs::spheroid epsg4053(6371228, 6371228); + bg::srs::spheroid wgs84; + + // NOTE: the orientation is different in these CSes, + // in one of them the polygon is corrected before passing it into is_valid() + + test_valid_s("POLYGON((-148 -68,178 -74,76 0,-148 -68))", wgs84, true); + test_valid_s("POLYGON((-148 -68,178 -74,76 0,-148 -68))", epsg4053, true); + + test_valid_s("POLYGON((-152 -54,-56 43,142 -52,-152 -54))", wgs84, true); + test_valid_s("POLYGON((-152 -54,-56 43,142 -52,-152 -54))", epsg4053, true); + + return; +} \ No newline at end of file diff --git a/src/boost/libs/geometry/test/algorithms/length/Jamfile b/src/boost/libs/geometry/test/algorithms/length/Jamfile new file mode 100644 index 000000000..8fe1bb13f --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/length/Jamfile @@ -0,0 +1,17 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2016 Oracle and/or its affiliates. +# +# Contributed and/or modified by Vissarion Fisikopoulos, 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) + +test-suite boost-geometry-algorithms-length + : + [ run length.cpp : : : : algorithms_length ] + [ run length_multi.cpp : : : : algorithms_length_multi ] + [ run length_sph.cpp : : : : algorithms_length_sph ] + [ run length_geo.cpp : : : : algorithms_length_geo ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/length/length.cpp b/src/boost/libs/geometry/test/algorithms/length/length.cpp new file mode 100644 index 000000000..11e18d396 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/length/length.cpp @@ -0,0 +1,55 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include + +#include +#include +#include + +#include +#include + + +template +void test_all() +{ + // 3-4-5 triangle + test_geometry >("LINESTRING(0 0,3 4)", 5); + + // 3-4-5 plus 1-1 + test_geometry >("LINESTRING(0 0,3 4,4 3)", 5 + sqrt(2.0)); + test_geometry >("LINESTRING(0 0,3 4,4 3)", 5 + sqrt(2.0)); + test_geometry >("LINESTRING(0 0,3 4,4 3)", 5 + sqrt(2.0)); + + // Geometries with length zero + test_geometry

("POINT(0 0)", 0); + test_geometry >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 0); +} + +template +void test_empty_input() +{ + test_empty_input(bg::model::linestring

()); +} + +int test_main(int, char* []) +{ + test_all >(); + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + // test_empty_input >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/length/length_geo.cpp b/src/boost/libs/geometry/test/algorithms/length/length_geo.cpp new file mode 100644 index 000000000..66754eaf0 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/length/length_geo.cpp @@ -0,0 +1,121 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2016 Oracle and/or its affiliates. +// Contributed and/or modified by Vissarion Fisikopoulos, 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) + +#include +#include + +#include +#include +#include + +#include +#include + +template +struct geo_strategies +{ + // Set radius type, but for integer coordinates we want to have floating + // point radius type + typedef typename bg::promote_floating_point + < + typename bg::coordinate_type

::type + >::type rtype; + + typedef bg::srs::spheroid stype; + typedef bg::strategy::distance::andoyer andoyer_type; + typedef bg::strategy::distance::thomas thomas_type; + typedef bg::strategy::distance::vincenty vincenty_type; +}; + +template +void test_default() //this should use andoyer strategy +{ + for(std::size_t i = 0; i < 2; ++i) + { + test_geometry >(Ls_data_geo[i], + 1116814.237 + 1116152.605); + } + // Geometries with length zero + test_geometry

("POINT(0 0)", 0); + test_geometry >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 0); +} + +template +void test_with_strategy(N exp_length, Strategy strategy) +{ + for(std::size_t i = 0; i < 2; ++i) + { + test_geometry >(Ls_data_geo[i], + exp_length, + strategy); + } + // Geometries with length zero + test_geometry

("POINT(0 0)", 0, strategy); + test_geometry >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 0, + strategy); +} + +template +void test_andoyer() +{ + typename geo_strategies

::andoyer_type andoyer; + test_with_strategy

(1116814.237 + 1116152.605, andoyer); +} + +template +void test_thomas() +{ + typename geo_strategies

::thomas_type thomas; + test_with_strategy

(1116825.795 + 1116158.7417, thomas); +} + +template +void test_vincenty() +{ + typename geo_strategies

::vincenty_type vincenty; + test_with_strategy

(1116825.857 + 1116159.144, vincenty); +} + +template +void test_all() +{ + test_default

(); + test_andoyer

(); + test_thomas

(); + test_vincenty

(); +} + +template +void test_empty_input() +{ + test_empty_input(bg::model::linestring

()); + test_empty_input(bg::model::multi_linestring

()); +} + +int test_main(int, char* []) +{ + // Works only for double(?!) + //test_all > >(); + //test_all > >(); + test_all > >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + //test_empty_input > >(); + + return 0; +} + diff --git a/src/boost/libs/geometry/test/algorithms/length/length_multi.cpp b/src/boost/libs/geometry/test/algorithms/length/length_multi.cpp new file mode 100644 index 000000000..083349f57 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/length/length_multi.cpp @@ -0,0 +1,38 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + + +#include + +#include +#include + +template +void test_all() +{ + test_geometry > > + ("MULTILINESTRING((0 0,3 4,4 3))", 5 + sqrt(2.0)); +} + +template +void test_empty_input() +{ + test_empty_input(bg::model::multi_linestring

()); +} + +int test_main( int , char* [] ) +{ + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + // test_empty_input >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/length/length_sph.cpp b/src/boost/libs/geometry/test/algorithms/length/length_sph.cpp new file mode 100644 index 000000000..6b2f8944f --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/length/length_sph.cpp @@ -0,0 +1,87 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2016 Oracle and/or its affiliates. +// Contributed and/or modified by Vissarion Fisikopoulos, 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) + +#include +#include + +#include +#include +#include + +#include +#include + +template +void test_all_default() //test the default strategy +{ + double const pi = boost::math::constants::pi(); + + for(std::size_t i = 0; i < 2; ++i) + { + test_geometry >(Ls_data_sph[i], 2 * pi); + } + // Geometries with length zero + test_geometry

("POINT(0 0)", 0); + test_geometry >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 0); +} + +template +void test_all_haversine(double const mean_radius) +{ + double const pi = boost::math::constants::pi(); + bg::strategy::distance::haversine haversine_strategy(mean_radius); + + for(std::size_t i = 0; i < 2; ++i) + { + test_geometry >(Ls_data_sph[i], + 2 * pi * mean_radius, + haversine_strategy); + } + // Geometries with length zero + test_geometry

("POINT(0 0)", 0, haversine_strategy); + test_geometry >("POLYGON((0 0,0 1,1 1,1 0,0 0))", + 0, haversine_strategy); +} + +template +void test_empty_input() +{ + test_empty_input(bg::model::linestring

()); + test_empty_input(bg::model::multi_linestring

()); +} + +int test_main(int, char* []) +{ + //Earth radius estimation in Km + //(see https://en.wikipedia.org/wiki/Earth_radius) + double const mean_radius = 6371.0; + + test_all_default > >(); + test_all_default > >(); + test_all_default > >(); + + test_all_haversine > >(mean_radius); + test_all_haversine > >(mean_radius); + test_all_haversine > >(mean_radius); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + //test_empty_input >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/length/linestring_cases.hpp b/src/boost/libs/geometry/test/algorithms/length/linestring_cases.hpp new file mode 100644 index 000000000..9c7774f86 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/length/linestring_cases.hpp @@ -0,0 +1,28 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016 Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, 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) + +#ifndef LINESTRING_CASES_HPP +#define LINESTRING_CASES_HPP + +#include + +static std::string Ls_data_geo[] = {"LINESTRING(0 90,1 80,1 70)", + "LINESTRING(0 90,1 80,1 80,1 80,1 70,1 70)", + "LINESTRING(0 90,1 80,1 79,1 78,1 77,1 76,1 75,1 74,\ + 1 73,1 72,1 71,1 70)"}; + +static std::string Ls_data_sph[] = {"LINESTRING(0 0,180 0,180 180)", + "LINESTRING(0 0,180 0,180 0,180 0,180 180,180 180)", + "LINESTRING(0 0,180 0,180 10,180 20,180 30,180 40,180 50,180 60,\ + 180 70,180 80,180 90,180 100,180 110,180 120,180 130,\ + 180 140,180 150,180 160,180 170,180 180)"}; + +#endif // LINESTRING_CASES_HPP diff --git a/src/boost/libs/geometry/test/algorithms/line_interpolate.cpp b/src/boost/libs/geometry/test/algorithms/line_interpolate.cpp new file mode 100644 index 000000000..45a169905 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/line_interpolate.cpp @@ -0,0 +1,370 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2018, Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#include + +#include +#include + +#include +#include + +#include + +#include + +#include + +template ::type> +struct check_points: bg::not_implemented +{}; + +template +struct check_points +{ + static void apply(P const& p0, P const& p1) + { + double p00 = bg::get<0>(p0); + double p10 = bg::get<0>(p1); + + BOOST_CHECK_CLOSE(p00, p10, 0.001); + + double p01 = bg::get<1>(p0); + double p11 = bg::get<1>(p1); + + BOOST_CHECK_CLOSE(p01, p11, 0.001); + } +}; + +template +struct check_points +{ + template + static void apply(Range const& r0, Range const& r1) + { + + typedef typename boost::range_iterator::type iterator_t; + typedef typename boost::range_value::type point_t; + + std::size_t count0 = boost::size(r0); + std::size_t count1 = boost::size(r1); + + BOOST_CHECK_MESSAGE(count0 == count1, bg::wkt(r0) << " != " << bg::wkt(r1)); + + if (count0 == count1) + { + for (iterator_t it0 = boost::begin(r0), it1 = boost::begin(r1); + it0 < boost::end(r0); it0++, it1++) + { + check_points::apply(*it0, *it1); + } + } + } +}; + +template +inline void test(std::string const& wkt1, + double fraction, + std::string const& wkt2, + S str) +{ + G g; + bg::read_wkt(wkt1, g); + + P o; + bg::read_wkt(wkt2, o); + + P p1; + bg::line_interpolate(g, fraction * bg::length(g), p1, str); + check_points

::apply(p1, o); + +} + +template +inline void test(std::string const& wkt1, + double fraction, + std::string const& wkt2) +{ + G g; + bg::read_wkt(wkt1, g); + + P o; + bg::read_wkt(wkt2, o); + + P p1; + bg::line_interpolate(g, fraction * bg::length(g), p1); + check_points

::apply(p1, o); +} + +template +inline void test_distance(std::string const& wkt1, + double distance, + std::string const& wkt2) +{ + G g; + bg::read_wkt(wkt1, g); + + P o; + bg::read_wkt(wkt2, o); + + P p1; + bg::line_interpolate(g, distance, p1); + check_points

::apply(p1, o); +} + +template +inline void test_distance(std::string const& wkt1, + double distance, + std::string const& wkt2, + S str) +{ + G g; + bg::read_wkt(wkt1, g); + + P o; + bg::read_wkt(wkt2, o); + + P p1; + bg::line_interpolate(g, distance, p1, str); + check_points

::apply(p1, o); +} + +std::string const s = "SEGMENT(1 1, 2 2)"; +std::string const l1 = "LINESTRING(1 1, 2 1, 2 2, 1 2, 1 3)"; +std::string const l2 = "LINESTRING(0 2, 5 2, 5 1, 20 1)"; +std::string const l00 = "LINESTRING()"; +std::string const l01 = "LINESTRING(1 1)"; +std::string const l02 = "LINESTRING(1 1, 1 1)"; + +void test_car_edge_cases() +{ + typedef bg::model::point P; + typedef bg::model::multi_point

MP; + typedef bg::model::linestring

LS; + + //negative input distance + test_distance(l1, -1, "POINT(1 1)"); + test_distance(l1, -1, "MULTIPOINT((1 1))"); + + //input distance longer than total length + test_distance(l1, 5, "POINT(1 3)"); + test_distance(l1, 5, "MULTIPOINT((1 3))"); + + //linestring with only one point + test_distance(l01, 1, "POINT(1 1)"); + test_distance(l01, 1, "MULTIPOINT((1 1))"); + + //linestring with two same points + test_distance(l02, 1, "POINT(1 1)"); + test_distance(l02, 1, "MULTIPOINT((1 1))"); + + //empty linestring + try + { + test_distance(l00, 1, "POINT(1 1)"); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "A empty_input_exception should have been thrown" ); +} + +void test_car() +{ + typedef bg::model::point P; + typedef bg::model::multi_point

MP; + typedef bg::model::segment

S; + typedef bg::model::linestring

LS; + + test(s, 0, "POINT(1 1)"); + test(s, 0.5, "POINT(1.5 1.5)"); + test(s, 1, "POINT(2 2)"); + + test(l1, 0, "POINT(1 1)"); + test(l1, 0.1, "POINT(1.4 1)"); + test(l1, 0.2, "POINT(1.8 1)"); + test(l1, 0.3, "POINT(2 1.2)"); + test(l1, 0.4, "POINT(2 1.6)"); + test(l1, 0.5, "POINT(2 2)"); + test(l1, 0.6, "POINT(1.6 2)"); + test(l1, 0.7, "POINT(1.2 2)"); + test(l1, 0.8, "POINT(1 2.2)"); + test(l1, 0.9, "POINT(1 2.6)"); + test(l1, 1, "POINT(1 3)"); + + test(l1, 0, "MULTIPOINT((1 1))"); + //(1 3) missing due to floating point round off errors + test(l1, 0.1, "MULTIPOINT((1.4 1)(1.8 1)(2 1.2)(2 1.6)(2 2)(1.6 2)\ + (1.2 2)(1 2.2)(1 2.6))"); + //(1 3) is not missing if you directly pass the distance + test_distance(l1, 0.4, "MULTIPOINT((1.4 1)(1.8 1)(2 1.2)(2 1.6)(2 2)(1.6 2)\ + (1.2 2)(1 2.2)(1 2.6)(1 3))"); + test(l1, 0.2, "MULTIPOINT((1.8 1)(2 1.6)(1.6 2)(1 2.2))");//(1 3) missing + test(l1, 0.4, "MULTIPOINT((2 1.6)(1 2.2))"); + test(l1, 0.5, "MULTIPOINT((2 2)(1 3))"); + test(l1, 0.6, "MULTIPOINT((1.6 2))"); + test(l1, 1, "MULTIPOINT((1 3))"); +} + +void test_sph() +{ + typedef bg::model::point > P; + typedef bg::model::multi_point

MP; + typedef bg::model::segment

S; + typedef bg::model::linestring

LS; + + test(s, 0, "POINT(1 1)"); + test(s, 0.5, "POINT(1.4998857365615981 1.5000570914791198)"); + test(s, 1, "POINT(2 2)"); + + test(l1, 0, "POINT(1 1)"); + test(l1, 0.1, "POINT(1.39998476912905323 1.0000365473536286)"); + test(l1, 0.2, "POINT(1.79996953825810646 1.0000243679448551)"); + test(l1, 0.3, "POINT(2 1.1999238595669637)"); + test(l1, 0.4, "POINT(2 1.5998477098527744)"); + test(l1, 0.5, "POINT(2 1.9997715601390484)"); + test(l1, 0.6, "POINT(1.6000609543036084 2.0000730473928678)"); + test(l1, 0.7, "POINT(1.1998933176222553 2.0000486811516014)"); + test(l1, 0.8, "POINT(1 2.2001522994279883)"); + test(l1, 0.9, "POINT(1 2.6000761497139444)"); + test(l1, 1, "POINT(1 3)"); + + test(l1, 0, "MULTIPOINT((1 1))"); + test(l1, 0.1, "MULTIPOINT((1.39998476912905323 1.0000365473536286)\ + (1.79996953825810646 1.0000243679448551)\ + (2 1.1999238595669637)\ + (2 1.5998477098527744)\ + (2 1.9997715601385837)\ + (1.6000609543036084 2.0000730473928678)\ + (1.1998933176222553 2.0000486811516014)\ + (1 2.2001522994279883)\ + (1 2.6000761497139444)\ + )");//(1,3) + test(l1, 0.2, "MULTIPOINT((1.79996953825810646 1.0000243679448551)\ + (2 1.5998477098527744)\ + (1.6000609543036084 2.0000730473928678)\ + (1 2.2001522994279883)\ + )");//(1,3) + test(l1, 0.4, "MULTIPOINT((2 1.5998477098527744)(1 2.2001522994279883))"); + test(l1, 0.5, "MULTIPOINT((2 1.9997715601385837)(1 3))"); + test(l1, 0.6, "MULTIPOINT((1.6000609543036084 2.0000730473928678))"); + test(l1, 1, "MULTIPOINT((1 3))"); + + test(l2, 0.3, "MULTIPOINT((5.3014893312120446 1.0006787676128222)\ + (11.600850053156366 1.0085030143490989)\ + (17.9002174825842 1.0041514208039872))"); + +} + +template +void test_sph(Strategy str) +{ + typedef bg::model::point > P; + typedef bg::model::segment

S; + + test_distance(s, 0, "POINT(1 1)", str); + test_distance(s, 0.01, "POINT(1.4051065077123643 1.405268220524982)"); + test_distance(s, 0.01, "POINT(1.0040505023484179 1.0040529633262307)", str); + test_distance(s, 1, "POINT(1.4051065077123015 1.405268220524919)", str); + test_distance(s, 1, "POINT(2 2)"); + test_distance(s, 10, "POINT(2 2)"); +} + +template +void test_geo(Strategy str) +{ + typedef bg::model::point > P; + typedef bg::model::multi_point

MP; + typedef bg::model::segment

S; + typedef bg::model::linestring

LS; + + test(s, 0, "POINT(1 1)", str); + test(s, 0.5, "POINT(1.4998780900539985 1.5000558288006378)", str); + test(s, 1, "POINT(2 2)", str); + + test(l1, 0, "POINT(1 1)", str); + test(l1, 0.1, "POINT(1.3986445638301882 1.0000367522730751)", str); + test(l1, 0.2, "POINT(1.79728912766037641 1.0000247772611039)", str); + test(l1, 0.3, "POINT(2 1.1972285554368427)", str); + test(l1, 0.4, "POINT(2 1.598498298996567)", str); + test(l1, 0.5, "POINT(2 1.9997664696834965)", str); + test(l1, 0.6, "POINT(1.6013936980010324 2.0000734568388099)", str); + test(l1, 0.7, "POINT(1.2025664628960846 2.0000494983098767)", str); + test(l1, 0.8, "POINT(1 2.1974612279909937)", str); + test(l1, 0.9, "POINT(1 2.5987263175375022)", str); + test(l1, 1, "POINT(1 3)", str); + + test(l1, 0, "MULTIPOINT((1 1))", str); + + //adnoyer is missing the last point in the following cases + // of linestrings due to inaccuracy + if (!boost::is_same >::value) + { + test(l1, 0.1, "MULTIPOINT((1.3986445638301882 1.0000367522730751)\ + (1.79728912766037641 1.0000247772582571)\ + (2 1.1972285554368427)\ + (2 1.598498298996567)\ + (2 1.9997664696834965)\ + (1.6013936980010324 2.0000734568388099)\ + (1.2025664628960846 2.0000495003440779)\ + (1 2.1974612279909937)\ + (1 2.5987263175375022)\ + (1 3))", str); + + test(l1, 0.2, "MULTIPOINT((1.79728912766037641 1.0000247772613331)\ + (2 1.598498298996567)\ + (1.6013936980010324 2.0000734568388099)\ + (1 2.1974612279909937)\ + (1 3))", str); + } + test(l1, 0.4, "MULTIPOINT((2 1.598498298996567)(1 2.1974612279909937))", str); + test(l1, 0.5, "MULTIPOINT((2 1.9997664696834965)(1 3))", str); + test(l1, 0.6, "MULTIPOINT((1.6013936980010324 2.0000734568388099))", str); + test(l1, 1, "MULTIPOINT((1 3))", str); + + test(l2, 0.3, "MULTIPOINT((5.306157814 1.0006937303)\ + (11.60351281 1.0085614548123072)\ + (17.90073492 1.004178475142552))", str); +} + +template +void test_geo_non_standard_spheroid(Strategy str) +{ + typedef bg::model::point > P; + typedef bg::model::segment

S; + + test(s, 0, "POINT(1 1)", str); + test(s, 0.5, "POINT(1.5127731436886724 1.5129021873759412)", str); + test(s, 1, "POINT(2 2)", str); +} + +int test_main(int, char* []) +{ + test_car(); + test_car_edge_cases(); + + test_sph(); + test_sph(bg::strategy::line_interpolate::spherical<>(100)); + + typedef bg::srs::spheroid stype; + + test_geo(bg::strategy::line_interpolate::geographic()); + test_geo(bg::strategy::line_interpolate::geographic()); + test_geo(bg::strategy::line_interpolate::geographic()); + + test_geo_non_standard_spheroid(bg::strategy::line_interpolate::geographic + (stype(5000000,6000000))); + + return 0; +} + diff --git a/src/boost/libs/geometry/test/algorithms/make.cpp b/src/boost/libs/geometry/test/algorithms/make.cpp new file mode 100644 index 000000000..fae968a8c --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/make.cpp @@ -0,0 +1,137 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include + +#include + +#include + +#include +#include +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +template +void test_point_2d() +{ + P p = bg::make

((T) 123, (T) 456); + BOOST_CHECK_CLOSE(bg::get<0>(p), 123.0, 1.0e-6); + BOOST_CHECK_CLOSE(bg::get<1>(p), 456.0, 1.0e-6); +} + +template +void test_point_3d() +{ + P p = bg::make

((T) 123, (T) 456, (T) 789); + BOOST_CHECK_CLOSE( bg::get<0>(p), 123.0, 1.0e-6); + BOOST_CHECK_CLOSE( bg::get<1>(p), 456.0, 1.0e-6); + BOOST_CHECK_CLOSE( bg::get<2>(p), 789.0, 1.0e-6); +} + +template +void test_box_2d() +{ + typedef bg::model::box

B; + B b = bg::make((T) 123, (T) 456, (T) 789, (T) 1011); + BOOST_CHECK_CLOSE( (bg::get(b)), 123.0, 1.0e-6); + BOOST_CHECK_CLOSE( (bg::get(b)), 456.0, 1.0e-6); + BOOST_CHECK_CLOSE( (bg::get(b)), 789.0, 1.0e-6); + BOOST_CHECK_CLOSE( (bg::get(b)), 1011.0, 1.0e-6); + + b = bg::make_inverse(); +} + +template +void test_linestring_2d() +{ + typedef bg::model::linestring

L; + + T coors[][2] = {{1,2}, {3,4}}; + + L line = bg::detail::make::make_points(coors); + + BOOST_CHECK_EQUAL(line.size(), 2u); +} + +template +void test_linestring_3d() +{ + typedef bg::model::linestring

L; + + T coors[][3] = {{1,2,3}, {4,5,6}}; + + L line = bg::detail::make::make_points(coors); + + BOOST_CHECK_EQUAL(line.size(), 2u); + //std::cout << dsv(line) << std::endl; + +} + +template +void test_2d_t() +{ + test_point_2d(); + test_box_2d(); + test_linestring_2d(); +} + +template +void test_2d() +{ + test_2d_t(); + test_2d_t(); + test_2d_t(); +} + +template +void test_3d_t() +{ + test_linestring_3d(); +// test_point_3d(); +} + +template +void test_3d() +{ + test_3d_t(); + test_3d_t(); + test_3d_t(); +} + +int test_main(int, char* []) +{ + //test_2d(); + //test_2d(); + //test_2d(); + test_2d >(); + test_2d >(); + test_2d >(); + + + test_3d >(); + +#if defined(HAVE_TTMATH) + test_2d >(); + test_3d >(); +#endif + + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/maximum_gap.cpp b/src/boost/libs/geometry/test/algorithms/maximum_gap.cpp new file mode 100644 index 000000000..d73e4b04a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/maximum_gap.cpp @@ -0,0 +1,139 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2015, 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_maximum_gap +#endif + +#include + +#include + +#include +#include +#include + +#include + +namespace bg = boost::geometry; + +class uint_interval +{ +public: + typedef unsigned value_type; + typedef int difference_type; + + uint_interval(unsigned left, unsigned right) + : m_left(left) + , m_right(right) + {} + + template + value_type get() const + { + return (Index == 0) ? m_left : m_right; + } + + difference_type length() const + { + return static_cast(m_right) - static_cast(m_left); + } + +private: + unsigned m_left, m_right; +}; + +struct uint_intervals + : public std::vector +{ + uint_intervals() + {} + + uint_intervals(unsigned left, unsigned right) + { + this->push_back(uint_interval(left, right)); + } + + uint_intervals & operator()(unsigned left, unsigned right) + { + this->push_back(uint_interval(left, right)); + return *this; + } +}; + +std::ostream& operator<<(std::ostream& os, uint_interval const& interval) +{ + os << "[" << interval.get<0>() << ", " << interval.get<1>() << "]"; + return os; +} + + +template +inline void test_one(std::string const& case_id, + RangeOfIntervals const& intervals, + typename boost::range_value + < + RangeOfIntervals + >::type::difference_type expected_gap) +{ + typedef typename boost::range_value::type interval_type; + typedef typename interval_type::difference_type gap_type; + + gap_type gap = bg::maximum_gap(intervals); + + std::ostringstream stream; + for (typename boost::range_const_iterator::type + it = boost::const_begin(intervals); + it != boost::const_end(intervals); + ++it) + { + stream << " " << *it; + } + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "intervals:" << stream.str() << std::endl; + std::cout << "gap found? " << ((gap > 0) ? "yes" : "no") << std::endl; + std::cout << "max gap length: " << gap << std::endl; + std::cout << std::endl << std::endl; +#endif + + BOOST_CHECK_MESSAGE(gap == expected_gap, + case_id << "; intervals: " + << stream.str() + << "; expected: " << expected_gap + << ", detected: " << gap); +} + +BOOST_AUTO_TEST_CASE( test_maximum_gap ) +{ + uint_intervals intervals; + + intervals = uint_intervals(3,4)(1,10)(5,11)(20,35)(12,14)(36,40)(39,41)(35,36)(37,37)(50,50)(50,51); + test_one("case_01", intervals, 9); + + intervals = uint_intervals(3,4)(1,10)(5,11)(20,35)(52,60)(12,14)(36,40)(39,41)(35,36)(37,37)(55,56); + test_one("case_02", intervals, 11); + + intervals = uint_intervals(3,4); + test_one("case_03", intervals, 0); + + intervals = uint_intervals(3,4)(15,15); + test_one("case_04", intervals, 11); + + intervals = uint_intervals(3,14)(5,5)(5,6); + test_one("case_05", intervals, 0); + + intervals = uint_intervals(3,10)(15,15)(15,18)(15,16); + test_one("case_06", intervals, 5); + + intervals = uint_intervals(38,41)(3,10)(15,15)(15,18)(15,16)(20,30)(22,30)(23,30); + test_one("case_07", intervals, 8); +} diff --git a/src/boost/libs/geometry/test/algorithms/num_geometries.cpp b/src/boost/libs/geometry/test/algorithms/num_geometries.cpp new file mode 100644 index 000000000..7c8589f87 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/num_geometries.cpp @@ -0,0 +1,151 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_num_geometries +#endif + +#include + +#include + +#include + +#include + +#include +#include +#include +#include + +namespace bg = boost::geometry; + + +typedef bg::model::point point; +typedef bg::model::linestring linestring; +typedef bg::model::segment segment; +typedef bg::model::box box; +typedef bg::model::ring ring; +typedef bg::model::polygon polygon; +typedef bg::model::multi_point multi_point; +typedef bg::model::multi_linestring multi_linestring; +typedef bg::model::multi_polygon multi_polygon; + + +template +struct test_num_geometries +{ + static inline void apply(Geometry const& geometry, + std::size_t expected) + { + std::size_t detected = bg::num_geometries(geometry); + BOOST_CHECK_MESSAGE( detected == expected, + "Expected: " << expected + << " detected: " << detected + << " wkt: " << bg::wkt(geometry) ); + } + + static inline void apply(std::string const& wkt, + std::size_t expected) + { + Geometry geometry; + bg::read_wkt(wkt, geometry); + apply(geometry, expected); + } +}; + +BOOST_AUTO_TEST_CASE( test_point ) +{ + test_num_geometries::apply("POINT(0 0)", 1); +} + +BOOST_AUTO_TEST_CASE( test_segment ) +{ + test_num_geometries::apply("SEGMENT(0 0,1 1)", 1); +} + +BOOST_AUTO_TEST_CASE( test_box ) +{ + test_num_geometries::apply("BOX(0 0,1 1)", 1); +} + +BOOST_AUTO_TEST_CASE( test_linestring ) +{ + test_num_geometries::apply("LINESTRING(0 0,1 1,2 2)", 1); +} + +BOOST_AUTO_TEST_CASE( test_multipoint ) +{ + typedef test_num_geometries tester; + + tester::apply("MULTIPOINT()", 0); + tester::apply("MULTIPOINT(0 0)", 1); + tester::apply("MULTIPOINT(0 0,0 0)", 2); + tester::apply("MULTIPOINT(0 0,0 0,1 1)", 3); +} + +BOOST_AUTO_TEST_CASE( test_multilinestring ) +{ + typedef test_num_geometries tester; + + tester::apply("MULTILINESTRING()", 0); + tester::apply("MULTILINESTRING((0 0,1 0))", 1); + tester::apply("MULTILINESTRING((0 0,1 0,0 1),(0 0,1 0,0 1,0 0))", 2); + tester::apply("MULTILINESTRING((),(),(0 0,1 0))", 3); +} + +BOOST_AUTO_TEST_CASE( test_ring ) +{ + test_num_geometries::apply("POLYGON((0 0,1 0,0 1,0 0))", 1); +} + +BOOST_AUTO_TEST_CASE( test_polygon ) +{ + typedef test_num_geometries tester; + + tester::apply("POLYGON((0 0,10 0,0 10,0 0))", 1); + tester::apply("POLYGON((0 0,10 0,0 10,0 0),(1 1,2 1,1 1))", 1); + tester::apply("POLYGON((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,2 2,1 2,1 1),(5 5,6 5,6 6,5 6,5 5))", 1); +} + +BOOST_AUTO_TEST_CASE( test_multipolygon ) +{ + typedef test_num_geometries tester; + + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,1 2,1 1)))", 1); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,2 2,1 2,1 1),(5 5,6 5,6 6,5 6,5 5)))", 1); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,1 2,1 1)),((100 100,110 100,110 110,100 100),(101 101,102 101,102 102,101 101)))", 2); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,2 2,1 2,1 1),(5 5,6 5,6 6,5 6,5 5)),((100 100,110 100,110 110,100 100),(101 101,102 101,102 102,101 101),(105 105,106 105,106 106,105 106,105 105)))", 2); +} + +BOOST_AUTO_TEST_CASE( test_variant ) +{ + typedef boost::variant + < + linestring, multi_linestring + > variant_geometry_type; + + typedef test_num_geometries tester; + + linestring ls; + bg::read_wkt("LINESTRING(0 0,1 1,2 2)", ls); + + multi_linestring mls; + bg::read_wkt("MULTILINESTRING((0 0,1 1,2 2),(3 3,4 4),(5 5,6 6,7 7,8 8))", + mls); + + variant_geometry_type variant_geometry; + + variant_geometry = ls; + tester::apply(variant_geometry, 1); + + variant_geometry = mls; + tester::apply(variant_geometry, 3); +} diff --git a/src/boost/libs/geometry/test/algorithms/num_geometries_multi.cpp b/src/boost/libs/geometry/test/algorithms/num_geometries_multi.cpp new file mode 100644 index 000000000..9c18a9618 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/num_geometries_multi.cpp @@ -0,0 +1,57 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#include + +#include + +#include + +#include +#include + +template +void test_geometry(std::string const& wkt, std::size_t expected) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + std::size_t detected = bg::num_geometries(geometry); + BOOST_CHECK_MESSAGE(detected == expected, + "num_geometries: " << wkt + << " -> Expected: " << expected + << " detected: " << detected); +} + + +template +void test_all() +{ + typedef bg::model::polygon poly; + typedef bg::model::linestring ls; + typedef bg::model::multi_point mpoint; + typedef bg::model::multi_linestring mls; + typedef bg::model::multi_polygon mpoly; + + test_geometry("POINT(0 0)", 1); + test_geometry("LINESTRING(0 0,0 1)", 1); + test_geometry("POLYGON((0 0,0 1,1 0,0 0))", 1); + test_geometry("MULTIPOINT((0 0),(0 1),(1 0),(0 0))", 4); + test_geometry("MULTILINESTRING((0 0,0 1),(1 0,0 0))", 2); + test_geometry("MULTIPOLYGON(((0 0,0 1,1 0,0 0)),((10 0,10 1,11 0,10 0)))", 2); +} + + +int test_main( int , char* [] ) +{ + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/num_interior_rings.cpp b/src/boost/libs/geometry/test/algorithms/num_interior_rings.cpp new file mode 100644 index 000000000..8b78ed7de --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/num_interior_rings.cpp @@ -0,0 +1,153 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_num_interior_rings +#endif + +#include + +#include + +#include + +#include + +#include +#include +#include +#include + +namespace bg = boost::geometry; + + +typedef bg::model::point point; +typedef bg::model::linestring linestring; +typedef bg::model::segment segment; +typedef bg::model::box box; +typedef bg::model::ring ring; +typedef bg::model::polygon polygon; +typedef bg::model::multi_point multi_point; +typedef bg::model::multi_linestring multi_linestring; +typedef bg::model::multi_polygon multi_polygon; + + +template +struct test_num_interior_rings +{ + static inline void apply(Geometry const& geometry, + std::size_t expected) + { + std::size_t detected = bg::num_interior_rings(geometry); + BOOST_CHECK_MESSAGE( detected == expected, + "Expected: " << expected + << " detected: " << detected + << " wkt: " << bg::wkt(geometry) ); + } + + static inline void apply(std::string const& wkt, + std::size_t expected) + { + Geometry geometry; + bg::read_wkt(wkt, geometry); + apply(geometry, expected); + } +}; + +BOOST_AUTO_TEST_CASE( test_point ) +{ + test_num_interior_rings::apply("POINT(0 0)", 0); +} + +BOOST_AUTO_TEST_CASE( test_segment ) +{ + test_num_interior_rings::apply("SEGMENT(0 0,1 1)", 0); +} + +BOOST_AUTO_TEST_CASE( test_box ) +{ + test_num_interior_rings::apply("BOX(0 0,1 1)", 0); +} + +BOOST_AUTO_TEST_CASE( test_linestring ) +{ + test_num_interior_rings::apply("LINESTRING(0 0,1 1)", 0); +} + +BOOST_AUTO_TEST_CASE( test_multipoint ) +{ + test_num_interior_rings::apply("MULTIPOINT(0 0,1 1)", 0); +} + +BOOST_AUTO_TEST_CASE( test_multilinestring ) +{ + test_num_interior_rings + < + multi_linestring + >::apply("MULTILINESTRING((0 0,1 0,0 1),(0 0,1 0,0 1,0 0))", 0); +} + +BOOST_AUTO_TEST_CASE( test_ring ) +{ + typedef test_num_interior_rings tester; + + tester::apply("POLYGON((0 0,1 0,0 1,0 0))", 0); + tester::apply("POLYGON((0 0,1 0,1 0,0 1,0 0))", 0); +} + +BOOST_AUTO_TEST_CASE( test_polygon ) +{ + typedef test_num_interior_rings tester; + + tester::apply("POLYGON((0 0,10 0,0 10,0 0))", 0); + tester::apply("POLYGON((0 0,10 0,0 10,0 0),(1 1,2 1,1 2,1 1))", 1); + tester::apply("POLYGON((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,2 2,1 2,1 1),(5 5,6 5,6 6,5 6,5 5))", 2); +} + +BOOST_AUTO_TEST_CASE( test_multipolygon ) +{ + typedef test_num_interior_rings tester; + + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)))", 0); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,1 2,1 1)))", 1); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,2 2,1 2,1 1),(5 5,6 5,6 6,5 6,5 5)))", 2); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,1 2,1 1)),((100 100,110 100,110 110,100 100),(101 101,102 101,102 102,101 101)))", 2); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,2 2,1 2,1 1),(5 5,6 5,6 6,5 6,5 5)),((100 100,110 100,110 110,100 100),(101 101,102 101,102 102,101 101),(105 105,106 105,106 106,105 106,105 105)))", 4); +} + +BOOST_AUTO_TEST_CASE( test_variant ) +{ + typedef boost::variant + < + linestring, polygon, multi_polygon + > variant_geometry_type; + + typedef test_num_interior_rings tester; + + linestring ls; + bg::read_wkt("LINESTRING(0 0,1 1,2 2)", ls); + + polygon poly; + bg::read_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0),(1 1,9 1,9 9,1 9,1 1))", poly); + + multi_polygon mpoly; + bg::read_wkt("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(1 1,2 1,1 2,1 1),(5 5,6 5,6 6,5 6,5 5)))", mpoly); + + variant_geometry_type variant_geometry; + + variant_geometry = ls; + tester::apply(variant_geometry, 0); + + variant_geometry = poly; + tester::apply(variant_geometry, 1); + + variant_geometry = mpoly; + tester::apply(variant_geometry, 2); +} diff --git a/src/boost/libs/geometry/test/algorithms/num_interior_rings_multi.cpp b/src/boost/libs/geometry/test/algorithms/num_interior_rings_multi.cpp new file mode 100644 index 000000000..2ad958d81 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/num_interior_rings_multi.cpp @@ -0,0 +1,50 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#include + +#include + +#include + +#include +#include + +template +void test_geometry(std::string const& wkt, std::size_t expected) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + std::size_t detected = bg::num_interior_rings(geometry); + BOOST_CHECK_MESSAGE(detected == expected, + "num_interior_rings: " << wkt + << " -> Expected: " << expected + << " detected: " << detected); +} + + +template +void test_all() +{ + typedef bg::model::polygon poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("POLYGON((0 0,0 10,10 0,0 0),(1 1,1 9,9 1,1 1))", 1); + test_geometry("MULTIPOLYGON(((0 0,0 10,10 0,0 0),(1 1,1 9,9 1,1 1)),((0 0,0 10,10 0,0 0),(1 1,1 4,4 1,1 1),(5 1,5 4,9 1,5 1)))", 3); +} + + +int test_main( int , char* [] ) +{ + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/num_points.cpp b/src/boost/libs/geometry/test/algorithms/num_points.cpp new file mode 100644 index 000000000..6d24f43f0 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/num_points.cpp @@ -0,0 +1,94 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +// Copyright (c) 2013-2015 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 +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +#include + +#include +#include + +#include + +template +struct box_dD +{ + typedef boost::geometry::model::box + < + boost::geometry::model::point + > type; +}; + +template +inline void test_num_points(std::string const& wkt, + std::size_t expected, + std::size_t expected_add_for_open) +{ + namespace bg = boost::geometry; + Geometry geometry; + boost::geometry::read_wkt(wkt, geometry); + std::size_t detected = bg::num_points(geometry); + BOOST_CHECK_EQUAL(expected, detected); + detected = bg::num_points(geometry, false); + BOOST_CHECK_EQUAL(expected, detected); + detected = bg::num_points(geometry, true); + BOOST_CHECK_EQUAL(expected_add_for_open, detected); +} + +template +inline void test_num_points(std::string const& wkt, std::size_t expected) +{ + test_num_points(wkt, expected, expected); +} + +int test_main(int, char* []) +{ + typedef bg::model::point point; + typedef bg::model::linestring linestring; + typedef bg::model::segment segment; + typedef bg::model::box box; + typedef bg::model::ring ring; + typedef bg::model::polygon polygon; + typedef bg::model::multi_point multi_point; + typedef bg::model::multi_linestring multi_linestring; + typedef bg::model::multi_polygon multi_polygon; + + // open geometries + typedef bg::model::ring open_ring; + typedef bg::model::polygon open_polygon; + typedef bg::model::multi_polygon open_multi_polygon; + + test_num_points("POINT(0 0)", 1u); + test_num_points("LINESTRING(0 0,1 1)", 2u); + test_num_points("LINESTRING(0 0,1 1)", 2u); + test_num_points("POLYGON((0 0,10 10))", 4u); + test_num_points::type>("BOX(0 0 0,1 1 1)", 8u); + test_num_points::type>("BOX(0 0 0 0,1 1 1 1)", 16u); + test_num_points::type>("BOX(0 0 0 0 0,1 1 1 1 1)", 32u); + test_num_points("POLYGON((0 0,1 1,0 1,0 0))", 4u); + test_num_points("POLYGON((0 0,10 10,0 10,0 0))", 4u); + test_num_points("POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4))", 10u); + test_num_points("MULTIPOINT((0 0),(1 1))", 2u); + test_num_points("MULTILINESTRING((0 0,1 1),(2 2,3 3,4 4))", 5u); + test_num_points("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 10,1 10,1 9,0 10)))", 9u); + + // test open geometries + test_num_points("POLYGON((0 0,1 1,0 1))", 3u, 4u); + test_num_points("POLYGON((0 0,1 1,0 1,0 0))", 3u, 4u); + test_num_points("POLYGON((0 0,10 10,0 10))", 3u, 4u); + test_num_points("POLYGON((0 0,10 10,0 10,0 0))", 3u, 4u); + test_num_points("MULTIPOLYGON(((0 0,0 10,10 10,10 0)),((0 10,1 10,1 9)))", 7u, 9u); + test_num_points("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 10,1 10,1 9,0 10)))", 7u, 9u); + + return 0; +} + diff --git a/src/boost/libs/geometry/test/algorithms/num_points_multi.cpp b/src/boost/libs/geometry/test/algorithms/num_points_multi.cpp new file mode 100644 index 000000000..dd96bf3a4 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/num_points_multi.cpp @@ -0,0 +1,70 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#include + +#include + +#include + +#include +#include +#include +#include +#include + +#include + + +template +void check_geometry(Geometry const& geometry, std::string const& wkt, std::size_t expected) +{ + std::size_t detected = bg::num_points(geometry); + BOOST_CHECK_MESSAGE(detected == expected, + "num_points: " << wkt + << " -> Expected: " << expected + << " detected: " << detected); +} + +template +void test_geometry(std::string const& wkt, int expected) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + check_geometry(geometry, wkt, expected); + check_geometry(boost::variant(geometry), wkt, expected); +} + + +template +void test_all() +{ + typedef bg::model::polygon poly; + typedef bg::model::linestring ls; + typedef bg::model::multi_point mpoint; + typedef bg::model::multi_linestring mls; + typedef bg::model::multi_polygon mpoly; + + test_geometry("POINT(0 0)", 1); + test_geometry("LINESTRING(0 0,0 1)", 2); + test_geometry("POLYGON((0 0,0 1,1 0,0 0))", 4); + test_geometry("MULTIPOINT((0 0),(0 1),(1 0),(0 0))", 4); + test_geometry("MULTILINESTRING((0 0,0 1),(1 0,0 0))", 4); + test_geometry("MULTIPOLYGON(((0 0,0 1,1 0,0 0)),((10 0,10 1,11 0,10 0)))", 8); +} + + +int test_main( int , char* [] ) +{ + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/num_segments.cpp b/src/boost/libs/geometry/test/algorithms/num_segments.cpp new file mode 100644 index 000000000..f6f0ddbf1 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/num_segments.cpp @@ -0,0 +1,291 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_num_segments +#endif + +#include + +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +namespace bg = boost::geometry; + + +typedef bg::model::point point; +typedef bg::model::linestring linestring; +typedef bg::model::segment segment; +typedef bg::model::box box; +typedef bg::model::ring ring_cw_closed; +typedef bg::model::ring ring_cw_open; +typedef bg::model::ring ring_ccw_closed; +typedef bg::model::ring ring_ccw_open; +typedef bg::model::polygon polygon_cw_closed; +typedef bg::model::polygon polygon_cw_open; +typedef bg::model::polygon polygon_ccw_closed; +typedef bg::model::polygon polygon_ccw_open; +typedef bg::model::multi_point multi_point; +typedef bg::model::multi_linestring multi_linestring; +typedef bg::model::multi_polygon multi_polygon_cw_closed; +typedef bg::model::multi_polygon multi_polygon_cw_open; +typedef bg::model::multi_polygon multi_polygon_ccw_closed; +typedef bg::model::multi_polygon multi_polygon_ccw_open; + +template +struct box_dD +{ + typedef boost::geometry::model::box + < + boost::geometry::model::point + > type; +}; + +template ::type> +struct test_num_segments +{ + static inline void apply(Geometry const& geometry, std::size_t expected) + { + std::size_t detected = bg::num_segments(geometry); + BOOST_CHECK_MESSAGE( detected == expected, + "Expected: " << expected + << " detected: " << detected + << " wkt: " << bg::wkt(geometry) ); + } + + static inline void apply(std::string const& wkt, std::size_t expected) + { + Geometry geometry; + bg::read_wkt(wkt, geometry); + apply(geometry, expected); + } +}; + +template +struct test_num_segments +{ + static inline void apply(Box const& box, std::size_t expected) + { + std::size_t detected = bg::num_segments(box); + BOOST_CHECK_MESSAGE( detected == expected, + "Expected: " << expected + << " detected: " << detected + << " dsv: " << bg::dsv(box) ); + } + + static inline void apply(std::string const& wkt, std::size_t expected) + { + Box box; + bg::read_wkt(wkt, box); + apply(box, expected); + } +}; + +BOOST_AUTO_TEST_CASE( test_point ) +{ + test_num_segments::apply("POINT(0 0)", 0); +} + +BOOST_AUTO_TEST_CASE( test_segment ) +{ + test_num_segments::apply("SEGMENT(0 0,1 1)", 1); +} + +BOOST_AUTO_TEST_CASE( test_box ) +{ + test_num_segments::apply("BOX(0 0,1 1)", 4); + + // test higher-dimensional boxes + test_num_segments::type>::apply("BOX(0 0 0,1 1 1)", 12); + test_num_segments::type>::apply("BOX(0 0 0 0,1 1 1 1)", 32); + test_num_segments::type>::apply("BOX(0 0 0 0 0,1 1 1 1 1)", 80); +} + +BOOST_AUTO_TEST_CASE( test_linestring ) +{ + typedef test_num_segments tester; + + tester::apply("LINESTRING()", 0); + tester::apply("LINESTRING(0 0)", 0); + tester::apply("LINESTRING(0 0,0 0)", 1); + tester::apply("LINESTRING(0 0,0 0,1 1)", 2); + tester::apply("LINESTRING(0 0,0 0,0 0,1 1)", 3); +} + +BOOST_AUTO_TEST_CASE( test_multipoint ) +{ + typedef test_num_segments tester; + + tester::apply("MULTIPOINT()", 0); + tester::apply("MULTIPOINT(0 0)", 0); + tester::apply("MULTIPOINT(0 0,0 0)", 0); + tester::apply("MULTIPOINT(0 0,0 0,1 1)", 0); +} + +BOOST_AUTO_TEST_CASE( test_multilinestring ) +{ + typedef test_num_segments tester; + + tester::apply("MULTILINESTRING()", 0); + tester::apply("MULTILINESTRING((),(0 0))", 0); + tester::apply("MULTILINESTRING((0 0))", 0); + tester::apply("MULTILINESTRING((0 0,1 0))", 1); + tester::apply("MULTILINESTRING((),(),(0 0,1 0))", 1); + tester::apply("MULTILINESTRING((0 0,1 0,0 1),(0 0,1 0,0 1,0 0))", 5); +} + +template +void test_open_ring() +{ + typedef test_num_segments tester; + + tester::apply("POLYGON(())", 0); + tester::apply("POLYGON((0 0))", 0); + tester::apply("POLYGON((0 0,1 0))", 2); + tester::apply("POLYGON((0 0,1 0,0 1))", 3); + tester::apply("POLYGON((0 0,0 0,1 0,0 1))", 4); +} + +template +void test_closed_ring() +{ + typedef test_num_segments tester; + + tester::apply("POLYGON(())", 0); + tester::apply("POLYGON((0 0))", 0); + tester::apply("POLYGON((0 0,0 0))", 1); + tester::apply("POLYGON((0 0,1 0,0 0))", 2); + tester::apply("POLYGON((0 0,1 0,0 1,0 0))", 3); + tester::apply("POLYGON((0 0,1 0,1 0,0 1,0 0))", 4); +} + +BOOST_AUTO_TEST_CASE( test_ring ) +{ + test_open_ring(); + test_open_ring(); + test_closed_ring(); + test_closed_ring(); +} + +template +void test_open_polygon() +{ + typedef test_num_segments tester; + + tester::apply("POLYGON(())", 0); + tester::apply("POLYGON((0 0))", 0); + tester::apply("POLYGON((0 0,10 0),(0 0))", 2); + tester::apply("POLYGON((0 0,10 0),(1 1,2 1))", 4); + tester::apply("POLYGON((0 0,10 0,0 10))", 3); + tester::apply("POLYGON((0 0,10 0,0 10),())", 3); + tester::apply("POLYGON((0 0,10 0,0 10),(1 1))", 3); + tester::apply("POLYGON((0 0,10 0,0 10),(1 1,2 1))", 5); + tester::apply("POLYGON((0 0,10 0,0 10),(1 1,2 1,1 2))", 6); + tester::apply("POLYGON((0 0,10 0,10 10,0 10),(1 1,2 1,1 2))", 7); + tester::apply("POLYGON((0 0,10 0,10 10,0 10),(1 1,2 1,2 2,1 2))", 8); + tester::apply("POLYGON((0 0,10 0,10 10,0 10),(1 1,2 1,2 2,1 2),(5 5,6 5,6 6,5 6))", 12); +} + +template +void test_closed_polygon() +{ + typedef test_num_segments tester; + + tester::apply("POLYGON(())", 0); + tester::apply("POLYGON((0 0))", 0); + tester::apply("POLYGON((0 0,10 0,0 0),(0 0))", 2); + tester::apply("POLYGON((0 0,10 0,0 0),(1 1,2 1,1 1))", 4); + tester::apply("POLYGON((0 0,10 0,0 10,0 0))", 3); + tester::apply("POLYGON((0 0,10 0,0 10,0 0),())", 3); + tester::apply("POLYGON((0 0,10 0,0 10,0 0),(1 1))", 3); + tester::apply("POLYGON((0 0,10 0,0 10,0 0),(1 1,2 1,1 1))", 5); + tester::apply("POLYGON((0 0,10 0,0 10,0 0),(1 1,2 1,1 2,1 1))", 6); + tester::apply("POLYGON((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,1 2,1 1))", 7); + tester::apply("POLYGON((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,2 2,1 2,1 1))", 8); + tester::apply("POLYGON((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,2 2,1 2,1 1),(5 5,6 5,6 6,5 6,5 5))", 12); +} + +BOOST_AUTO_TEST_CASE( test_polygon ) +{ + test_open_polygon(); + test_open_polygon(); + test_closed_polygon(); + test_closed_polygon(); +} + +template +void test_open_multipolygon() +{ + typedef test_num_segments tester; + + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10),(1 1,2 1,1 2)))", 7); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10),(1 1,2 1,2 2,1 2),(5 5,6 5,6 6,5 6)))", 12); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10),(1 1,2 1,1 2)),((100 100,110 100,110 110),(101 101,102 101,102 102)))", 13); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10),(1 1,2 1,2 2,1 2),(5 5,6 5,6 6,5 6)),((100 100,110 100,110 110),(101 101,102 101,102 102),(105 105,106 105,106 106,105 106)))", 22); +} + +template +void test_closed_multipolygon() +{ + typedef test_num_segments tester; + + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,1 2,1 1)))", 7); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,2 2,1 2,1 1),(5 5,6 5,6 6,5 6,5 5)))", 12); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,1 2,1 1)),((100 100,110 100,110 110,100 100),(101 101,102 101,102 102,101 101)))", 13); + tester::apply("MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,2 2,1 2,1 1),(5 5,6 5,6 6,5 6,5 5)),((100 100,110 100,110 110,100 100),(101 101,102 101,102 102,101 101),(105 105,106 105,106 106,105 106,105 105)))", 22); +} + +BOOST_AUTO_TEST_CASE( test_multipolygon ) +{ + test_open_multipolygon(); + test_open_multipolygon(); + test_closed_multipolygon(); + test_closed_multipolygon(); +} + +BOOST_AUTO_TEST_CASE( test_variant ) +{ + typedef boost::variant + < + linestring, polygon_cw_open, polygon_cw_closed + > variant_geometry_type; + + typedef test_num_segments tester; + + linestring ls; + bg::read_wkt("LINESTRING(0 0,1 1,2 2)", ls); + + polygon_cw_open p_open; + bg::read_wkt("POLYGON((0 0,0 1,1 0))", p_open); + + polygon_cw_closed p_closed; + bg::read_wkt("POLYGON((0 0,0 1,1 1,1 0,0 0))", p_closed); + + variant_geometry_type variant_geometry; + + variant_geometry = ls; + tester::apply(variant_geometry, 2); + + variant_geometry = p_open; + tester::apply(variant_geometry, 3); + + variant_geometry = p_closed; + tester::apply(variant_geometry, 4); +} diff --git a/src/boost/libs/geometry/test/algorithms/overlaps/Jamfile b/src/boost/libs/geometry/test/algorithms/overlaps/Jamfile new file mode 100644 index 000000000..ec744c76c --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlaps/Jamfile @@ -0,0 +1,24 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2016. +# Modifications copyright (c) 2014-2016, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-overlaps + : + [ run overlaps.cpp : : : : algorithms_overlaps ] + [ run overlaps_areal.cpp : : : : algorithms_overlaps_areal ] + [ run overlaps_box.cpp : : : : algorithms_overlaps_box ] + [ run overlaps_sph.cpp : : : : algorithms_overlaps_sph ] + ; + diff --git a/src/boost/libs/geometry/test/algorithms/overlaps/overlaps.cpp b/src/boost/libs/geometry/test/algorithms/overlaps/overlaps.cpp new file mode 100644 index 000000000..b305edb5b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlaps/overlaps.cpp @@ -0,0 +1,63 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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 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) + +#include "test_overlaps.hpp" + +template +void test_pp() +{ + typedef bg::model::multi_point

mpt; + + test_geometry("POINT(0 0)", "POINT(0 0)", false); + test_geometry("POINT(0 0)", "POINT(1 1)", false); + + test_geometry("POINT(0 0)", "MULTIPOINT(0 0, 1 1)", false); + + test_geometry("MULTIPOINT(0 0, 1 1)", "POINT(0 0)", false); + + test_geometry("MULTIPOINT(0 0,1 1,2 2)", "MULTIPOINT(1 1,3 3,4 4)", true); + test_geometry("MULTIPOINT(0 0,1 1,2 2)", "MULTIPOINT(1 1,2 2)", false); +} + +template +void test_ll() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("LINESTRING(0 0,2 2,3 1)", "LINESTRING(1 1,2 2,4 4)", true); + test_geometry("LINESTRING(0 0,2 2,4 0)", "LINESTRING(0 1,2 1,3 2)", false); + + test_geometry("LINESTRING(0 0,2 2,3 1)", "MULTILINESTRING((1 1,2 2),(2 2,4 4))", true); + test_geometry("LINESTRING(0 0,2 2,3 1)", "MULTILINESTRING((1 1,2 2),(3 3,4 4))", true); + test_geometry("LINESTRING(0 0,3 3,3 1)", "MULTILINESTRING((3 3,2 2),(0 0,1 1))", false); +} + +template +void test_2d() +{ + test_pp

(); + test_ll

(); +} + +int test_main( int , char* [] ) +{ + test_2d >(); + test_2d >(); + +#if defined(HAVE_TTMATH) + test_2d >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlaps/overlaps_areal.cpp b/src/boost/libs/geometry/test/algorithms/overlaps/overlaps_areal.cpp new file mode 100644 index 000000000..c7361f203 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlaps/overlaps_areal.cpp @@ -0,0 +1,73 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 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) + +#include "test_overlaps.hpp" + +template +void test_aa() +{ + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("POLYGON((0 0,0 5,5 5,5 0,0 0))", "POLYGON((3 3,3 9,9 9,9 3,3 3))", true); + test_geometry("POLYGON((0 0,0 5,5 5,5 0,0 0))", "POLYGON((5 5,5 9,9 9,9 5,5 5))", false); + test_geometry("POLYGON((0 0,0 5,5 5,5 0,0 0))", "POLYGON((3 3,3 5,5 5,5 3,3 3))", false); + + test_geometry("POLYGON((0 0,0 5,5 5,5 0,0 0))", + "MULTIPOLYGON(((3 3,3 5,5 5,5 3,3 3)),((5 5,5 6,6 6,6 5,5 5)))", + true); + test_geometry("MULTIPOLYGON(((3 3,3 5,5 5,5 3,3 3)),((0 0,0 3,3 3,3 0,0,0)))", + "MULTIPOLYGON(((3 3,3 5,5 5,5 3,3 3)),((5 5,5 6,6 6,6 5,5 5)))", + true); + + // related to https://svn.boost.org/trac/boost/ticket/10912 + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2))", + "POLYGON((3 3,3 9,9 9,9 3,3 3))", + true); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2),(6 6,8 6,8 8,6 8,6 6))", + "POLYGON((0 0,0 5,5 5,5 0,0 0))", + true); + + test_geometry("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "POLYGON((0 0,0 5,5 5,5 0,0 0))", + false); + test_geometry("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + false); + + // mysql 21872795 + test_geometry("POLYGON((2 2,2 8,8 8,8 2,2 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(8 8,4 6,4 4,8 8))", + true); + test_geometry("POLYGON((2 2,2 8,8 8,8 2,2 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 4,4 6,2 2))", + true); +} + +template +void test_2d() +{ + test_aa

(); +} + +int test_main( int , char* [] ) +{ + test_2d >(); + test_2d >(); + +#if defined(HAVE_TTMATH) + test_2d >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlaps/overlaps_box.cpp b/src/boost/libs/geometry/test/algorithms/overlaps/overlaps_box.cpp new file mode 100644 index 000000000..b58cfa967 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlaps/overlaps_box.cpp @@ -0,0 +1,65 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 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) + +#include "test_overlaps.hpp" + +template +void test_box_box_2d() +{ +#if defined(BOOST_GEOMETRY_COMPILE_FAIL) + test_geometry("POINT(1 1)", "POINT(1 1)", true); +#endif + + test_geometry, bg::model::box

>("BOX(1 1, 3 3)", "BOX(0 0,2 2)", true); + + // touch -> false + test_geometry, bg::model::box

>("BOX(1 1, 3 3)", "BOX(3 3,5 5)", false); + + // disjoint -> false + test_geometry, bg::model::box

>("BOX(1 1, 3 3)", "BOX(4 4,6 6)", false); + + // within -> false + test_geometry, bg::model::box

>("BOX(1 1, 5 5)", "BOX(2 2,3 3)", false); + + // within+touch -> false + test_geometry, bg::model::box

>("BOX(1 1, 5 5)", "BOX(2 2,5 5)", false); +} + +template +void test_3d() +{ + test_geometry, bg::model::box

>("BOX(1 1 1, 3 3 3)", "BOX(0 0 0,2 2 2)", true); + test_geometry, bg::model::box

>("BOX(1 1 1, 3 3 3)", "BOX(3 3 3,5 5 5)", false); + test_geometry, bg::model::box

>("BOX(1 1 1, 3 3 3)", "BOX(4 4 4,6 6 6)", false); +} + + +template +void test_2d() +{ + test_box_box_2d

(); +} + +int test_main( int , char* [] ) +{ + test_2d >(); + test_2d >(); + +#if defined(HAVE_TTMATH) + test_2d >(); +#endif + + //test_3d >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlaps/overlaps_sph.cpp b/src/boost/libs/geometry/test/algorithms/overlaps/overlaps_sph.cpp new file mode 100644 index 000000000..79478ad3d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlaps/overlaps_sph.cpp @@ -0,0 +1,153 @@ +// Boost.Geometry + +// Copyright (c) 2016 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) + +#include "test_overlaps.hpp" + +#include +#include + +#include + + +template +void test_polygon_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + + test_geometry(case_1[0], case_1[1], + true); + test_geometry(case_1[0], case_1[1], + true); + + test_geometry(case_1[0], case_1[1], + true); + test_geometry(case_2[0], case_2[1], + true); + test_geometry(case_3_sph[0], case_3_sph[1], + false); + test_geometry(case_3_2_sph[0], case_3_2_sph[1], + false); + test_geometry(case_4[0], case_4[1], + true); + test_geometry(case_5[0], case_5[1], + true); + test_geometry(case_6_sph[0], case_6_sph[1], + false); + + test_geometry(case_7[0], case_7[1], + false); + test_geometry(case_8_sph[0], case_8_sph[1], + false); + test_geometry(case_9_sph[0], case_9_sph[1], + false); + test_geometry(case_10_sph[0], case_10_sph[1], + false); + test_geometry(case_11_sph[0], case_11_sph[1], + false); + test_geometry(case_12[0], case_12[1], + true); + + test_geometry(case_13_sph[0], case_13_sph[1], + false); + test_geometry(case_14_sph[0], case_14_sph[1], + false); + test_geometry(case_15_sph[0], case_15_sph[1], + false); + test_geometry(case_16_sph[0], case_16_sph[1], + false); + test_geometry(case_17_sph[0], case_17_sph[1], + false); + test_geometry(case_18_sph[0], case_18_sph[1], + false); +} + +template +void test_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_1[0], case_multi_2[0], + true); + test_geometry(case_2[0], case_multi_2[0], + true); +} + +template +void test_multi_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_multi_2[0], case_multi_2[1], + true); +} + +template +void test_linestring_linestring() +{ + typedef bg::model::linestring

ls; + + test_geometry("LINESTRING(0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", false); + + test_geometry("LINESTRING(1 0,2 2,2 3)", "LINESTRING(0 0, 2 2, 3 2)", false); +} + +template +void test_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("LINESTRING(0 0,10 0)", + "MULTILINESTRING((1 0,2 0),(1 1,2 1))", + true); + + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,0 5,0 0),(0 0,5 0,5 5))", + false); +} + +template +void test_multi_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0))", + true); +} + + +template +void test_all() +{ + test_polygon_polygon

(); + test_polygon_multi_polygon

(); + test_multi_polygon_multi_polygon

(); + + test_linestring_linestring

(); + test_linestring_multi_linestring

(); + test_multi_linestring_multi_linestring

(); +} + + +int test_main( int , char* [] ) +{ + test_all > >(); + +#if defined(HAVE_TTMATH) + test_cs > >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlaps/test_overlaps.hpp b/src/boost/libs/geometry/test/algorithms/overlaps/test_overlaps.hpp new file mode 100644 index 000000000..7d6686986 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlaps/test_overlaps.hpp @@ -0,0 +1,94 @@ +// Generic Geometry2 Library +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2015, 2017. +// Modifications copyright (c) 2015-2017 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) + +#ifndef BOOST_GEOMETRY_TEST_OVERLAPS_HPP +#define BOOST_GEOMETRY_TEST_OVERLAPS_HPP + + +#include + +#include +#include +#include +#include +#include + +#include + + +struct no_strategy {}; + +template +bool call_overlaps(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) +{ + return bg::overlaps(geometry1, geometry2, strategy); +} + +template +bool call_overlaps(Geometry1 const& geometry1, + Geometry2 const& geometry2, + no_strategy) +{ + return bg::overlaps(geometry1, geometry2); +} + +template +void test_geometry(Geometry1 const& geometry1, + Geometry2 const& geometry2, + std::string const& wkt1, + std::string const& wkt2, + bool expected, + Strategy const& strategy) +{ + bool detected = call_overlaps(geometry1, geometry2, strategy); + + BOOST_CHECK_MESSAGE(detected == expected, + "overlaps: " << wkt1 + << " with " << wkt2 + << " -> Expected: " << expected + << " detected: " << detected); + + detected = call_overlaps(geometry2, geometry1, strategy); + + BOOST_CHECK_MESSAGE(detected == expected, + "overlaps: " << wkt2 + << " with " << wkt1 + << " -> Expected: " << expected + << " detected: " << detected); +} + +template +void test_geometry(std::string const& wkt1, + std::string const& wkt2, + bool expected) +{ + Geometry1 geometry1; + Geometry2 geometry2; + + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); + + test_geometry(geometry1, geometry2, wkt1, wkt2, expected, no_strategy()); + + typedef typename bg::strategy::relate::services::default_strategy + < + Geometry1, Geometry2 + >::type strategy_type; + + test_geometry(geometry1, geometry2, wkt1, wkt2, expected, strategy_type()); +} + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/overlay/Jamfile b/src/boost/libs/geometry/test/algorithms/overlay/Jamfile new file mode 100644 index 000000000..be413b335 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/Jamfile @@ -0,0 +1,38 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2016, 2017. +# Modifications copyright (c) 2014-2017 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) + +test-suite boost-geometry-algorithms-overlay + : + [ run assemble.cpp : : : : algorithms_assemble ] + [ run get_turn_info.cpp : : : : algorithms_get_turn_info ] + [ run get_turns.cpp : : : : algorithms_get_turns ] + [ run get_turns_areal_areal.cpp : : : : algorithms_get_turns_areal_areal ] + [ run get_turns_areal_areal_sph.cpp : : : : algorithms_get_turns_areal_areal_sph ] + [ run get_turns_linear_areal.cpp : : : : algorithms_get_turns_linear_areal ] + [ run get_turns_linear_areal_sph.cpp : : : : algorithms_get_turns_linear_areal_sph ] + [ run get_turns_linear_linear.cpp : : : : algorithms_get_turns_linear_linear ] + [ run get_turns_linear_linear_geo.cpp : : : : algorithms_get_turns_linear_linear_geo ] + [ run get_turns_linear_linear_sph.cpp : : : : algorithms_get_turns_linear_linear_sph ] + [ run overlay.cpp : : : : algorithms_overlay ] + [ run sort_by_side_basic.cpp : : : : algorithms_sort_by_side_basic ] + [ run sort_by_side.cpp : : : : algorithms_sort_by_side ] + #[ run handle_touch.cpp : : : : algorithms_handle_touch ] + [ run relative_order.cpp : : : : algorithms_relative_order ] + [ run select_rings.cpp : : : : algorithms_select_rings ] + [ run self_intersection_points.cpp : : : : algorithms_self_intersection_points ] + #[ run traverse.cpp : : : : algorithms_traverse ] + #[ run traverse_ccw.cpp : : : : algorithms_traverse_ccw ] + #[ run traverse_multi.cpp : : : : algorithms_traverse_multi ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/overlay/assemble.cpp b/src/boost/libs/geometry/test/algorithms/overlay/assemble.cpp new file mode 100644 index 000000000..78965692a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/assemble.cpp @@ -0,0 +1,196 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2019. +// Modifications copyright (c) 2019, 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) + +#include +#include +#include + + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + + + +#if defined(TEST_WITH_SVG) +# include +#endif + +template +inline void test_assemble(std::string const& id, Geometry const& p, Geometry const& q, char operation = 'i') +{ + std::vector u, i, d1, d2; + bg::detail::union_::union_insert(p, q, std::back_inserter(u)); + bg::detail::intersection::intersection_insert(p, q, std::back_inserter(i)); + bg::detail::difference::difference_insert(p, q, std::back_inserter(d1)); + bg::detail::difference::difference_insert(q, p, std::back_inserter(d2)); + + if (operation == 'i') + { + typedef typename bg::default_area_result::type type; + type area_p = bg::area(p); + type area_q = bg::area(q); + + type area_i = 0, area_u = 0, area_d1 = 0, area_d2 = 0; + + BOOST_FOREACH(Geometry const& g, u) + { + area_u += bg::area(g); + } + BOOST_FOREACH(Geometry const& g, i) + { + area_i += bg::area(g); + } + BOOST_FOREACH(Geometry const& g, d1) + { + area_d1 += bg::area(g); + } + BOOST_FOREACH(Geometry const& g, d2) + { + area_d2 += bg::area(g); + } + + type diff = (area_p + area_q) - area_u - area_i; + type diff_d1 = (area_u - area_q) - area_d1; + type diff_d2 = (area_u - area_p) - area_d2; + + bool ok = bg::math::abs(diff) < 0.001 + && bg::math::abs(diff_d1) < 0.001 + && bg::math::abs(diff_d2) < 0.001; + + BOOST_CHECK_MESSAGE(ok, + id << " diff: " + << diff << " d1: " + << diff_d1 << " d2: " + << diff_d2); + } + +#if defined(TEST_WITH_SVG) + { + std::ostringstream filename; + filename << "assemble_" << id << "_" << operation << ".svg"; + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper::type> mapper(svg, 500, 500); + mapper.add(p); + mapper.add(q); + mapper.map(p, "fill-opacity:0.3;fill:rgb(51,51,153);stroke:rgb(51,51,153);stroke-width:3"); + mapper.map(q, "fill-opacity:0.5;fill:rgb(153,204,0);stroke:rgb(153,204,0);stroke-width:3"); + std::string linestyle = "opacity:0.7;fill:none;stroke-opacity:1;stroke-miterlimit:4;"; + + std::vector const& v = operation == 'i' ? i + : operation == 'u' ? u + : operation == 'd' ? d1 + : d2 + ; + + BOOST_FOREACH(Geometry const& geometry, v) + { + mapper.map(geometry, + linestyle + "stroke-width:3;stroke-linejoin:round;stroke-linecap:square;stroke-dasharray:12,12;stroke:rgb(255,0,0);"); + } + } +#endif +} + +template +inline bool int_ok(Polygon const& poly) +{ + + typename bg::point_type::type const& pi = + bg::interior_rings(poly)[0].front(); + + return bg::within(pi, bg::exterior_ring(poly)); +} + + +template +void generate() +{ + + static std::string exteriors[4] = { + "(0 0,0 10,10 10,10 0,0 0)", + "(1 1,1 9,8 9,8 1,1 1)", + "(2 0.5, 0.5 2,0.5 8,2 9.5,6 9.5,8.5 8,8.5 2,7 0.5,2 0.5)", + "(3 3,3 7,6 7,6 3,3 3)" + }; + static std::string interiors[4] = { + "(2 2,2 8,7 8,7 2,2 2)", + "(8.5 1,8.5 2,9.5 2,9.5 1,8.5 1)", + "(4 4,4 5,5 5,5 4,4 4)", + "(6 4,6 5,9 5,9 4,6 4)" + }; + for (int pe = 0; pe < 4; pe++) + { + for (int qe = 0; qe < 4; qe++) + { + for (int pi = 0; pi < 4; pi++) + { + for (int qi = 0; qi < 4; qi++) + { + std::string ps = "POLYGON(" + exteriors[pe] + "," + interiors[pi] + ")"; + std::string qs = "POLYGON(" + exteriors[qe] + "," + interiors[qi] + ")"; + + typedef bg::model::d2::point_xy point_type; + bg::model::polygon p, q; + bg::read_wkt(ps, p); + bg::read_wkt(qs, q); + bg::correct(p); + bg::correct(q); + if (! bg::intersects(p) + && ! bg::intersects(q) + && int_ok(p) + && int_ok(q) + ) + { + std::ostringstream out; + out << pe << qe << pi << qi; + test_assemble(out.str(), p, q); + +#if defined(TEST_WITH_SVG) + test_assemble(out.str(), p, q, 'u'); + test_assemble(out.str(), p, q, 'd'); + test_assemble(out.str(), p, q, 'r'); +#endif + } + } + } + } + } +} + + +#if ! defined(GEOMETRY_TEST_MULTI) +int test_main(int, char* []) +{ + generate(); + return 0; +} +#endif diff --git a/src/boost/libs/geometry/test/algorithms/overlay/debug_sort_by_side_svg.hpp b/src/boost/libs/geometry/test/algorithms/overlay/debug_sort_by_side_svg.hpp new file mode 100644 index 000000000..71ac7204b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/debug_sort_by_side_svg.hpp @@ -0,0 +1,123 @@ +// Boost.Geometry + +// Copyright (c) 2017 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#ifndef BOOST_GEOMETRY_TEST_DEBUG_SORT_BY_SIDE_SVG_HPP +#define BOOST_GEOMETRY_TEST_DEBUG_SORT_BY_SIDE_SVG_HPP + +#include +#include +#include + +#include +#include +#include + +namespace boost { namespace geometry { namespace debug +{ + + +template +inline void sorted_side_map(std::string const& case_id, + Sbs const& sbs, Point const& point, + Geometry1 const& geometry1, + Geometry2 const& geometry2, + int take_turn_index = -1, int take_operation_index = -1) +{ + + // Check number of sources (buffer has only one source) + std::set sources; + for (std::size_t i = 0; i < sbs.m_ranked_points.size(); i++) + { + const typename Sbs::rp& er = sbs.m_ranked_points[i]; + sources.insert(er.seg_id.source_index); + } + std::size_t const source_count = sources.size(); + + std::ostringstream filename; + filename << "sort_by_side_" << case_id << ".svg"; + std::ofstream svg(filename.str().c_str()); + + typedef geometry::svg_mapper mapper_type; + typedef geometry::model::referring_segment seg; + + mapper_type mapper(svg, 500, 500); + + for (std::size_t i = 0; i < sbs.m_ranked_points.size(); i++) + { + const typename Sbs::rp& er = sbs.m_ranked_points[i]; + mapper.add(er.point); + } + + if (sources.count(0) > 0) + { + mapper.map(geometry1, "fill-opacity:0.5;fill:rgb(153,204,0);stroke:rgb(153,204,0);stroke-width:0"); + } + if (sources.count(1) > 0) + { + mapper.map(geometry2, "fill-opacity:0.3;fill:rgb(51,51,153);stroke:rgb(51,51,153);stroke-width:0"); + } + + const std::string style = "fill:rgb(0,0,0);font-family:Arial;font-size:10px;"; + for (std::size_t i = 0; i < sbs.m_ranked_points.size(); i++) + { + const typename Sbs::rp& er = sbs.m_ranked_points[i]; + + std::ostringstream out; + out << er.rank + << " (" << i << ")" + << " z=" << er.zone + << " " << (er.direction == detail::overlay::sort_by_side::dir_to ? "t" : "f") + << " " << er.turn_index + << "[" << er.operation_index << "]"; + + if (er.direction == detail::overlay::sort_by_side::dir_to) + { + out << " L=" << er.count_left << " R=" << er.count_right; + } + else + { + out << " l=" << er.count_left << " r=" << er.count_right; + } + out << " " << operation_char(er.operation); + if (source_count > 1) + { + out << " s=" << er.seg_id.source_index; + } + + bool left = (i / 2) % 2 == 1; + int x_offset = left ? -6 : 6; + int y_offset = i % 2 == 0 ? 0 : 10; + const std::string align = left ? "text-anchor:end;" : ""; + + std::string const source_style + = er.seg_id.source_index == 0 + ? "opacity:0.7;stroke:rgb(0,255,0);stroke-width:4;" + : "opacity:0.7;stroke:rgb(0,0,255);stroke-width:4;"; + mapper.map(seg(point, er.point), source_style); + + if (er.direction == detail::overlay::sort_by_side::dir_to) + { + if (er.turn_index == take_turn_index + && er.operation_index == take_operation_index) + { + mapper.map(er.point, "opacity:0.7;fill:rgb(255,0,255);", 3); + } + else + { + mapper.map(er.point, "opacity:0.7;fill:rgb(0,0,0);", 3); + } + } + + mapper.text(er.point, out.str(), style + align, x_offset, y_offset); + } + mapper.map(sbs.m_origin, "opacity:0.9;fill:rgb(255,0,0);", 5); +} + +}}} // namespace boost::geometry::debug + +#endif // BOOST_GEOMETRY_TEST_DEBUG_SORT_BY_SIDE_SVG_HPP diff --git a/src/boost/libs/geometry/test/algorithms/overlay/dissolver.cpp b/src/boost/libs/geometry/test/algorithms/overlay/dissolver.cpp new file mode 100644 index 000000000..c928fa7b3 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/dissolver.cpp @@ -0,0 +1,217 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include + + +#include + +#include + +#include +#include +#include +#include + + +#include + + +#if defined(TEST_WITH_SVG) +# include +# include +#endif + +// Collection might be a multi-geometry, or std::vector +template +void test_dissolve_plusmin(std::string const& caseid, Collection const& input, + T const& expected_positive_area, + T const& expected_negative_area) +{ + typedef typename boost::range_value::type geometry_type; + typedef typename bg::point_type::type point_type; + + + GeometryOut output; + bg::dissolver(input, output); + + T zero = T(); + T positive_area = T(); + T negative_area = T(); + + BOOST_FOREACH(geometry_type const& geometry, output) + { + T a = bg::area(geometry); + if (a > zero) + { + positive_area += a; + } + else + { + negative_area += a; + } + } + + BOOST_CHECK_CLOSE(positive_area, expected_positive_area, 0.001); + BOOST_CHECK_CLOSE(negative_area, expected_negative_area, 0.001); + + +#if defined(TEST_WITH_SVG) + { + std::ostringstream filename; + filename << "dissolve_plusmin_" + << caseid << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 500, 500); + + typedef typename boost::range_value::type value_type; + BOOST_FOREACH(value_type const& geometry, input) + { + mapper.add(geometry); + } + + BOOST_FOREACH(value_type const& geometry, input) + { + mapper.map(geometry, + "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:0.5"); + } + BOOST_FOREACH(geometry_type const& geometry, output) + { + mapper.map(geometry, + bg::area(geometry) > 0 + ? "opacity:0.5;fill:none;stroke:rgb(255,0,0);stroke-width:5" + : "opacity:0.5;fill:none;stroke:rgb(0,0,255);stroke-width:5" + ); + } + } +#endif + +} + +template +void test_geometry(std::string const& caseid, std::string const& wkt, + T const& expected_positive_area, + T const& expected_negative_area = T()) +{ + + MultiPolygon multi_polygon; + bg::read_wkt(wkt, multi_polygon); + + // Test std::vector (= multi_polygon) + test_dissolve_plusmin(caseid, multi_polygon, + expected_positive_area, + expected_negative_area); + + // Test std::vector + { + typedef typename boost::range_value::type polygon_type; + typedef typename bg::ring_type::type ring_type; + std::vector rings; + BOOST_FOREACH(polygon_type const& polygon, multi_polygon) + { + rings.push_back(bg::exterior_ring(polygon)); + } + + test_dissolve_plusmin(caseid + "_rings", rings, + expected_positive_area, + expected_negative_area); + } + + // Test different combinations +#define BOOST_GEOMETRY_TEST_PERMUTATIONS +#ifdef BOOST_GEOMETRY_TEST_PERMUTATIONS + + int n = multi_polygon.size(); + + // test them in all orders + std::vector indices; + for (int i = 0; i < n; i++) + { + indices.push_back(i); + } + int permutation = 0; + do + { + std::ostringstream out; + out << caseid; + MultiPolygon multi_polygon2; + for (int i = 0; i < n; i++) + { + int index = indices[i]; + out << "_" << index; + multi_polygon2.push_back(multi_polygon[index]); + } + test_dissolve_plusmin(out.str(), multi_polygon2, expected_positive_area, + expected_negative_area); + } while (std::next_permutation(indices.begin(), indices.end())); +#endif +} + +template +void test_all() +{ + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + + test_geometry("simplex_one", + "MULTIPOLYGON(((0 0,1 4,4 1,0 0)))", + 7.5); + + test_geometry("simplex_two", + "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)))", + 14.7); + test_geometry("simplex_three", + "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)),((3 4,5 6,6 2,3 4)))", + 16.7945); + test_geometry("simplex_four", + "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)),((3 4,5 6,6 2,3 4)),((5 5,7 7,8 4,5 5)))", + 20.7581); + + // disjoint + test_geometry("simplex_disjoint", + "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((1 6,2 10,5 7,1 6)),((3 4,5 6,6 2,3 4)),((6 5,8 7,9 4,6 5)))", + 24.0); + + // new hole of four + test_geometry("new_hole", + "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,3 6,6 3,2 2)),((3 4,5 6,6 2,3 4)),((3 1,5 4,8 4,3 1)))", + 19.5206); + + // intersection of positive/negative ring + test_geometry("plus_min_one", + "MULTIPOLYGON(((0 0,1 4,4 1,0 0)),((2 2,6 3,3 6,2 2)))", + 7.5, -7.2); + + // negative ring within a positive ring + test_geometry("plus_min_one_within", + "MULTIPOLYGON(((0 0,1 7,7 3,0 0)),((1 2,4 4,2 5,1 2)))", + 23.0, -3.5); + + // from buffer + test_geometry("from_buffer_1", + "MULTIPOLYGON(((2.4 3.03431,1.71716 3.71716,2.4 4,2.4 3.03431))" + ",((2.4 1.96569,2.4 1,1.71716 1.28284,2.4 1.96569))" + ",((2.93431 2.5,2.4 3.03431,2.4 1.96569,2.93431 2.5))" + ",((3.06569 2.5,3 2.43431,2.93431 2.5,3 2.56569,3.06569 2.5))" + ",((-0.4 5.4,4.4 5.4,4.4 3.83431,3.06569 2.5,4.4 1.16569,4.4 -0.4,-0.4 -0.4,-0.4 5.4)))" + , + 26.0596168239, -0.2854871761); + +} + +int test_main(int, char* []) +{ + test_all >(); + return 0; +} + + diff --git a/src/boost/libs/geometry/test/algorithms/overlay/enrich_intersection_points.cpp b/src/boost/libs/geometry/test/algorithms/overlay/enrich_intersection_points.cpp new file mode 100644 index 000000000..c0078a9e1 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/enrich_intersection_points.cpp @@ -0,0 +1,187 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#error This unit test is not updated for several years + +#include + +#include + +#include + +//#include +//#include +#include + +#include + +#define GEOMETRY_TEST_OVERLAY_NOT_REVERSED + + +#include + + +#if defined(TEST_WITH_SVG) +# include +#endif + +struct test_enrich_intersection_points +{ + static inline std::string dir(int d) + { + return d == 0 ? "-" : (d == 1 ? "L" : "R"); + } + + template + static void apply(std::string const& id, + boost::tuple const& expected_count_and_center, + G1 const& g1, G2 const& g2, double precision) + { + //std::cout << "#" << id << std::endl; + + typedef bg::detail::intersection::intersection_point + ::type> ip; + typedef typename boost::range_const_iterator >::type iterator; + std::vector ips; + + bg::get_intersection_points(g1, g2, ips); + bg::merge_intersection_points(ips); + bg::enrich_intersection_points(ips, true); + + std::ostringstream out; + out << std::setprecision(2); + + bool first = true; + for (iterator it = boost::begin(ips); it != boost::end(ips); ++it, first = false) + { + out << (first ? "" : ","); + for (unsigned int i = 0; i < it->info.size(); i++) + { + out << dir(it->info[i].direction); + } + } + int n = boost::size(ips); + //std::cout << n << " " << out.str() << std::endl; + BOOST_CHECK_EQUAL(expected_count_and_center.get<0>(), n); + BOOST_CHECK_EQUAL(expected_count_and_center.get<1>(), out.str()); + + + +#if defined(TEST_WITH_SVG) + { + std::ostringstream filename; + filename << "enrich_ip" << id << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper::type> mapper(svg, 500, 500); + mapper.add(g1); + mapper.add(g2); + + mapper.map(g1, "fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:1"); + mapper.map(g2, "opacity:0.8;fill:rgb(0,0,255);stroke:rgb(0,0,0);stroke-width:1"); + + for (iterator it = boost::begin(ips); it != boost::end(ips); ++it) + { + mapper.map(it->point, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1"); + } + } +#endif + } +}; + + +int test_main(int, char* []) +{ + std::vector > expected; + + /* + TODO Will be refactored + + // NOTE: the order is sometimes not really important, in GCC it is sometimes + // different from here... + + + // 1-6 + expected.push_back(boost::make_tuple(6, "RL,LR,LR,RL,RL,LR")); + expected.push_back(boost::make_tuple(8, "RL,LR,LR,RL,RL,LR,LR,RL")); + expected.push_back(boost::make_tuple(4, "RLRR,RRRL,RRRL,RRRL")); + expected.push_back(boost::make_tuple(12, "RL,LR,RL,LR,LR,RL,RL,LR,LR,RL,LR,RL")); + expected.push_back(boost::make_tuple(17, "LR,RL,LR,RRLR,RL,LR,RL,RL,LR,LR,RL,LR,RL,RL,LR,RL,LR")); + expected.push_back(boost::make_tuple(2, "--RR,LR")); + + // 7-12 + expected.push_back(boost::make_tuple(2, "LL,LL")); + expected.push_back(boost::make_tuple(2, "RL--,LL--")); + expected.push_back(boost::make_tuple(1, "RLLL")); + expected.push_back(boost::make_tuple(2, "RL--,LL--")); + expected.push_back(boost::make_tuple(1, "RRLR")); + expected.push_back(boost::make_tuple(8, "RL,LR,RL,LR,RL,LR,RL,LR")); + + // 13-18 + expected.push_back(boost::make_tuple(2, "LL--,LL--")); + expected.push_back(boost::make_tuple(2, "RL--,LL--")); + expected.push_back(boost::make_tuple(2, "RL--,LL--")); + expected.push_back(boost::make_tuple(2, "LL,--RL")); + expected.push_back(boost::make_tuple(2, "RR--,--LR")); + expected.push_back(boost::make_tuple(2, "RR--,--LR")); + + // 19-24 + expected.push_back(boost::make_tuple(2, "LL,LL")); + expected.push_back(boost::make_tuple(0, "")); + expected.push_back(boost::make_tuple(0, "")); + expected.push_back(boost::make_tuple(1, "RLLLRRLR")); + expected.push_back(boost::make_tuple(2, "RL,RLRRRRLR")); + expected.push_back(boost::make_tuple(1, "LRRRRRLR")); + + // 25-30 + expected.push_back(boost::make_tuple(1, "LRRRLLRL")); + expected.push_back(boost::make_tuple(1, "LRLLLLLR")); + expected.push_back(boost::make_tuple(2, "LR,LRRRRRRL")); + expected.push_back(boost::make_tuple(2, "LR,LRLLRRLR")); + expected.push_back(boost::make_tuple(2, "RL,LRRRLLLR")); + expected.push_back(boost::make_tuple(2, "LR,LRLLLLRL")); + + // 31-36 + expected.push_back(boost::make_tuple(1, "--LLLL--")); + expected.push_back(boost::make_tuple(1, "LR--LLRL")); + expected.push_back(boost::make_tuple(1, "LRLLLL--")); + expected.push_back(boost::make_tuple(2, "LR,LRLLRR--")); + expected.push_back(boost::make_tuple(1, "LRLLRRLR")); + expected.push_back(boost::make_tuple(3, "RL,LR,RLLLRRLR")); + + // 37-42 + expected.push_back(boost::make_tuple(3, "LRRRRRLR,RL,LR")); + expected.push_back(boost::make_tuple(3, "LR--RRRL,LR,RL")); + expected.push_back(boost::make_tuple(3, "RL,LR,LRRRRRRL")); + + // 43-48 + expected.push_back(boost::make_tuple(4, "LR,RL,RL,LR")); + + // 49 + expected.push_back(boost::make_tuple(16, "--RL,RRLR,RRLR,RL,LLRL,RLLLRRLR,RR--,--LR,RLRR,--LL,RL--,RL,RRRL,RL,LR,RRRLRRRL")); + + // 101 + expected.push_back(boost::make_tuple(3, "RL,LR,RL")); + + // ticket#17 + expected.push_back(boost::make_tuple(6, "LR,RL,LR,RL,RL,LR")); + + //test_all, test_enrich_intersection_points>(expected); + test_all, test_enrich_intersection_points>(expected); + //test_all, test_enrich_intersection_points>(expected); + + */ + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/get_turn_info.cpp b/src/boost/libs/geometry/test/algorithms/overlay/get_turn_info.cpp new file mode 100644 index 000000000..3835f6f47 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/get_turn_info.cpp @@ -0,0 +1,901 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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 + +// 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) + +#include + +#include + +#include +#include + +#include +#include + +#include +#include +#include + +#if defined(TEST_WITH_SVG) +# include +#endif + + +// For test purposes, returns the point specified in the constructor +template +struct sub_range_from_points +{ + typedef Point point_type; + + sub_range_from_points(Point const& i, Point const& j, Point const& k) + { + m_points[0] = i; + m_points[1] = j; + m_points[2] = k; + } + + static inline bool is_first_segment() { return false; } + static inline bool is_last_segment() { return false; } + + static inline std::size_t size() { return 3; } + + inline Point const& at(std::size_t index) const + { + return m_points[index % 3]; + } + +private : + boost::array m_points; +}; + +template +void test_with_point(std::string const& caseid, + T pi_x, T pi_y, T pj_x, T pj_y, T pk_x, T pk_y, + T qi_x, T qi_y, T qj_x, T qj_y, T qk_x, T qk_y, + bg::detail::overlay::method_type expected_method, + bool expected_touch_only, + T ip_x, T ip_y, + std::string const& expected, + T ip_x2, T ip_y2) +{ + P pi = bg::make

(pi_x, pi_y); + P pj = bg::make

(pj_x, pj_y); + P pk = bg::make

(pk_x, pk_y); + P qi = bg::make

(qi_x, qi_y); + P qj = bg::make

(qj_x, qj_y); + P qk = bg::make

(qk_x, qk_y); + + typedef typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag

::type + >::type strategy_type; + + typedef typename bg::detail::no_rescale_policy rescale_policy_type; + + typedef bg::detail::overlay::turn_info + < + P, + typename bg::detail::segment_ratio_type::type + > turn_info; + typedef std::vector tp_vector; + turn_info model; + tp_vector info; + strategy_type strategy; + rescale_policy_type rescale_policy; + sub_range_from_points

sub_range_p(pi, pj, pk); + sub_range_from_points

sub_range_q(qi, qj, qk); + bg::detail::overlay::get_turn_info + < + bg::detail::overlay::assign_null_policy + >::apply(sub_range_p, sub_range_q, model, strategy, rescale_policy, std::back_inserter(info)); + + if (info.size() == 0) + { + BOOST_CHECK_EQUAL(expected_method, + bg::detail::overlay::method_none); + } + + std::string detected; + std::string method; + for (typename tp_vector::const_iterator it = info.begin(); it != info.end(); ++it) + { + for (int t = 0; t < 2; t++) + { + detected += bg::operation_char(it->operations[t].operation); + method += bg::method_char(it->method); + } + } + + BOOST_CHECK_MESSAGE(detected == expected, + caseid + << (caseid.find("_") == std::string::npos ? " " : "") + << " method: " << method + << " detected: " << detected + << " expected: " << expected); + + + if (! info.empty()) + { + BOOST_CHECK_EQUAL(info[0].method, expected_method); + BOOST_CHECK_MESSAGE(info[0].touch_only == expected_touch_only, + caseid + << " detected: " << info[0].touch_only + << " expected: " << expected_touch_only); + BOOST_CHECK_CLOSE(bg::get<0>(info[0].point), ip_x, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(info[0].point), ip_y, 0.001); + + if (info.size() > 1) + { + BOOST_CHECK_EQUAL(info.size(), 2u); + BOOST_CHECK_EQUAL(info[1].method, expected_method); + BOOST_CHECK_CLOSE(bg::get<0>(info[1].point), ip_x2, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(info[1].point), ip_y2, 0.001); + } + } + +#if defined(TEST_WITH_SVG) + { + std::ostringstream filename; + filename << "get_turn_info_" << caseid + << "_" << string_from_type::type>::name() + << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper

mapper(svg, 500, 500); + mapper.add(bg::make

(0, 0)); + mapper.add(bg::make

(10, 10)); + + bg::model::linestring

p; p.push_back(pi); p.push_back(pj); p.push_back(pk); + bg::model::linestring

q; q.push_back(qi); q.push_back(qj); q.push_back(qk); + mapper.map(p, "opacity:0.8;stroke:rgb(0,192,0);stroke-width:3"); + mapper.map(q, "opacity:0.8;stroke:rgb(0,0,255);stroke-width:3"); + + std::string style = ";font-family='Verdana';font-weight:bold"; + std::string align = ";text-anchor:end;text-align:end"; + int offset = 8; + + mapper.text(pi, "pi", "fill:rgb(0,192,0)" + style, offset, offset); + mapper.text(pj, "pj", "fill:rgb(0,192,0)" + style, offset, offset); + mapper.text(pk, "pk", "fill:rgb(0,192,0)" + style, offset, offset); + + mapper.text(qi, "qi", "fill:rgb(0,0,255)" + style + align, -offset, offset); + mapper.text(qj, "qj", "fill:rgb(0,0,255)" + style + align, -offset, offset); + mapper.text(qk, "qk", "fill:rgb(0,0,255)" + style + align, -offset, offset); + + + int factor = 1; // second info, if any, will go left by factor -1 + int ch = '1'; + for (typename tp_vector::const_iterator it = info.begin(); + it != info.end(); + ++it, factor *= -1, ch++) + { + bool at_j = it->method == bg::detail::overlay::method_crosses; + std::string op; + op += bg::operation_char(it->operations[0].operation); + align = ";text-anchor:middle;text-align:center"; + mapper.text(at_j ? pj : pk, op, "fill:rgb(255,128,0)" + style + align, offset * factor, -offset); + + op.clear(); + op += bg::operation_char(it->operations[1].operation); + mapper.text(at_j ? qj : qk, op, "fill:rgb(255,128,0)" + style + align, offset * factor, -offset); + + // Map intersection point + method + mapper.map(it->point, "opacity:0.8;fill:rgb(255,0,0);stroke:rgb(0,0,100);stroke-width:1"); + + op.clear(); + op += bg::method_char(it->method); + op += ' '; + op += (it->touch_only ? 'o' : '*'); + if (info.size() != 1) + { + op += ch; + op += " p:"; op += bg::operation_char(it->operations[0].operation); + op += " q:"; op += bg::operation_char(it->operations[1].operation); + } + mapper.text(it->point, op, "fill:rgb(255,0,0)" + style, offset, -offset); + } + } +#endif + +} + +template +void test_both(std::string const& caseid, + T pi_x, T pi_y, T pj_x, T pj_y, T pk_x, T pk_y, + T qi_x, T qi_y, T qj_x, T qj_y, T qk_x, T qk_y, + bg::detail::overlay::method_type method + = bg::detail::overlay::method_none, + bool expected_touch_only = false, + T ip_x = -1, T ip_y = -1, + std::string const& expected = "", + T ip_x2 = -1, T ip_y2 = -1) +{ + test_with_point(caseid, + pi_x, pi_y, pj_x, pj_y, pk_x, pk_y, + qi_x, qi_y, qj_x, qj_y, qk_x, qk_y, + method, expected_touch_only, ip_x, ip_y, expected, ip_x2, ip_y2); + + std::string reversed(expected.rbegin(), expected.rend()); + + if (ip_x2 >= 0 && ip_y2 >= 0) + { + std::swap(ip_x, ip_x2); + std::swap(ip_y, ip_y2); + } + + test_with_point(caseid + "_r", + qi_x, qi_y, qj_x, qj_y, qk_x, qk_y, // q + pi_x, pi_y, pj_x, pj_y, pk_x, pk_y, // p + method, expected_touch_only, ip_x, ip_y, reversed, ip_x2, ip_y2); +} + + +template +void test_all() +{ + using namespace bg::detail::overlay; + + // See powerpoint "doc/testcases/get_turn_info.ppt" + + + // ------------------------------------------------------------------------ + // "Real" intersections ("i"), or, crossing + // ------------------------------------------------------------------------ + test_both("il1", + 5, 1, 5, 6, 7, 8, // p + 3, 3, 7, 5, 8, 3, // q + method_crosses, false, 5, 4, "ui"); + + test_both("il2", + 5, 1, 5, 6, 7, 8, // p + 3, 5, 7, 5, 3, 3, // q + method_crosses, false, 5, 5, "ui"); + + test_both("il3", + 5, 1, 5, 6, 7, 8, // p + 3, 3, 7, 5, 3, 5, // q + method_crosses, false, 5, 4, "ui"); + + test_both("il4", + 5, 1, 5, 6, 7, 8, // p + 3, 3, 7, 5, 4, 8, // q + method_crosses, false, 5, 4, "ui"); + + test_both("ir1", + 5, 1, 5, 6, 7, 8, // p + 7, 5, 3, 3, 2, 5, // q + method_crosses, false, 5, 4, "iu"); + + + // ------------------------------------------------------------------------ + // TOUCH INTERIOR or touch in the middle ("m") + // ------------------------------------------------------------------------ + test_both("ml1", + 5, 1, 5, 6, 7, 8, // p + 3, 3, 5, 4, 7, 3, // q + method_touch_interior, false, 5, 4, "ui"); + + test_both("ml2", + 5, 1, 5, 6, 7, 8, // p + 3, 3, 5, 4, 3, 6, // q + method_touch_interior, true, 5, 4, "iu"); + + test_both("ml3", + 5, 1, 5, 6, 7, 8, // p + 3, 6, 5, 4, 3, 3, // q + method_touch_interior, true, 5, 4, "uu"); + + test_both("mr1", + 5, 1, 5, 6, 7, 8, // p + 7, 3, 5, 4, 3, 3, // q + method_touch_interior, false, 5, 4, "iu"); + + test_both("mr2", + 5, 1, 5, 6, 7, 8, // p + 7, 3, 5, 4, 7, 6, // q + method_touch_interior, true, 5, 4, "ui"); + + test_both("mr3", + 5, 1, 5, 6, 7, 8, // p + 7, 6, 5, 4, 7, 3, // q + method_touch_interior, true, 5, 4, "ii"); + + test_both("mcl", + 5, 1, 5, 6, 7, 8, // p + 3, 2, 5, 3, 5, 5, // q + method_touch_interior, false, 5, 3, "cc"); + + test_both("mcr", + 5, 1, 5, 6, 7, 8, // p + 7, 2, 5, 3, 5, 5, // q + method_touch_interior, false, 5, 3, "cc"); + + test_both("mclo", + 5, 1, 5, 6, 7, 8, // p + 3, 4, 5, 5, 5, 3, // q + method_touch_interior, false, 5, 5, "ux"); + + test_both("mcro", + 5, 1, 5, 6, 7, 8, // p + 7, 4, 5, 5, 5, 3, // q + method_touch_interior, false, 5, 5, "ix"); + + // ------------------------------------------------------------------------ + // COLLINEAR + // ------------------------------------------------------------------------ + test_both("cll1", + 5, 1, 5, 6, 3, 8, // p + 5, 5, 5, 7, 3, 8, // q + method_collinear, false, 5, 6, "ui"); + test_both("cll2", + 5, 1, 5, 6, 3, 8, // p + 5, 3, 5, 5, 3, 6, // q + method_collinear, false, 5, 5, "iu"); + test_both("clr1", + 5, 1, 5, 6, 3, 8, // p + 5, 5, 5, 7, 6, 8, // q + method_collinear, false, 5, 6, "ui"); + test_both("clr2", + 5, 1, 5, 6, 3, 8, // p + 5, 3, 5, 5, 6, 6, // q + method_collinear, false, 5, 5, "ui"); + + test_both("crl1", + 5, 1, 5, 6, 7, 8, // p + 5, 5, 5, 7, 3, 8, // q + method_collinear, false, 5, 6, "iu"); + test_both("crl2", + 5, 1, 5, 6, 7, 8, // p + 5, 3, 5, 5, 3, 6, // q + method_collinear, false, 5, 5, "iu"); + test_both("crr1", + 5, 1, 5, 6, 7, 8, // p + 5, 5, 5, 7, 6, 8, // q + method_collinear, false, 5, 6, "iu"); + test_both("crr2", + 5, 1, 5, 6, 7, 8, // p + 5, 3, 5, 5, 6, 6, // q + method_collinear, false, 5, 5, "ui"); + + // The next two cases are changed (BSG 2013-09-24), they contain turn info (#buffer_rt_g) + // In new approach they are changed back (BSG 2013-10-20) + test_both("ccx1", + 5, 1, 5, 6, 5, 8, // p + 5, 5, 5, 7, 3, 8, // q + method_collinear, false, 5, 6, "cc"); // "iu"); + test_both("cxc1", + 5, 1, 5, 6, 7, 8, // p + 5, 3, 5, 5, 5, 7, // q + method_collinear, false, 5, 5, "cc"); // "iu"); + + // Bug in case #54 of "overlay_cases.hpp" + test_both("c_bug1", + 5, 0, 2, 0, 2, 2, // p + 4, 0, 1, 0, 1, 2, // q + method_collinear, false, 2, 0, "iu"); + + + // ------------------------------------------------------------------------ + // COLLINEAR OPPOSITE + // ------------------------------------------------------------------------ + + test_both("clo1", + 5, 2, 5, 6, 3, 8, // p + 5, 7, 5, 5, 3, 3, // q + method_collinear, false, 5, 6, "ixxu", 5, 5); + test_both("clo2", + 5, 2, 5, 6, 3, 8, // p + 5, 7, 5, 5, 5, 2, // q + method_collinear, false, 5, 6, "ix"); + // actually "xxix", xx is skipped everywhere + test_both("clo3", + 5, 2, 5, 6, 3, 8, // p + 5, 7, 5, 5, 7, 3, // q + method_collinear, false, 5, 6, "ixxi", 5, 5); + + test_both("cco1", + 5, 2, 5, 6, 5, 8, // p + 5, 7, 5, 5, 3, 3, // q + method_collinear, false, 5, 5, "xu"); // "xuxx" + test_both("cco2", + 5, 2, 5, 6, 5, 8, // p + 5, 7, 5, 5, 5, 2); // q "xxxx" + test_both("cco3", + 5, 2, 5, 6, 5, 8, // p + 5, 7, 5, 5, 7, 3, // q + method_collinear, false, 5, 5, "xi"); // "xixx" + + + test_both("cro1", + 5, 2, 5, 6, 7, 8, // p + 5, 7, 5, 5, 3, 3, // q + method_collinear, false, 5, 6, "uxxu", 5, 5); + test_both("cro2", + 5, 2, 5, 6, 7, 8, // p + 5, 7, 5, 5, 5, 2, // q + method_collinear, false, 5, 6, "ux"); // "xxux" + test_both("cro3", + 5, 2, 5, 6, 7, 8, // p + 5, 7, 5, 5, 7, 3, // q + method_collinear, false, 5, 6, "uxxi", 5, 5); + + test_both("cxo1", + 5, 2, 5, 6, 3, 8, // p + 5, 5, 5, 3, 3, 1, // q + method_collinear, false, 5, 3, "xu"); + test_both("cxo2", + 5, 2, 5, 6, 3, 8, // p + 5, 5, 5, 3, 5, 0); // q "xx" + test_both("cxo3", + 5, 2, 5, 6, 3, 8, // p + 5, 5, 5, 3, 7, 1, // q + method_collinear, false, 5, 3, "xi"); + + test_both("cxo4", + 5, 2, 5, 6, 3, 8, // p + 5, 7, 5, 1, 3, 0, // q + method_collinear, false, 5, 6, "ix"); + test_both("cxo5", + 5, 2, 5, 6, 5, 8, // p + 5, 7, 5, 1, 3, 0); // q "xx" + test_both("cxo6", + 5, 2, 5, 6, 7, 8, // p + 5, 7, 5, 1, 3, 0, // q + method_collinear, false, 5, 6, "ux"); + + + // Verify + test_both("cvo1", + 5, 3, 5, 7, 7, 9, // p + 5, 5, 5, 3, 3, 1 // q + ); + test_both("cvo2", + 5, 3, 5, 7, 7, 9, // p + 5, 4, 5, 2, 3, 0 // q + ); + + + // ------------------------------------------------------------------------ + // TOUCH - both same + // ------------------------------------------------------------------------ + // Both left, Q turns right + test_both("blr1", + 5, 1, 5, 6, 4, 4, // p + 3, 7, 5, 6, 3, 5, // q + method_touch, true, 5, 6, "ui"); + test_both("blr2", + 5, 1, 5, 6, 1, 4, // p + 3, 7, 5, 6, 3, 5, // q + method_touch, false, 5, 6, "cc"); + test_both("blr3", + 5, 1, 5, 6, 3, 6, // p + 3, 7, 5, 6, 3, 5, // q + method_touch, false, 5, 6, "iu"); + test_both("blr4", + 5, 1, 5, 6, 1, 8, // p + 3, 7, 5, 6, 3, 5, // q + method_touch, false, 5, 6, "xu"); + test_both("blr5", + 5, 1, 5, 6, 4, 8, // p + 3, 7, 5, 6, 3, 5, // q + method_touch, true, 5, 6, "uu"); + test_both("blr6", + 5, 1, 5, 6, 6, 4, // p + 3, 7, 5, 6, 3, 5, // q + method_touch, true, 5, 6, "uu"); + + test_both("blr7", + 5, 1, 5, 6, 3, 6, // p + 3, 7, 5, 6, 5, 3, // q + method_touch, false, 5, 6, "ix"); + test_both("blr8", + 5, 1, 5, 6, 3, 6, // p + 3, 6, 5, 6, 5, 3, // q + method_touch, false, 5, 6, "xx"); + test_both("blr9", + 5, 1, 5, 6, 3, 6, // p + 3, 5, 5, 6, 5, 3, // q + method_touch, false, 5, 6, "ux"); + + // Variants + test_both("blr7-a", + 5, 1, 5, 6, 3, 6, // p + 5, 8, 5, 6, 5, 3, // q + method_touch, false, 5, 6, "ix"); + test_both("blr7-b", // in fact NOT "both-left" + 5, 1, 5, 6, 3, 6, // p + 6, 8, 5, 6, 5, 3, // q + method_touch, false, 5, 6, "ix"); + + // To check if "collinear-check" on other side + // does not apply to this side + test_both("blr6-c1", + 5, 1, 5, 6, 7, 5, // p + 3, 7, 5, 6, 3, 5, // q + method_touch, true, 5, 6, "uu"); + test_both("blr6-c2", + 5, 1, 5, 6, 7, 7, // p + 3, 7, 5, 6, 3, 5, // q + method_touch, true, 5, 6, "uu"); + + + + // Both right, Q turns right + test_both("brr1", + 5, 1, 5, 6, 6, 4, // p + 7, 5, 5, 6, 7, 7, // q + method_touch, true, 5, 6, "uu"); + test_both("brr2", + 5, 1, 5, 6, 9, 4, // p + 7, 5, 5, 6, 7, 7, // q + method_touch, false, 5, 6, "xu"); + test_both("brr3", + 5, 1, 5, 6, 7, 6, // p + 7, 5, 5, 6, 7, 7, // q + method_touch, false, 5, 6, "iu"); + test_both("brr4", + 5, 1, 5, 6, 9, 8, // p + 7, 5, 5, 6, 7, 7, // q + method_touch, false, 5, 6, "cc"); + test_both("brr5", + 5, 1, 5, 6, 6, 8, // p + 7, 5, 5, 6, 7, 7, // q + method_touch, true, 5, 6, "ui"); + test_both("brr6", + 5, 1, 5, 6, 4, 4, // p + 7, 5, 5, 6, 7, 7, // q + method_touch, true, 5, 6, "ui"); + + // Both right, Q turns left + test_both("brl1", + 5, 1, 5, 6, 6, 4, // p + 7, 7, 5, 6, 7, 5, // q + method_touch, true, 5, 6, "iu"); + test_both("brl2", + 5, 1, 5, 6, 9, 4, // p + 7, 7, 5, 6, 7, 5, // q + method_touch, false, 5, 6, "cc"); + test_both("brl3", + 5, 1, 5, 6, 7, 6, // p + 7, 7, 5, 6, 7, 5, // q + method_touch, false, 5, 6, "ui"); + test_both("brl4", + 5, 1, 5, 6, 9, 8, // p + 7, 7, 5, 6, 7, 5, // q + method_touch, false, 5, 6, "xi"); + test_both("brl5", + 5, 1, 5, 6, 6, 8, // p + 7, 7, 5, 6, 7, 5, // q + method_touch, true, 5, 6, "ii"); + test_both("brl6", + 5, 1, 5, 6, 4, 4, // p + 7, 7, 5, 6, 7, 5, // q + method_touch, true, 5, 6, "ii"); + test_both("brl7", + 5, 1, 5, 6, 7, 6, // p + 7, 7, 5, 6, 5, 3, // q + method_touch, false, 5, 6, "ux"); + test_both("brl8", + 5, 1, 5, 6, 7, 6, // p + 7, 6, 5, 6, 5, 3, // q + method_touch, false, 5, 6, "xx"); + test_both("brl9", + 5, 1, 5, 6, 7, 6, // p + 7, 5, 5, 6, 5, 3, // q + method_touch, false, 5, 6, "ix"); + + // Variants + test_both("brl7-a", + 5, 1, 5, 6, 7, 6, // p + 5, 8, 5, 6, 5, 3, // q + method_touch, false, 5, 6, "ux"); + test_both("brl7-b", // in fact NOT "both right" + 5, 1, 5, 6, 7, 6, // p + 4, 8, 5, 6, 5, 3, // q + method_touch, false, 5, 6, "ux"); + + + + // Both left, Q turns left + test_both("bll1", + 5, 1, 5, 6, 4, 4, // p + 3, 5, 5, 6, 3, 7, // q + method_touch, true, 5, 6, "ii"); + test_both("bll2", + 5, 1, 5, 6, 1, 4, // p + 3, 5, 5, 6, 3, 7, // q + method_touch, false, 5, 6, "xi"); + test_both("bll3", + 5, 1, 5, 6, 3, 6, // p + 3, 5, 5, 6, 3, 7, // q + method_touch, false, 5, 6, "ui"); + test_both("bll4", + 5, 1, 5, 6, 1, 8, // p + 3, 5, 5, 6, 3, 7, // q + method_touch, false, 5, 6, "cc"); + test_both("bll5", + 5, 1, 5, 6, 4, 8, // p + 3, 5, 5, 6, 3, 7, // q + method_touch, true, 5, 6, "iu"); + test_both("bll6", + 5, 1, 5, 6, 6, 4, // p + 3, 5, 5, 6, 3, 7, // q + method_touch, true, 5, 6, "iu"); + + // TOUCH - COLLINEAR + one side + // Collinear/left, Q turns right + test_both("t-clr1", + 5, 1, 5, 6, 4, 4, // p + 5, 8, 5, 6, 3, 5, // q + method_touch, true, 5, 6, "ui"); + test_both("t-clr2", + 5, 1, 5, 6, 1, 4, // p + 5, 8, 5, 6, 3, 5, // q + method_touch, false, 5, 6, "cc"); + test_both("t-clr3", + 5, 1, 5, 6, 3, 6, // p + 5, 8, 5, 6, 3, 5, // q + method_touch, false, 5, 6, "iu"); + test_both("t-clr4", + 5, 1, 5, 6, 5, 8, // p + 5, 8, 5, 6, 3, 5, // q + method_touch, false, 5, 6, "xu"); + // 5 n.a. + test_both("t-clr6", + 5, 1, 5, 6, 6, 4, // p + 5, 8, 5, 6, 3, 5, // q + method_touch, true, 5, 6, "uu"); + + // Collinear/right, Q turns right + test_both("t-crr1", + 5, 1, 5, 6, 6, 4, // p + 7, 5, 5, 6, 5, 8, // q + method_touch, true, 5, 6, "uu"); + test_both("t-crr2", + 5, 1, 5, 6, 9, 4, // p + 7, 5, 5, 6, 5, 8, // q + method_touch, false, 5, 6, "xu"); + test_both("t-crr3", + 5, 1, 5, 6, 7, 6, // p + 7, 5, 5, 6, 5, 8, // q + method_touch, false, 5, 6, "iu"); + test_both("t-crr4", + 5, 1, 5, 6, 5, 9, // p + 7, 5, 5, 6, 5, 8, // q + method_touch, false, 5, 6, "cc"); + // 5 n.a. + test_both("t-crr6", + 5, 1, 5, 6, 4, 4, // p + 7, 5, 5, 6, 5, 8, // q + method_touch, true, 5, 6, "ui"); + + // Collinear/right, Q turns left + test_both("t-crl1", + 5, 1, 5, 6, 6, 4, // p + 5, 7, 5, 6, 7, 5, // q + method_touch, true, 5, 6, "iu"); + test_both("t-crl2", + 5, 1, 5, 6, 9, 4, // p + 5, 7, 5, 6, 7, 5, // q + method_touch, false, 5, 6, "cc"); + test_both("t-crl3", + 5, 1, 5, 6, 7, 6, // p + 5, 7, 5, 6, 7, 5, // q + method_touch, false, 5, 6, "ui"); + test_both("t-crl4", + 5, 1, 5, 6, 5, 8, // p + 5, 7, 5, 6, 7, 5, // q + method_touch, false, 5, 6, "xi"); + // 5 n.a. + test_both("t-crl6", + 5, 1, 5, 6, 4, 4, // p + 5, 7, 5, 6, 7, 5, // q + method_touch, true, 5, 6, "ii"); + + // Collinear/left, Q turns left + test_both("t-cll1", + 5, 1, 5, 6, 4, 4, // p + 3, 5, 5, 6, 5, 8, // q + method_touch, true, 5, 6, "ii"); + test_both("t-cll2", + 5, 1, 5, 6, 1, 4, // p + 3, 5, 5, 6, 5, 8, // q + method_touch, false, 5, 6, "xi"); + test_both("t-cll3", + 5, 1, 5, 6, 3, 6, // p + 3, 5, 5, 6, 5, 8, // q + method_touch, false, 5, 6, "ui"); + test_both("t-cll4", + 5, 1, 5, 6, 5, 9, // p + 3, 5, 5, 6, 5, 8, // q + method_touch, false, 5, 6, "cc"); + // 5 n.a. + test_both("t-cll6", + 5, 1, 5, 6, 6, 4, // p + 3, 5, 5, 6, 5, 8, // q + method_touch, true, 5, 6, "iu"); + + // Left to right + test_both("lr1", + 5, 1, 5, 6, 3, 3, // p + 1, 5, 5, 6, 9, 5, // q + method_touch, true, 5, 6, "ii"); + test_both("lr2", + 5, 1, 5, 6, 1, 5, // p + 1, 5, 5, 6, 9, 5, // q + method_touch, false, 5, 6, "xi"); + test_both("lr3", + 5, 1, 5, 6, 4, 8, // p + 1, 5, 5, 6, 9, 5, // q + method_touch, false, 5, 6, "ui"); + test_both("lr4", + 5, 1, 5, 6, 9, 5, // p + 1, 5, 5, 6, 9, 5, // q + method_touch, false, 5, 6, "cc"); + test_both("lr5", + 5, 1, 5, 6, 7, 3, // p + 1, 5, 5, 6, 9, 5, // q + method_touch, true, 5, 6, "iu"); + // otherwise case more thoroughly + test_both("lr3a", + 5, 1, 5, 6, 1, 6, // p + 1, 5, 5, 6, 9, 5, // q + method_touch, false, 5, 6, "ui"); + test_both("lr3b", + 5, 1, 5, 6, 5, 10, // p + 1, 5, 5, 6, 9, 5, // q + method_touch, false, 5, 6, "ui"); + test_both("lr3c", + 5, 1, 5, 6, 8, 9, // p + 1, 5, 5, 6, 9, 5, // q + method_touch, false, 5, 6, "ui"); + test_both("lr3d", + 5, 1, 5, 6, 9, 7, // p + 1, 5, 5, 6, 9, 5, // q + method_touch, false, 5, 6, "ui"); + test_both("lr3e", + 5, 1, 5, 6, 9, 6, // p + 1, 5, 5, 6, 9, 5, // q + method_touch, false, 5, 6, "ui"); + + // Right to left + test_both("rl1", + 5, 1, 5, 6, 3, 3, // p + 9, 5, 5, 6, 1, 5, // q + method_touch, true, 5, 6, "ui"); + test_both("rl2", + 5, 1, 5, 6, 1, 5, // p + 9, 5, 5, 6, 1, 5, // q + method_touch, false, 5, 6, "cc"); + test_both("rl3", + 5, 1, 5, 6, 4, 8, // p + 9, 5, 5, 6, 1, 5, // q + method_touch, false, 5, 6, "iu"); + test_both("rl4", + 5, 1, 5, 6, 9, 5, // p + 9, 5, 5, 6, 1, 5, // q + method_touch, false, 5, 6, "xu"); + test_both("rl5", + 5, 1, 5, 6, 7, 3, // p + 9, 5, 5, 6, 1, 5, // q + method_touch, true, 5, 6, "uu"); + + // Equal (p1/q1 are equal) + test_both("ebl1", + 5, 1, 5, 6, 3, 4, // p + 5, 1, 5, 6, 3, 8, // q + method_equal, false, 5, 6, "ui"); + test_both("ebl2", + 5, 1, 5, 6, 3, 8, // p + 5, 1, 5, 6, 3, 4, // q + method_equal, false, 5, 6, "iu"); + test_both("ebl3", + 5, 1, 5, 6, 3, 8, // p + 5, 1, 5, 6, 3, 8, // q + method_equal, false, 5, 6, "cc"); + + test_both("ebl3-c1", + 5, 1, 5, 6, 10, 1, // p + 5, 1, 5, 6, 3, 8, // q + method_equal, false, 5, 6, "iu"); + + test_both("ebr1", + 5, 1, 5, 6, 7, 4, // p + 5, 1, 5, 6, 7, 8, // q + method_equal, false, 5, 6, "iu"); + test_both("ebr2", + 5, 1, 5, 6, 7, 8, // p + 5, 1, 5, 6, 7, 4, // q + method_equal, false, 5, 6, "ui"); + test_both("ebr3", + 5, 1, 5, 6, 7, 8, // p + 5, 1, 5, 6, 7, 8, // q + method_equal, false, 5, 6, "cc"); + + test_both("ebr3-c1", + 5, 1, 5, 6, 0, 1, // p + 5, 1, 5, 6, 7, 8, // q + method_equal, false, 5, 6, "ui"); + + test_both("elr1", + 5, 1, 5, 6, 7, 8, // p + 5, 1, 5, 6, 3, 8, // q + method_equal, false, 5, 6, "iu"); + test_both("elr2", + 5, 1, 5, 6, 3, 8, // p + 5, 1, 5, 6, 7, 8, // q + method_equal, false, 5, 6, "ui"); + test_both("ec1", + 5, 1, 5, 6, 5, 8, // p + 5, 1, 5, 6, 5, 8, // q + method_equal, false, 5, 6, "cc"); + test_both("ec2", + 5, 1, 5, 6, 5, 8, // p + 5, 1, 5, 6, 5, 7, // q + method_equal, false, 5, 6, "cc"); + + test_both("snl-1", + 0, 3, 2, 3, 4, 3, // p + 4, 3, 2, 3, 0, 3, // q + method_touch, false, 2, 3, "xx"); + + // BSG 2012-05-26 to be decided what's the problem here and what it tests... + // Anyway, test results are not filled out. + //test_both("issue_buffer_mill", + // 5.1983614873206241 , 6.7259025813913107 , 5.0499999999999998 , 6.4291796067500622 , 5.1983614873206241 , 6.7259025813913107, // p + // 5.0499999999999998 , 6.4291796067500622 , 5.0499999999999998 , 6.4291796067500622 , 5.1983614873206241 , 6.7259025813913107, // q + // method_collinear, false, 2, 0, "tt"); + +} + + +/*** +#include +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) + +template +void test2(G const& geometry) +{ + typedef typename bg::point_type::type P; + typedef typename bg::tag::type T; + typedef typename bg::tag

::type PT; + std::cout << typeid(G).name() << std::endl; + std::cout << typeid(T).name() << std::endl; + std::cout << typeid(P).name() << std::endl; + std::cout << typeid(PT).name() << std::endl; + + + std::cout << bg::length(geometry) << std::endl; + + typedef bg::model::point P2; + bg::model::linestring out; + bg::strategy::transform::scale_transformer scaler(5); + bg::transform(geometry, out, scaler); + std::cout << bg::dsv(out) << std::endl; +} + +void test_f3() +{ + float vertices[][3] = { + {-1, -1, 1}, {1, -1, 1}, {1, 1, 1}, {-1, 1, 1}, + {-1, -1, -1}, {1, -1, -1}, {1, 1, -1}, {-1, 1, -1} + }; + test2(vertices); +} +***/ + +int test_main(int, char* []) +{ + test_all >(); + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/get_turn_info.xls b/src/boost/libs/geometry/test/algorithms/overlay/get_turn_info.xls new file mode 100644 index 000000000..facd118e4 Binary files /dev/null and b/src/boost/libs/geometry/test/algorithms/overlay/get_turn_info.xls differ diff --git a/src/boost/libs/geometry/test/algorithms/overlay/get_turns.cpp b/src/boost/libs/geometry/test/algorithms/overlay/get_turns.cpp new file mode 100644 index 000000000..b32e2eba3 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/get_turns.cpp @@ -0,0 +1,404 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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. + +// 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) + +#include +#include + +#include + +#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER + + +#include + +#include +#include +#include + +#include + +#include + +#include +#include + +#if defined(TEST_WITH_SVG) +# include +#endif + +#include + + + + +// To test that "get_turns" can be called using additional information +template +struct my_turn_op : public bg::detail::overlay::turn_operation +{ +}; + +namespace detail +{ + +struct test_get_turns +{ + template + static void apply(std::string const& id, + std::size_t expected_count, + G1 const& g1, G2 const& g2, double /*precision*/) + { + typedef typename bg::point_type::type point_type; + + typedef typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy_type; + + typedef typename bg::rescale_policy_type::type + rescale_policy_type; + + strategy_type strategy; + + rescale_policy_type rescale_policy + = bg::get_rescale_policy(g1, g2); + + typedef bg::detail::overlay::turn_info + < + point_type, + typename bg::detail::segment_ratio_type::type + > turn_info; + std::vector turns; + + + bg::detail::get_turns::no_interrupt_policy policy; + bg::get_turns + < + false, false, bg::detail::overlay::assign_null_policy + >(g1, g2, strategy, rescale_policy, turns, policy); + + BOOST_CHECK_MESSAGE( + expected_count == boost::size(turns), + "get_turns: " << id + << " #turns expected: " << expected_count + << " detected: " << boost::size(turns) + << " type: " << string_from_type + ::type>::name() + ); + +#if defined(TEST_WITH_SVG) + { + typedef typename bg::coordinate_type::type coordinate_type; + std::map, int> offsets; + std::ostringstream filename; + filename << "get_turns_" << id + << "_" << string_from_type::type>::name() + << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper::type> mapper(svg, 500, 500); + mapper.add(g1); + mapper.add(g2); + + // Input shapes in green/blue + mapper.map(g1, "fill-opacity:0.5;fill:rgb(153,204,0);" + "stroke:rgb(153,204,0);stroke-width:3"); + mapper.map(g2, "fill-opacity:0.3;fill:rgb(51,51,153);" + "stroke:rgb(51,51,153);stroke-width:3"); + + int index = 0; + BOOST_FOREACH(turn_info const& turn, turns) + { + mapper.map(turn.point, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1"); + + // Map characteristics + std::pair p + = std::make_pair(bg::get<0>(turn.point), bg::get<1>(turn.point)); + + { + std::ostringstream out; + out << index + << ": " << bg::operation_char(turn.operations[0].operation) + << " " << bg::operation_char(turn.operations[1].operation) + << " (" << bg::method_char(turn.method) << ")" + << (turn.discarded ? " (discarded) " : turn.blocked() ? " (blocked)" : "") + ; + + offsets[p] += 10; + int offset = offsets[p]; + mapper.text(turn.point, out.str(), + "fill:rgb(0,0,0);font-family:Arial;font-size:8px", + 5, offset); + } + + ++index; + } + } +#endif + } +}; + +} + +template +struct test_get_turns +{ + inline static void apply(std::string const& id, std::size_t expected_count, + std::string const& wkt1, std::string const& wkt2, + double precision = 0.001) + { + if (wkt1.empty() || wkt2.empty()) + { + return; + } + + G1 g1; + bg::read_wkt(wkt1, g1); + + G2 g2; + bg::read_wkt(wkt2, g2); + + bg::correct(g1); + bg::correct(g2); + + // Try the overlay-function in both ways + std::string caseid = id; + //goto case_reversed; + +#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION + std::cout << std::endl << std::endl << "# " << caseid << std::endl; +#endif + detail::test_get_turns::apply(caseid, expected_count, g1, g2, precision); + +#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION + return; +#endif + + //case_reversed: +#if ! defined(BOOST_GEOMETRY_TEST_OVERLAY_NOT_EXCHANGED) + caseid = id + "_rev"; +#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION + std::cout << std::endl << std::endl << "# " << caseid << std::endl; +#endif + + detail::test_get_turns::apply(caseid, expected_count, g2, g1, precision); +#endif + } +}; + +#if ! defined(GEOMETRY_TEST_MULTI) +template +void test_all() +{ + typedef bg::model::point P; + typedef bg::model::polygon

polygon; + typedef bg::model::linestring

linestring; + typedef bg::model::box

box; + +#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION + std::cout << string_from_type::name() << std::endl; +#endif + + + // snl + /* + test_get_turns::apply("snl_2", + 5, + //snl-1 + //"POLYGON((182467 605842,182480 605954,182557 605958,182571 605958,182585 605958,182579 605843,182559 605838,182467 605842))", + //"POLYGON((182499 605955,182511 605960,182536 605974,182536 605981,182536 606006,182563 606006,182610 605985,182613 605976,182620 605948,182628 605937,182631 605924,182639 605889,182634 605885,182603 605848,182579 605843,182585 605958,182571 605958,182557 605958,182499 605955))"); + //snl-2 + //"POLYGON((120812 525783,120845 525792,120821 525842,120789 525826,120818 525849,120831 525854,120875 525875,120887 525881,120887 525881,120920 525834,120920 525834,120811 525772,120789 525826,120812 525783))", + //"POLYGON((120789 525826,120812 525783,120845 525792,120821 525842,120789 525826,120818 525849,120831 525854,120875 525875,120923 525836,120811 525772,120789 525826))" + //snl-4 + "POLYGON((184913.4512400339881423860788345336914 606985.779408219968900084495544433594,184912.8999999999941792339086532592773 606987.145999999949708580970764160156,184904.4135310589917935431003570556641 606987.651360383024439215660095214844,184901.847619076987029984593391418457 607014.593436188995838165283203125,184916.3977574919990729540586471557617 607021.060164373018778860569000244141,184927.7147701499925460666418075561523 607008.126435620011761784553527832031,184926.0980706939881201833486557006836 606998.426238880958408117294311523438,184913.4512400339881423860788345336914 606985.779408219968900084495544433594),(184907.5560000000114087015390396118164 607013.300999999977648258209228515625,184905.7820000000065192580223083496094 607009.971999999950639903545379638672,184906.0039999999862629920244216918945 607005.978000000002793967723846435547,184908.4439999999885912984609603881836 606998.876999999978579580783843994141,184912.2149999999965075403451919555664 606994.217999999993480741977691650391,184919.3140000000130385160446166992188 606993.996000000042840838432312011719,184922.4200000000128056854009628295898 606995.770999999949708580970764160156,184925.7470000000030267983675003051758 606998.876999999978579580783843994141,184926.4130000000004656612873077392578 607002.871999999973922967910766601563,184925.7470000000030267983675003051758 607007.753000000026077032089233398438,184922.4200000000128056854009628295898 607012.190999999991618096828460693359,184917.0959999999904539436101913452148 607015.297999999951571226119995117188,184911.7710000000079162418842315673828 607015.297999999951571226119995117188,184907.5560000000114087015390396118164 607013.300999999977648258209228515625))", + "POLYGON((184861.1180000010062940418720245361328 606901.158000000054016709327697753906,184893.7870000000111758708953857421875 606898.482999998959712684154510498047,184925.0430000009946525096893310546875 606913.399999998975545167922973632813,184927.1739999990095384418964385986328 606951.758999999961815774440765380859,184912.8999999990046489983797073364258 606987.146000002045184373855590820313,184877.8700000010139774531126022338867 606989.232000001007691025733947753906,184885.1030000000027939677238464355469 607023.773999999975785613059997558594,184899.0579999980109278112649917602539 607022.743000000948086380958557128906,184906.0080000009911600500345230102539 607044.947999999043531715869903564453,184966.4649999999965075403451919555664 607025.020000000018626451492309570313,184968.4420000019890721887350082397461 606961.300000000977888703346252441406,185024.7679999989923089742660522460938 606947.401999998954124748706817626953,185024.5439999999944120645523071289063 606941.354999999981373548507690429688,185027.0069999989937059581279754638672 606937.322999999043531715869903564453,185030.3660000000090803951025009155273 606934.186999998986721038818359375,185035.5159999990137293934822082519531 606933.962999999988824129104614257813,185040.4420000019890721887350082397461 606935.530999999027699232101440429688,185042.905000000988366082310676574707 606939.114999998011626303195953369141,185088.3640000000013969838619232177734 606931.385000001988373696804046630859,185089.1389999990060459822416305541992 607015.508999999961815774440765380859,185095.1999999989930074661970138549805 607011.300000000977888703346252441406,185118.8269999999902211129665374755859 606995.545000002020969986915588378906,185126.813000001013278961181640625 606991.9950000010430812835693359375,185177.7270000019925646483898162841797 606973.798999998951330780982971191406,185181.4820000010076910257339477539063 606966.67599999904632568359375,185193.5709999990067444741725921630859 606977.795000002020969986915588378906,185193.710999998991610482335090637207 606960.300000000977888703346252441406,185189.3520000019925646483898162841797 606779.020000000018626451492309570313,185167.5150000010035000741481781005859 606783.844000000972300767898559570313,185086.9600000010104849934577941894531 606801.241000000038184225559234619141,185011.7069999990053474903106689453125 606817.809000000008381903171539306641,185000 606819.304000001051463186740875244141,184994.0340000019932631403207778930664 606819.793999999994412064552307128906,184976.3979999980074353516101837158203 606819.572000000975094735622406005859,184956.6539999989909119904041290283203 606817.1310000009834766387939453125,184934.9129999990109354257583618164063 606813.136999998008832335472106933594,184893.0969999989902134984731674194336 606804.927000000956468284130096435547,184884.4450000000069849193096160888672 606831.555000000051222741603851318359,184866.9189999999944120645523071289063 606883.480999998981133103370666503906,184861.1180000010062940418720245361328 606901.158000000054016709327697753906),(184907.5560000019904691725969314575195 607013.30099999904632568359375,184905.7820000019855797290802001953125 607009.971999999019317328929901123047,184906.0040000010048970580101013183594 607005.978000000002793967723846435547,184908.4439999980095308274030685424805 606998.876999999978579580783843994141,184912.2149999999965075403451919555664 606994.217999998014420270919799804688,184919.3139999989944044500589370727539 606993.995999998995102941989898681641,184922.420000001991866156458854675293 606995.771000002045184373855590820313,184925.7470000009925570338964462280273 606998.876999999978579580783843994141,184926.4129999990109354257583618164063 607002.872000001021660864353179931641,184925.7470000009925570338964462280273 607007.752999998978339135646820068359,184922.420000001991866156458854675293 607012.190999999991618096828460693359,184917.0960000010090880095958709716797 607015.297999999951571226119995117188,184911.7710000019869767129421234130859 607015.297999999951571226119995117188,184907.5560000019904691725969314575195 607013.30099999904632568359375))" + ); + + + return; + */ + + // 1-6 + test_get_turns::apply("1", 6, case_1[0], case_1[1]); + test_get_turns::apply("2", 8, case_2[0], case_2[1]); + test_get_turns::apply("3", 4, case_3[0], case_3[1]); + test_get_turns::apply("4", 12, case_4[0], case_4[1]); + test_get_turns::apply("5", 17, case_5[0], case_5[1]); + test_get_turns::apply("6", 3, case_6[0], case_6[1]); + + // 7-12 + test_get_turns::apply("7", 2, case_7[0], case_7[1]); + test_get_turns::apply("8", 2, case_8[0], case_8[1]); + test_get_turns::apply("9", 1, case_9[0], case_9[1]); + test_get_turns::apply("10", 3, case_10[0], case_10[1]); + test_get_turns::apply("11", 1, case_11[0], case_11[1]); + test_get_turns::apply("12", 8, case_12[0], case_12[1]); + + // 13-18 + test_get_turns::apply("13", 2, case_13[0], case_13[1]); + test_get_turns::apply("14", 2, case_14[0], case_14[1]); + test_get_turns::apply("15", 2, case_15[0], case_15[1]); + test_get_turns::apply("16", 4, case_16[0], case_16[1]); + test_get_turns::apply("17", 2, case_17[0], case_17[1]); + ///test_get_turns::apply("18", 4, case_18[0], case_18[1]); + + // 19-24 + test_get_turns::apply("19", 2, case_19[0], case_19[1]); + test_get_turns::apply("20", 3, case_20[0], case_20[1]); + test_get_turns::apply("21", 3, case_21[0], case_21[1]); + test_get_turns::apply("22", 1, case_22[0], case_22[1]); + test_get_turns::apply("23", 2, case_23[0], case_23[1]); + test_get_turns::apply("24", 1, case_24[0], case_24[1]); + + // 25-30 + test_get_turns::apply("25", 1, case_25[0], case_25[1]); + test_get_turns::apply("26", 1, case_26[0], case_26[1]); + test_get_turns::apply("27", 2, case_27[0], case_27[1]); + test_get_turns::apply("28", 2, case_28[0], case_28[1]); + test_get_turns::apply("29", 2, case_29[0], case_29[1]); + test_get_turns::apply("30", 2, case_30[0], case_30[1]); + + // 31-36 + test_get_turns::apply("31", 1, case_31[0], case_31[1]); + test_get_turns::apply("32", 1, case_32[0], case_32[1]); + test_get_turns::apply("33", 1, case_33[0], case_33[1]); + test_get_turns::apply("34", 2, case_34[0], case_34[1]); + test_get_turns::apply("35", 1, case_35[0], case_35[1]); + test_get_turns::apply("36", 3, case_36[0], case_36[1]); + + // 37-42 + test_get_turns::apply("37", 3, case_37[0], case_37[1]); + test_get_turns::apply("38", 3, case_38[0], case_38[1]); + test_get_turns::apply("39", 4, case_39[0], case_39[1]); + test_get_turns::apply("40", 3, case_40[0], case_40[1]); + test_get_turns::apply("41", 5, case_41[0], case_41[1]); + test_get_turns::apply("42", 5, case_42[0], case_42[1]); + + // 43-48 + test_get_turns::apply("43", 4, case_43[0], case_43[1]); + test_get_turns::apply("44", 4, case_44[0], case_44[1]); + test_get_turns::apply("45", 4, case_45[0], case_45[1]); + test_get_turns::apply("46", 4, case_46[0], case_46[1]); + test_get_turns::apply("47", 5, case_47[0], case_47[1]); + + // 49-54 + test_get_turns::apply("50", 4, case_50[0], case_50[1]); + test_get_turns::apply("51", 3, case_51[0], case_51[1]); + test_get_turns::apply("52", 8, case_52[0], case_52[1]); + // A touching point interior/ring exterior/ring can be represented in two ways: + test_get_turns::apply("53a", 4, case_53[0], case_53[1]); + test_get_turns::apply("53b", 4, case_53[0], case_53[2]); + test_get_turns::apply("54aa", 13, case_54[0], case_54[2]); + test_get_turns::apply("54ab", 13, case_54[0], case_54[3]); + test_get_turns::apply("54ba", 13, case_54[1], case_54[2]); + test_get_turns::apply("54bb", 13, case_54[1], case_54[3]); + + test_get_turns::apply("55", 12, case_55[0], case_55[1]); + test_get_turns::apply("56", 9, case_56[0], case_56[1]); + + + // other + test_get_turns::apply("many_situations", 31, case_many_situations[0], case_many_situations[1]); + + + // ticket#17 + test_get_turns::apply("ticket_17", 6, ticket_17[0], ticket_17[1]); + + // GGL-mailing list + test_get_turns::apply("ggl_list_20110306_javier", + 4, + ggl_list_20110306_javier[0], ggl_list_20110306_javier[1]); + +#ifdef _MSC_VER // gcc returns 14 for float + // test_get_turns::apply("ggl_list_20110716_enrico", + // 13, + // ggl_list_20110716_enrico[0], ggl_list_20110716_enrico[1]); + +#endif + + // pies + test_get_turns::apply("pie_23_16_16", 3, pie_23_16_16[0], pie_23_16_16[1]); + test_get_turns::apply("pie_16_4_12", 2, pie_16_4_12[0], pie_16_4_12[1]); + test_get_turns::apply("pie_4_13_15", 3, pie_4_13_15[0], pie_4_13_15[1]); + test_get_turns::apply("pie_16_2_15_0", 2, pie_16_2_15_0[0], pie_16_2_15_0[1]); + test_get_turns::apply("pie_20_20_7_100", 3, pie_20_20_7_100[0], pie_20_20_7_100[1]); + test_get_turns::apply("pie_23_23_3_2000", 5, pie_23_23_3_2000[0], pie_23_23_3_2000[1]); + + + // line-line + test_get_turns::apply("lineline1", 3, line_line1[0], line_line1[1]); + + // line-polygon + test_get_turns::apply("line_poly1", 4, line_line1[0], case_1[1]); + test_get_turns::apply("line_poly2", 4, line_line1[1], case_1[0]); + test_get_turns::apply("poly_line", 4, case_1[1], line_line1[0]); +} + + +template +void test_ccw() +{ + typedef bg::model::point P; + typedef bg::model::polygon polygon; + + test_get_turns::apply("ccw_1", + 6, + ccw_case_1[0], ccw_case_1[1]); + + test_get_turns::apply("ccw_9", + 1, + case_9[0], case_9[1]); + +} + +template +void test_open() +{ + typedef bg::model::point P; + typedef bg::model::polygon polygon; + + test_get_turns::apply("open_1", + 6, + open_case_1[0], open_case_1[1]); + + test_get_turns::apply("open_9", + 1, + open_case_9[0], open_case_9[1]); +} + + + +int test_main(int, char* []) +{ + test_all(); + test_all(); + test_ccw(); + test_open(); + +#if ! defined(_MSC_VER) + test_all(); +#endif + +#if defined(HAVE_TTMATH) + test_all(); +#endif + return 0; +} + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/overlay/get_turns_areal_areal.cpp b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_areal_areal.cpp new file mode 100644 index 000000000..a1a93abab --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_areal_areal.cpp @@ -0,0 +1,62 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2015. +// Modifications copyright (c) 2015 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) + +#include "test_get_turns.hpp" +#include + +//TEST +//#include + +template +void test_all() +{ + typedef bg::model::point pt; + //typedef bg::model::ring ring; + typedef bg::model::polygon poly; + //typedef bg::model::multi_polygon mpoly; + + // mailing list report 17.03.2015 + // operations ok but wrong IPs for int + // (the coordinates are generates at endpoints only) + { + // cw(duplicated point) + test_geometry("POLYGON((-8042 -1485,-8042 250,-8042 250,15943 254,15943 -1485,-8042 -1485))", + "POLYGON((-7901 -1485,-7901 529,-7901 529, 15802 544, 15802 -1485, -7901 -1485))", + expected("iiu")("iui")("mcc")("cui")); + //to_svg("POLYGON((-8042 -1485,-8042 250,15943 254,15943 -1485,-8042 -1485))", + // "POLYGON((-7901 -1485,-7901 529,15802 544, 15802 -1485, -7901 -1485))", + // "poly_poly_1.svg"); + test_geometry("POLYGON((-7901 -1485,-7901 529,-7901 529, 15802 544, 15802 -1485, -7901 -1485))", + "POLYGON((-8042 -1485,-8042 250,-8042 250,15943 254,15943 -1485,-8042 -1485))", + expected("iui")("iiu")("mcc")("ciu")); + } +} + +int test_main(int, char* []) +{ + test_all(); + test_all(); + test_all(); + +#if ! defined(_MSC_VER) + test_all(); +#endif + +#if defined(HAVE_TTMATH) + test_all(); +#endif + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/get_turns_areal_areal_sph.cpp b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_areal_areal_sph.cpp new file mode 100644 index 000000000..4905e4b53 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_areal_areal_sph.cpp @@ -0,0 +1,84 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016-2017, 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) + + +#include "test_get_turns.hpp" +#include + +#include + + +template +void test_all() +{ + typedef bg::model::point > pt; + //typedef bg::model::ring ring; + typedef bg::model::polygon poly; + //typedef bg::model::multi_polygon mpoly; + + test_geometry(case_1[0], case_1[1], + expected("iiu")("iui")("iiu")("iui")("iiu")("iui")); + test_geometry(case_2[0], case_2[1], + expected("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")); + test_geometry(case_3_sph[0], case_3_sph[1], + expected("miu")("miu")("miu")("miu")); + test_geometry(case_4[0], case_4[1], + expected("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")); + test_geometry(case_5[0], case_5[1], + expected("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")); + test_geometry(case_6_sph[0], case_6_sph[1], + expected("ccc")("eui")("mcc")); + + test_geometry(case_7[0], case_7[1], + expected("txu")("tux")); + test_geometry(case_8_sph[0], case_8_sph[1], + expected("mux")("cxu")); + test_geometry(case_9_sph[0], case_9_sph[1], + expected("muu")); + test_geometry(case_10_sph[0], case_10_sph[1], + expected("cxu")("mux")("txx")); + test_geometry(case_11_sph[0], case_11_sph[1], + expected("mui")); + test_geometry(case_12[0], case_12[1], + expected("iiu")("iui")("iiu")("iui")("iiu")("iui")("iiu")("iui")); + + test_geometry(case_13_sph[0], case_13_sph[1], + expected("mxu")("mux")); + test_geometry(case_14_sph[0], case_14_sph[1], + expected("cxu")("mux")); + test_geometry(case_15_sph[0], case_15_sph[1], + expected("cxu")("mux")); + test_geometry(case_16_sph[0], case_16_sph[1], + expected("txx")("txx")("tux")("cxu")); + test_geometry(case_17_sph[0], case_17_sph[1], + expected("mcc")("cui")); + test_geometry(case_18_sph[0], case_18_sph[1], + expected("mcc")("ccc")("ccc")("cui")); + + test_geometry("POLYGON((16 15,-132 10,-56 89,67 5,16 15))", + "POLYGON((101 49,12 40,-164 10,117 0,101 49))", + expected("iiu")("iui")); +} + +int test_main(int, char* []) +{ + test_all(); + test_all(); + +//#if ! defined(_MSC_VER) +// test_all(); +//#endif + +//#if defined(HAVE_TTMATH) +// test_all(); +//#endif + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_areal.cpp b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_areal.cpp new file mode 100644 index 000000000..1ac88bff1 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_areal.cpp @@ -0,0 +1,234 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 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. + +// 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) + +#include "test_get_turns.hpp" +#include + +//TEST +//#include + +template +void test_all() +{ + typedef bg::model::point pt; + typedef bg::model::linestring ls; + typedef bg::model::polygon poly; + + test_geometry("LINESTRING(15 5,24 5,20 2,19 0,13 -4,1 0,10 0,13 3,15 7,16 10,10 10,8 10,4 6,2 8,1 10)", + "POLYGON((0 0,5 5,0 10,20 10,20 2,19 0,0 0)(10 3,15 3,15 7,10 7,10 3))", + expected("miu+")("iuu+")("tcc+")("tuu=")("mcu+")("mic=")("muu+") + ("tiu+")("mcu+")("mic=")("mcc+")("miu=")("mxu+")); + + test_geometry("LINESTRING(5 0,5 5,10 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "miu+", "mxu+"); + test_geometry("LINESTRING(0 0,5 5,10 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "tiu+", "txu+"); + test_geometry("LINESTRING(0 0,5 0,5 5,10 5,10 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + expected("tcu+")("mic=")("mcc+")("txu=")); + test_geometry("LINESTRING(10 0,5 0,5 5,10 5,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + expected("tcc+")("miu=")("mcu+")("txc=")); + + test_geometry("LINESTRING(0 0,10 0,10 10)", + "POLYGON((0 0,5 5,0 10,20 10,20 2,19 0,0 0)(10 3,15 3,15 7,10 7,10 3))", + expected("tcu+")("mic=")("mcu+")("mic=")("mxu+")); + + test_geometry("LINESTRING(11 1,10 0,0 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "tcc+", "txu="); + test_geometry("LINESTRING(0 0,10 0,11 1)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "tcu+", "tuc="); + test_geometry("LINESTRING(10 0,0 0,-1 1)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "tcc+", "tuu="); + + // true hole + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 5,10 0,0 0)(2 2,10 5,2 8,2 2))", + expected("tiu+")("tiu+")); + test_geometry("LINESTRING(10 1,10 5,10 9)", + "POLYGON((0 0,0 10,10 10,10 5,10 0,0 0)(2 2,10 5,2 8,2 2))", + expected("mcu+")("ecc=")("tiu+")("mxc=")); + + // fake hole + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + expected("tuu+")("tiu+")); + test_geometry("LINESTRING(10 1,10 5,10 9)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + expected("mcu+")("tuc=")("tcu+")("mxc=")); + + // true hole + test_geometry("LINESTRING(10 1,10 5,2 2)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + expected("mcu+")("mic=")("tcu+")("txc=")); + test_geometry("LINESTRING(10 1,10 5,2 8)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + expected("mcu+")("mic=")("tcc+")("txu=")); + + // SPIKE - NON-ENDPOINT - NON-OPPOSITE + + // spike - neq eq + test_geometry("LINESTRING(2 2,4 4,1 1)", "POLYGON((0 0,4 4,6 3,6 0,0 0))", + expected("mcc+")("txu=")("tcu=")("mxc=")); + // spike - eq eq + test_geometry("LINESTRING(0 0,4 4,1 1)", "POLYGON((0 0,4 4,6 3,6 0,0 0))", + expected("tcc+")("txu=")("tcu=")("mxc=")); + // spike - eq neq + test_geometry("LINESTRING(0 0,3 3,1 1)", "POLYGON((0 0,4 4,6 3,6 0,0 0))", + expected("tcc+")("mxu=")("mcu=")("mxc=")); + // spike - neq neq + test_geometry("LINESTRING(1 1,3 3,2 2)", "POLYGON((0 0,4 4,6 3,6 0,0 0))", + expected("mcc+")("mxu=")("mcu=")("mxc=")); + // spike - out neq + test_geometry("LINESTRING(0 0,3 3,2 2)", "POLYGON((1 1,4 4,6 3,6 0,1 1))", + expected("mcc+")("mxu=")("mcu=")("mxc=")); + // spike - out eq + test_geometry("LINESTRING(0 0,4 4,2 2)", "POLYGON((1 1,4 4,6 3,6 0,1 1))", + expected("mcc+")("txu=")("tcu=")("mxc=")); + // spike - out out/eq + test_geometry("LINESTRING(0 0,4 4,2 2)", "POLYGON((1 0,4 4,6 3,1 0))", + expected("tuu+")); + test_geometry("LINESTRING(0 0,4 4,2 2)", "POLYGON((0 1,4 4,6 3,6 0,-1 -1,0 1))", + expected("tiu+")); + // spike - out out/neq + test_geometry("LINESTRING(0 0,4 4,2 2)", "POLYGON((4 0,4 5,6 3,4 0))", + expected("muu+")); + test_geometry("LINESTRING(0 0,4 4,2 2)", "POLYGON((0 4,5 4,6 3,6 0,-1 -1,0 4))", + expected("miu+")); + + test_geometry("LINESTRING(0 1,1 1,0 1)", "POLYGON((0 0,3 3,3 0,0 0))", + expected("muu+")); + test_geometry("LINESTRING(0 1,3 3,0 1)", "POLYGON((0 0,3 3,3 0,0 0))", + expected("tuu+")); + test_geometry("LINESTRING(0 1,0 0,0 1)", "POLYGON((0 0,3 3,3 0,0 0))", + expected("tuu+")); + + // SPIKE - NON-ENDPOINT - OPPOSITE + + // opposite - eq eq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2)", "POLYGON((-1 -1,0 0,4 4,6 3,-1 -1))", + expected("tcu+")("txc=")("tcc=")("mxu=")); + // opposite - neq eq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2)", "POLYGON((-1 -1,0 0,5 5,6 3,-1 -1))", + expected("mcu+")("txc=")("tcc=")("mxu=")); + // opposite - eq, neq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2)", "POLYGON((-2 -2,-1 -1,4 4,6 3,-2 -2))", + expected("tcu+")("mxc=")("mcc=")("mxu=")); + // opposite - neq neq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2)", "POLYGON((-2 -2,-1 -1,3 3,6 3,-2 -2))", + expected("mcu+")("mxc=")("mcc=")("mxu=")); + // opposite - neq neq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2)", "POLYGON((-2 -2,-1 -1,3 3,5 5,6 3,-2 -2))", + expected("mcu+")("mxc=")("mcc=")("mxu=")); + + // spike vs internal + test_geometry("LINESTRING(0 1,1 1,0 1)", // -- + "POLYGON((1 0,1 1,2 1,1 0))", + expected("tuu+")); + test_geometry("LINESTRING(1 2,1 1,1 2)", // | + "POLYGON((1 0,1 1,2 1,1 0))", + expected("tuu+")); + test_geometry("LINESTRING(0 2,1 1,0 2)", + "POLYGON((1 0,1 1,2 1,1 0))", + expected("tuu+")); + test_geometry("LINESTRING(2 0,1 1,2 0)", + "POLYGON((1 0,1 1,2 1,2 0,1 0))", + expected("tiu+")("tiu+")("txu+")); // TODO: should spike point be duplicated? + test_geometry("LINESTRING(0 0,1 1,0 0)", // / + "POLYGON((1 0,1 1,2 1,1 0))", + expected("tuu+")); + test_geometry("LINESTRING(2 2,1 1,2 2)", // / + "POLYGON((1 0,1 1,2 1,1 0))", + expected("tuu+")); + + test_geometry("LINESTRING(2 1,1 1,2 1)", + "POLYGON((1 0,1 1,2 1,1 0))", + expected("tcu+")("txc=")("tcc=")("txu=")); + + // 21.01.2015 + test_geometry("LINESTRING(1 3,3 1)", + "POLYGON((0 0,0 4,4 4,4 0,2 2,0 0))", + expected("mcu+")("mxc=")); + // extended + test_geometry("LINESTRING(1 7,4 4,7 1)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("tcu+")("mxc=")); + test_geometry("LINESTRING(1 7,3 5,7 1)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcu+")("mxc=")); + test_geometry("LINESTRING(1 7,5 3,7 1)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcu+")("mxc=")); + test_geometry("LINESTRING(4 4,7 1)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("tcu+")("mxc=")); + test_geometry("LINESTRING(5 3,7 1)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcu+")("mxc=")); + // reversed + test_geometry("LINESTRING(7 1,4 4,1 7)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcc+")("tiu=")); + test_geometry("LINESTRING(7 1,3 5,1 7)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcc+")("miu=")); + test_geometry("LINESTRING(7 1,5 3,1 7)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcc+")("ccc=")("miu=")); + test_geometry("LINESTRING(7 1,4 4)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcc+")("txu=")); + test_geometry("LINESTRING(7 1,5 3)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcc+")("mxu=")); + test_geometry("LINESTRING(7 1,3 5)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcc+")("miu=")); + + // 23.01.2015 - spikes + test_geometry("LINESTRING(3 10, 1 5, 1 10, 3 4, 7 8, 6 10, 10 2)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + expected("miu+")("miu+")("miu+")("mxu+")); + // extended + test_geometry("LINESTRING(7 8, 6 10, 11 0)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + expected("miu+")("iuu+")); + + // 25.01.2015 + test_geometry("LINESTRING(2 3, 4 5, 0 6, 5 6)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4))", + expected("miu+")("miu+")("mcu+")("mxc=")); + test_geometry("LINESTRING(0 6, 5 6)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4))", + expected("miu+")("mcu+")("mxc=")); + +} + +int test_main(int, char* []) +{ + test_all(); + test_all(); + +#if ! defined(_MSC_VER) + test_all(); +#endif + +#if defined(HAVE_TTMATH) + test_all(); +#endif + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_areal_sph.cpp b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_areal_sph.cpp new file mode 100644 index 000000000..be893b34a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_areal_sph.cpp @@ -0,0 +1,241 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016, 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) + + +#include "test_get_turns.hpp" +#include + + +template +void test_all() +{ + typedef bg::model::point > pt; + typedef bg::model::linestring ls; + typedef bg::model::polygon poly; + + test_geometry("LINESTRING(15 5,24 5,20 2,19 0,13 -4,1 0,10 0,13 3.0027386970408236,15 7,16 10.096620161421658,10 10.151081711048134,8 10.145026423873857,4 6.0128694190616088,2 8.0210217579873273,1 10.028657322246225)", + "POLYGON((0 0,5 5,0 10,20 10,20 2,19 0,0 0)(10 3,15 3,15 7,10 7,10 3))", + expected("miu+")("iuu+")("tcc+")("tuu=")("mcu+")("mic=")("muu+") + ("tiu+")("mcu+")("mic=")("mcc+")("miu=")("mxu+")); + + test_geometry("LINESTRING(5 0,5 5,10 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "miu+", "mxu+"); + test_geometry("LINESTRING(0 0,5 5,10 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "tiu+", "txu+"); + test_geometry("LINESTRING(0 0,5 0,5 5,10 5,10 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + expected("tcu+")("mic=")("mcc+")("txu=")); + test_geometry("LINESTRING(10 0,5 0,5 5,10 5,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + expected("tcc+")("miu=")("mcu+")("txc=")); + + test_geometry("LINESTRING(0 0,10 0,10 10.151081711048134)", + "POLYGON((0 0,5 5,0 10,20 10,20 2,19 0,0 0)(10 3,15 3,15 7,10 7,10 3))", + expected("tcu+")("mic=")("mcu+")("mic=")("mxu+")); + + test_geometry("LINESTRING(11 1,10 0,0 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "tcc+", "txu="); + test_geometry("LINESTRING(0 0,10 0,11 1)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "tcu+", "tuc="); + test_geometry("LINESTRING(10 0,0 0,-1 1)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "tcc+", "tuu="); + + // true hole + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 5,10 0,0 0)(2 2,10 5,2 8,2 2))", + expected("tiu+")("tiu+")); + test_geometry("LINESTRING(10 1,10 5,10 9)", + "POLYGON((0 0,0 10,10 10,10 5,10 0,0 0)(2 2,10 5,2 8,2 2))", + expected("mcu+")("ecc=")("tiu+")("mxc=")); + + // fake hole + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + expected("tuu+")("tiu+")); + test_geometry("LINESTRING(10 1,10 5,10 9)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + expected("mcu+")("tuc=")("tcu+")("mxc=")); + + // true hole + test_geometry("LINESTRING(10 1,10 5,2 2)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + expected("mcu+")("mic=")("tcu+")("txc=")); + test_geometry("LINESTRING(10 1,10 5,2 8)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + expected("mcu+")("mic=")("tcc+")("txu=")); + + // SPIKE - NON-ENDPOINT - NON-OPPOSITE + + // spike - neq eq + test_geometry("LINESTRING(2 2.0036594926050877,4 4,1 1.0022887548647630)", + "POLYGON((0 0,4 4,6 3,6 0,0 0))", + expected("mcc+")("txu=")("tcu=")("mxc=")); + // spike - eq eq + test_geometry("LINESTRING(0 0,4 4,1 1.0022887548647630)", + "POLYGON((0 0,4 4,6 3,6 0,0 0))", + expected("tcc+")("txu=")("tcu=")("mxc=")); + // spike - eq neq + test_geometry("LINESTRING(0 0,3 3.0031983963093536,1 1.0022887548647630)", + "POLYGON((0 0,4 4,6 3,6 0,0 0))", + expected("tcc+")("mxu=")("mcu=")("mxc=")); + // spike - neq neq + test_geometry("LINESTRING(1 1.0022887548647630,3 3.0031983963093536,2 2.0036594926050877)", + "POLYGON((0 0,4 4,6 3,6 0,0 0))", + expected("mcc+")("mxu=")("mcu=")("mxc=")); + // spike - out neq + test_geometry("LINESTRING(0 -0.0030515201230775146,3 3.0024370300767784,2 2.0021346673827409)", + "POLYGON((1 1,4 4,6 3,6 0,1 1))", + expected("mcc+")("mxu=")("mcu=")("mxc=")); + // spike - out eq + test_geometry("LINESTRING(0 -0.0030515201230775146,4 4,2 2.0021346673827409)", + "POLYGON((1 1,4 4,6 3,6 0,1 1))", + expected("mcc+")("txu=")("tcu=")("mxc=")); + // spike - out out/eq + test_geometry("LINESTRING(0 0,4 4,2 2.0036594926050877)", + "POLYGON((1 0,4 4,6 3,1 0))", + expected("tuu+")); + test_geometry("LINESTRING(0 0,4 4,2 2.0036594926050877)", + "POLYGON((0 1,4 4,6 3,6 0,-1 -1,0 1))", + expected("tiu+")); + // spike - out out/neq + test_geometry("LINESTRING(0 0,4 4,2 2.0036594926050877)", + "POLYGON((4 0,4 5,6 3,4 0))", + expected("muu+")); + test_geometry("LINESTRING(0 0,4 4.0024308111527205,2 2.0048800944714089)", + "POLYGON((0 4,5 4,6 3,6 0,-1 -1,0 4))", + expected("miu+")); + + test_geometry("LINESTRING(0 1,1 1.0012195839797347,0 1)", + "POLYGON((0 0,3 3,3 0,0 0))", + expected("muu+")); + test_geometry("LINESTRING(0 1,3 3,0 1)", + "POLYGON((0 0,3 3,3 0,0 0))", + expected("tuu+")); + test_geometry("LINESTRING(0 1,0 0,0 1)", + "POLYGON((0 0,3 3,3 0,0 0))", + expected("tuu+")); + + // SPIKE - NON-ENDPOINT - OPPOSITE + + // opposite - eq eq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2.0036594926050877)", + "POLYGON((-1 -1,0 0,4 4,6 3,-1 -1))", + expected("tcu+")("txc=")("tcc=")("mxu=")); + // opposite - neq eq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2.0036594926050877)", + "POLYGON((-1 -1,0 0,5 4.9931712414532354,6 3,-1 -1))", + expected("mcu+")("txc=")("tcc=")("mxu=")); + // opposite - eq, neq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2.0036594926050877)", + "POLYGON((-2 -2,-1 -1.0022887548647628,4 4,6 3,-2 -2))", + expected("tcu+")("mxc=")("mcc=")("mxu=")); + // opposite - neq neq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2.0036594926050877)", + "POLYGON((-2 -2,-1 -1.0022887548647628,3 3.0031983963093536,6 3,-2 -2))", + expected("mcu+")("mxc=")("mcc=")("mxu=")); + // opposite - neq neq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2.0036594926050877)", + "POLYGON((-2 -2,-1 -1.0022887548647628,3 3.0031983963093536,5 4.9931712414532354,6 3,-2 -2))", + expected("mcu+")("mxc=")("mcc=")("mxu=")); + + // spike vs internal + test_geometry("LINESTRING(0 1,1 1,0 1)", // -- + "POLYGON((1 0,1 1,2 1,1 0))", + expected("tuu+")); + test_geometry("LINESTRING(1 2,1 1,1 2)", // | + "POLYGON((1 0,1 1,2 1,1 0))", + expected("tuu+")); + test_geometry("LINESTRING(0 2,1 1,0 2)", // \ (avoid multi-line comment) + "POLYGON((1 0,1 1,2 1,1 0))", + expected("tuu+")); + test_geometry("LINESTRING(2 0,1 1,2 0)", // \ (avoid multi-line comment) + "POLYGON((1 0,1 1,2 1,2 0,1 0))", + expected("tiu+")("tiu+")("txu+")); // TODO: should spike point be duplicated? + test_geometry("LINESTRING(0 0,1 1,0 0)", // / + "POLYGON((1 0,1 1,2 1,1 0))", + expected("tuu+")); + test_geometry("LINESTRING(2 2,1 1,2 2)", // / + "POLYGON((1 0,1 1,2 1,1 0))", + expected("tuu+")); + + test_geometry("LINESTRING(2 1,1 1,2 1)", // -- + "POLYGON((1 0,1 1,2 1,1 0))", + expected("tcu+")("txc=")("tcc=")("txu=")); + + // 21.01.2015 + test_geometry("LINESTRING(1 2.9977189008308085,3 1.0004570537241195)", + "POLYGON((0 0,0 4,4 4,4 0,2 2,0 0))", + expected("mcu+")("mxc=")); + + // extended + test_geometry("LINESTRING(1 6.9651356719477091,4 4,7 1.0022887548647630)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("tcu+")("mxc=")); + test_geometry("LINESTRING(1 6.9651356719477091,3 4.9931712414532363,7 1.0022887548647630)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcu+")("mxc=")); + test_geometry("LINESTRING(1 6.9651356719477091,5 3.0031983963093536,7 1.0022887548647630)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcu+")("mxc=")); + test_geometry("LINESTRING(4 4,7 1.0022887548647630)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("tcu+")("mxc=")); + test_geometry("LINESTRING(5 3.0031983963093536,7 1.0022887548647630)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcu+")("mxc=")); + // reversed + test_geometry("LINESTRING(7 1.0022887548647630,4 4,1 6.9651356719477091)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcc+")("tiu=")); + test_geometry("LINESTRING(7 1.0022887548647630,3 4.9931712414532363,1 6.9651356719477091)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcc+")("miu=")); + test_geometry("LINESTRING(7 1.0022887548647630,5 3.0031983963093536,1 6.9651356719477091)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcc+")("ccc=")("miu=")); + test_geometry("LINESTRING(7 1.0022887548647630,4 4)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcc+")("txu=")); + test_geometry("LINESTRING(7 1.0022887548647630,5 3.0031983963093536)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcc+")("mxu=")); + test_geometry("LINESTRING(7 1.0022887548647630,3 4.9931712414532363)", + "POLYGON((0 0,0 8,8 8,8 0,4 4,0 0))", + expected("mcc+")("miu=")); + + // 23.01.2015 - spikes + test_geometry("LINESTRING(3 10.031432746397092, 1 5, 1 10.013467818052765, 3 4, 7 8, 6 10.035925377760330, 10 1.7773315888299086)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + expected("miu+")("miu+")("miu+")("mxu+")); + test_geometry("LINESTRING(7 8, 6 10.035925377760330, 11 -0.31552621163523403)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + expected("miu+")("iuu+")); + + // 25.01.2015 + test_geometry("LINESTRING(2 3, 4 5, 0 5.9782377228588262, 5 6.0009072995372446)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4))", + expected("miu+")("miu+")("mcu+")("mxc=")); + test_geometry("LINESTRING(0 5.9782377228588262, 5 6.0009072995372446)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4))", + expected("miu+")("mcu+")("mxc=")); +} + +int test_main(int, char* []) +{ + test_all(); + test_all(); + +//#if ! defined(_MSC_VER) +// test_all(); +//#endif + +//#if defined(HAVE_TTMATH) +// test_all(); +//#endif + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_linear.cpp b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_linear.cpp new file mode 100644 index 000000000..df543bf2d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_linear.cpp @@ -0,0 +1,687 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 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. + +// 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) + +#include "test_get_turns.hpp" +#include + +//TEST +//#include + +template +void test_all() +{ + typedef bg::model::point pt; + typedef bg::model::linestring ls; + typedef bg::model::multi_linestring mls; + + // NOTE: currently for the first endpoint of the Linestring on collinear segment + // is_collinear flags are set to FALSE! + // E.g. in the first test tii++, NOT tii== + + test_geometry("LINESTRING(0 0,2 0)", "LINESTRING(0 0,2 0)", "tii++", "txx=="); + test_geometry("LINESTRING(0 0,2 0)", "LINESTRING(2 0,0 0)", "tix+=", "txi=+"); + + test_geometry("LINESTRING(1 0,1 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++"); + test_geometry("LINESTRING(1 0,0 0)", "LINESTRING(0 0,1 0,2 0)", "txi=+", "tiu+="); + test_geometry("LINESTRING(1 0,2 0)", "LINESTRING(0 0,1 0,2 0)", "tii++", "txx=="); + test_geometry("LINESTRING(1 1,1 0)", "LINESTRING(0 0,1 0,2 0)", "txu++"); + test_geometry("LINESTRING(0 0,1 0)", "LINESTRING(0 0,1 0,2 0)", "tii++", "txu=="); + test_geometry("LINESTRING(2 0,1 0)", "LINESTRING(0 0,1 0,2 0)", "txi=+", "tix+="); + + test_geometry("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,1 1)", "tuu++"); + test_geometry("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,0 0)", "tix+=", "tui=+"); + test_geometry("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,2 0)", "tii++", "txx=="); + test_geometry("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 1,1 0)", "tux++"); + test_geometry("LINESTRING(0 0,1 0,2 0)", "LINESTRING(0 0,1 0)", "tii++", "tux=="); + test_geometry("LINESTRING(0 0,1 0,2 0)", "LINESTRING(2 0,1 0)", "tix+=", "txi=+"); + + test_geometry("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 1,1 0,3 0,3 1)", "mii++", "ccc==", "muu=="); + test_geometry("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 -1,1 0,3 0,3 -1)", "mii++", "ccc==", "muu=="); + test_geometry("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 1,3 0,1 0,1 1)", "miu+=", "mui=+"); + test_geometry("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 -1,3 0,1 0,1 -1)", "miu+=", "mui=+"); + test_geometry("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 1,2 0,4 0,4 1)", "tii++", "ccc==", "tuu=="); + test_geometry("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 -1,2 0,4 0,4 -1)", "tii++", "ccc==", "tuu=="); + test_geometry("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 1,4 0,2 0,2 1)", "tiu+=", "tui=+"); + test_geometry("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 -1,4 0,2 0,2 -1)", "tiu+=", "tui=+"); + + // same as above - TODO: reverse manually or automatically for all tests + /*test_geometry("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 1,1 0,2 0,3 0,3 1)", "mii", "ecc", "muu"); + test_geometry("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 -1,1 0,2 0,3 0,3 -1)", "mii", "ecc", "muu"); + test_geometry("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 1,3 0,2 0,1 0,1 1)", "miu", "ecc", "mui"); + test_geometry("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 -1,3 0,2 0,1 0,1 -1)", "miu", "ecc", "mui"); + test_geometry("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 1,2 0,3 0,4 0,4 1)", "tii", "ecc", "tuu"); + test_geometry("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 -1,2 0,3 0,4 0,4 -1)", "tii", "ecc", "tuu"); + test_geometry("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 1,4 0,3 0,2 0,2 1)", "tiu", "ecc", "tui"); + test_geometry("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 -1,4 0,3 0,2 0,2 -1)", "tiu", "ecc", "tui");*/ + + test_geometry("LINESTRING(0 0,1 0,2 1,3 5,4 0)", "LINESTRING(1 0,2 1,3 5)", "tii++", "ecc==", "tux=="); + test_geometry("LINESTRING(0 0,1 0,2 1,3 5,4 0)", "LINESTRING(3 5,2 1,1 0)", "tix+=", "ecc==", "tui=+"); + test_geometry("LINESTRING(1 0,2 1,3 5)", "LINESTRING(0 0,1 0,2 1,3 5,4 0)", "txu==", "ecc==", "tii++"); + test_geometry("LINESTRING(3 5,2 1,1 0)", "LINESTRING(0 0,1 0,2 1,3 5,4 0)", "tiu+=", "ecc==", "txi=+"); + + test_geometry("LINESTRING(0 0,10 0)", "LINESTRING(-1 -1,1 0,10 0,20 -1)", "mii++", "txu=="); + test_geometry("LINESTRING(0 0,10 0)", "LINESTRING(20 -1,10 0,1 0,-1 -1)", "miu+=", "txi=+"); + test_geometry("LINESTRING(-1 -1,1 0,10 0,20 -1)", "LINESTRING(0 0,10 0)", "mii++", "tux=="); + test_geometry("LINESTRING(20 -1,10 0,1 0,-1 -1)", "LINESTRING(0 0,10 0)", "mui=+", "tix+="); + + test_geometry("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)", + "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", + expected("tii++")("ecc==")("muu==")("mii++")("muu==")("mii++")("mux==")); + test_geometry("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)", + "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", + expected("tiu+=")("ecc==")("mui=+")("miu+=")("mui=+")("miu+=")("mui=+")); + test_geometry("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)", + "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", + expected("tui=+")("ecc==")("miu+=")("mui=+")("miu+=")("mui=+")("mix+=")); + test_geometry("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)", + "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", + expected("tuu==")("ecc==")("mii++")("muu==")("mii++")("muu==")("mii++")); + + test_geometry("LINESTRING(-1 0,1 0,2 1,3 2)", "LINESTRING(4 5,3 2,1 0,0 0)", "mix+=", "txi=+", "ecc=="); + test_geometry("LINESTRING(4 5,3 2,1 0,0 0)", "LINESTRING(-1 0,1 0,2 1,3 2)", "mxi=+", "tix+=", "ecc=="); + + test_geometry("LINESTRING(30 1,20 1,10 0,0 0)", "LINESTRING(1 1,2 0,3 1,20 1,25 1)", "mix+=", "tui=+", "muu++"); + test_geometry("LINESTRING(1 1,2 0,3 1,20 1,25 1)", "LINESTRING(30 1,20 1,10 0,0 0)", "mxi=+", "tiu+=", "muu++"); + + test_geometry("LINESTRING(0 0,30 0)", "LINESTRING(4 0,4 1,20 1,5 0,1 0)", "muu++", "mui=+", "mix+="); + test_geometry("LINESTRING(4 0,4 1,20 1,5 0,1 0)", "LINESTRING(0 0,30 0)", "muu++", "miu+=", "mxi=+"); + + test_geometry("LINESTRING(30 0,0 0)", "LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)", + expected("mui=+")("miu+=")("mui=+")("mix+=")); + test_geometry("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)", "LINESTRING(30 0,0 0)", + expected("miu+=")("mui=+")("miu+=")("mxi=+")); + + test_geometry("LINESTRING(1 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,4 -1)", + expected("mii++")("iuu++")("muu==")); + test_geometry("LINESTRING(1 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,5 0,4 1)", + expected("mii++")("muu++")("muu==")); + + // non-collinear + test_geometry("LINESTRING(0 1,0 0)", "LINESTRING(0 0,1 0,2 0)", "txu++"); + test_geometry("LINESTRING(0 1,0 0,1 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++"); + test_geometry("LINESTRING(0 1,1 0,2 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++"); + + // SPIKE - NON-ENDPOINT - NON-OPPOSITE + + // spike - neq eq + test_geometry("LINESTRING(2 2,4 4,1 1)", "LINESTRING(0 0,4 4,6 3)", + expected("mii++")("txu==")("tiu==")("mxi=+")); + // spike - eq eq + test_geometry("LINESTRING(0 0,4 4,1 1)", "LINESTRING(0 0,4 4,6 3)", + expected("tii++")("txu==")("tiu==")("mxi=+")); + // spike - eq neq + test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(0 0,4 4,6 3)", + expected("tii++")("mxu==")("miu==")("mxi=+")); + // spike - neq neq + test_geometry("LINESTRING(1 1,3 3,2 2)", "LINESTRING(0 0,4 4,6 3)", + expected("mii++")("mxu==")("miu==")("mxi=+")); + // spike - out neq + test_geometry("LINESTRING(0 0,3 3,2 2)", "LINESTRING(1 1,4 4,6 3)", + expected("mii++")("mxu==")("miu==")("mxi=+")); + // spike - out eq + test_geometry("LINESTRING(0 0,4 4,2 2)", "LINESTRING(1 1,4 4,6 3)", + expected("mii++")("txu==")("tiu==")("mxi=+")); + // spike - out out/eq + test_geometry("LINESTRING(0 0,4 4,2 2)", "LINESTRING(1 0,4 4,6 3)", + expected("tuu++")); + test_geometry("LINESTRING(0 0,4 4,2 2)", "LINESTRING(0 1,4 4,6 3)", + expected("tuu++")); + // spike - out out/neq + test_geometry("LINESTRING(0 0,4 4,2 2)", "LINESTRING(4 0,4 5,6 3)", + expected("muu++")); + test_geometry("LINESTRING(0 0,4 4,2 2)", "LINESTRING(0 4,5 4,6 3)", + expected("muu++")); + + // SPIKE - NON-ENDPOINT - OPPOSITE + + // opposite - eq eq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2)", "LINESTRING(-1 -1,0 0,4 4,6 3)", + expected("tiu+=")("txi=+")("tii=+")("mxu==")); + test_geometry("LINESTRING(-1 -1,0 0,4 4,6 3)", "LINESTRING(6 6,4 4,0 0,2 2)", + expected("tui=+")("tix+=")("tii+=")("mux==")); + // opposite - neq eq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2)", "LINESTRING(-1 -1,0 0,5 5,6 3)", + expected("miu+=")("txi=+")("tii=+")("mxu==")); + // opposite - eq neq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2)", "LINESTRING(-2 -2,-1 -1,4 4,6 3)", + expected("tiu+=")("mxi=+")("mii=+")("mxu==")); + // opposite - neq neq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2)", "LINESTRING(-2 -2,-1 -1,3 3,6 3)", + expected("miu+=")("mxi=+")("mii=+")("mxu==")); + // opposite - neq neq + test_geometry("LINESTRING(6 6,4 4,0 0,2 2)", "LINESTRING(-2 -2,-1 -1,3 3,5 5,6 3)", + expected("miu+=")("mxi=+")("mii=+")("mxu==")); + // opposite - neq eq + test_geometry("LINESTRING(6 3,3 3,0 0)", "LINESTRING(0 0,2 2,3 3,1 1)", + expected("txi=+")("tix+=")("tii+=")("mux==")); + + // SPIKE - ENDPOINT - NON-OPPOSITE + + // spike - neq eq + test_geometry("LINESTRING(2 2,4 4,1 1)", "LINESTRING(0 0,4 4)", + expected("mii++")("txx==")("tix==")("mxi=+")); + test_geometry("LINESTRING(2 2,4 4,1 1)", "LINESTRING(4 4,0 0)", + expected("miu+=")("txi=+")("tii=+")("mxu==")); + // spike - eq eq + test_geometry("LINESTRING(0 0,4 4,1 1)", "LINESTRING(0 0,4 4)", + expected("tii++")("txx==")("tix==")("mxi=+")); + test_geometry("LINESTRING(0 0,4 4,1 1)", "LINESTRING(4 4,0 0)", + expected("tix+=")("txi=+")("tii=+")("mxu==")); + // spike - eq neq + test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(0 0,4 4)", + expected("tii++")("mxu==")("miu==")("mxi=+")); + test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(4 4,0 0)", + expected("tix+=")("mxi=+")("mii=+")("mxu==")); + // spike - neq neq + test_geometry("LINESTRING(1 1,3 3,2 2)", "LINESTRING(0 0,4 4)", + expected("mii++")("mxu==")("miu==")("mxi=+")); + test_geometry("LINESTRING(1 1,3 3,2 2)", "LINESTRING(4 4,0 0)", + expected("miu+=")("mxi=+")("mii=+")("mxu==")); + // spike - out neq + test_geometry("LINESTRING(0 0,3 3,2 2)", "LINESTRING(1 1,4 4)", + expected("mii++")("mxu==")("miu==")("mxi=+")); + test_geometry("LINESTRING(0 0,3 3,2 2)", "LINESTRING(4 4,1 1)", + expected("mix+=")("mxi=+")("mii=+")("mxu==")); + // spike - out eq + test_geometry("LINESTRING(0 0,4 4,2 2)", "LINESTRING(1 1,4 4)", + expected("mii++")("txx==")("tix==")("mxi=+")); + test_geometry("LINESTRING(0 0,4 4,2 2)", "LINESTRING(4 4,1 1)", + expected("mix+=")("txi=+")("tii=+")("mxu==")); + // spike - out out/eq + test_geometry("LINESTRING(0 0,4 4,2 2)", "LINESTRING(1 0,4 4)", + expected("tux++")); + test_geometry("LINESTRING(0 0,4 4,2 2)", "LINESTRING(0 1,4 4)", + expected("tux++")); + // spike - out out/neq + test_geometry("LINESTRING(0 0,4 4,2 2)", "LINESTRING(4 0,4 5)", + expected("muu++")); + test_geometry("LINESTRING(0 0,4 4,2 2)", "LINESTRING(0 4,5 4)", + expected("muu++")); + + // 29.01.2015 + if ( BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + { + // FAILING - possibly wrong IPs + test_geometry("LINESTRING(3 -0.6,0 -0.9)", + "LINESTRING(4 2.232432,1 -0.8,9 0)", + expected("mui=+")("miu+=")); + + test_geometry("LINESTRING(3 -0.6,1 -0.8,0 -0.9)", + "LINESTRING(4 2.232432,1 -0.8,9 0)", + expected("tui=+")("miu+=")); + + test_geometry("LINESTRING(3 -0.6, 0 -0.9, -1 -1)", + "LINESTRING(4 2.232432, 0 -0.9, 9 0)", + expected("tui=+")("miu+=")); + + test_geometry("LINESTRING(3 -0.6, 0 -0.9, -1 -1, -2 -2)", + "LINESTRING(4 2.232432,-1 -1, 0 -0.9, 9 0)", + expected("tui=+")("ecc==")("miu+=")); + } + + test_geometry("LINESTRING(3 0,0 0)", + "LINESTRING(4 2,1 0,9 0)", + expected("mui=+")("miu+=")); + + + // 01.02.2015 + test_geometry("LINESTRING(6 0,0 0,5 0)", + "LINESTRING(2 0,0 0,-10 0)", + expected("mii++")("txu==")("tiu==")("mui=+")); + // the reversal could be automatic... + test_geometry("LINESTRING(2 0,0 0,-10 0)", + "LINESTRING(6 0,0 0,5 0)", + expected("mii++")("tux==")("tui==")("miu+=")); + // sanity check + test_geometry("LINESTRING(6 0,0 0)", + "LINESTRING(2 0,0 0,-10 0)", + expected("mii++")("txu==")); + test_geometry("LINESTRING(0 0,5 0)", + "LINESTRING(2 0,0 0,-10 0)", + expected("tiu+=")("mui=+")); + + // 03.02.2015 + test_geometry("LINESTRING(-7 -8,3 0,4 -1,-7 10)", + "LINESTRING(-5 -4,3 0,4 -1,7 -4,2 -1)", + expected("tii++")("txu==")("tiu==")("mui=+")); + test_geometry("LINESTRING(-7 -8,3 0,4 -1,-7 10)", + "LINESTRING(-5 -4,3 0,7 -4,2 -1)", + expected("tii++")("mxu==")("miu==")("mui=+")); + + if ( BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + { + // BUG - the operations are correct but IP coordinates are wrong + // ok now also the 3rd turn is wrong +#ifdef BOOST_GEOMETRY_TEST_FAILURES + test_geometry("LINESTRING(8 5,5 1,-2 3,1 10)", + "LINESTRING(1.9375 1.875, 1.7441860465116283 1.9302325581395348, -0.7692307692307692 2.6483516483516487, -2 3, -1.0071942446043165 5.316546762589928)", + expected("mii++")("ccc==")("ccc==")("mux==")); + // Now tii++ is generated instead of ccc== + + test_geometry("LINESTRING(8 5,5 1,-2 3,1 10)", + "LINESTRING(1.9375 1.875, 1.7441860465116283 1.9302325581395348, -0.7692307692307692 2.6483516483516487, -2 3, -0.5 6.5)", + expected("mii++")("ccc==")("ccc==")("mux==")); + // Now tii++ is generated instead of ccc== + +#endif + + test_geometry("LINESTRING(-0.5 7,8 1,0 -0.2)", + "LINESTRING(2 8,4 0.4,8 1,0 5)", + expected("iuu++")("mui=+")("tiu+=")); + +#if ! ( defined(BOOST_CLANG) && defined(BOOST_GEOMETRY_COMPILER_MODE_RELEASE) ) + + // In clang/release mode this testcase gives other results + + // assertion failure in 1.57 + // FAILING - no assertion failure but the result is not very good + test_geometry("LINESTRING(-2305843009213693956 4611686018427387906, -33 -92, 78 83)", + "LINESTRING(31 -97, -46 57, -20 -4)", + expected("")("")); + test_geometry("LINESTRING(31 -97, -46 57, -20 -4)", + "LINESTRING(-2305843009213693956 4611686018427387906, -33 -92, 78 83)", + expected("")("")); + +#endif + + } + + // In 1.57 the results of those combinations was different for MinGW + // (probably also QCC and GCC5.0) and MSVC/GCC. The results was depending + // on the instructions generated by the compiler when calculating the + // determinants. + // See also: https://svn.boost.org/trac/boost/ticket/8379 + // https://github.com/boostorg/geometry/pull/259 + if ( BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + { + test_geometry("LINESTRING(0 0, 10 0, 20 1)", + "LINESTRING(12 10, 13 0.3, 14 0.4, 15 0.5)", + expected("mii++")("ccc==")("mux==")); + test_geometry("LINESTRING(0 0, 10 0, 110 1)", + "LINESTRING(12 10, 13 0.03, 14 0.04, 15 0.05)", + expected("mii++")("ccc==")("mux==")); + test_geometry("LINESTRING(0 0, 10 0, 110 1)", + "LINESTRING(102 10, 103 0.93, 104 0.94, 105 0.95)", + expected("mii++")("ccc==")("mux==")); + test_geometry("LINESTRING(100 0, 110 0, 120 1)", + "LINESTRING(112 10, 113 0.3, 114 0.4, 115 0.5)", + expected("mii++")("ccc==")("mux==")); + test_geometry("LINESTRING(0 0, 10 0, 20 1)", + "LINESTRING(15 0.5, 14 0.4, 13 0.3, 12 10)", + expected("miu+=")("mui=+")); + test_geometry("LINESTRING(20 1, 10 0, 0 0)", + "LINESTRING(12 10, 13 0.3, 14 0.4, 15 0.5)", + expected("mui=+")("mix+=")); + test_geometry("LINESTRING(20 1, 10 0, 0 0)", + "LINESTRING(15 0.5, 14 0.4, 13 0.3, 12 10)", + expected("muu==")("ccc==")("mii++")); + + test_geometry("LINESTRING(0 0, 10 0, 20 1)", + "LINESTRING(13 0.3, 14 0.4, 15 0.5)", + expected("mii++")("ccc==")("mux==")); + test_geometry("LINESTRING(0 0, 10 0, 20 1)", + "LINESTRING(15 0.5, 14 0.4, 13 0.3)", + expected("mix+=")("mui=+")); + test_geometry("LINESTRING(20 1, 10 0, 0 0)", + "LINESTRING(13 0.3, 14 0.4, 15 0.5)", + expected("mui=+")("mix+=")); + test_geometry("LINESTRING(20 1, 10 0, 0 0)", + "LINESTRING(15 0.5, 14 0.4, 13 0.3)", + expected("mux==")("ccc==")("mii++")); + + test_geometry("LINESTRING(0 0, 10 0, 20 1)", + "LINESTRING(12 10, 13 0.3, 14 0.4)", + expected("mii++")("mux==")); + test_geometry("LINESTRING(0 0, 10 0, 20 1)", + "LINESTRING(14 0.4, 13 0.3, 12 10)", + expected("miu+=")("mui=+")); + test_geometry("LINESTRING(20 1, 10 0, 0 0)", + "LINESTRING(12 10, 13 0.3, 14 0.4)", + expected("mui=+")("mix+=")); + test_geometry("LINESTRING(20 1, 10 0, 0 0)", + "LINESTRING(14 0.4, 13 0.3, 12 10)", + expected("muu==")("mii++")); + } + + // TODO: + //test_geometry("LINESTRING(0 0,2 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102"); + //test_geometry("LINESTRING(2 0,0 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102"); + + //test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(3 0,3 3,3 1)", "0F1FF0102"); + //test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(2 0,2 3,2 1)", "0F1FF0102"); + //test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(2 0,2 2,2 1)", "0F1FF0102"); + + //test_geometry("LINESTRING(0 0,2 2,3 3,4 4)", "LINESTRING(0 0,1 1,4 4)", "1FFF0FFF2"); + + + //if ( boost::is_same::value ) + //{ + // to_svg("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)", "LINESTRING(0 0,2 0,2.5 0,3 1)", "test11.svg"); + // to_svg("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)", "LINESTRING(3 1,2.5 0,2 0,0 0)", "test12.svg"); + // to_svg("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,20 0,30 0,31 1)", "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", "test21.svg"); + // to_svg("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,20 0,30 0,31 1)", "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", "test22.svg"); + + // to_svg("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)", "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", "test31.svg"); + // to_svg("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)", "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", "test32.svg"); + // to_svg("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)", "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", "test33.svg"); + // to_svg("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)", "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", "test34.svg"); + //} + + // duplicated + test_geometry("MULTILINESTRING((0 0,10 0,30 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0),(2 0,2 0),(3 0,3 0,3 0))", + expected("mii++")("ccc==")("ccc==")("txx==")); + + // spike + test_geometry("LINESTRING(2 2,5 -1,15 2,18 0,20 0)", + "LINESTRING(30 0,19 0,18 0,0 0)", + expected("iuu++")("iuu++")("tiu+=")("mxi=+")); + // spike + test_geometry("MULTILINESTRING((0 0,10 0,5 0))", + "MULTILINESTRING((1 0,8 0,4 0))", + expected("mii++")("mix+=")("mux==")("mui==")("mix+=")("mii+=")("mxu==")("mxi=+")); + + /*test_geometry("MULTILINESTRING((0 0,10 0,5 0))", + "MULTILINESTRING((1 0,8 0,4 0),(2 0,9 0,5 0))", + expected("mii")("ccc")("ccc")("txx"));*/ + + // spike vs endpoint + test_geometry("MULTILINESTRING((0 0,10 0))", + "MULTILINESTRING((-1 0,0 0,-2 0),(11 0,10 0,12 0))", + expected("tuu++")("txu++")); + // internal turning R vs spike + test_geometry("MULTILINESTRING((1 0,1 1,2 1))", + "MULTILINESTRING((0 1,1 1,0 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,2 1))", + "MULTILINESTRING((1 2,1 1,1 2))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 0,1 0,0 0))", + "MULTILINESTRING((2 0,1 0,2 0))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,2 1))", + "MULTILINESTRING((0 2,1 1,0 2))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,2 1))", + "MULTILINESTRING((2 0,1 1,2 0))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,2 1))", + "MULTILINESTRING((2 1,1 1,2 1))", + expected("txi=+")("tix+=")("tii+=")("txx==")); + // internal turning L vs spike + test_geometry("MULTILINESTRING((1 0,1 1,0 1))", + "MULTILINESTRING((2 1,1 1,2 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,0 1))", + "MULTILINESTRING((1 2,1 1,1 2))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,0 1))", + "MULTILINESTRING((2 2,1 1,2 2))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,0 1))", + "MULTILINESTRING((0 0,1 1,0 0))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,0 1))", + "MULTILINESTRING((0 1,1 1,0 1))", + expected("txi=+")("tix+=")("tii+=")("txx==")); + // spike vs internal turning R + test_geometry("MULTILINESTRING((0 1,1 1,0 1))", + "MULTILINESTRING((1 0,1 1,2 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 2,1 1,1 2))", + "MULTILINESTRING((1 0,1 1,2 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((2 0,1 0,2 0))", + "MULTILINESTRING((0 0,1 0,0 0))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 2,1 1,0 2))", + "MULTILINESTRING((1 0,1 1,2 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((2 0,1 1,2 0))", + "MULTILINESTRING((1 0,1 1,2 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((2 1,1 1,2 1))", + "MULTILINESTRING((1 0,1 1,2 1))", + expected("tix+=")("txi=+")("tii=+")("txx==")); + // spike vs internal turning L + test_geometry("MULTILINESTRING((2 1,1 1,2 1))", + "MULTILINESTRING((1 0,1 1,0 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 2,1 1,1 2))", + "MULTILINESTRING((1 0,1 1,0 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((2 2,1 1,2 2))", + "MULTILINESTRING((1 0,1 1,0 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((1 0,1 1,0 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 1,1 1,0 1))", + "MULTILINESTRING((1 0,1 1,0 1))", + expected("tix+=")("txi=+")("tii=+")("txx==")); + // spike vs internal collinear + test_geometry("MULTILINESTRING((0 1,1 1,0 1))", + "MULTILINESTRING((2 1,1 1,0 1))", + expected("tix+=")("txi=+")("tii=+")("txx==")); + // internal collinear vs spike + test_geometry("MULTILINESTRING((2 1,1 1,0 1))", + "MULTILINESTRING((0 1,1 1,0 1))", + expected("txi=+")("tix+=")("tii+=")("txx==")); + // spike vs spike + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((2 2,1 1,2 2))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((2 0,1 1,2 0))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((2 1,1 1,2 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((0 1,1 1,0 1))", + expected("tuu++")); + // collinear spikes + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((0 0,1 1,0 0))", + expected("tii++")("tix+=")("txi=+")("txx==") + ("ecc==")); + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((1 1,0 0,1 1))", + expected("tix+=")("tii+=")("txx==")("txi==") + ("txi=+")("tii=+")("txx==")("tix==")); + // non-spike similar + test_geometry("MULTILINESTRING((0 0,10 0))", + "MULTILINESTRING((-1 0,0 0,2 0))", + expected("tii++")("mux==")); + test_geometry("MULTILINESTRING((0 0,10 0))", + "MULTILINESTRING((-1 -1,0 0,2 0))", + expected("tii++")("mux==")); + test_geometry("MULTILINESTRING((0 0,10 0))", + "MULTILINESTRING((2 0,0 0,-1 0))", + expected("tiu+=")("mui=+")); + test_geometry("MULTILINESTRING((0 0,10 0))", + "MULTILINESTRING((2 0,0 0,-1 -1))", + expected("tiu+=")("mui=+")); + + // parts of boundaries taken from union A/A buffer_mp1 + if ( BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + { + test_geometry("LINESTRING(6.95629520146761 5.415823381635526,6.989043790736545 5.209056926535316,7 5,6.989043790736547 4.790943073464693,6.956295201467611 4.584176618364482)", + "LINESTRING(7.415823381635519 5.043704798532389,7.209056926535308 5.010956209263453,7.000000000000001 5,6.790943073464693 5.010956209263453,6.584176618364483 5.043704798532389)", + expected("tuu++")); + // the above should give the same result as this: + test_geometry("LINESTRING(6.95629520146761 5.415823381635526,6.989043790736545 5.209056926535316,7 5,6.989043790736547 4.790943073464693,6.956295201467611 4.584176618364482)", + "LINESTRING(7.415823381635519 5.043704798532389,7.209056926535308 5.010956209263453,7 5,6.790943073464693 5.010956209263453,6.584176618364483 5.043704798532389)", + expected("tuu++")); + } +} + +int test_main(int, char* []) +{ + test_all(); + test_all(); + +#if ! defined(_MSC_VER) + test_all(); +#endif + +#if defined(HAVE_TTMATH) + test_all(); +#endif + return 0; +} + +/* +to_svg("LINESTRING(0 0,2 0)", "LINESTRING(1 0,3 0)", "lsls0000.svg"); +to_svg("LINESTRING(1 0,3 0)", "LINESTRING(2 0,0 0)", "lsls0001.svg"); +to_svg("LINESTRING(0 0,2 0)", "LINESTRING(3 0,1 0)", "lsls0002.svg"); + +to_svg("LINESTRING(0 0,1 0)", "LINESTRING(1 0,2 0)", "lsls0003.svg"); +to_svg("LINESTRING(0 0,1 0)", "LINESTRING(2 0,1 0)", "lsls0004.svg"); +to_svg("LINESTRING(1 0,2 0)", "LINESTRING(1 0,0 0)", "lsls0005.svg"); + +to_svg("LINESTRING(0 0,2 0)", "LINESTRING(0 0,2 0)", "lsls0006.svg"); +to_svg("LINESTRING(0 0,2 0)", "LINESTRING(2 0,0 0)", "lsls0007.svg"); + +to_svg("LINESTRING(0 0,3 0)", "LINESTRING(1 0,2 0)", "lsls0008.svg"); +to_svg("LINESTRING(0 0,3 0)", "LINESTRING(2 0,1 0)", "lsls0009.svg"); + +to_svg("LINESTRING(0 0,1 0)", "LINESTRING(1 0,1 1)", "lsls00010.svg"); +to_svg("LINESTRING(0 0,1 0)", "LINESTRING(1 1,1 0)", "lsls00011.svg"); +to_svg("LINESTRING(0 0,1 0)", "LINESTRING(0 0,0 1)", "lsls00012.svg"); +to_svg("LINESTRING(0 0,1 0)", "LINESTRING(0 1,0 0)", "lsls00013.svg"); +to_svg("LINESTRING(0 0,2 0)", "LINESTRING(1 0,1 1)", "lsls00014.svg"); +to_svg("LINESTRING(0 0,2 0)", "LINESTRING(1 1,1 0)", "lsls00015.svg"); + +to_svg("LINESTRING(0 0,2 0)", "LINESTRING(1 0,3 1)", "lsls00016.svg"); + +to_svg("LINESTRING(0 0,2 0)", "LINESTRING(2 0,1 0)", "lsls00017.svg"); +to_svg("LINESTRING(0 0,2 0)", "LINESTRING(0 0,1 0)", "lsls00018.svg"); +to_svg("LINESTRING(0 0,2 0)", "LINESTRING(1 0,0 0)", "lsls00019.svg"); +to_svg("LINESTRING(0 0,2 0)", "LINESTRING(1 0,2 0)", "lsls00020.svg"); + +to_svg("LINESTRING(0 0,2 0)", "LINESTRING(0 0,2 0)", "lsls000.svg"); +to_svg("LINESTRING(0 0,2 0,2 0,3 0)", "LINESTRING(0 0,2 0)", "lsls001.svg"); +to_svg("LINESTRING(1 0,1 1)", "LINESTRING(0 0,1 0,2 0)", "lsls0020.svg"); +to_svg("LINESTRING(1 0,0 0)", "LINESTRING(0 0,1 0,2 0)", "lsls0021.svg"); +to_svg("LINESTRING(1 0,2 0)", "LINESTRING(0 0,1 0,2 0)", "lsls0022.svg"); +to_svg("LINESTRING(1 1,1 0)", "LINESTRING(0 0,1 0,2 0)", "lsls0023.svg"); +to_svg("LINESTRING(0 0,1 0)", "LINESTRING(0 0,1 0,2 0)", "lsls0024.svg"); +to_svg("LINESTRING(2 0,1 0)", "LINESTRING(0 0,1 0,2 0)", "lsls0025.svg"); +to_svg("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,1 1)", "lsls00200.svg"); +to_svg("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,0 0)", "lsls00211.svg"); +to_svg("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,2 0)", "lsls00222.svg"); +to_svg("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 1,1 0)", "lsls00233.svg"); +to_svg("LINESTRING(0 0,1 0,2 0)", "LINESTRING(0 0,1 0)", "lsls00244.svg"); +to_svg("LINESTRING(0 0,1 0,2 0)", "LINESTRING(2 0,1 0)", "lsls00255.svg"); + +to_svg("LINESTRING(0 0,2 0,4 0,6 0,8 0)", "LINESTRING(1 0,3 0,5 0,6 0,9 0)", "lsls01.svg"); +to_svg("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(1 0,3 0,4 0,4 2,4 5)", "lsls02.svg"); +to_svg("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(1 0,4 0,4 4)", "lsls031.svg"); +to_svg("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(4 0,2 0,0 0)", "lsls032.svg"); +to_svg("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(4 0,2 2,0 2)", "lsls0321.svg"); +to_svg("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(4 0,2 0)", "lsls033.svg"); +to_svg("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(4 0,4 4)", "lsls034.svg"); +to_svg("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(4 0,3 1)", "lsls035.svg"); +to_svg("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(4 0,4 -1)", "lsls036.svg"); +to_svg("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(1 0,4 0,4 3)", "lsls04.svg"); +to_svg("LINESTRING(1 0,2 0,4 0,6 0,8 0)", "LINESTRING(0 0,3 0,5 0,6 0,9 0)", "lsls05.svg"); + +to_svg("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,10 9)", "lsls061.svg"); +to_svg("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,10 -9)", "lsls062.svg"); +to_svg("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,-10 9)", "lsls063.svg"); +to_svg("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,-10 -9)", "lsls064.svg"); +to_svg("LINESTRING(0 0,1 0,10 9,10 10)", "LINESTRING(1 0,10 9)", "lsls065.svg"); +to_svg("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,9 9)", "lsls071.svg"); +to_svg("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,9 -9)", "lsls072.svg"); +to_svg("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,-9 9)", "lsls073.svg"); +to_svg("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,-9 -9)", "lsls074.svg"); +to_svg("LINESTRING(0 0,1 0,10 0,10 10)", "LINESTRING(1 0,9 9)", "lsls081.svg"); +to_svg("LINESTRING(0 0,1 0,10 0,10 10)", "LINESTRING(0 0,9 9)", "lsls082.svg"); +to_svg("LINESTRING(0 0,1 0)", "LINESTRING(1 0,9 9)", "lsls083.svg"); +to_svg("LINESTRING(0 0,1 0)", "LINESTRING(9 9,1 0)", "lsls084.svg"); +to_svg("LINESTRING(0 0,1 0)", "LINESTRING(1 0,2 0)", "lsls085.svg"); +to_svg("LINESTRING(0 0,1 0)", "LINESTRING(2 0,1 0)", "lsls086.svg"); +to_svg("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 1,10 5)", "lsls091.svg"); +to_svg("LINESTRING(0 0,10 0,10 5,10 10)", "LINESTRING(1 1,10 5)", "lsls092.svg"); +to_svg("LINESTRING(0 0,10 0,10 10)", "LINESTRING(19 1,10 5)", "lsls093.svg"); +to_svg("LINESTRING(0 0,10 0,10 5,10 10)", "LINESTRING(19 1,10 5)", "lsls094.svg"); + +to_svg("LINESTRING(5 3,1 1,3 3,2 2,0 0)", "LINESTRING(0 0,3 3,6 3)", "1F100F10T.svg"); + +to_svg("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 1,1 0,3 0,3 1)", "lsls_01.svg"); +to_svg("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 -1,1 0,3 0,3 -1)", "lsls_02.svg"); +to_svg("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 1,3 0,1 0,1 1)", "lsls_03.svg"); +to_svg("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 -1,3 0,1 0,1 -1)", "lsls_04.svg"); +to_svg("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 1,2 0,4 0,4 1)", "lsls_05.svg"); +to_svg("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 -1,2 0,4 0,4 -1)", "lsls_06.svg"); +to_svg("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 1,4 0,2 0,2 1)", "lsls_07.svg"); +to_svg("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 -1,4 0,2 0,2 -1)", "lsls_08.svg"); + +to_svg("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 1,1 0,2 0,3 0,3 1)", "lsls_11.svg"); +to_svg("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 -1,1 0,2 0,3 0,3 -1)", "lsls_12.svg"); +to_svg("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 1,3 0,2 0,1 0,1 1)", "lsls_13.svg"); +to_svg("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 -1,3 0,2 0,1 0,1 -1)", "lsls_14.svg"); +to_svg("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 1,2 0,3 0,4 0,4 1)", "lsls_15.svg"); +to_svg("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 -1,2 0,3 0,4 0,4 -1)", "lsls_16.svg"); +to_svg("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 1,4 0,3 0,2 0,2 1)", "lsls_17.svg"); +to_svg("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 -1,4 0,3 0,2 0,2 -1)", "lsls_18.svg"); + +to_svg("LINESTRING(0 5,5 5,10 5,10 10,5 10,5 5,5 0)", "LINESTRING(0 5,5 5,5 10,10 10,10 5,5 5,5 0)", "lsls11.svg"); +to_svg("LINESTRING(0 5,5 5,10 5,10 10,5 10,5 5,5 0)", "LINESTRING(5 0,5 5,10 5,10 10,5 10,5 5,0 5)", "lsls12.svg"); +to_svg("LINESTRING(5 0,5 5,5 10,10 10,10 5,5 5,0 5)", "LINESTRING(0 5,5 5,5 10,10 10,10 5,5 5,5 0)", "lsls13.svg"); +to_svg("LINESTRING(5 0,5 5,5 10,10 10,10 5,5 5,0 5)", "LINESTRING(5 0,5 5,10 5,10 10,5 10,5 5,0 5)", "lsls14.svg"); + +to_svg("LINESTRING(0 5,10 5,10 10,5 10,5 0)", "LINESTRING(0 5,5 5,5 10,10 10,10 5,5 5,5 0)", "lsls15.svg"); +to_svg("LINESTRING(0 5,10 5,10 10,5 10,5 0)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls16.svg"); +to_svg("LINESTRING(0 5,10 5)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls161.svg"); +to_svg("LINESTRING(0 5,8 5,10 5)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls162.svg"); +to_svg("LINESTRING(0 5,8 5)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls1631.svg"); +to_svg("LINESTRING(0 5,1 5,7 5,8 5)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls1632.svg"); +to_svg("LINESTRING(0 5,1 5,7 5,8 5)", "LINESTRING(5 10,10 10,10 5,0 5)", "lsls1633.svg"); +to_svg("LINESTRING(0 5,8 4)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls1641.svg"); +to_svg("LINESTRING(0 5,8 6)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls1642.svg"); +to_svg("LINESTRING(1 5,8 4)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls1643.svg"); +to_svg("LINESTRING(1 5,8 5)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls1644.svg"); +to_svg("LINESTRING(0 5,5 5,8 4)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls165.svg"); +to_svg("LINESTRING(0 5,5 5,8 5)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls166.svg"); +to_svg("LINESTRING(0 5,5 5,8 5)", "LINESTRING(0 10,10 0,5 0,5 10,10 10,10 5,0 5)", "lsls167.svg"); +to_svg("LINESTRING(0 5,5 5,8 5)", "LINESTRING(0 10,5 5,10 0,5 0,5 5,5 10,10 10,10 5,0 5)", "lsls168.svg"); + +to_svg("LINESTRING(0 0,0 10,10 10,10 0,0 0)", "LINESTRING(0 2,0 0,10 0,10 10,0 10,0 8,0 2)", "lsls1690.svg"); +to_svg("LINESTRING(0 0,10 0,10 10,0 10,0 0)", "LINESTRING(0 8,0 0,10 0,10 10,0 10,0 8)", "lsls1691.svg"); +to_svg("LINESTRING(0 0,10 0,10 10,0 10,0 0)", "LINESTRING(0 2,0 0,10 0,10 10,0 10,0 8)", "lsls1692.svg"); +to_svg("LINESTRING(0 0,0 10,10 10,10 0,0 0)", "LINESTRING(0 2,0 0,10 0,10 10,0 10,0 8)", "lsls1693.svg"); +to_svg("LINESTRING(0 2,0 0,10 0,10 10,0 10,0 8)", "LINESTRING(0 0,10 0,10 10,0 10,0 0)", "lsls1694.svg"); +to_svg("LINESTRING(0 2,0 0,10 0,10 10,0 10,0 8)", "LINESTRING(0 0,0 10,10 10,10 0,0 0)", "lsls1695.svg"); + +to_svg("LINESTRING(0 8,0 0,10 0,10 10,0 10,0 2)", "ls1.svg"); +to_svg("LINESTRING(8 8,0 0,10 0,10 10,0 10,8 2)", "ls2.svg"); + +typedef bg::model::multi_linestring mls; +to_svg("LINESTRING(0 5,10 5,10 10,5 10,5 0)", "MULTILINESTRING((5 0,5 7),(5 8,5 10,10 10,10 5,0 5))", "lsls17.svg"); +to_svg("LINESTRING(0 5,10 5,10 10,5 10,5 0)", "MULTILINESTRING((5 0,5 4,5 6,5 7),(5 8,5 10,10 10,10 5,0 5))", "lsls18.svg"); +to_svg("LINESTRING(0 5,10 5,10 10,5 10,5 0)", "MULTILINESTRING((5 0,5 8),(5 7,5 10,10 10,10 5,0 5))", "lsls19.svg"); +to_svg("MULTILINESTRING((5 0,5 7),(5 8,5 10,10 10,10 5,0 5))", "LINESTRING(0 5,10 5,10 10,5 10,5 0)", "lsls20.svg"); +to_svg("MULTILINESTRING((5 0,5 8),(5 7,5 10,10 10,10 5,0 5))", "LINESTRING(0 5,10 5,10 10,5 10,5 0)", "lsls21.svg"); + +to_svg("LINESTRING(0 5,5 5,10 5,10 10,5 10,5 5,5 0)", "LINESTRING(0 5,5 5,0 10,10 10,10 5,5 5,5 0)", "lsls100.svg"); + +to_svg("LINESTRING(5 0,5 5,5 0)", "LINESTRING(0 5,5 5,0 10,2 10,5 5,5 10,10 10,10 5,5 5,10 2,10 0,8 0,5 5,5 0)", "lsls101.svg"); +*/ diff --git a/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_linear_geo.cpp b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_linear_geo.cpp new file mode 100644 index 000000000..4b3a22d47 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_linear_geo.cpp @@ -0,0 +1,50 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017, 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) + + +#include "test_get_turns.hpp" +#include + + +template +void test_radian() +{ + typedef bg::model::point > pt; + typedef bg::model::linestring ls; + typedef bg::model::multi_linestring mls; + + bg::srs::spheroid sph_wgs84(6378137.0, 6356752.3142451793); + boost::geometry::strategy::intersection::geographic_segments<> wgs84(sph_wgs84); + + test_geometry( + "LINESTRING(0 0, -3.14159265358979 0)", + "MULTILINESTRING((-2.1467549799530232 -0.12217304763960295," + "-2.5481807079117185 -0.90757121103705041," + "-2.6529004630313784 0.85521133347722067," + " 0.92502450355699373 0.62831853071795796," + "-2.5307274153917754 0," + " 2.8099800957108676 1.0646508437165401," + "-1.6057029118347816 -1.5009831567151219," + " 0.2268928027592626 1.0646508437165401," + "-2.199114857512853 -0.017453292519943278," + " 0 0.31415926535897898," + " 0 0.57595865315812822," + " 1.0471975511965967 -0.73303828583761765," + " 2.1118483949131366 -0.54105206811824158))", + expected("mii++")("muu==")("iuu++")("iuu++")("iuu++")("iuu++"), + wgs84); +} + +int test_main(int, char* []) +{ + test_radian(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_linear_sph.cpp b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_linear_sph.cpp new file mode 100644 index 000000000..962bc8c38 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_linear_sph.cpp @@ -0,0 +1,442 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016, 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) + + +#include "test_get_turns.hpp" +#include + + +template +void test_all() +{ + typedef bg::model::point > pt; + typedef bg::model::linestring ls; + typedef bg::model::multi_linestring mls; + + // NOTE: currently for the first endpoint of the Linestring on collinear segment + // is_collinear flags are set to FALSE! + // E.g. in the first test tii++, NOT tii== + + test_geometry("LINESTRING(0 0,2 0)", "LINESTRING(0 0,2 0)", "tii++", "txx=="); + test_geometry("LINESTRING(0 0,2 0)", "LINESTRING(2 0,0 0)", "tix+=", "txi=+"); + + test_geometry("LINESTRING(1 0,1 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++"); + test_geometry("LINESTRING(1 0,0 0)", "LINESTRING(0 0,1 0,2 0)", "txi=+", "tiu+="); + test_geometry("LINESTRING(1 0,2 0)", "LINESTRING(0 0,1 0,2 0)", "tii++", "txx=="); + test_geometry("LINESTRING(1 1,1 0)", "LINESTRING(0 0,1 0,2 0)", "txu++"); + test_geometry("LINESTRING(0 0,1 0)", "LINESTRING(0 0,1 0,2 0)", "tii++", "txu=="); + test_geometry("LINESTRING(2 0,1 0)", "LINESTRING(0 0,1 0,2 0)", "txi=+", "tix+="); + + test_geometry("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,1 1)", "tuu++"); + test_geometry("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,0 0)", "tix+=", "tui=+"); + test_geometry("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,2 0)", "tii++", "txx=="); + test_geometry("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 1,1 0)", "tux++"); + test_geometry("LINESTRING(0 0,1 0,2 0)", "LINESTRING(0 0,1 0)", "tii++", "tux=="); + test_geometry("LINESTRING(0 0,1 0,2 0)", "LINESTRING(2 0,1 0)", "tix+=", "txi=+"); + + test_geometry("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 1,1 0,3 0,3 1)", "mii++", "ccc==", "muu=="); + test_geometry("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 -1,1 0,3 0,3 -1)", "mii++", "ccc==", "muu=="); + test_geometry("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 1,3 0,1 0,1 1)", "miu+=", "mui=+"); + test_geometry("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 -1,3 0,1 0,1 -1)", "miu+=", "mui=+"); + test_geometry("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 1,2 0,4 0,4 1)", "tii++", "ccc==", "tuu=="); + test_geometry("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 -1,2 0,4 0,4 -1)", "tii++", "ccc==", "tuu=="); + test_geometry("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 1,4 0,2 0,2 1)", "tiu+=", "tui=+"); + test_geometry("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 -1,4 0,2 0,2 -1)", "tiu+=", "tui=+"); + + test_geometry("LINESTRING(0 0,1 0,2 1,3 5,4 0)", "LINESTRING(1 0,2 1,3 5)", "tii++", "ecc==", "tux=="); + test_geometry("LINESTRING(0 0,1 0,2 1,3 5,4 0)", "LINESTRING(3 5,2 1,1 0)", "tix+=", "ecc==", "tui=+"); + test_geometry("LINESTRING(1 0,2 1,3 5)", "LINESTRING(0 0,1 0,2 1,3 5,4 0)", "txu==", "ecc==", "tii++"); + test_geometry("LINESTRING(3 5,2 1,1 0)", "LINESTRING(0 0,1 0,2 1,3 5,4 0)", "tiu+=", "ecc==", "txi=+"); + + test_geometry("LINESTRING(0 0,10 0)", "LINESTRING(-1 -1,1 0,10 0,20 -1)", "mii++", "txu=="); + test_geometry("LINESTRING(0 0,10 0)", "LINESTRING(20 -1,10 0,1 0,-1 -1)", "miu+=", "txi=+"); + test_geometry("LINESTRING(-1 -1,1 0,10 0,20 -1)", "LINESTRING(0 0,10 0)", "mii++", "tux=="); + test_geometry("LINESTRING(20 -1,10 0,1 0,-1 -1)", "LINESTRING(0 0,10 0)", "mui=+", "tix+="); + + test_geometry("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)", + "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", + expected("tii++")("ecc==")("muu==")("mii++")("muu==")("mii++")("mux==")); + test_geometry("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)", + "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", + expected("tiu+=")("ecc==")("mui=+")("miu+=")("mui=+")("miu+=")("mui=+")); + test_geometry("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)", + "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", + expected("tui=+")("ecc==")("miu+=")("mui=+")("miu+=")("mui=+")("mix+=")); + test_geometry("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)", + "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", + expected("tuu==")("ecc==")("mii++")("muu==")("mii++")("muu==")("mii++")); + + if (BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + { + test_geometry("LINESTRING(-1 0,1 0,2 1.0004570537241201524198894179384922,3 2)", + "LINESTRING(4 5,3 2,1 0,0 0)", + "mix+=", "txi=+", "ecc=="); + test_geometry("LINESTRING(4 5,3 2,1 0,0 0)", + "LINESTRING(-1 0,1 0,2 1.0004570537241201524198894179384922,3 2)", + "mxi=+", "tix+=", "ecc=="); + } + + test_geometry("LINESTRING(30 0,20 0,1 1,-1 -1)", "LINESTRING(0 -1,0 0,1 -1,20 0,25 0)", "mix+=", "tui=+", "muu++"); + test_geometry("LINESTRING(0 -1,0 0,1 -1,20 0,25 0)", "LINESTRING(30 0,20 0,1 1,-1 -1)", "mxi=+", "tiu+=", "muu++"); + + test_geometry("LINESTRING(0 0,30 0)", "LINESTRING(4 0,4 1,20 1,5 0,1 0)", "muu++", "mui=+", "mix+="); + test_geometry("LINESTRING(4 0,4 1,20 1,5 0,1 0)", "LINESTRING(0 0,30 0)", "muu++", "miu+=", "mxi=+"); + + test_geometry("LINESTRING(30 0,0 0)", "LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)", + expected("mui=+")("miu+=")("mui=+")("mix+=")); + test_geometry("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)", "LINESTRING(30 0,0 0)", + expected("miu+=")("mui=+")("miu+=")("mxi=+")); + + test_geometry("LINESTRING(1 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,4 -1)", + expected("mii++")("iuu++")("muu==")); + test_geometry("LINESTRING(1 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,5 0,4 1)", + expected("mii++")("muu++")("muu==")); + + // non-collinear + test_geometry("LINESTRING(0 1,0 0)", "LINESTRING(0 0,1 0,2 0)", "txu++"); + test_geometry("LINESTRING(0 1,0 0,1 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++"); + test_geometry("LINESTRING(0 1,1 0,2 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++"); + + // SPIKE - NON-ENDPOINT - NON-OPPOSITE + + // spike - neq eq + test_geometry("LINESTRING(0 2,0 4,0 1)", "LINESTRING(0 0,0 4,6 3)", + expected("mii++")("txu==")("tiu==")("mxi=+")); + // spike - eq eq + test_geometry("LINESTRING(0 0,0 4,0 1)", "LINESTRING(0 0,0 4,6 3)", + expected("tii++")("txu==")("tiu==")("mxi=+")); + // spike - eq neq + test_geometry("LINESTRING(0 0,0 3,0 1)", "LINESTRING(0 0,0 4,6 3)", + expected("tii++")("mxu==")("miu==")("mxi=+")); + // spike - neq neq + test_geometry("LINESTRING(0 1,0 3,0 2)", "LINESTRING(0 0,0 4,6 3)", + expected("mii++")("mxu==")("miu==")("mxi=+")); + // spike - out neq + test_geometry("LINESTRING(0 0,0 3,0 2)", "LINESTRING(0 1,0 4,6 3)", + expected("mii++")("mxu==")("miu==")("mxi=+")); + // spike - out eq + test_geometry("LINESTRING(0 0,0 4,0 2)", "LINESTRING(0 1,0 4,6 3)", + expected("mii++")("txu==")("tiu==")("mxi=+")); + // spike - out out/eq + test_geometry("LINESTRING(0 0,0 4,0 2)", "LINESTRING(1 0,0 4,6 3)", + expected("tuu++")); + test_geometry("LINESTRING(0 0,0 4,0 2)", "LINESTRING(-1 0,0 4,6 3)", + expected("tuu++")); + // spike - out out/neq + test_geometry("LINESTRING(0 -2,0 0,0 -1)", "LINESTRING(-1 0,1 0,6 3)", + expected("muu++")); + test_geometry("LINESTRING(0 -2,0 0,0 -1)", "LINESTRING(-1 0,1 0,6 3)", + expected("muu++")); + + // SPIKE - NON-ENDPOINT - OPPOSITE + + // opposite - eq eq + test_geometry("LINESTRING(0 6,0 4,0 0,0 2)", "LINESTRING(0 -1,0 0,0 4,6 3)", + expected("tiu+=")("txi=+")("tii=+")("mxu==")); + test_geometry("LINESTRING(0 -1,0 0,0 4,6 3)", "LINESTRING(0 6,0 4,0 0,0 2)", + expected("tui=+")("tix+=")("tii+=")("mux==")); + // opposite - neq eq + test_geometry("LINESTRING(0 6,0 4,0 0,0 2)", "LINESTRING(0 -1,0 0,0 5,6 3)", + expected("miu+=")("txi=+")("tii=+")("mxu==")); + // opposite - eq neq + test_geometry("LINESTRING(0 6,0 4,0 0,0 2)", "LINESTRING(0 -2,0 -1,0 4,6 3)", + expected("tiu+=")("mxi=+")("mii=+")("mxu==")); + // opposite - neq neq + test_geometry("LINESTRING(0 6,0 4,0 0,0 2)", "LINESTRING(0 -2,0 -1,0 3,6 3)", + expected("miu+=")("mxi=+")("mii=+")("mxu==")); + // opposite - neq neq + test_geometry("LINESTRING(0 6,0 4,0 0,0 2)", "LINESTRING(0 -2,0 -1,0 3,0 5,6 3)", + expected("miu+=")("mxi=+")("mii=+")("mxu==")); + // opposite - neq eq + test_geometry("LINESTRING(6 3,0 3,0 0)", "LINESTRING(0 0,0 2,0 3,0 1)", + expected("txi=+")("tix+=")("tii+=")("mux==")); + + // SPIKE - ENDPOINT - NON-OPPOSITE + + // spike - neq eq + test_geometry("LINESTRING(0 2,0 4,0 1)", "LINESTRING(0 0,0 4)", + expected("mii++")("txx==")("tix==")("mxi=+")); + test_geometry("LINESTRING(0 2,0 4,0 1)", "LINESTRING(0 4,0 0)", + expected("miu+=")("txi=+")("tii=+")("mxu==")); + // spike - eq eq + test_geometry("LINESTRING(0 0,0 4,0 1)", "LINESTRING(0 0,0 4)", + expected("tii++")("txx==")("tix==")("mxi=+")); + test_geometry("LINESTRING(0 0,0 4,0 1)", "LINESTRING(0 4,0 0)", + expected("tix+=")("txi=+")("tii=+")("mxu==")); + // spike - eq neq + test_geometry("LINESTRING(0 0,0 3,0 1)", "LINESTRING(0 0,0 4)", + expected("tii++")("mxu==")("miu==")("mxi=+")); + test_geometry("LINESTRING(0 0,0 3,0 1)", "LINESTRING(0 4,0 0)", + expected("tix+=")("mxi=+")("mii=+")("mxu==")); + // spike - neq neq + test_geometry("LINESTRING(0 1,0 3,0 2)", "LINESTRING(0 0,0 4)", + expected("mii++")("mxu==")("miu==")("mxi=+")); + test_geometry("LINESTRING(0 1,0 3,0 2)", "LINESTRING(0 4,0 0)", + expected("miu+=")("mxi=+")("mii=+")("mxu==")); + // spike - out neq + test_geometry("LINESTRING(0 0,0 3,0 2)", "LINESTRING(0 1,0 4)", + expected("mii++")("mxu==")("miu==")("mxi=+")); + test_geometry("LINESTRING(0 0,0 3,0 2)", "LINESTRING(0 4,0 1)", + expected("mix+=")("mxi=+")("mii=+")("mxu==")); + // spike - out eq + test_geometry("LINESTRING(0 0,0 4,0 2)", "LINESTRING(0 1,0 4)", + expected("mii++")("txx==")("tix==")("mxi=+")); + test_geometry("LINESTRING(0 0,0 4,0 2)", "LINESTRING(0 4,0 1)", + expected("mix+=")("txi=+")("tii=+")("mxu==")); + // spike - out out/eq + test_geometry("LINESTRING(0 0,0 4,0 2)", "LINESTRING(1 0,0 4)", + expected("tux++")); + test_geometry("LINESTRING(0 0,0 4,0 2)", "LINESTRING(-1 0,0 4)", + expected("tux++")); + // spike - out out/neq + test_geometry("LINESTRING(0 -2,0 0,0 -1)", "LINESTRING(-1 0,1 0)", + expected("muu++")); + test_geometry("LINESTRING(0 -2,0 0,0 -1)", "LINESTRING(1 0,-1 0)", + expected("muu++")); + + + test_geometry("LINESTRING(3 0,0 0)", + "LINESTRING(4 2,1 0,9 0)", + expected("mui=+")("miu+=")); + + + // 01.02.2015 + test_geometry("LINESTRING(6 0,0 0,5 0)", + "LINESTRING(2 0,0 0,-10 0)", + expected("mii++")("txu==")("tiu==")("mui=+")); + // the reversal could be automatic... + test_geometry("LINESTRING(2 0,0 0,-10 0)", + "LINESTRING(6 0,0 0,5 0)", + expected("mii++")("tux==")("tui==")("miu+=")); + // sanity check + test_geometry("LINESTRING(6 0,0 0)", + "LINESTRING(2 0,0 0,-10 0)", + expected("mii++")("txu==")); + test_geometry("LINESTRING(0 0,5 0)", + "LINESTRING(2 0,0 0,-10 0)", + expected("tiu+=")("mui=+")); + + if ( BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + { + test_geometry("LINESTRING(0 -1, 10 -1, 20 1)", + "LINESTRING(12 10, 12.5 -0.50051443471392, 15 0, 17.5 0.50051443471392)", + expected("mii++")("ccc==")("mux==")); + test_geometry("LINESTRING(0 -1, 10 -1, 20 1)", + "LINESTRING(17.5 0.50051443471392, 15 0, 12.5 -0.50051443471392, 12 10)", + expected("miu+=")("mui=+")); + test_geometry("LINESTRING(20 1, 10 -1, 0 -1)", + "LINESTRING(12 10, 12.5 -0.50051443471392, 15 0, 17.5 0.50051443471392)", + expected("mui=+")("mix+=")); + test_geometry("LINESTRING(20 1, 10 -1, 0 0)", + "LINESTRING(17.5 0.50051443471392, 15 0, 12.5 -0.50051443471392, 12 10)", + expected("muu==")("ccc==")("mii++")); + + test_geometry("LINESTRING(0 -1, 10 -1, 20 1)", + "LINESTRING(12.5 -0.50051443471392, 15 0, 17.5 0.50051443471392)", + expected("mii++")("ccc==")("mux==")); + test_geometry("LINESTRING(0 -1, 10 -1, 20 1)", + "LINESTRING(17.5 0.50051443471392, 15 0, 12.5 -0.50051443471392)", + expected("mix+=")("mui=+")); + test_geometry("LINESTRING(20 1, 10 -1, 0 -1)", + "LINESTRING(12.5 -0.50051443471392, 15 0, 17.5 0.50051443471392)", + expected("mui=+")("mix+=")); + test_geometry("LINESTRING(20 1, 10 -1, 0 -1)", + "LINESTRING(17.5 0.50051443471392, 15 0, 12.5 -0.50051443471392)", + expected("mux==")("ccc==")("mii++")); + + test_geometry("LINESTRING(0 -1, 10 -1, 20 1)", + "LINESTRING(12 10, 12.5 -0.50051443471392, 15 0)", + expected("mii++")("mux==")); + test_geometry("LINESTRING(0 -1, 10 -1, 20 1)", + "LINESTRING(15 0, 12.5 -0.50051443471392, 12 10)", + expected("miu+=")("mui=+")); + test_geometry("LINESTRING(20 1, 10 -1, 0 -1)", + "LINESTRING(12 10, 12.5 -0.50051443471392, 15 0)", + expected("mui=+")("mix+=")); + test_geometry("LINESTRING(20 1, 10 -1, 0 -1)", + "LINESTRING(15 0, 12.5 -0.50051443471392, 12 10)", + expected("muu==")("mii++")); + } + + // TODO: + //test_geometry("LINESTRING(0 0,2 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102"); + //test_geometry("LINESTRING(2 0,0 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102"); + + //test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(3 0,3 3,3 1)", "0F1FF0102"); + //test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(2 0,2 3,2 1)", "0F1FF0102"); + //test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(2 0,2 2,2 1)", "0F1FF0102"); + + //test_geometry("LINESTRING(0 0,2 2,3 3,4 4)", "LINESTRING(0 0,1 1,4 4)", "1FFF0FFF2"); + + + //if ( boost::is_same::value ) + //{ + // to_svg("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)", "LINESTRING(0 0,2 0,2.5 0,3 1)", "test11.svg"); + // to_svg("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)", "LINESTRING(3 1,2.5 0,2 0,0 0)", "test12.svg"); + // to_svg("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,20 0,30 0,31 1)", "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", "test21.svg"); + // to_svg("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,20 0,30 0,31 1)", "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", "test22.svg"); + + // to_svg("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)", "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", "test31.svg"); + // to_svg("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)", "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", "test32.svg"); + // to_svg("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)", "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", "test33.svg"); + // to_svg("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)", "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", "test34.svg"); + //} + + // duplicated + test_geometry("MULTILINESTRING((0 0,10 0,30 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0),(2 0,2 0),(3 0,3 0,3 0))", + expected("mii++")("ccc==")("ccc==")("txx==")); + + // spike + test_geometry("LINESTRING(2 2,5 -1,15 2,18 0,20 0)", + "LINESTRING(30 0,19 0,18 0,0 0)", + expected("iuu++")("iuu++")("tiu+=")("mxi=+")); + // spike + test_geometry("MULTILINESTRING((0 0,10 0,5 0))", + "MULTILINESTRING((1 0,8 0,4 0))", + expected("mii++")("mix+=")("mux==")("mui==")("mix+=")("mii+=")("mxu==")("mxi=+")); + + /*test_geometry("MULTILINESTRING((0 0,10 0,5 0))", + "MULTILINESTRING((1 0,8 0,4 0),(2 0,9 0,5 0))", + expected("mii")("ccc")("ccc")("txx"));*/ + + // spike vs endpoint + test_geometry("MULTILINESTRING((0 0,10 0))", + "MULTILINESTRING((-1 0,0 0,-2 0),(11 0,10 0,12 0))", + expected("tuu++")("txu++")); + // internal turning R vs spike + test_geometry("MULTILINESTRING((1 0,1 1,2 1))", + "MULTILINESTRING((0 1,1 1,0 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,2 1))", + "MULTILINESTRING((1 2,1 1,1 2))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 0,1 0,0 0))", + "MULTILINESTRING((2 0,1 0,2 0))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,2 1))", + "MULTILINESTRING((0 2,1 1,0 2))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,2 1))", + "MULTILINESTRING((2 0,1 1,2 0))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,2 1))", + "MULTILINESTRING((2 1,1 1,2 1))", + expected("txi=+")("tix+=")("tii+=")("txx==")); + // internal turning L vs spike + test_geometry("MULTILINESTRING((1 0,1 1,0 1))", + "MULTILINESTRING((2 1,1 1,2 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,0 1))", + "MULTILINESTRING((1 2,1 1,1 2))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,0 1))", + "MULTILINESTRING((2 2,1 1,2 2))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,0 1))", + "MULTILINESTRING((0 0,1 1,0 0))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 0,1 1,0 1))", + "MULTILINESTRING((0 1,1 1,0 1))", + expected("txi=+")("tix+=")("tii+=")("txx==")); + // spike vs internal turning R + test_geometry("MULTILINESTRING((0 1,1 1,0 1))", + "MULTILINESTRING((1 0,1 1,2 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 2,1 1,1 2))", + "MULTILINESTRING((1 0,1 1,2 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((2 0,1 0,2 0))", + "MULTILINESTRING((0 0,1 0,0 0))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 2,1 1,0 2))", + "MULTILINESTRING((1 0,1 1,2 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((2 0,1 1,2 0))", + "MULTILINESTRING((1 0,1 1,2 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((2 1,1 1,2 1))", + "MULTILINESTRING((1 0,1 1,2 1))", + expected("tix+=")("txi=+")("tii=+")("txx==")); + // spike vs internal turning L + test_geometry("MULTILINESTRING((2 1,1 1,2 1))", + "MULTILINESTRING((1 0,1 1,0 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((1 2,1 1,1 2))", + "MULTILINESTRING((1 0,1 1,0 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((2 2,1 1,2 2))", + "MULTILINESTRING((1 0,1 1,0 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((1 0,1 1,0 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 1,1 1,0 1))", + "MULTILINESTRING((1 0,1 1,0 1))", + expected("tix+=")("txi=+")("tii=+")("txx==")); + // spike vs internal collinear + test_geometry("MULTILINESTRING((0 1,1 1,0 1))", + "MULTILINESTRING((2 1,1 1,0 1))", + expected("tix+=")("txi=+")("tii=+")("txx==")); + // internal collinear vs spike + test_geometry("MULTILINESTRING((2 1,1 1,0 1))", + "MULTILINESTRING((0 1,1 1,0 1))", + expected("txi=+")("tix+=")("tii+=")("txx==")); + // spike vs spike + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((2 2,1 1,2 2))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((2 0,1 1,2 0))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((2 1,1 1,2 1))", + expected("tuu++")); + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((0 1,1 1,0 1))", + expected("tuu++")); + // collinear spikes + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((0 0,1 1,0 0))", + expected("tii++")("tix+=")("txi=+")("txx==") + ("ecc==")); + test_geometry("MULTILINESTRING((0 0,1 1,0 0))", + "MULTILINESTRING((1 1,0 0,1 1))", + expected("tix+=")("tii+=")("txx==")("txi==") + ("txi=+")("tii=+")("txx==")("tix==")); + // non-spike similar + test_geometry("MULTILINESTRING((0 0,10 0))", + "MULTILINESTRING((-1 0,0 0,2 0))", + expected("tii++")("mux==")); + test_geometry("MULTILINESTRING((0 0,10 0))", + "MULTILINESTRING((-1 -1,0 0,2 0))", + expected("tii++")("mux==")); + test_geometry("MULTILINESTRING((0 0,10 0))", + "MULTILINESTRING((2 0,0 0,-1 0))", + expected("tiu+=")("mui=+")); + test_geometry("MULTILINESTRING((0 0,10 0))", + "MULTILINESTRING((2 0,0 0,-1 -1))", + expected("tiu+=")("mui=+")); +} + +int test_main(int, char* []) +{ + test_all(); + test_all(); + +#if ! defined(_MSC_VER) + test_all(); +#endif + +#if defined(HAVE_TTMATH) + test_all(); +#endif + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/multi_overlay_cases.hpp b/src/boost/libs/geometry/test/algorithms/overlay/multi_overlay_cases.hpp new file mode 100644 index 000000000..865e2bef7 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/multi_overlay_cases.hpp @@ -0,0 +1,1549 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2016. +// Modifications copyright (c) 2016, 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) + +#ifndef BOOST_GEOMETRY_TEST_MULTI_OVERLAY_CASES_HPP +#define BOOST_GEOMETRY_TEST_MULTI_OVERLAY_CASES_HPP + + +#include + +// See powerpoint doc/other/test_cases/overlay_cases.ppt +// Note that there are some duplicates with single (80 and on) + +static std::string case_multi_simplex[2] = +{ + "MULTIPOLYGON(((0 1,2 5,5 3,0 1)),((1 1,5 2,5 0,1 1)))", + "MULTIPOLYGON(((3 0,0 3,4 5,3 0)))" +}; + +// To mix multi/single +static std::string case_single_simplex = "POLYGON((3 0,0 3,4 5,3 0))"; + +static std::string case_multi_no_ip[2] = +{ + "MULTIPOLYGON(((4 1,0 7,7 9,4 1)),((8 1,6 3,10 4,8 1)),((12 6,10 7,13 8,12 6)))", + "MULTIPOLYGON(((14 4,8 8,15 10,14 4)),((15 3,18 9,20 2,15 3)),((3 4,1 7,5 7,3 4)))" +}; + +static std::string case_multi_2[2] = +{ + "MULTIPOLYGON(((4 3,2 7,10 9,4 3)),((8 1,6 3,10 4,8 1)),((12 6,10 7,13 8,12 6)))", + "MULTIPOLYGON(((14 4,8 8,15 10,14 4)),((15 3,18 9,20 2,15 3)),((5 5,4 7,7 7,5 5)))" +}; + +// Case 58, same as case_58 IET (single) but here the second polygon is inverted +// To check behaviour of difference, but in an intersection operation +static std::string case_58_multi[8] = +{ + /* a */ "MULTIPOLYGON(((3 3,3 4,4 4,4 3,3 3)))", + /* b */ "MULTIPOLYGON(((0 2,0 5,4 4,5 0,0 2),(4 4,1 4,1 3,4 4),(4 4,2 3,2 2,4 4),(4 4,3 2,4 2,4 4)))", + /* a inv */ "MULTIPOLYGON(((-1 -1,-1 6,6 6,6 -1,-1 -1),(3 3,4 3,4 4,3 4,3 3)))", + /* b inv */ "MULTIPOLYGON(((6 6,6 0,5 0,4 4,0 5,0 6,6 6)),((4 4,1 3,1 4,4 4)),((4 4,2 2,2 3,4 4)),((4 4,4 2,3 2,4 4)))", + + // simpler versions of b + /* b */ "MULTIPOLYGON(((0 2,0 5,4 4,5 0,0 2),(4 4,1 4,1 3,4 4)))", + /* b */ "MULTIPOLYGON(((0 2,0 5,4 4,5 0,0 2),(4 4,3 2,4 2,4 4)))", + /* b */ "MULTIPOLYGON(((0 2,0 5,4 4,5 0,0 2),(4 4,2 3,2 2,4 4)))", + /* b */ "MULTIPOLYGON(((0 2,0 5,4 4,5 0,0 2),(4 4,2 3,2 2,4 4),(4 4,3 2,4 2,4 4)))", +}; + +static std::string case_61_multi[2] = +{ + // extracted from recursive boxes + "MULTIPOLYGON(((1 1,1 2,2 2,2 1,1 1)),((2 2,2 3,3 3,3 2,2 2)))", + "MULTIPOLYGON(((1 2,1 3,2 3,2 2,1 2)),((2 3,2 4,3 4,3 3,2 3)))" +}; + +static std::string case_62_multi[2] = +{ + // extracted from recursive boxes + "MULTIPOLYGON(((1 2,1 3,2 3,2 2,1 2)))", + "MULTIPOLYGON(((1 2,1 3,2 3,2 2,1 2)),((2 3,2 4,3 4,3 3,2 3)))" +}; + +static std::string case_63_multi[2] = +{ + // extracted from recursive boxes + "MULTIPOLYGON(((1 2,1 3,2 3,2 2,1 2)))", + "MULTIPOLYGON(((1 2,1 3,2 3,2 2,1 2)),((2 1,2 2,3 2,3 1,2 1)))" +}; + +static std::string case_64_multi[3] = +{ + // extracted from recursive boxes + "MULTIPOLYGON(((1 1,1 2,2 2,2 1,1 1)),((2 2,2 3,3 3,3 2,2 2)))", + "MULTIPOLYGON(((1 1,1 2,2 2,3 2,3 1,2 1,1 1)))" , + // same but omitting not-necessary form-points at x=2 (==simplified) + "MULTIPOLYGON(((1 1,1 2,3 2,3 1,1 1)))" +}; + +static std::string case_65_multi[4] = +{ + "MULTIPOLYGON(((2 2,2 3,3 3,3 2,2 2)))", + "MULTIPOLYGON(((1 1,1 2,2 2,2 1,1 1)),((2 2,2 3,3 3,3 2,2 2)),((3 1,3 2,5 2,5 1,3 1)))", + + // Inverse versions + "MULTIPOLYGON(((0 0,0 4,6 4,6 0,0 0),(2 2,3 2,3 3,2 3,2 2)))", + "MULTIPOLYGON(((0 0,0 4,6 4,6 0,0 0),(1 1,2 1,2 2,1 2,1 1),(2 2,3 2,3 3,2 3,2 2),(3 1,5 1,5 2,3 2,3 1)))" +}; + +static std::string case_66_multi[2] = +{ + "MULTIPOLYGON(((3 5,2 5,2 6,3 6,4 6,4 5,3 5)),((1 6,0 6,0 7,1 7,2 7,2 6,1 6)))", + "MULTIPOLYGON(((1 4,1 5,2 5,2 4,1 4)),((1 7,2 7,2 6,1 6,1 7)),((0 8,0 9,1 9,1 8,1 7,0 7,0 8)))" +}; + +static std::string case_67_multi[2] = +{ + "MULTIPOLYGON(((1 2,1 3,2 3,2 2,1 2)),((2 1,2 2,3 2,3 1,2 1)))", + "MULTIPOLYGON(((1 1,1 2,3 2,3 1,1 1)))" +}; + +static std::string case_68_multi[2] = +{ + "MULTIPOLYGON(((2 1,2 2,4 2,4 1,2 1)),((4 2,4 3,5 3,5 2,4 2)))", + "MULTIPOLYGON(((1 2,1 3,2 3,2 2,1 2)),((2 1,2 2,3 2,3 1,2 1)),((3 2,3 3,5 3,5 2,3 2)))" +}; + +static std::string case_69_multi[2] = +{ + "MULTIPOLYGON(((1 1,1 2,2 2,2 1,1 1)),((3 2,3 3,4 3,4 2,3 2)))", + "MULTIPOLYGON(((2 0,2 1,3 1,3 0,2 0)),((1 1,1 3,2 3,2 1,1 1)),((2 3,2 4,3 4,3 3,2 3)))" +}; + +static std::string case_71_multi[2] = +{ + "MULTIPOLYGON(((0 0,0 3,1 3,1 1,3 1,3 2,4 2,4 0,0 0)),((2 2,2 3,3 3,3 2,2 2)))", + "MULTIPOLYGON(((0 2,0 3,3 3,3 2,0 2)))" +}; + +static std::string case_72_multi[3] = +{ + // cluster with ii, done by both traverse and assemble + "MULTIPOLYGON(((0 3,4 4,3 0,3 3,0 3)),((3 3,2 1,1 2,3 3)))", + "MULTIPOLYGON(((0 0,1 4,3 3,4 1,0 0)))", + + // Inverse version of a + "MULTIPOLYGON(((-1 -1,-1 5,5 5,5 -1,-1 -1),(0 3,3 3,3 0,4 4,0 3),(3 3,1 2,2 1,3 3)))" +}; + +static std::string case_73_multi[2] = +{ + "MULTIPOLYGON(((2 2,2 3,3 3,3 2,2 2)),((1 1,1 2,2 2,2 1,1 1)))", + "MULTIPOLYGON(((1 1,1 2,2 2,2 3,3 3,3 1,1 1)))" +}; + +static std::string case_74_multi[2] = +{ + "MULTIPOLYGON(((3 0,2 0,2 1,3 1,3 3,1 3,1 2,2 2,2 1,0 1,0 5,4 5,4 0,3 0)))", + "MULTIPOLYGON(((0 2,0 3,1 3,1 1,2 1,2 0,0 0,0 2)),((2 3,1 3,1 4,2 4,2 3)))" +}; + +static std::string case_75_multi[2] = +{ + // cc/uu turns on all corners of second box + "MULTIPOLYGON(((1 1,1 2,2 2,2 1,1 1)),((1 3,1 4,2 4,2 3,1 3)),((2 2,2 3,3 3,3 2,2 2)),((3 1,3 2,4 2,4 1,3 1)),((3 3,3 4,4 4,4 3,3 3)))", + "MULTIPOLYGON(((2 2,2 3,3 3,3 2,2 2)))" +}; + +static std::string case_76_multi[2] = +{ + // cc/uu turns on all corners of second box, might generate TWO OVERLAPPING union polygons! + // therefore, don't follow uu. + "MULTIPOLYGON(((1 0,1 1,2 1,2 0,1 0)),((3 2,4 2,4 1,3 1,3 2)),((2 2,2 3,3 3,3 2,2 2)),((2 3,1 3,1 4,2 4,2 3)),((3 3,3 4,4 4,4 3,3 3)))", + "MULTIPOLYGON(((0 2,0 3,1 3,1 2,2 2,2 0,1 0,1 1,0 1,0 2)),((2 2,2 3,3 3,3 2,2 2)))" +}; + +static std::string case_77_multi[2] = +{ + // with a point on interior-ring-border of enclosing + // -> went wrong in the assemble phase for intersection (traversal is OK) + // -> fixed + "MULTIPOLYGON(((3 3,3 4,4 4,4 3,3 3)),((5 3,5 4,4 4,4 5,3 5,3 6,5 6,5 5,7 5,7 6,8 6,8 5,9 5,9 2,8 2,8 1,7 1,7 2,5 2,5 3),(6 3,8 3,8 4,6 4,6 3)))", + "MULTIPOLYGON(((6 3,6 4,7 4,7 3,6 3)),((2 3,1 3,1 4,3 4,3 5,4 5,4 6,5 6,5 7,9 7,9 4,7 4,7 5,8 5,8 6,7 6,7 5,6 5,6 4,4 4,4 3,3 3,3 2,2 2,2 3)),((5 2,4 2,4 3,6 3,6 2,5 2)),((7 2,7 3,8 3,8 2,8 1,7 1,7 2)))" +}; + +static std::string case_78_multi[2] = +{ + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0),(2 2,4 2,4 3,2 3,2 2)))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0),(3 2,4 2,4 3,3 3,3 2),(1 1,2 1,2 2,1 2,1 1)))" + +}; + +static std::string case_80_multi[2] = +{ + // Many ux-clusters -> needs correct cluster-sorting + // Fixed now + "MULTIPOLYGON(((3 1,3 2,4 2,3 1)),((1 5,0 4,0 5,1 6,1 5)),((3 3,4 3,3 2,2 2,2 3,3 3)),((4 5,5 6,5 5,4 5)),((4 2,4 3,5 3,4 2)),((2.5 5.5,3 5,2 5,2 7,3 6,2.5 5.5)),((1 6,0 6,0 7,1 7,2 6,1 6)))", + "MULTIPOLYGON(((3 5,3 6,4 6,4 5,3 5)),((4 4,5 5,5 4,4 4)),((3 3,4 4,4 3,3 3)),((1 5,1 6,2 6,2 5,1 5)),((0 6,1 7,1 6,0 6)),((1 4,1 3,0 3,0 4,1 4)),((3 5,4 4,3 4,3 3,2 3,2 5,3 5)))" +}; + +static std::string case_81_multi[2] = +{ + "MULTIPOLYGON(((1 1,2 2,2 1,1 1)),((2 2,2 3,3 2,2 2)),((3 1,4 2,4 1,3 1)))", + "MULTIPOLYGON(((2 1,2 2,3 3,3 2,4 2,3 1,2 1)))" +}; + +static std::string case_82_multi[2] = +{ + "MULTIPOLYGON(((4 0,5 1,5 0,4 0)),((2 1,3 2,3 1,2 1)),((3 0,4 1,4 0,3 0)),((1 0,1 1,2 1,2 0,1 0)))", + "MULTIPOLYGON(((3 2,4 3,4 2,3 2)),((3 1,3 2,4 1,3 1)),((0 0,1 1,1 0,0 0)),((5 1,5 0,4 0,4 1,5 1)))" +}; + +static std::string case_83_multi[2] = +{ + // iu/iu + "MULTIPOLYGON(((1 0,1 1,2 1,1 0)),((0 1,0 4,1 4,1 1,0 1)),((2 1,2 2,3 2,3 1,2 1)),((2 3,3 4,3 3,2 3)))", + "MULTIPOLYGON(((1 0,2 1,2 0,1 0)),((0 3,1 4,1 3,0 3)),((2 3,2 4,3 3,2 3)),((1 3,2 3,2 2,0 2,1 3)))" +}; + +static std::string case_84_multi[2] = +{ + // iu/ux + "MULTIPOLYGON(((2 2,3 3,3 2,2 2)),((2 1,2 2,3 1,2 1)),((2 3,3 4,3 3,2 3)),((1 3,2 4,2 2,1 2,1 3)))", + "MULTIPOLYGON(((2 3,3 3,3 1,2 1,2 2,1 2,1 3,2 3)))" +}; + +static std::string case_85_multi[2] = +{ + // iu/ux (and ux/ux) + "MULTIPOLYGON(((0 1,0 2,1 2,0 1)),((1 1,1 2,2 1,1 1)),((0 3,1 3,0 2,0 3)))", + "MULTIPOLYGON(((1 3,2 3,2 1,1 1,1 2,0 2,1 3)))" +}; + +static std::string case_86_multi[2] = +{ + // iu/ux + "MULTIPOLYGON(((4 2,4 3,5 3,4 2)),((5 2,6 3,6 2,5 2)),((5 1,4 1,4 2,5 2,6 1,5 1)))", + "MULTIPOLYGON(((5 1,5 2,6 2,6 1,5 1)),((4 2,5 3,5 2,4 2)),((3 2,4 3,4 2,3 2)))" +}; + +static std::string case_87_multi[2] = +{ + // iu/ux where iu crosses, no touch + "MULTIPOLYGON(((5 0,5 1,6 0,5 0)),((6 2,7 3,7 2,6 2)),((5 1,5 3,6 3,6 1,5 1)))", + "MULTIPOLYGON(((5 1,5 2,7 2,7 1,6 1,6 0,5 0,5 1)),((4 3,5 3,5 2,3 2,4 3)))" +}; + + +static std::string case_88_multi[2] = +{ + "MULTIPOLYGON(((0 0,0 1,1 0,0 0)),((1 1,1 2,2 1,1 1)),((0 2,0 3,1 3,2 3,2 2,1 2,0 1,0 2)))", + "MULTIPOLYGON(((0 0,0 1,1 0,0 0)),((0 1,1 2,1 1,0 1)),((0 2,0 3,1 3,1 2,0 2)))" +}; + +static std::string case_89_multi[2] = +{ + // Extract from rec.boxes_3 + "MULTIPOLYGON(((8 1,7 1,8 2,8 3,9 4,9 2,8.5 1.5,9 1,8 0,8 1)),((9 1,9 2,10 2,10 1,9 0,9 1)))", + "MULTIPOLYGON(((8 3,9 4,9 3,8 3)),((7 0,7 1,8 1,8 0,7 0)),((9 2,9 1,8 1,8 3,8.5 2.5,9 3,9 2)))" +}; + +static std::string case_90_multi[2] = +{ + // iu/iu for Union; see ppt + "MULTIPOLYGON(((1 8,0 8,0 10,1 10,1 9,2 8,2 7,1 7,1 8)),((2 9,2 10,4 10,4 9,3 9,3 8,2 8,2 9)))", + "MULTIPOLYGON(((2 8,1 8,1 9,2 9,2 10,3 10,3 8,2 8)),((0 10,2 10,0 8,0 10)))" +}; + +static std::string case_91_multi[2] = +{ + // iu/xi for Intersection + "MULTIPOLYGON(((3 3,3 4,4 4,3 3)),((2 2,1 2,1 4,2 4,2 3,3 3,2 2)))", + "MULTIPOLYGON(((2 2,2 3,3 2,2 2)),((2 3,1 3,1 4,1.5 3.5,2 4,2.5 3.5,3 4,3 3,2 3)))" +}; + +static std::string case_92_multi[2] = +{ + // iu/iu all aligned (for union) + "MULTIPOLYGON(((7 2,7 3,8 2,7 2)),((8 4,9 5,9 4,8 4)),((8 2,8 3,9 2,8 2)),((7 3,7 4,8 4,8 3,7 3)),((9 3,9 4,10 4,10 3,9 3)))", + "MULTIPOLYGON(((9 2,8 2,8 3,9 3,10 2,9 2)),((7 5,8 5,9 6,9 4,8 4,7 3,6 3,6 4,6.5 3.5,7 4,6 4,7 5)))" +}; + +static std::string case_93_multi[2] = +{ + // iu/xi for intersection + "MULTIPOLYGON(((6 2,7 2,7 1,5 1,6 2)),((7 3,8 3,7.5 2.5,8 2,7 2,7 3)))", + "MULTIPOLYGON(((7 1,6 0,6 2,7 3,7 2,8 3,8 2,7 1)))" +}; + + +static std::string case_94_multi[2] = +{ + // iu/iu for union + "MULTIPOLYGON(((9 2,9 3,10 3,10 2,9 2)),((7 3,8 4,9 3,8 3,9 2,7 2,7 3)),((8 6,9 5,9 4,8 4,8 6)))", + "MULTIPOLYGON(((6 2,6 3,7 3,8 2,6 2)),((9 3,10 3,9 2,9 1,8 0,7 0,8 1,8 3,8.5 2.5,9 3)),((7 4,7 5,8 5,9 6,9 4,8 4,8 3,7 3,7 4)))" +}; + +static std::string case_95_multi[2] = +{ + // iu/iu for union + "MULTIPOLYGON(((0 8,1 8,1 7,0 7,0 8)),((2 8,2 9,2.5 8.5,3 9,3 7,2 7,2 8)),((1 9,1 10,2 9,1 8,1 9)))", + "MULTIPOLYGON(((1 7,0 7,0 8,1 8,2 7,1 7)),((2 9,1 9,1 10,2 10,3 9,4 9,4 8,2 8,2 9)))" +}; + +static std::string case_96_multi[2] = +{ + // iu/iu all collinear, for intersection/union + "MULTIPOLYGON(((8 2,9 3,9 2,8 2)),((8 1,9 2,9 1,10 1,10 0,8 0,8 1)))", + "MULTIPOLYGON(((9 0,9 1,10 0,9 0)),((8 1,8 2,9 2,9 1,8 1)))" +}; + +static std::string case_97_multi[2] = +{ + // ux/ux for union + "MULTIPOLYGON(((4 4,4 5,4.5 4.5,5 5,6 5,5 4,5 3,4 3,4 4)))", + "MULTIPOLYGON(((5 3,5 4,6 3,5 3)),((6 5,7 5,6 4,5 4,6 5)))" +}; + + +static std::string case_98_multi[2] = +{ + // ii/iu for intersection, solved by discarding iu (ordering not possible) + "MULTIPOLYGON(((2 0,3 1,3 0,2 0)),((2 2,2 3,1 3,1 4,2 4,3 3,3 4,5 2,4 2,4 1,3 1,3 2,2.5 1.5,3 1,2 1,2 2)))", + "MULTIPOLYGON(((4 2,4 3,5 2,4 2)),((1 0,0 0,0 2,4 2,4 1,2 1,2 0,1 0)),((3 3,4 4,4 3,3 2,3 3)))" +}; + +static std::string case_99_multi[2] = +{ + // iu/iu for intersection + "MULTIPOLYGON(((1 0,2 1,2 0,1 0)),((1 2,2 2,1.5 1.5,2 1,1 1,1 0,0 0,0 1,1 2)))", + "MULTIPOLYGON(((1 1,2 0,0 0,1 1)),((1 1,0 1,0 2,1 2,2 3,2 2,1 1)))" +}; + +static std::string case_100_multi[2] = +{ + // for intersection + "MULTIPOLYGON(((0 0,0 1,1 0,0 0)),((2 2,2 1,0 1,0 2,1 2,2 3,2 2)))", + "MULTIPOLYGON(((1 1,1 2,2 2,2 1,1 1)),((1 2,0 1,0 3,1 4,1 2)))" +}; + +static std::string case_101_multi[4] = +{ + // interior ring / union + "MULTIPOLYGON(((7 2,7 3,8 2,7 2)),((9 3,9 4,10 3,9 3)),((10 1,10 0,8 0,8 1,9 2,10 2,10 1)),((9 3,9 2,8 2,8 3,7 3,7 4,8 4,9 3)),((8 4,8 7,9 6,9 4,8 4)))", + "MULTIPOLYGON(((5 1,5 2,6 3,6 4,7 5,6 5,7 6,8 6,8 5,9 5,10 5,10 1,8 1,7 0,5 0,5 1),(9 5,8 4,9 4,9 5),(8 1,8 3,7 3,7 2,6 2,7 1,8 1),(5 1,5.5 0.5,6 1,5 1),(8.5 2.5,9 2,9 3,8.5 2.5)))", + + // inverse versions + "MULTIPOLYGON(((4 -1,4 8,11 8,11 -1,4 -1),(7 2,8 2,7 3,7 2),(9 3,10 3,9 4,9 3),(10 1,10 2,9 2,8 1,8 0,10 0,10 1),(9 3,8 4,7 4,7 3,8 3,8 2,9 2,9 3),(8 4,9 4,9 6,8 7,8 4)))", + "MULTIPOLYGON(((4 -1,4 8,11 8,11 -1,4 -1),(5 1,5 0,7 0,8 1,10 1,10 5,9 5,8 5,8 6,7 6,6 5,7 5,6 4,6 3,5 2,5 1)),((9 5,9 4,8 4,9 5)),((8 1,7 1,6 2,7 2,7 3,8 3,8 1)),((5 1,6 1,5.5 0.5,5 1)),((8.5 2.5,9 3,9 2,8.5 2.5)))" +}; + +static std::string case_102_multi[4] = +{ + // interior ring 'fit' / union + "MULTIPOLYGON(((0 2,0 7,5 7,5 2,0 2),(4 3,4 6,1 6,2 5,1 5,1 4,3 4,4 3)),((3 4,3 5,4 5,3 4)),((2 5,3 6,3 5,2 4,2 5)))", + "MULTIPOLYGON(((0 2,0 7,5 7,5 2,0 2),(2 4,3 5,2 5,2 4),(4 4,3 4,3 3,4 4),(4 5,4 6,3 6,4 5)))", + + // inverse versions (first was already having an interior, so outer ring is just removed + "MULTIPOLYGON(((4 3,3 4,1 4,1 5,2 5,1 6,4 6,4 3),(3 4,4 5,3 5,3 4),(2 5,2 4,3 5,3 6,2 5)))", + "MULTIPOLYGON(((-1 1,-1 8,6 8,6 1,-1 1),(0 2,5 2,5 7,0 7,0 2)),((2 4,2 5,3 5,2 4)),((4 4,3 3,3 4,4 4)),((4 5,3 6,4 6,4 5)))" +}; + +static std::string case_103_multi[2] = +{ + // interior ring 'fit' (ix) / union / assemble + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,2 0,2 1,1 0,0 0),(2 1,3 1,3 2,2 2,2 1),(2 2,2 3,1 2,2 2)))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0),(2 1,2 2,1 1,2 1)))" +}; + +static std::string case_104_multi[2] = +{ + // interior ring 'fit' (ii) / union / assemble + "MULTIPOLYGON(((1 0,1 1,0 1,0 5,5 5,5 0,2 0,2 1,1 0),(2 2,3 3,2 3,2 2)))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0),(1 1,3 1,3 2,1 2,1 1)))" +}; + +static std::string case_105_multi[2] = +{ + // interior ring 'fit' () / union / assemble + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0),(2 2,3 2,3 3,1 3,2 2)))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0),(1 1,2 1,2 2,1 1),(2 1,3 1,3 2,2 1),(1 3,2 3,2 4,1 4,1 3),(2 3,3 3,3 4,2 3)))" +}; + +static std::string case_106_multi[2] = +{ + // interior ring 'fit' () / union / assemble + // [1] is reported as invalid by BG, but not by postgis + "MULTIPOLYGON(((0 0,0 3,0 5,5 5,5 0,0 0),(0 3,1 2,1 3,0 3),(1 3,2 3,3 4,1 4,1 3),(2 3,2 2,3 3,2 3),(2 2,2 1,3 2,2 2)))", + "MULTIPOLYGON(((0 0,0 5,1 5,1 4,2 4,2 5,3 5,3 3,4 4,5 4,5 0,2 0,3 1,2 1,1 1,0 0),(2 1,2 2,1.5 1.5,2 1),(2 2,2 3,1 3,2 2)),((2 0,1 0,2 1,2 0)))" +}; + +static std::string case_107_multi[4] = +{ + // For CCW polygon reports a iu/iu problem. + "MULTIPOLYGON(((6 8,7 9,7 7,8 7,7 6,6 6,6 8)),((6.5 9.5,7 10,7 9,6 9,6 10,6.5 9.5)))", + "MULTIPOLYGON(((5 7,6 8,6 10,7 9,8 10,8 8,7 8,6 7,6 6,5 7)))", + + // inverse versions + "MULTIPOLYGON(((5 5,5 11,9 11,9 5,5 5),(6 8,6 6,7 6,8 7,7 7,7 9,6 8),(6.5 9.5,6 10,6 9,7 9,7 10,6.5 9.5)))", + "MULTIPOLYGON(((4 5,4 11,9 11,9 5,4 5),(5 7,6 6,6 7,7 8,8 8,8 10,7 9,6 10,6 8,5 7)))" +}; + +static std::string case_108_multi[2] = +{ + // Missing intersection point in [0] / [1], [0] / [2] is OK + "MULTIPOLYGON(((1 2,0 1,0 6,1 6,2 5,2 4,3 4,4 4,4 2,4 1,1 1,1 2),(1 2,2 2,3 3,1 3,1 2),(2 2,2.5 1.5,3 2,2 2),(2 4,1 4,1.5 3.5,2 4)))", + "MULTIPOLYGON(((1 2,2 3,2 4,1 3,1 4,1 5,2 6,3 6,3 5,5 5,5 0,4 0,4 1,1 1,1 2),(2 4,2.5 3.5,3 4,2 4),(3 4,4 3,4 4,3 4),(4 3,3 3,3 2,4 2,4 3)),((0 3,1 3,1 2,0 2,0 3)),((0 3,0 4,1 4,0 3)))" +}; + +static std::string case_109_multi[2] = + { + "MULTIPOLYGON(((0 0,0 40,40 40,40 0,0 0),(10 10,30 10,30 30,10 30,10 10)))", + "MULTIPOLYGON(((10 10,10 20,20 10,10 10)),((20 10,30 20,30 10,20 10)),((10 20,10 30,20 20,10 20)),((20 20,30 30,30 20,20 20)))" + }; + +static std::string case_110_multi[2] = + { + "MULTIPOLYGON(((0 0,0 40,40 40,40 0,0 0),(10 10,30 10,30 30,10 30,10 10)))", + "MULTIPOLYGON(((15 10,10 15,10 17,15 10)),((15 10,10 20,10 22,15 10)),((15 10,10 25,10 27,15 10)),((25 10,30 17,30 15,25 10)),((25 10,30 22,30 20,25 10)),((25 10,30 27,30 25,25 10)),((18 10,20 30,19 10,18 10)),((21 10,20 30,22 10,21 10)))" + }; + + +// Cases 111 to 122 are for testing uu-cases, validity, touch, interior rings +static std::string case_111_multi[2] = +{ + "MULTIPOLYGON(((4 0,2 2,4 4,6 2,4 0)))", + "MULTIPOLYGON(((4 4,2 6,4 8,6 6,4 4)))" +}; + +static std::string case_112_multi[2] = +{ + "MULTIPOLYGON(((0 0,0 2,2 4,4 2,6 4,8 2,8 0,0 0)))", + "MULTIPOLYGON(((0 8,8 8,8 6,6 4,4 6,2 4,0 6,0 8)))" +}; + +// Provided by Menelaos (1) +static std::string case_113_multi[2] = +{ + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((15 5,15 10,20 10,20 5,15 5)))", + "MULTIPOLYGON(((10 0,15 5,15 0,10 0)),((10 5,10 10,15 10,15 5,10 5)))" +}; + +// Provided by Menelaos (2) +static std::string case_114_multi[2] = +{ + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((15 5,15 10,20 10,20 5,15 5)))", + "MULTIPOLYGON(((10 0,15 5,20 5,20 0,10 0)),((10 5,10 10,15 10,15 5,10 5)))" +}; + +// Mailed by Barend +static std::string case_115_multi[2] = +{ + "MULTIPOLYGON(((4 0,2 2,4 4,6 2,4 0)),((4 6,6 8,8 6,6 4,4 6)))", + "MULTIPOLYGON(((4 4,2 6,4 8,6 6,4 4)),((4 2,7 6,8 3,4 2)))" +}; + +// Formerly referred to as a +// Should result in 1 polygon with 2 holes +// "POLYGON((4 9,4 10,6 10,6 12,8 12,8 11,10 11,10 9,11 9,11 2,3 2,3 9,4 9),(6 10,6 8,7 8,7 10,6 10),(6 8,5 8,5 3,9 3,9 7,8 7,8 6,6 6,6 8))" +static std::string case_116_multi[2] = +{ + "MULTIPOLYGON(((4 8,4 10,6 10,6 8,4 8)),((7 7,7 11,10 11,10 7,7 7)))", + "MULTIPOLYGON(((6 6,6 8,8 8,8 6,6 6)),((6 10,6 12,8 12,8 10,6 10)),((9 9,11 9,11 2,3 2,3 9,5 9,5 3,9 3,9 9)))" +}; + +// Formerly referred to as b +// Should result in 2 polygons +// "MULTIPOLYGON(((4 8,4 10,6 10,6 8,4 8)),((7 8,7 10,6 10,6 12,8 12,8 11,10 11,10 7,8 7,8 6,6 6,6 8,7 8)))" +static std::string case_117_multi[2] = +{ + "MULTIPOLYGON(((4 8,4 10,6 10,6 8,4 8)),((7 7,7 11,10 11,10 7,7 7)))", + "MULTIPOLYGON(((6 6,6 8,8 8,8 6,6 6)),((6 10,6 12,8 12,8 10,6 10)))" +}; + +// Formerly referred to as c +// Shoud result in 3 polygons: +// "MULTIPOLYGON(((4 8,4 10,6 10,6 8,4 8)),((8 8,8 10,10 10,10 8,8 8)),((7 12,7 13,13 13,13 5,7 5,7 6,6 6,6 8,8 8,8 7,11 7,11 11,8 11,8 10,6 10,6 12,7 12)))" +static std::string case_118_multi[2] = +{ + "MULTIPOLYGON(((4 8,4 10,6 10,6 8,4 8)),((8 8,8 10,10 10,10 8,8 8)),((7 11,7 13,13 13,13 5,7 5,7 7,11 7,11 11,7 11)))", + "MULTIPOLYGON(((6 6,6 8,8 8,8 6,6 6)),((6 10,6 12,8 12,8 10,6 10)))" +}; + +// Formerly referred to as d +// Should result in 2 polygons: +// "MULTIPOLYGON(((2 4,2 6,3 6,3 7,7 7,7 6,8 6,8 4,6 4,6 5,4 5,4 4,2 4)),((1 0,1 2,0 2,0 4,2 4,2 3,8 3,8 4,10 4,10 2,9 2,9 0,1 0)))" +static std::string case_119_multi[2] = +{ + "MULTIPOLYGON(((2 4,2 6,4 6,4 4,2 4)),((6 4,6 6,8 6,8 4,6 4)),((1 0,1 3,9 3,9 0,1 0)))", + "MULTIPOLYGON(((0 2,0 4,2 4,2 2,0 2)),((8 2,8 4,10 4,10 2,8 2)),((3 5,3 7,7 7,7 5,3 5)))" +}; + +// With a c/c turn +static std::string case_120_multi[2] = +{ + "MULTIPOLYGON(((6 4,6 9,9 9,9 6,11 6,11 4,6 4)),((10 7,10 10,12 10,12 7,10 7)))", + "MULTIPOLYGON(((10 5,10 8,12 8,12 5,10 5)),((6 10,8 12,10 10,8 8,6 10)))" +}; + +// With c/c turns in both involved polygons +static std::string case_121_multi[2] = +{ + "MULTIPOLYGON(((7 4,7 8,9 8,9 6,11 6,11 4,7 4)),((10 7,10 10,12 10,12 7,10 7)))", + "MULTIPOLYGON(((10 5,10 8,12 8,12 5,10 5)),((7 7,7 10,10 10,9 9,9 7,7 7)))" +}; + +// Same but here c/c not directly involved in the turns itself +// (This one breaks if continue is not checked in handle_touch) +static std::string case_122_multi[2] = +{ + "MULTIPOLYGON(((10 8,10 10,12 10,12 8,10 8)),((10 4,10 7,12 7,12 4,10 4)),((7 5,7 8,9 8,9 5,7 5)))", + "MULTIPOLYGON(((7 3,7 6,9 6,9 5,11 5,11 3,7 3)),((10 6,10 9,12 9,12 6,10 6)),((7 7,7 10,10 10,9 9,9 7,7 7)))" +}; + +static std::string case_123_multi[2] = +{ + // Intersection: one cluster with 3 zones, intersection -> no holes + "MULTIPOLYGON(((1 0,1 1,1.5 0.5,2 0.5,2 0,1 0)),((0 1,1 2,2 2,2 1,0 1)))", + "MULTIPOLYGON(((1 0,1 2,2 2,2 0,1 0)),((0 1,0 2,1 1,0 1)))" +}; + +static std::string case_124_multi[2] = +{ + // Intersection: one cluster with 3 zones, intersection -> one hole + "MULTIPOLYGON(((1 0,1 1,0 1,1 2,2 2,2 0,1 0),(1.5 0.5,1.75 1,1 1,1.5 0.5)))", + "MULTIPOLYGON(((1 0,1 2,2 2,2 0,1 0)),((0 1,0 2,1 1,0 1)))" +}; + +static std::string case_125_multi[2] = +{ + // Intersection: one cluster with 3 zones, intersection -> one hole (filled with other polygon) + "MULTIPOLYGON(((1 0,1 1,0 1,1 2,2 2,2 0,1 0),(1.5 0.5,1.75 1,1 1,1.5 0.5)),((1 1,1.5 0.9,1.25 0.8,1 1)))", + "MULTIPOLYGON(((1 0,1 2,2 2,2 0,1 0)),((0 1,0 2,1 1,0 1)))" +}; + +static std::string case_126_multi[2] = +{ + // Intersection: should result in multi-polygon of 5 (needs self-intersections) + "MULTIPOLYGON(((5 5,5 10,10 10,10 5,5 5),(9 8,7 9,5 8,7 7,9 8)),((3 3,3 5,5 5,5 3,3 3)))", + "MULTIPOLYGON(((0 3,6 3,6 9,0 9,0 3),(2 6,4 7,6 6,4 5,2 6)),((6 9,6 11,8 11,8 9,6 9)))" +}; + +static std::string case_127_multi[2] = +{ + // Intersection/validity with ii at (4 4), and both have self intersections at (5 5) + "MULTIPOLYGON(((0 0,0 5,3 5,3 4,4 4,4 5,5 5,5 0,0 0)),((5 5,5 6,6 6,6 5,5 5)))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 4,4 4,4 3,5 3,5 0,0 0)),((5 5,5 7,7 7,7 5,5 5)))" +}; + +static std::string case_128_multi[2] = +{ + // Contains isolated areas of two types + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 8,6 7,8 8,6 9,4 8),(1 2,2 0,3 2,2 4,1 2)))", + "MULTIPOLYGON(((0 0,0 10,11 10,11 0,0 0),(2 9,0 8,2 7,4 8,2 9),(5 5,5 0,10 5,5 5)))" +}; + +static std::string case_129_multi[2] = +{ + // Extract from rec.box #6 + "MULTIPOLYGON(((0 0,0 5,5 5,5 4,4 4,4 2,5 1,5 0,0 0),(3 4,3 3,4 4,3 4),(2 1,3 2,3 3,2 2,2 1)))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0),(4 4,4 3,5 4,4 4),(2 1,3 1,3 3,2 2,2 1)))" +}; + +static std::string case_130_multi[2] = +{ + // For validity + "MULTIPOLYGON(((0 0,0 7,7 7,7 0,0 0),(1 4,2 3,3 4,2 5,1 4),(5 4,6 3,7 4,6 5,5 4),(3 6,4 5,5 6,4 7,3 6)))", + "MULTIPOLYGON(((0 0,0 7,7 7,7 0,0 0),(4 3,5 4,4 5,3 4,4 3),(1 2,2 1,3 2,2 3,1 2)))" +}; + +static std::string case_131_multi[2] = +{ + // For validity, interior ring connections + "MULTIPOLYGON(((1 2,1 3,2 3,2 2,1 2)),((2 1,2 2,3 2,3 1,2 1)))", + "MULTIPOLYGON(((0 0,0 4,4 4,4 0,0 0),(3 3,1 3,1 1,3 1,3 3)))" +}; + +static std::string case_132_multi[2] = +{ + // For validity, interior ring connections including cluster + "MULTIPOLYGON(((2 4,2 6,4 6,4 4,2 4)),((4 2,4 4,6 4,6 2,4 2)))", + "MULTIPOLYGON(((0 0,0 8,8 8,8 0,0 0),(6 6,2 6,2 2,6 2,6 6)),((2 2,2.5 3.5,4 4,3.5 2.5,2 2)),((4 4,4.5 5.5,6 6,5.5 4.5,4 4)))" +}; + +static std::string case_133_multi[2] = +{ + // Zoomed in version of case_recursive_boxes_49 with in both interiors an extra polygon (same for both) + "MULTIPOLYGON(((0 0,0 4,2 4,2 6,4 6,4 8,10 8,10 4,8 4,8 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((5 4.5,4 6,5.5 5, 5 4.5)))", + "MULTIPOLYGON(((2 0,2 8,8 8,8 6,10 6,10 2,6 2,6 0,2 0),(6 6,6 4,4 4,4 6,6 6)),((5 4.5,4 6,5.5 5, 5 4.5)))" +}; + +static std::string case_134_multi[2] = +{ + // Zoomed in version of case_recursive_boxes_49 with two interior rings + "MULTIPOLYGON(((0 0,0 4,2 4,2 6,4 6,4 8,10 8,10 4,8 4,8 0,0 0),(3 4,4 6,4 4,3 4),(6 6,4 6,6 7,6 6)))", + "MULTIPOLYGON(((2 0,2 8,8 8,8 6,10 6,10 2,6 2,6 0,2 0),(3 4,4 6,4 4,3 4),(6 6,4 6,6 7,6 6)))" +}; + +static std::string case_135_multi[2] = +{ + // Contains two equal interior rings, both touching to their exterior rings + // Needs detection of isolated interior ring pattern + "MULTIPOLYGON(((5 8,4 8,4 7,3 7,3 6,2 6,2 7,1 7,1 10,3 10,3 9,5 9,5 8),(3 8,3 9,2 9,2 8,3 8)))", + "MULTIPOLYGON(((5 4,4 4,3 4,3 7,1 7,1 8,0 8,0 9,1 9,1 10,3 10,3 9,4 9,4 8,6 8,6 9,7 9,7 5,6 5,6 4,5 4),(5 5,5 6,6 6,6 7,4 7,4 5,5 5),(3 8,3 9,2 9,2 8,3 8)))" +}; + +static std::string case_136_multi[2] = +{ + // Variant of 135, but approaching cluster is non equal + "MULTIPOLYGON(((5 8,4 8,4 7,3 7,3 6,2 6,2 7,1 7,1 10,2 10,3 9,5 9,5 8),(3 8,3 9,2 9,2 8,3 8)))", + "MULTIPOLYGON(((5 4,4 4,3 4,3 7,1 7,1 8,0 8,0 9,1 9,1 10,3 10,3 9,4 9,4 8,6 8,6 9,7 9,7 5,6 5,6 4,5 4),(5 5,5 6,6 6,6 7,4 7,4 5,5 5),(3 8,3 9,2 9,2 8,3 8)))" +}; + +static std::string case_137_multi[2] = +{ + // Variant of 135, but leaving cluster is non equal + "MULTIPOLYGON(((5 8,4 8,4 7,3 7,3 6,2 6,2 7,1 7,1 10,3 10,3 9,5 9,5 8),(3 8,3 9,2 9,2 8,3 8)))", + "MULTIPOLYGON(((5 4,4 4,3 4,3 7,1 7,1 8,0 8,0 9,1 9,1 10,3 10,3 9,4 8,6 8,6 9,7 9,7 5,6 5,6 4,5 4),(5 5,5 6,6 6,6 7,4 7,4 5,5 5),(3 8,3 9,2 9,2 8,3 8)))" +}; + +static std::string case_138_multi[2] = +{ + // Zoomed in version of case_recursive_boxes_49 with in both interiors an extra polygon (different for both) + "MULTIPOLYGON(((0 0,0 4,2 4,2 6,4 6,4 8,10 8,10 4,8 4,8 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((4.5 4.5,4 6,5.5 5.5,4.5 4.5)))", + "MULTIPOLYGON(((2 0,2 8,8 8,8 6,10 6,10 2,6 2,6 0,2 0),(6 6,6 4,4 4,4 6,6 6)),((5 4.5,4 6,5.5 5, 5 4.5)))" +}; + +static std::string case_139_multi[2] = +{ + // Another zoomed in version of case_recursive_boxes_49 with different interior polygons + "MULTIPOLYGON(((0 0,0 4,2 4,2 6,4 6,4 8,10 8,10 4,8 4,8 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((4.5 4.5,4 6,5.5 5,4.5 4.5)))", + "MULTIPOLYGON(((2 0,2 8,8 8,8 6,10 6,10 2,6 2,6 0,2 0),(6 6,6 4,4 4,4 6,6 6)),((5 4.5,4 6,5.5 5, 5 4.5)))" +}; + +static std::string case_140_multi[2] = +{ + // Another zoomed in version of case_recursive_boxes_49 with different interior polygons + "MULTIPOLYGON(((0 0,0 4,2 4,2 6,4 6,4 8,10 8,10 4,8 4,8 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((5 4.5,4 6,5.5 5.5,5 4.5)))", + "MULTIPOLYGON(((2 0,2 8,8 8,8 6,10 6,10 2,6 2,6 0,2 0),(6 6,6 4,4 4,4 6,6 6)),((5 4.5,4 6,5.5 5, 5 4.5)))" +}; + +static std::string case_141_multi[2] = +{ + // Version to test more isolation/validity cases + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(2 3,1 2,2 1,3 2,2 3),(2 7,3 8,2 9,1 8,2 7),(10 3,9 4,8 3,9 2,10 3),(7 10,6 9,7 8,8 9,7 10),(10 7,9 8,8 7,9 6,10 7)))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(0 5,2 3,4 5,2 7),(3 2,4 1,5 2,4 3,3 2),(3 8,4 7,5 8,4 9,3 8),(7 2,8 1,9 2,8 2,8 3,7 2),(8 7,7 8,6 7,7 6,8 7)))" +}; + +static std::string case_recursive_boxes_1[2] = +{ + "MULTIPOLYGON(((1 0,0 0,0 1,1 1,1 2,0 2,0 4,2 4,2 5,3 5,3 6,1 6,1 5,0 5,0 10,9 10,9 9,7 9,7 8,6 8,6 7,8 7,8 6,9 6,9 4,8 4,8 3,10 3,10 0,6 0,6 1,5 1,5 0,1 0),(8 4,8 5,7 5,7 6,6 6,6 5,5 5,5 4,4 4,4 3,5 3,5 2,7 2,7 3,6 3,6 4,8 4),(8 1,9 1,9 2,8 2,8 1),(4 7,4 9,3 9,3 7,4 7)),((9 9,10 9,10 7,10 6,9 6,9 7,8 7,8 8,9 8,9 9)))", + "MULTIPOLYGON(((5 6,5 7,3 7,3 9,2 9,2 8,1 8,1 10,4 10,4 9,6 9,6 10,10 10,10 9,9 9,9 8,10 8,10 6,9 6,9 5,10 5,10 3,7 3,7 4,6 4,6 6,5 6),(5 7,6 7,6 8,5 8,5 7),(7 7,7 6,8 6,8 7,7 7)),((1 0,0 0,0 7,2 7,2 6,5 6,5 5,4 5,4 4,5 4,5 3,7 3,7 2,6 2,6 0,1 0),(2 1,2 2,3 2,3 3,1 3,1 1,2 1)),((7 2,10 2,10 0,9 0,9 1,8 1,8 0,7 0,7 2)))" +}; + +static std::string case_recursive_boxes_2[2] = +{ + // Traversal problem; Many ii-cases -> formerly caused "Endless loop" + // So it appears that there might be more decisions than intersection points + "MULTIPOLYGON(((1 0,0 0,0 4,1 4,1 5,0 5,0 10,3 10,3 9,4 9,4 10,6 10,6 9,7 9,7 10,10 10,10 0,1 0),(6 9,5 9,5 8,6 8,6 9),(7 6,8 6,8 7,7 7,7 6),(8 7,9 7,9 8,8 8,8 7),(9 1,9 2,8 2,8 1,9 1)))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,8 0,8 1,7 1,7 0,0 0),(7 3,6 3,6 2,7 2,7 3),(6 7,7 7,7 8,6 8,6 7)))" +}; + + +static std::string case_recursive_boxes_3[2] = +{ + // Previously a iu/ux problem causing union to fail. + // For CCW polygon it also reports a iu/iu problem. + "MULTIPOLYGON(((8 3,9 4,9 3,8 3)),((5 9,5 10,6 10,5 9)),((2 0,2 1,3 0,2 0)),((2 5,2 6,3 6,3 5,2 5)),((2 2,1 2,1 3,2 3,3 2,3 1,2 1,2 2)),((6 8,7 9,7 7,8 7,7 6,6 6,6 8)),((4 6,5 7,5 6,4 6)),((4 8,4 9,5 9,5 8,4 8)),((0 3,1 4,1 3,0 3)),((8 7,9 8,9 7,8 7)),((9 6,9 7,10 7,9 6)),((7 0,8 1,8 0,7 0)),((0 4,0 5,1 5,1 4,0 4)),((4 2,5 3,5 2,4 1,4 2)),((4 10,4 9,2 9,3 10,4 10)),((5 2,6 3,7 3,7 2,6 2,6 1,5 0,5 2)),((5 3,4 3,4 4,2 4,4 6,4 5,4.5 4.5,6 6,6 5,7 4,5 4,5 3)),((10 2,9 1,9 3,10 2)),((8 4,7 4,8 5,7 5,7 6,9 6,9 5,10 5,10 4,8 4)),((1 7,0 7,0 8,1 8,1 7)),((1 10,2 10,1 9,0 9,0 10,1 10)),((6.5 9.5,7 10,7 9,6 9,6 10,6.5 9.5)),((8 8,8 9,10 9,9 8,8 8)))", + "MULTIPOLYGON(((7 3,7 4,8 5,8.5 4.5,9 5,9 4,10 3,8 3,7 3),(9 4,8 4,8.5 3.5,9 4)),((0 2,1 1,0 1,0 2)),((1 1,2 2,2 1,1 1)),((2 2,1 2,1 3,2 3,2 2)),((2 1,3 1,2 0,1 0,2 1)),((3 1,4 2,5 2,6 1,5 1,5 0,4 0,4 1,3 1)),((5 2,5 3,4 3,4 4,6 4,6 3,7 3,6 2,5 2)),((6 1,7 1,7 0,6 0,6 1)),((6 4,6 5,7 6,8 6,8 5,7 5,6 4)),((8 3,9 2,8 2,8 3)),((9 2,10 2,10 1,9 1,9 2)),((9 1,9 0,8 0,9 1)),((1 3,0 3,0 4,1 4,1 3)),((2 3,3 4,3 3,2 3)),((9 7,9 8,10 8,10 7,9 7)),((0 7,0 8,1 8,1 7,0 7)),((1 8,1 9,2 8,1 8)),((1 7,3 7,3 8,4 7,5 7,6 8,6 10,7 9,8 10,9 10,9 9,8 9,8 8,7 8,6 7,6 6,3 6,1 6,1 7)),((1 6,1 5,0 5,1 6)),((3 6,4 5,2 5,3 6)),((1 9,1 10,2 10,2 9,1 9)))" +}; + + +static std::string case_recursive_boxes_4[2] = +{ + // Occurred after refactoring assemble + "MULTIPOLYGON(((0 1,0 3,1 4,0 4,0 5,1 6,0 6,0 8,1 9,0 9,0 10,6 10,7 10,7.5 9.5,8 10,8 9,9 9,9.5 8.5,10 9,10 8,9.5 7.5,10 7,10 5,9 5,9 3,10 2,10 1,9 1,10 0,4 0,4 1,3 1,3 0,1 0,1 1,0 0,0 1),(1 9,1 8,2 9,1 9),(2 9,2 8,3 9,2 9),(2 8,2 7,3 8,2 8),(2 7,1.5 6.5,2 6,2 7),(2 6,2.5 5.5,3 6,2 6),(3 6,3 5,4 6,3 6),(6 10,5.5 9.5,6 9,6 10),(8 9,7 9,7 8,8 8,8 9),(7 8,6 8,6.5 7.5,7 8),(9 5,8 5,8 4,9 5),(8 4,7 3,7 2,8 3,8 4),(9 1,8 1,8.5 0.5,9 1),(6 4,6.5 3.5,7 4,6 4),(4 2,4.5 1.5,5 2,5 3,4 3,4 2),(5 3,5 4,4.5 3.5,5 3),(5 7,5 9,4 9,4 8,5 7),(3 3,4 4,3 4,3 3),(3 4,2 4,2.5 3.5,3 4)),((9 3,10 4,10 3,9 3)),((10 9,9 9,10 10,10 9)))", + "MULTIPOLYGON(((1 0,0 0,0 3,1 3,1 4,0 4,0 8,1 7,1 9,0 9,0 10,7 10,6 9,6.5 8.5,7 9,8 9,9 8,8 8,9 7,9 6,10 7,10 5,10 0,7 0,8 1,7 1,6 0,3 0,3 1,2 1,1 1,1 0),(1 3,2 2,2 3,1 3),(1 4,2 4,2 5,1 4),(1 7,1 6,2 7,1 7),(10 5,9 5,9 4,10 5),(5 1,5.5 0.5,6 1,5 1),(6 1,6 2,5 2,6 1),(6 2,6.5 1.5,7 2,8 2,8 4,7 3,6 3,6 2),(6 5,7 6,7 7,6 7,6 5),(6 5,6.5 4.5,7 5,6 5),(4 4,5 4,5 5,4 4),(3 7,2 6,3 6,3 7),(3 7,4 6,4 7,3 7),(3.5 7.5,4 8,4 9,3 8,3.5 7.5)),((1 0,2 1,2 0,1 0)),((7 10,8 10,7 9,7 10)),((8 9,9 10,10 10,10 8,9 8,9 9,8 9)))" +}; + +static std::string case_recursive_boxes_5[2] = +{ + // Occurs after refactoring uu / handle_touch (not yet integrated) + "MULTIPOLYGON(((0 9,0 10,1 10,1 9,0 9)),((9 0,9 1,10 1,10 0,9 0)),((5 6,5 7,6 7,6 6,7 6,7 4,6 4,6 5,5 5,5 6)),((5 3,7 3,7 2,4 2,4 3,5 3)),((5 8,5 9,7 9,7 8,5 8)),((4 0,1 0,1 1,5 1,5 0,4 0)),((3 5,3 4,4 4,4 3,2 3,2 2,1 2,1 3,0 3,0 4,2 4,2 5,1 5,1 6,4 6,4 5,3 5)),((0 2,1 2,1 1,0 1,0 2)),((4 10,4 7,1 7,1 6,0 6,0 8,1 8,1 9,2 9,2 10,4 10)),((9 4,9 3,8 3,8 5,9 5,9 4)),((7 2,8 2,8 0,7 0,7 2)),((8 7,10 7,10 6,7 6,7 8,8 8,8 7)))", + "MULTIPOLYGON(((2 6,2 8,3 8,3 7,5 7,5 6,6 6,6 5,8 5,8 6,9 6,9 4,8 4,8 3,7 3,7 4,6 4,6 3,5 3,5 4,3 4,3 6,2 6),(5 6,4 6,4 5,5 5,5 6)),((1 1,2 1,2 0,1 0,1 1)),((2 1,2 2,3 2,3 1,2 1)),((2 2,1 2,1 3,2 3,2 2)),((1 3,0 3,0 5,1 5,1 4,1 3)),((1 5,1 6,2 6,2 5,1 5)),((2 8,0 8,0 10,3 10,4 10,4 9,2 9,2 8)),((8 6,7 6,7 7,8 7,8 6)),((8 7,8 10,9 10,9 9,10 9,10 8,9 8,9 7,8 7)),((9 7,10 7,10 6,9 6,9 7)),((9 4,10 4,10 3,10 1,9 1,9 2,8 2,8 3,9 3,9 4)),((8 2,8 1,7 1,7 2,8 2)),((8 1,9 1,9 0,8 0,8 1)),((7 1,7 0,5 0,3 0,3 1,4 1,4 2,6 2,6 1,7 1)),((6 2,6 3,7 3,7 2,6 2)),((3 4,3 3,2 3,2 4,3 4)),((6 8,6 9,7 9,7 8,6 8)))" +}; + +static std::string case_recursive_boxes_6[2] = +{ + // [1] is reported as invalid by BG, but not by postgis + // Fixed by replacing handle_tangencies + "MULTIPOLYGON(((0 3,1 3,1 4,2 4,2 5,5 5,5 0,2 0,0 0,0 3),(2 0,2 1,1 1,2 0),(2 1,2 2,1.5 1.5,2 1),(2 2,3 1,3 2,2 2),(3 2,3.5 1.5,4 2,3 2)),((0 3,0 5,1 5,2 5,1 4,0 3)))", + "MULTIPOLYGON(((1 2,2 3,1 3,1 4,0 4,0 5,5 5,5 2,4 2,3 2,3 1,2 1,2 2,1 2),(4 2,4 3,3 3,4 2)),((1 2,2 1,3 0,2 0,0 0,0 3,1 3,1 2)),((3 0,3 1,4 2,4 1,5 1,5 0,4 0,3 0)))" +}; + +static std::string case_recursive_boxes_7[2] = +{ + "MULTIPOLYGON(((3 1,3 2,4 2,4 1,3 1)),((2.5 2.5,3 3,3 2,2 2,2 3,2.5 2.5)),((2 1,3 0,1 0,1 2,2 2,2 1)))", + "MULTIPOLYGON(((0 0,1 1,1 0,0 0)),((0 1,0 2,1 2,0 1)),((3.5 2.5,4 3,4 2,3 2,3 3,3.5 2.5)),((3 2,4 1,1 1,1 2,3 2)))" +}; + +static std::string case_recursive_boxes_8[2] = +{ + // Having colocated IP halfway segment + "MULTIPOLYGON(((3 4,3 3,2 3,2 2,0 2,0 3,1 3,1 4,1.5 3.5,2 4,3 4)),((2 5,2 4,1 4,0 3,0 5,2 5)))", + "MULTIPOLYGON(((0 2,0 4,3 4,4 4,4 3,3 3,3 1,0 1,0 2),(0 2,1 2,1 3,0 2)))" +}; + +static std::string case_recursive_boxes_9[2] = +{ + // Needs ii turn skipping + "MULTIPOLYGON(((2 2,3 2,3 0,2 0,2 1,1 1,2 2)),((1 1,1 0,0 0,0 3,0.5 2.5,1 3,2 2,1 2,1 1)))", + "MULTIPOLYGON(((2 1,2 2,0 2,0 3,2 3,3 2,3 1,2 1)),((2.5 0.5,3 1,3 0,0 0,0 1,1 1,1 2,2.5 0.5)))" +}; + +static std::string case_recursive_boxes_10[4] = +{ + // Requires skipping ux for difference (a) and switching a->b + "MULTIPOLYGON(((2 2,2 3,3 2,2 2)),((2 2,3 1,1 1,1 2,2 2)))", + "MULTIPOLYGON(((3 2,2 1,2 3,3 3,3 2)))", + + // Inverse versions + "MULTIPOLYGON(((0 0,0 4,4 4,4 0,0 0),(2 2,3 2,2 3,2 2),(2 2,1 2,1 1,3 1,2 2)))", + "MULTIPOLYGON(((1 0,1 4,4 4,4 0,1 0),(3 2,3 3,2 3,2 1,3 2)))" +}; + +static std::string case_recursive_boxes_11[4] = +{ + // Requires switching a->b + "MULTIPOLYGON(((3 2,5 2,5 1,4 1,4 0,3 0,3 1,2 1,3 2)))", + "MULTIPOLYGON(((5 2,4 1,4 3,5 2)),((3 1,3 2,4 2,3 1)),((4 1,5 1,5 0,4 0,4 1)),((3 2,2 1,3 1,2 0,1 1,2 2,2 3,3 3,3 2)))", + + // Inverse versions + "MULTIPOLYGON(((0 -1,0 4,6 4,6 -1,0 -1),(3 2,2 1,3 1,3 0,4 0,4 1,5 1,5 2,3 2)))", + "MULTIPOLYGON(((0 -1,0 4,6 4,6 -1,0 -1),(5 2,4 3,4 1,5 2),(3 1,4 2,3 2,3 1),(4 1,4 0,5 0,5 1,4 1),(3 2,3 3,2 3,2 2,1 1,2 0,3 1,2 1,3 2)))" +}; + +static std::string case_recursive_boxes_12[2] = +{ + "MULTIPOLYGON(((0 3,1 3,0.5 2.5,1 2,0 2,0 3)),((1 2,2 2,2 1,1 1,1 2)),((2 1,3 2,3 1,2 1)),((2 2,2 3,3 3,2 2)),((0 0,0 1,1 0,0 0)))", + "MULTIPOLYGON(((0 1,0 2,1 2,0 1)),((0 1,1 1,1.5 0.5,2 1,2 0,0 0,0 1)),((1 3,1 4,2 3,1 2,1 3)))" +}; + +static std::string case_recursive_boxes_13[2] = +{ + "MULTIPOLYGON(((1 3,1 5,2 5,2 4,1.5 3.5,2 3,1 3)),((1 3,2 2,0 2,1 3)),((2 2,3 2,3 1,2 1,2 2)),((3 2,3 3,4 3,4 2,3 2)))", + "MULTIPOLYGON(((1 4,1 3,0 3,0 4,1 5,1 4)),((3 5,4 5,4 4,2 4,2 5,3 5)),((3 1,3 2,5 2,5 1,3 1)))" +}; + +static std::string case_recursive_boxes_14[2] = +{ + "MULTIPOLYGON(((2 2,2 3,3 2,2 2)),((2 3,3 4,3 3,2 3)),((2 3,1 3,1 4,2 4,2 3)))", + "MULTIPOLYGON(((3 3,4 4,4 3,3 3)),((1 2,2 3,2 2,1 2)),((2 1,2 2,3 1,2 1)),((1 4,1 5,2 5,2 4,1 4)))" +}; + +static std::string case_recursive_boxes_12_invalid[2] = +{ + // One of them is invalid requiring discarding turns colocated with uu in these clusters + "MULTIPOLYGON(((2 2,2 3,3 3,2 2)),((0 0,0 1,1 0,0 0)),((0 3,1 3,0.5 2.5,1 2,0 2,0 3)),((3 2,3 1,1 1,1 2,2 2,2 1,3 2)))", + "MULTIPOLYGON(((0 1,0 2,1 2,0 1)),((0 1,1 1,1.5 0.5,2 1,2 0,0 0,0 1)),((1 3,1 4,2 3,1 2,1 3)))" +}; + +static std::string case_recursive_boxes_13_invalid[2] = +{ + // Strictly invalid, requires checking seg_id while considering skipping to next turn + "MULTIPOLYGON(((2 1,2 2,3 2,3 1,2 1)),((3 2,3 3,4 3,4 2,3 2)),((2 4,1.5 3.5,2 3,1 3,2 2,0 2,1 3,1 5,2 5,2 4)))", + "MULTIPOLYGON(((1 4,1 3,0 3,0 4,1 5,1 4)),((3 5,4 5,4 4,2 4,2 5,3 5)),((3 1,3 2,5 2,5 1,3 1)))" +}; + +static std::string case_recursive_boxes_14_invalid[2] = +{ + // Strictly invalid, requires skipping assignment of discarded turns for clusters + "MULTIPOLYGON(((2 2,2 3,3 2,2 2)),((2 4,2 3,3 4,3 3,1 3,1 4,2 4)))", + "MULTIPOLYGON(((3 3,4 4,4 3,3 3)),((1 2,2 3,2 2,1 2)),((2 1,2 2,3 1,2 1)),((1 4,1 5,2 5,2 4,1 4)))" +}; + + +static std::string case_recursive_boxes_15[2] = +{ + // Requires inspecting blocked operations in traversing cluster + "MULTIPOLYGON(((3 2,3 3,4 3,3 2)),((4 1,4 2,5 2,5 1,4 1)),((4 2,4 3,5 3,4 2)),((3 5,4 4,2 4,2 5,3 5)))", + "MULTIPOLYGON(((3 4,4 3,3 2,3 3,2 3,2 4,3 4)),((4 3,4 4,5 4,5 3,4 3)))" +}; + +static std::string case_recursive_boxes_16[2] = +{ + // Requires inspecting if traverse is possible in selecting continue operation + "MULTIPOLYGON(((2 4,1 3,0 3,0 5,3 5,3 4,2 4)),((3 4,4 4,4 5,5 5,5 4,4 3,2 3,3 4)),((2.5 1.5,3 1,2.5 0.5,3 0,0 0,0 2,3 2,2.5 1.5)),((3 1,3 2,4 2,4 1,5 2,5 0,3 0,3 1)))", + "MULTIPOLYGON(((0 1,1 1,1 0,0 0,0 1)),((0 1,0 5,1 5,1 3,2 3,2 2,1 1,1 2,0 1)),((2 2,3 1,2 1,2 2)),((3 1,3 2,4 1,5 1,5 0,3 0,3 1)),((4 1,4 2,3 2,3 4,2 4,2 5,3 5,5 5,5 4,4 4,4 3,5 3,5 2,4 1)))" +}; + +static std::string case_recursive_boxes_17[2] = +{ + // Requires including uu turns, at least in clusters + "MULTIPOLYGON(((0 4,0 5,1 5,0 4)),((1 5,1.5 4.5,2 5,2 4,1 3,1 5)),((2 4,3 4,3 3,2 2,1 2,1 3,2 3,2 4)),((1 2,1 1,2 1,3 0,0 0,0 2,1 2)),((2 1,2 2,2.5 1.5,4 3,5 3,5 1,4 1,4 0,3 0,3 1,2 1)),((4 0,5 1,5 0,4 0)),((3 4,3 5,4 5,5 5,5 4,3 4)))", + "MULTIPOLYGON(((2 5,3 5,2 4,2 5)),((3 1,4 2,4 0,3 0,3 1)),((2 0,0 0,0 1,1 2,0 2,1 3,2 2,2 3,3 2,3 1,2 0)),((1 4,0.5 3.5,1 3,0 3,0 4,1 4)),((4 3,3 3,3 5,4 5,4 4,5 4,5 2,4 2,4 3)))" +}; + +static std::string case_recursive_boxes_18[2] = +{ + // Simple case having two colocated uu turns + "MULTIPOLYGON(((2 1,3 0,2 0,2 1)),((2 1,1 1,1 2,2 1)))", + "MULTIPOLYGON(((2 2,2 3,3 3,3 2,2 1,2 2)))" +}; + +static std::string case_recursive_boxes_19[2] = +{ + // Simple case having two colocated uu and ux turns + "MULTIPOLYGON(((1 4,2 3,1 3,1 4)),((1 4,0 4,0 5,1 4)))", + "MULTIPOLYGON(((3 4,1 4,2 5,3 4)),((1 4,1 3,0 3,1 4)))" +}; + +static std::string case_recursive_boxes_20[2] = +{ + // Simple case having two colocated uu and (discarded) cc turns + "MULTIPOLYGON(((4 4,4 5,5 5,5 4,4 4)),((4 4,4 3,3 3,3 4,4 4)))", + "MULTIPOLYGON(((4 4,4 3,3 3,4 4)),((4 4,4 5,5 4,4 4)))" +}; + +static std::string case_recursive_boxes_21[2] = +{ + // Having colocated uu/ux/cc turns requiring traversing through arcs to + // find first open outgoing arc for union + "MULTIPOLYGON(((3 1,3 2,4 1,3 1)),((3 1,3 0,2 0,2 1,3 1)))", + "MULTIPOLYGON(((3 1,3 0,2 0,3 1)),((3 1,2 1,2 2,3 2,3 1)))" +}; + +static std::string case_recursive_boxes_22[2] = +{ + // Requires including ux turns for intersections to block paths + "MULTIPOLYGON(((2 2,3 2,2.5 1.5,3 1,2 1,2 2)),((2 2,2 3,3 3,2 2)))", + "MULTIPOLYGON(((1 2,0 2,0 3,1 2)),((1 2,2 3,2 1,1 1,1 2)))" +}; + +static std::string case_recursive_boxes_23[2] = +{ + // Requires discarding turns with uu for intersection/difference too + "MULTIPOLYGON(((4 3,4 4,4.5 3.5,5 4,5 3,4 3)),((4 3,5 2,4 2,4 3)))", + "MULTIPOLYGON(((4 3,5 4,5 3,4 3)),((3 3,3 4,4 3,3 3)))" +}; + +static std::string case_recursive_boxes_24[2] = +{ + // Requires including all combinations in clusters having uu + "MULTIPOLYGON(((0 2,0 3,1 2,0 2)),((2 3,1 3,1 4,2 4,2 3)),((2 3,4 3,3 2,2 2,2 3)))", + "MULTIPOLYGON(((3 2,4 1,2 1,3 2)),((3 2,2 2,2 3,3 2)),((2 2,2 1,1 1,1 2,2 2)))" +}; + +static std::string case_recursive_boxes_25[2] = +{ + // Requires startable flag per operation, assigned per cluster + "MULTIPOLYGON(((4 1,4 2,5 2,5 1,4 0,4 1)),((3 2,3 3,4 3,4 2,3 2)),((3 2,3 1,2 1,3 2)))", + "MULTIPOLYGON(((4 2,4 1,3 1,4 2)),((4 2,4 3,5 2,4 2)),((3 1,1 1,1 2,3 2,3 1)))" +}; + +static std::string case_recursive_boxes_26[2] = +{ + // Requires not including uu outside clusters (or travel through them) + "MULTIPOLYGON(((2 4,3 4,3 3,0 3,1 4,1 5,2 5,2 4)),((1 3,1 2,0 2,1 3)))", + "MULTIPOLYGON(((2 3,0 3,0 4,1 4,1 5,3 5,3 4,2 4,2 3)),((2 3,3 2,2 2,2 3)))" +}; + +static std::string case_recursive_boxes_27[2] = +{ + // Combination of lonely uu-turn (which is discarded) and a cluster containing it + "MULTIPOLYGON(((2 2,3 1,3 0,2 0,2 2)),((2 2,1 2,1 3,2 2)))", + "MULTIPOLYGON(((1 2,0 1,0 2,1 2)),((2 1,2 0,1 0,1 1,2 2,2 1)),((1 3,2 2,1 2,1 3)),((1 3,0 3,1 4,1 3)))" +}; + +static std::string case_recursive_boxes_28[2] = +{ + // Requires startable flag per operation, assigned per cluster (as #25 but in a different configuration) + "MULTIPOLYGON(((5 1,5 0,4 0,4 2,5 3,5 1)),((4 2,3 2,3 3,4 3,4 2)))", + "MULTIPOLYGON(((2 2,2 3,3 3,4 2,3 1,2 1,2 2)),((3 4,4 3,3 3,3 4)),((4 2,5 2,4 1,4 2)))" +}; + +static std::string case_recursive_boxes_29[2] = +{ + // Requires not discarding colocated cc turns + "MULTIPOLYGON(((2 3,2 4,1 4,2 5,4 5,4 4,3 4,3 3,2 3)),((3 3,4 3,4 1,5 1,5 0,3 0,3 2,2 2,3 3)),((1 2,0 2,0 3,1 3,1 2)),((1 1,0 1,1 2,2 2,2 1,1 1)),((2 1,2 0,1 0,2 1)))", + "MULTIPOLYGON(((0 4,0 5,1 4,0 4)),((2 3,2 4,4 4,4 3,2 3)),((2 2,1 2,1 3,2 3,2 2)),((1 2,0 2,0 3,1 3,0.5 2.5,1 2)),((1 0,0 0,1 1,4 1,4 0,1 0)),((4 0,5 1,5 0,4 0)))" +}; + +static std::string case_recursive_boxes_30[2] = +{ + // Requires not discarding turns colocated with uu/invalid polygons (now not necessary anymore because of startable) + "MULTIPOLYGON(((2 2,2 3,4 3,4 4,4.5 3.5,5 4,5 0,3 0,3 1,4 1,4 2,2 2)),((1 5,3 5,4 4,0 4,0 5,1 5)))", + "MULTIPOLYGON(((2 1,2 3,1 3,1 4,2 5,2 4,3 4,3 5,5 5,5 4,4 4,5 3,4.5 2.5,5 2,5 0,4 0,4 1,3 1,3 0,1 0,2 1),(4 4,3.5 3.5,4 3,4 4),(4 1,4 2,3 2,4 1),(3 2,3 3,2.5 2.5,3 2)))" +}; + +static std::string case_recursive_boxes_31[2] = +{ + // Requires allowing traverse through clusters having only uu/cc for intersection + "MULTIPOLYGON(((1 4,1 1,0 1,0 4,1 4)),((1 1,2 1,2 0,1 0,1 1)),((2 2,1 2,2 3,2 2)))", + "MULTIPOLYGON(((2 3,2 2,1 2,2 3)),((0 1,0 3,1 3,1 1,0 1)),((1 1,1 0,0 0,1 1)))" +}; + +static std::string case_recursive_boxes_32[2] = +{ + // Similar to #31 but here uu/ux/cc + "MULTIPOLYGON(((1 3,2 3,2 2,1 1,1 3)),((2 2,3 1,3 0,2 0,2 2)),((1 1,2 1,1 0,0 0,0 1,1 1)))", + "MULTIPOLYGON(((3 1,3 0,2 0,2 2,3 1)),((1 1,0 1,0 2,1 2,2 1,1 1)))" +}; + +static std::string case_recursive_boxes_33[2] = +{ + // Similar to #31 but here also a ui + "MULTIPOLYGON(((4 3,5 3,5 2,3 2,4 3)),((4 2,5 1,3 1,4 2)),((2 1,3 1,3 0,2 0,2 1)),((3 2,1 2,1 3,2 3,3 2)))", + "MULTIPOLYGON(((3 1,2 1,2 4,4 4,4 3,5 2,3 2,3 1)),((3 1,4 2,4 1,5 1,5 0,3 0,3 1)))" +}; + +static std::string case_recursive_boxes_34[2] = +{ + // Requires detecting finished arcs during cluster traversal + "MULTIPOLYGON(((2 0,0 0,0 5,2 5,2 4,3 5,5 5,5 0,2 0)))", + "MULTIPOLYGON(((1 0,0 0,0 5,1 4,1 5,4 5,5 4,5 1,4 1,4 3,3 3,2 3,2 2,3 2,3 1,2 0,1 0),(1 0,2 1,1 1,1 0),(4 5,3 4,3.5 3.5,4 4,4 5)),((4 1,3 0,3 1,4 1)))" +}; + +static std::string case_recursive_boxes_35[2] = +{ + // Requires detecting finished arcs during cluster traversal + "MULTIPOLYGON(((0 2,0 5,4 5,4 4,5 4,5 1,4 1,5 0,3 0,0 0,0 2),(0 2,1 2,1 3,0 2),(3 0,3 1,2 1,3 0),(2.5 1.5,3 2,2 2,2.5 1.5),(2 4,1 4,2 3,2 4)))", + "MULTIPOLYGON(((1 0,0 0,0 5,3 5,5 5,5 0,1 0),(1 0,2 1,1 1,1 0),(2 1,2 2,1.5 1.5,2 1),(3 5,2.5 4.5,3 4,3 5),(3 2,3 3,2.5 2.5,3 2),(2 3,2 4,1 4,1 3,2 3)))" +}; + +static std::string case_recursive_boxes_36[2] = +{ + // Requires increasing target rank while skipping finished arcs to avoid duplicate output + "MULTIPOLYGON(((5 3,4 3,4 4,5 3)),((5 2,4 2,5 3,5 2)),((5 2,5 1,4 1,5 2)))", + "MULTIPOLYGON(((4 2,4 3,5 3,5 2,4 2)),((4 2,4 1,3 1,3 2,4 2)))" +}; + +static std::string case_recursive_boxes_37[2] = +{ + // [1] is reported as invalid by BG, but not by postgis + // Requires skipping arc for union too, to avoid duplicate hole + "MULTIPOLYGON(((4 0,5 1,5 0,4 0)),((2 0,3 1,3 0,2 0)),((2 3,2 2,1 2,1 3,2 3)),((2 1,2 2,4 2,3 1,2 1)))", + "MULTIPOLYGON(((3 1,4 2,4 3,5 3,5 0,3 0,3 1),(3 1,3.5 0.5,4 1,3 1)),((3 1,2 0,2 1,3 1)),((2 3,1 2,1 3,2 3)))" +}; + +static std::string case_recursive_boxes_38[2] = +{ + // Smaller version of 29, removing generated lower interior in a union + "MULTIPOLYGON(((2 3,2 4,1 4,2 5,4 5,4 4,3 4,3 3,2 3)),((3 3,4 3,4 1,5 1,5 0,3 0,3 2,2 2,3 3)),((1 2,0 2,0 3,1 3,1 2)),((1 1,0 1,1 2,2 2,2 1,1 1)))", + "MULTIPOLYGON(((2 2,4 2,4 1,2 1,2 2)),((0 4,0 5,1 4,0 4)),((2 3,2 4,4 4,4 3,2 3)),((2 2,1 2,1 3,2 3,2 2)),((1 2,0 2,0 3,1 3,0.5 2.5,1 2)))" +}; + +static std::string case_recursive_boxes_39[2] = +{ + // Needs check for back at start during traversal + "MULTIPOLYGON(((3 8,2 8,2 9,3 9,3 8)),((4 8,4 9,5 9,5 8,4 8)),((6 9,6 10,7 10,7 9,6 9)),((5 6,4 6,4 7,6 7,6 5,5 5,5 6)),((4 7,3 7,3 8,4 8,4 7)),((7 8,8 8,8 7,6 7,6 8,7 8)))", + "MULTIPOLYGON(((3 7,3 6,2 6,2 7,3 7)),((4 8,4 7,3 7,3 8,4 8)),((6 10,7 10,7 9,5 9,5 10,6 10)),((5 8,4 8,4 9,5 9,5 8)),((5 8,6 8,6 7,5 7,5 8)))" +}; + +static std::string case_recursive_boxes_40[2] = +{ + "MULTIPOLYGON(((8 7,9 7,9 6,7 6,7 7,8 7)),((6 4,7 4,7 3,6 3,6 4)),((6 4,5 4,5 5,6 5,6 4)),((3 6,3 7,4 7,4 6,3 6)),((3 6,3 5,2 5,2 6,3 6)),((1 0,1 1,2 1,2 0,1 0)),((7 9,8 9,8 8,6 8,6 9,7 9)),((6 8,6 7,5 7,5 8,6 8)),((5 1,5 0,3 0,3 1,5 1)),((5 1,5 2,6 2,6 1,5 1)),((4 3,4 4,5 4,5 3,4 3)),((4 3,4 2,3 2,3 3,4 3)))", + "MULTIPOLYGON(((7 2,7 3,8 3,8 2,7 2)),((5 9,5 10,6 10,6 9,5 9)),((7 0,6 0,6 2,7 2,7 1,8 1,8 0,7 0)),((5 3,5 4,6 4,6 3,5 3)),((7 4,7 5,8 5,8 4,7 4)),((2 2,2 1,1 1,1 2,2 2)),((2 2,2 3,3 3,3 2,2 2)),((4 7,4 6,3 6,3 7,4 7)),((5 5,4 5,4 6,5 6,5 7,6 7,6 5,5 5)),((5 7,4 7,4 8,5 8,5 7)))" +}; + +static std::string case_recursive_boxes_41[2] = +{ + // Smaller version of 35 for validity checks + "MULTIPOLYGON(((0 2,0 5,5 5,5 1,5 0,3 0,0 0,0 2),(0 2,1 2,1 3,0 2),(2 4,1 4,2 3,2 4)))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0),(2 3,2 4,1 4,1 3,2 3)))" +}; + +static std::string case_recursive_boxes_42[2] = +{ + // Smaller version of 2 for validity checks + "MULTIPOLYGON(((0 0,0 10,6 10,6 9,7 9,7 10,10 10,10 0,0 0),(6 9,5 9,5 8,6 8,6 9),(7 6,8 6,8 7,7 7,7 6),(8 7,9 7,9 8,8 8,8 7)))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(6 7,7 7,7 8,6 8,6 7)))" +}; + +static std::string case_recursive_boxes_43[2] = +{ + // Smaller version of 35 for validity checks + "MULTIPOLYGON(((0 2,0 5,4 5,4 4,5 4,5 1,4 1,5 0,3 0,0 0,0 2),(3 0,3 1,2 1,3 0)))", + "MULTIPOLYGON(((1 0,0 0,0 5,3 5,5 5,5 0,1 0),(1 0,2 1,1 1,1 0)))" +}; + +static std::string case_recursive_boxes_44[2] = +{ + // Needs discarding uu turns in intersections, either globally or in aggregations + "MULTIPOLYGON(((4 1,5 1,5 0,4 0,4 1)),((4 1,2 1,2 2,4 2,4 1)),((2 2,1 2,1 1,2 1,2 0,0 0,0 3,2 3,2 2)))", + "MULTIPOLYGON(((2 1,2 2,3 2,3 1,2 1)),((1 0,0 0,0 1,2 1,2 0,1 0)))" +}; + +static std::string case_recursive_boxes_45[2] = +{ + // Needs discarding u/x turns in aggregations (for clusters for intersections) + // This case did go wrong, don't make it smaller, it also depends on the order of turns + "MULTIPOLYGON(((5 2,5 3,4 3,4 6,6 6,6 5,8 5,8 1,5 1,5 2)),((4 7,4 6,1 6,1 4,0 4,0 7,2 7,2 8,3 8,3 7,4 7)),((3 3,2 3,2 5,3 5,3 3)),((3 3,4 3,4 0,3 0,3 1,2 1,2 2,3 2,3 3)),((1 1,2 1,2 0,1 0,1 1)),((1 1,0 1,0 2,1 2,1 1)),((2 3,2 2,1 2,1 3,2 3)))", + "MULTIPOLYGON(((5 1,4 1,4 2,7 2,7 1,5 1)),((7 6,7 4,6 4,6 3,4 3,4 4,3 4,3 5,6 5,6 6,3 6,3 8,2 8,2 9,7 9,7 6)),((3 4,3 2,1 2,1 1,0 1,0 4,1 4,1 3,2 3,2 4,3 4)),((4 1,4 0,2 0,2 1,4 1)),((2 4,1 4,1 5,2 5,2 4)))" +}; + +static std::string case_recursive_boxes_46[2] = +{ + "MULTIPOLYGON(((8 9,8 10,9 10,9 9,8 9)),((5 5,5 4,3 4,3 5,5 5)),((5 5,5 6,6 6,6 5,5 5)),((5 9,6 9,6 10,7 10,7 8,9 8,9 5,10 5,10 4,9 4,6 4,6 5,7 5,7 6,6 6,6 8,3 8,3 9,4 9,4 10,5 10,5 9),(7 6,8 6,8 7,7 7,7 6)))", + "MULTIPOLYGON(((5 10,6 10,6 9,5 9,5 10)),((5 3,4 3,4 7,7 7,7 6,8 6,8 3,5 3),(5 5,5 4,7 4,7 6,6 6,6 5,5 5)),((9 7,9 6,8 6,8 7,9 7)),((9 7,9 9,8 9,8 10,10 10,10 7,9 7)),((8 9,8 8,7 8,7 9,8 9)))" +}; + +static std::string case_recursive_boxes_47[2] = +{ + // Needs open_count==0 in get_ring_turn_info to select_rings + "MULTIPOLYGON(((5 4,6 4,6 3,4 3,4 5,5 5,5 4)),((5 5,5 6,6 6,6 5,5 5)),((5 6,3 6,3 7,4 7,4 8,7 8,7 6,6 6,6 7,5 7,5 6)),((6 4,6 5,7 5,7 4,6 4)))", + "MULTIPOLYGON(((4 5,4 4,1 4,1 5,4 5)),((5 6,5 7,6 7,6 6,5 6)),((5 6,5 5,4 5,4 6,5 6)),((5 3,5 5,6 5,6 3,5 3)),((5 3,5 2,4 2,4 3,5 3)),((6 5,6 6,7 6,7 5,6 5)),((3 7,2 7,2 9,3 9,3 8,4 8,4 7,3 7)))" +}; + +static std::string case_recursive_boxes_48[2] = +{ + // Needs discarding self-ii turns not located within the other geometry + "MULTIPOLYGON(((6 7,6 8,7 8,7 7,6 7)))", + "MULTIPOLYGON(((9 9,10 9,10 7,9 7,9 5,8 5,8 6,7 6,7 7,6 7,6 8,7 8,7 9,8 9,8 10,9 10,9 9),(9 8,8 8,8 7,9 7,9 8)))" +}; + +static std::string case_recursive_boxes_49[2] = +{ + // Needs specific handling for cc interior rings touching one exterior ring + "MULTIPOLYGON(((5 2,5 3,4 3,4 4,5 4,5 5,6 5,6 2,7 2,7 1,0 1,0 3,1 3,1 2,5 2)),((5 7,5 8,6 8,6 9,7 9,7 10,10 10,10 8,9 8,9 6,10 6,10 4,9 4,9 3,8 3,8 4,7 4,7 6,5 6,5 7),(7 6,8 6,8 7,7 7,7 6),(8 9,7 9,7 8,8 8,8 9)),((2 6,4 6,4 5,3 5,3 4,1 4,1 5,2 5,2 6)),((3 10,4 10,4 7,2 7,2 10,3 10)))", + "MULTIPOLYGON(((5 1,4 1,4 3,3 3,3 6,2 6,2 9,5 9,5 7,4 7,4 4,5 4,5 3,6 3,6 2,8 2,8 1,9 1,9 0,5 0,5 1),(4 7,4 8,3 8,3 7,4 7)),((8 2,8 3,9 3,9 2,8 2)),((9 5,9 6,10 6,10 5,9 5)),((9 5,9 4,8 4,8 5,9 5)),((7 5,7 4,6 4,6 5,7 5)),((7 10,9 10,9 9,10 9,10 7,8 7,8 6,6 6,6 10,7 10),(7 9,7 8,8 8,8 9,7 9)))" +}; + +static std::string case_recursive_boxes_50[2] = +{ + // Same as 49 but needs the second variant + "MULTIPOLYGON(((6 9,6 10,7 10,7 9,6 9)),((5 6,6 6,6 5,4 5,4 7,3 7,3 8,4 8,4 9,2 9,2 10,5 10,5 8,6 8,6 7,5 7,5 6)),((4 0,1 0,1 1,2 1,2 2,3 2,3 3,5 3,5 0,4 0)),((3 5,3 3,1 3,1 4,0 4,0 6,1 6,1 7,0 7,0 8,2 8,2 6,3 6,3 5),(2 5,1 5,1 4,2 4,2 5)),((1 1,0 1,0 2,1 2,1 1)),((6 5,7 5,7 4,6 4,6 5)),((10 5,8 5,8 6,9 6,9 7,10 7,10 5)),((6 0,6 1,8 1,8 2,10 2,10 0,6 0)),((9 7,7 7,7 8,8 8,8 9,9 9,9 7)),((8 2,6 2,6 3,8 3,8 2)),((9 9,9 10,10 10,10 9,9 9)))", + "MULTIPOLYGON(((5 3,5 4,6 4,6 3,5 3)),((5 7,6 7,6 5,4 5,4 6,3 6,3 7,4 7,4 8,5 8,5 7)),((3 6,3 4,4 4,4 3,1 3,1 2,0 2,0 9,1 9,1 10,3 10,3 9,2 9,2 8,3 8,3 7,1 7,1 6,3 6),(1 5,1 4,2 4,2 5,1 5)),((4 0,0 0,0 1,1 1,1 2,3 2,3 1,5 1,5 0,4 0)),((7 6,7 7,8 7,8 8,9 8,9 6,8 6,8 5,7 5,7 6)),((9 0,7 0,7 1,9 1,9 2,10 2,10 0,9 0)),((7 9,5 9,5 10,7 10,7 9)),((7 9,8 9,8 8,7 8,7 9)),((8 3,8 2,7 2,7 3,8 3)),((8 3,8 4,9 4,9 3,8 3)),((8 9,8 10,9 10,9 9,8 9)),((9 8,9 9,10 9,10 8,9 8)))" +}; + +static std::string case_recursive_boxes_51[2] = +{ + // Needs keeping colocated turns with a xx turn to properly generate interior rings. It also needs self-turns for validity + "MULTIPOLYGON(((0 4,0 5,1 5,1 4,0 4)),((2 1,3 1,3 0,2 0,2 1)),((3 3,4 3,4 2,3 2,3 3)),((5 4,6 4,6 3,5 3,5 4)),((2 3,2 4,3 4,3 3,2 3)),((5 6,4 6,4 5,3 5,3 10,4 10,4 9,5 9,5 8,4 8,4 7,6 7,6 9,7 9,7 10,8 10,8 8,7 8,7 7,8 7,8 4,7 4,7 5,6 5,6 6,5 6)),((5 0,4 0,4 1,5 1,5 2,6 2,6 3,7 3,7 1,8 1,8 0,5 0)),((0 2,1 2,1 1,0 1,0 2)),((1 2,1 3,2 3,2 2,1 2)),((1 10,2 10,2 8,1 8,1 9,0 9,0 10,1 10)),((1 8,1 7,0 7,0 8,1 8)),((10 1,10 0,9 0,9 1,8 1,8 4,9 4,9 6,10 6,10 1)))", + "MULTIPOLYGON(((3 1,4 1,4 0,2 0,2 1,3 1)),((1 9,0 9,0 10,1 10,1 9)),((8 2,9 2,9 1,10 1,10 0,8 0,8 2)),((5 8,4 8,4 9,5 9,5 10,7 10,7 8,8 8,8 7,7 7,7 6,8 6,8 7,10 7,10 6,9 6,9 3,8 3,8 2,6 2,6 1,5 1,5 3,7 3,7 4,4 4,4 5,5 5,5 6,6 6,6 8,5 8),(7 5,7 4,8 4,8 5,7 5)),((4 4,4 3,2 3,2 4,1 4,1 5,0 5,0 7,1 7,1 9,2 9,2 8,4 8,4 6,3 6,3 4,4 4),(1 5,2 5,2 6,1 6,1 5)),((0 3,1 3,1 1,0 1,0 3)),((4 9,3 9,3 10,4 10,4 9)),((9 10,10 10,10 9,9 9,9 8,8 8,8 10,9 10)))" +}; + +static std::string case_recursive_boxes_52[2] = +{ + // Needs checking for isolated in handling of cc_ii clusters for intersection + "MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)),((5 1,2 1,2 3,1 3,1 4,0 4,0 8,1 8,1 9,2 9,2 8,5 8,5 5,6 5,6 7,7 7,7 9,9 9,9 10,10 10,10 7,9 7,9 6,10 6,10 5,9 5,9 1,8 1,8 2,7 2,7 3,6 3,6 4,5 4,5 2,6 2,6 0,5 0,5 1),(4 4,4 5,3 5,3 6,4 6,4 7,1 7,1 6,2 6,2 5,3 5,3 4,4 4),(7 5,7 4,8 4,8 6,7 6,7 5),(2 5,1 5,1 4,2 4,2 5)),((5 8,5 9,6 9,6 8,5 8)),((8 1,8 0,7 0,7 1,8 1)))", + "MULTIPOLYGON(((1 1,2 1,2 0,1 0,1 1)),((9 10,10 10,10 9,9 9,9 10)),((3 9,3 10,4 10,4 9,3 9)),((1 10,2 10,2 9,0 9,0 10,1 10)),((5 4,4 4,4 3,3 3,3 2,1 2,1 1,0 1,0 3,2 3,2 4,1 4,1 5,5 5,5 7,6 7,6 6,7 6,7 8,9 8,9 7,8 7,8 6,9 6,9 4,8 4,8 3,10 3,10 2,8 2,8 1,7 1,7 0,6 0,6 2,7 2,7 3,6 3,6 4,5 4),(8 5,7 5,7 4,8 4,8 5)),((5 9,5 10,8 10,8 9,6 9,6 8,5 8,5 9)),((4 0,3 0,3 1,4 1,4 2,5 2,5 0,4 0)),((3 8,4 8,4 6,2 6,2 8,3 8)),((9 1,9 0,8 0,8 1,9 1)),((9 7,10 7,10 6,9 6,9 7)))" +}; + +static std::string case_recursive_boxes_53[2] = +{ + // Needs checking for intersection patterns intersection_pattern_common_interior2 with ii + "MULTIPOLYGON(((2 0,0 0,0 5,5 5,4 4,5 4,5 0,2 0),(2.5 4.5,3 4,3 5,2.5 4.5),(3 1,4 0,4 1,3 1),(3 3,4 2,4 3,3 3)))", + "MULTIPOLYGON(((2 0,0 0,0 5,1 5,0.5 4.5,1 4,2 5,5 5,5 0,2 0),(2 3,2 4,1 4,2 3),(3 1,3 2,2 2,2 1,3 1),(1 3,0 2,1 2,1 3),(1 0,1 1,0.5 0.5,1 0),(5 3,4 3,4 2,5 3),(4 1,3.5 0.5,4 0,4 1)))" +}; + +static std::string case_recursive_boxes_54[2] = +{ + // Needs including blocked from-ranks/operations in aggregations + "MULTIPOLYGON(((2 2,2 3,1 3,1 5,2 4,2 5,5 5,5 4,4 3,5 3,5 2,4 2,4 1,5 0,2 0,2 1,1 1,1 2,2 2),(3 2,2.5 1.5,3 1,4 2,3 2),(3 2,3 3,2.5 2.5,3 2),(3 4,3 3,4 4,3 4)),((1 1,1 0,0 0,0 1,1 1)),((1 3,1 2,0 1,0 3,1 3)))", + "MULTIPOLYGON(((2 2,3 3,2 3,2 5,5 5,5 3,4 3,3 2,5 2,5 1,4 1,3 0,1 0,1 1,0 1,0 2,2 2)),((0 4,0 5,1 5,1 4,0 3,0 4)))" +}; + +static std::string case_recursive_boxes_55[2] = +{ + // Needs correct handling for union clusters with 3 open spaces + "MULTIPOLYGON(((3 4,3 5,4 5,3 4)),((0 4,1 4,1 3,0 3,0 4)),((2 1,1.5 0.5,2 0,1 0,1 1,0 1,0 2,2 2,2 1)),((3 2,3 3,4 2,4 3,5 2,4 1,2 1,3 2)),((2 2,2 3,3 3,2 2)))", + "MULTIPOLYGON(((2 1,2 0,1 0,2 1)),((2 1,2 2,3 2,3 1,2 1)),((1 3,1 4,2 5,2 2,1 2,0 1,0 4,1 3)),((5 4,4 3,3 3,4 4,3 4,3 5,5 5,5 4)),((1 0,0 0,1 1,1 0)),((0 4,0 5,1 5,0 4)))" +}; + +static std::string case_recursive_boxes_56[2] = +{ + // Needs not discarding clustered self-turns if the cluster does not contain anything else + "MULTIPOLYGON(((3 4,3 5,4 5,3 4)),((3 3,4 3,2 1,2 3,3 3)),((2 1,2 0,1 0,1 1,2 1)),((1 4,1 3,0 3,0 4,1 5,1 4)))", + "MULTIPOLYGON(((2 4,2 5,3 4,2 4)),((1 5,1 4,0 4,0 5,1 5)),((1 2,0 2,0 3,1 2)),((2 2,1 2,2 3,2 2)),((2 2,2 1,1 1,1 2,1.5 1.5,2 2)))" +}; + +static std::string case_recursive_boxes_57[2] = +{ + // Needs handling of 3 open spaces in union to form interior ring + "MULTIPOLYGON(((2 0,0 0,0 1,0.5 0.5,1 1,1 2,2 1,4 1,4 4,5 3,5 0,2 0)),((2 5,2 4,1 4,1 5,2 5)),((1 2,0 2,0 3,1 2)),((1 2,1 3,2 3,2 2,1 2)),((0 1,0 2,1 1,0 1)),((4 3,3 3,3 4,4 3)),((3 4,3 5,5 5,5 4,3 4)))", + "MULTIPOLYGON(((3 3,2 3,2 5,3 4,3 5,5 5,5 4,4 4,4 3,3 3)),((3 3,4 2,2 2,3 3)),((0 0,0 4,1 4,1 3,2 3,2 2,1 2,1 0,0 0)),((3 1,2 1,2 2,3 1)),((1 5,0 4,0 5,1 5)),((1 5,2 5,1 4,1 5)),((5 2,5 1,4 1,4 3,5 4,5 2)),((4 1,4 0,3 0,3 1,4 1)),((2 1,2 0,1 0,2 1)))", +}; + +static std::string case_recursive_boxes_58[2] = +{ + // Needs correct handling for union clusters with 3 open spaces + "MULTIPOLYGON(((0 0,1 1,2 1,1 0,0 0)),((1 1,1 2,2 2,1 1)),((3 1,4 2,4 1,3 1)),((3 2,3 3,4 3,3 2)))", + "MULTIPOLYGON(((0 1,0 2,1 1,0 1)),((1 1,1 2,2 1,1 1)),((1 2,1 3,2 2,1 2)),((2 2,2 3,3 2,2 2)),((4 2,4 3,5 3,4 2)),((1 0,2 1,2 2,3 1,2 0,1 0)))", +}; + +static std::string case_recursive_boxes_59[2] = +{ + // Needs correct handling for union clusters with 3 open spaces + "MULTIPOLYGON(((2 3,2 2,3 2,3 1,2 1,1.5 0.5,2 0,0 0,0 1,1 1,1 4,2 4,3 5,5 5,5 4,3 4,3 3,2 3)),((3 2,3 3,4 3,4 2,3 2)),((2 0,3 1,5 1,5 0,2 0)),((0 3,0 5,1 5,1 4,0 3)),((0 3,1 3,0 2,0 3)))", + "MULTIPOLYGON(((3 5,3 4,4 4,4 3,5 3,5 2,4 2,4 1,3.5 0.5,4 0,1 0,1 1,2 2,1 2,1 4,0 4,1 5,3 5),(2 3,2 4,1 3,2 3),(2 2,3 2,3 3,2 2)),((1 1,0 1,0 3,1 2,1 1)))", +}; + +static std::string case_recursive_boxes_60[2] = +{ + // Needs checking left_count in union clusters + "MULTIPOLYGON(((0 4,0 5,1 5,0 4)),((1 2,1 4,2 4,2 5,3 4,4 5,5 5,5 4,4 4,3.5 3.5,4 3,4 2,3 2,2 1,2 2,1 2)),((1 2,2 1,1 1,1 2)),((2 1,3 1,4 2,5 1,4 1,4 0,2 0,2 1)),((0 0,0 2,2 0,0 0)),((0 2,0 3,1 3,0 2)),((5 4,5 3,4 3,5 4)))", + "MULTIPOLYGON(((2 3,1 2,1 4,0 4,0 5,3 5,3 3,2 3)),((1 2,3 2,3 3,4 4,5 4,5 3,4 3,3.5 2.5,4 2,4 0,0 0,0 1,1 1,1 2)),((4 2,5 3,5 2,4 2)))", +}; + + +static std::string case_recursive_boxes_61[2] = +{ + // Needs pattern 4 for intersections + "MULTIPOLYGON(((2 0,2 1,1 0,0 0,0 1,1 2,0 2,0 4,1 4,1 5,1.5 4.5,2 5,4 5,4.5 4.5,5 5,5 2,4.5 1.5,5 1,5 0,2 0),(3 1,3 2,2 2,2 1,3 1),(4 5,3.5 4.5,4 4,4 5)),((0 4,0 5,1 5,0 4)))", + "MULTIPOLYGON(((3 5,5 5,5 0,2 0,2 1,1 1,1 0,0 0,0 2,1 2,1 3,0 3,0 5,3 5),(3 1,3 2,2 2,2 1,3 1)))", +}; + +static std::string case_recursive_boxes_62[2] = +{ + // Needs discarding self-intersections within other geometry + "MULTIPOLYGON(((2.5 3.5,3 4,3 3,4 3,4 2,5 2,5 0,1 0,1 1,2 1,3 2,2 2,2 3,1 3,2 4,2.5 3.5),(3 1,3 0,4 1,3 1)),((1 0,0 0,0 1,1 0)),((2 4,2 5,3 4,2 4)),((2 4,1 4,1 5,2 4)),((3 4,3 5,4 5,4 4,3 4)),((0 1,0 3,0.5 2.5,1 3,1 1,0 1)),((1 3,0 3,0 4,1 4,1 3)),((4 4,5 4,5 3,4 3,4 4)))", + "MULTIPOLYGON(((2 0,1 0,1 1,2 2,2 1,4 1,3 0,2 0)),((2 2,1 2,1 1,0.5 0.5,1 0,0 0,0 5,4 5,4 4,3 3,4 3,4 2,2 2),(1 3,1 4,0 4,1 3)),((4 2,5 1,4 1,4 2)))", +}; + +static std::string case_recursive_boxes_63[2] = +{ + // Derived from 62, needs not excluding startable points for checking rings for traversals + "MULTIPOLYGON(((2 0,1 0,1 1,2 2,2 1,4 1,3 0,2 0)),((2 2,1 2,1 1,0.5 0.5,1 0,0 0,0 5,4 5,4 4,3 3,4 3,4 2,2 2),(1 3,1 4,0 4,1 3)),((4 2,5 1,4 1,4 2)))", + "MULTIPOLYGON(((-1 -1, 6 -1, 6 6, -1 6, -1 -1), (0 0, 0 1, 0 3, 0 4, 1 4, 1 5, 2 4, 2 5, 3 4, 3 5, 4 5, 4 4, 5 4, 5 3, 4 3, 4 2, 5 2, 5 0, 3 0, 1 0, 0 0)),((2.5 3.5, 3 4, 2 4, 2.5 3.5)), ((3 3, 4 3, 4 4, 3 4, 3 3)), ((1 3, 2 4, 1 4, 1 3)), ((0.5 2.5, 1 3, 0 3, 0.5 2.5)), ((1 1, 2 1, 3 2, 2 2, 2 3, 1 3, 1 1)), ((3 0, 4 1, 3 1, 3 0)), ((1 0, 1 1, 0 1, 1 0)))", +}; + +static std::string case_recursive_boxes_64[2] = +{ + // Needs considering remaining_distance in clusters + "MULTIPOLYGON(((3 4,3 5,5 5,5 4,4 4,3 3,3.5 2.5,4 3,5 3,5 1,4 0,0 0,0 5,2 5,2 4,3 4),(2 2,3 2,3 3,2 2),(2 3,2 4,1 4,2 3),(2 0,2 1,1 1,2 0),(1 2,0 2,0.5 1.5,1 2)))", + "MULTIPOLYGON(((3 5,5 5,5 0,0 0,1 1,0 1,0 3,1 3,1 4,1.5 3.5,2 4,2 5,3 5),(2 2,1 2,2 1,2 2),(2 2,2.5 1.5,3 2,2 2),(4 4,4.5 3.5,5 4,4 4),(4 1,3 1,4 0,4 1)),((2 5,0 3,0 5,2 5)))" +}; + +static std::string case_recursive_boxes_65[2] = +{ + // Misses large hole in intersection + "MULTIPOLYGON(((3 5,3.5 4.5,4 5,5 5,5 1,4 0,3 0,3 1,2 0,0 0,0 4,1 4,1 5,3 5),(2 4,2 3,3 4,2 4),(2 1,2 2,1.5 1.5,2 1),(3 3,4 2,4 3,3 3)))", + "MULTIPOLYGON(((3 5,4 5,4 4,5 5,5 2,4 2,3.5 1.5,5 0,1 0,1 1,0 1,0 5,3 5),(2 2,3 2,4 3,1 3,1 2,2 2)),((1 0,0 0,0 1,1 0)),((4 1,4 2,5 1,4 1)))" +}; + +static std::string case_recursive_boxes_66[2] = +{ + // Needs self-turns startable, at least not determined using count left/right for self-turns + "MULTIPOLYGON(((1 0,0 0,1 1,0 1,0 4,1 4,1 5,3 5,3 4,4 5,5 5,5 0,1 0),(3 3,4 2,4 3,3 3),(3 1,4 1,4 2,3 2,3 1),(3 3,3 4,2 3,3 3),(3 4,3.5 3.5,4 4,3 4)))", + "MULTIPOLYGON(((2 0,0 0,0 1,1 1,1 2,0 2,0 5,1 5,2 4,2 5,5 5,5 0,2 0),(3 1,3 2,2.5 1.5,3 1),(2 3,1 2,2 1,2 2,3 2,4 3,2 3),(0 3,0.5 2.5,1 3,1 4,0 3)))" +}; + +static std::string case_recursive_boxes_67[2] = +{ + // Needs to avoid including any untraveled ring with blocked turns + "MULTIPOLYGON(((2 2,3 3,3 2,2 2)),((2 2,1 2,1 3,2 3,2 2)),((1 1,2 1,2 0,0 0,0 1,1 1)),((2 4,1 4,0.5 3.5,1 3,0 3,0 5,1 5,2 4)),((4 2,4 3,5 2,4 2)),((4 2,4 1,3 1,4 2)),((3 3,3 4,4 4,4 3,3 3)),((4 4,4 5,5 5,5 4,4 4)))", + "MULTIPOLYGON(((3 4,4 5,4 4,3 4)),((3 1,3 0,2 0,3 1)),((3 1,1 1,1 2,2 3,3 3,3 2,2 2,3 1)),((3 1,3 2,5 2,5 1,3 1)),((2 3,0 3,0 4,1 4,2 3)),((1 3,1 2,0 2,1 3)),((1 4,1 5,2 5,1 4)))" +}; + +static std::string case_recursive_boxes_68[2] = +{ + // Needs checking blocked turns in colocated turns + "MULTIPOLYGON(((3 3,3 4,4 4,4 5,5 5,4.5 4.5,5 4,5 3,4.5 2.5,5 2,2 2,2 4,3 3)),((2 5,3 5,3 4,2 4,1 3,1 2,0 2,0 4,1 4,1 5,2 5)),((2 2,4 0,1 0,2 1,1 1,1 2,2 2)),((1 0,0 0,0 1,1 1,1 0)),((4 0,5 1,5 0,4 0)),((5 1,4 1,4 2,5 1)))", + "MULTIPOLYGON(((2 0,2 1,1 1,2 2,3 2,3 1,4 2,5 2,5 0,2 0)),((2 0,1 0,1 1,2 0)),((2 2,2 3,3 4,3 3,2 2)),((3 2,3 3,4 4,5 4,5 3,4 2,3 2)),((3 4,3 5,4 4,3 4)),((2 4,2 3,1 2,1 3,0 3,0 5,1 5,1 4,2 4)),((1 2,1 1,0 1,0 2,1 2)),((4 4,4 5,5 5,4 4)))" +}; + +static std::string case_recursive_boxes_69[2] = +{ + // Needs checking left_count instead of is_closed for decision to block untraversed rings + "MULTIPOLYGON(((3 4,3 5,4 5,3 4)),((3 4,3 2,2 2,3 1,1 1,1 2,0 2,1 3,0 3,1 4,3 4)),((3 1,4 1,4 0,3 0,3 1)),((1 1,2 0,0 0,0 1,1 1)))", + "MULTIPOLYGON(((2 4,1 4,1 3,0 3,0 5,2 5,3 4,2 4)),((3 4,3 5,4 5,4 4,3 4)),((2 1,2 0,1 0,2 1)),((2 1,1 1,1 2,2 2,2 1)),((5 1,5 0,3 0,4 1,5 1)),((4 1,3 1,3 2,4 3,5 2,4 2,4 1)),((1 3,2 3,1 2,1 3)))" +}; + +static std::string case_recursive_boxes_70[2] = +{ + // Needs checking left_count instead of is_closed for decision to block untraversed rings + "MULTIPOLYGON(((2 0,0 0,0 4,1 3,3 3,3 5,5 5,5 3,4.5 2.5,5 2,5 0,2 0),(0 1,0.5 0.5,1 1,0 1),(5 2,4 2,4.5 1.5,5 2),(4 2,3 2,3 1,4 2)),((3 4,2 3,2 4,3 4)),((0 4,0 5,1 5,1.5 4.5,2 5,2 4,0 4)))", + "MULTIPOLYGON(((2 0,0 0,0 5,5 5,5 2,4.5 1.5,5 1,5 0,2 0),(2 1,3 0,3 1,2 1),(4 4,3 3,4 3,4 4),(1 1,1 2,0 2,1 1),(4 3,4.5 2.5,5 3,4 3)))" +}; + +static std::string case_recursive_boxes_71[2] = +{ + // Needs check for self-cluster within other geometry, in intersections + "MULTIPOLYGON(((4 0,4 1,5 1,5 0,4 0)),((4 3,4 4,5 4,4 3)),((3 3,4 2,3 2,3 3)),((3 3,2 3,3 4,3 3)),((3 2,3 0,1 0,1 3,0 3,0 4,1 4,3 2),(3 2,2 2,2 1,3 2)),((1 4,1 5,2 5,2 4,1 4)))", + "MULTIPOLYGON(((3 0,3 1,4 0,3 0)),((2 2,0 2,0 3,1 3,2 2)),((2 2,2 3,3 3,2 2)),((2 4,0 4,1 5,3 5,3 4,2 4)),((3 3,3 4,4 5,5 4,4 4,4 3,3 3)),((4 3,5 3,4 2,4 3)))" +}; + +static std::string case_recursive_boxes_72[2] = +{ + // Needs selection of ranked point in union (to finish the ring) + "MULTIPOLYGON(((3 1,4 1,4 0,3 0,3 1)),((1 0,1 1,2 1,2 0,1 0)),((3 3,3 5,5 5,5 2,4 2,4 3,3 3)),((3 3,2 2,2 3,3 3)),((1 3,0 2,0 3,1 3)),((1 4,2 4,2 3,1 2,1 4)),((1 4,1 5,2 5,1 4)),((2 5,3 5,2 4,2 5)),((1 5,0 4,0 5,1 5)))", + "MULTIPOLYGON(((4 0,4 1,5 0,4 0)),((4 4,4 5,5 5,5 4,4 4)),((2 4,2 3,1 3,1 4,2 4)),((2 4,2 5,3 5,2 4)),((2 2,2 3,3 3,2 2)),((2 2,3 2,3 1,2 1,2 2)),((3 3,4 2,3 2,3 3)),((3 1,3 0,2 0,3 1)),((1 3,2 2,1 1,1 3)),((1 2,0 2,0 3,1 2)),((1 4,0 4,0 5,1 5,1 4)),((4 2,4 3,5 2,4 2)))" +}; + +static std::string case_recursive_boxes_73[2] = +{ + // Needs handling connection points identical for clustered/non-clustered turns + "MULTIPOLYGON(((3 5,5 5,5 4,4.5 3.5,5 3,5 2,3 2,3 1,4 0,0 0,0 5,1 4,2 4,2 5,3 5),(2 3,2 2,3 3,2 3),(1 2,0 2,1 1,1 2)),((1 4,1 5,2 5,1 4)),((4 0,4 1,5 1,5 0,4 0)))", + "MULTIPOLYGON(((2 0,0 0,0 5,1 5,2 4,2 5,4 5,4.5 4.5,5 5,5 4,4 4,4 3,5 3,5 0,2 0),(0 2,0.5 1.5,1 2,0 2),(1 4,2 3,2 4,1 4)))" +}; + +static std::string case_recursive_boxes_74[2] = +{ + // Needs another method to find isolated regions (previous attempted used parents, that is dropped now) + "MULTIPOLYGON(((3 5,5 5,5 0,0 0,0 5,3 5),(2 3,1.5 2.5,2 2,3 3,2 3),(3 3,4 2,4 3,3 3),(2 0,3 1,2 1,2 0)))", + "MULTIPOLYGON(((2 0,0 0,0 5,1 5,2 4,2 5,5 5,5 0,2 0),(2 1,2.5 0.5,3 1,2 1),(2 3,3 3,3 4,2 4,2 3),(3 1,4 1,5 2,3 2,3 1)))" +}; + +static std::string case_recursive_boxes_75[2] = +{ + // Needs intersection pattern 6 (skip all isolated ranks in between) + "MULTIPOLYGON(((3 1,2 1,1 0,0 0,0 5,5 5,5 3,4 2,5 2,5 0,3 0,3 1),(2 3,1 3,2 2,2 3),(3 4,3.5 3.5,4 4,3 4),(3 3,3 2,4 2,4 3,3 3)))", + "MULTIPOLYGON(((3 5,4 5,4.5 4.5,5 5,5 0,4 0,4 1,2 1,2 2,1 2,1 3,0 2,0 5,1 5,0.5 4.5,1 4,2 5,3 5),(3 4,3 3,4 4,3 4),(3 3,4 2,4 3,3 3)),((2 1,2 0,1 0,1 1,2 1)),((0 2,1 2,0.5 1.5,1 1,0 1,0 2)),((1 0,0 0,0 1,1 0)))" +}; + +static std::string case_recursive_boxes_76[2] = +{ + // Needs considering ix/ix turns (opposite in both directions) as the same region + "MULTIPOLYGON(((3 5,3 4,4 5,4 4,5 4,5 0,0 0,0 4,1 4,1 5,3 5),(3 1,2 1,2.5 0.5,3 1),(1 2,0 2,0.5 1.5,1 2)))", + "MULTIPOLYGON(((2 0,0 0,0 3,1 4,0 4,0 5,2 5,2 4,3 4,4 5,5 5,5 0,2 0),(3 1,4 0,4 1,3 1),(3 2,2 1,3 1,3 2),(3 3,3 4,2 3,3 3),(2 1,1 1,1.5 0.5,2 1),(4 3,4 4,3 4,4 3)))" +}; + +static std::string case_recursive_boxes_77[2] = +{ + // Needs discarding self i/u turn traveling to itself (for intersection only) + "MULTIPOLYGON(((1 2,2 3,2 2,1 1,1 2)),((1 4,1 5,2 5,2 4,1 4)),((1 4,0 3,0 4,1 4)),((4 2,4 1,3 1,3 3,4 2)),((3 1,3 0,1 0,2 1,2.5 0.5,3 1)),((3 3,3 5,4 5,4 3,3 3)))", + "MULTIPOLYGON(((3 4,3 5,4 5,4 4,3 4)),((3 1,3 0,2 0,3 1)),((3 1,2 1,2 2,3 2,3 1)),((2 3,2 4,3 3,2 3)),((2 1,1 0,0 0,1 1,2 1)),((1 4,2 3,2 2,0 2,0 4,1 4),(2 3,1 3,1.5 2.5,2 3)),((1 4,1 5,2 5,2 4,1 4)),((4 1,5 0,4 0,4 1)),((4 1,4 2,5 1,4 1)),((4 2,5 3,5 2,4 2)))" +}; + +static std::string case_recursive_boxes_78[2] = +{ + // Needs checking intersection/right_count in overlay, as was already done for union + "MULTIPOLYGON(((3 2,1 2,1 4,3 2)),((3 2,3 4,4 4,3.5 3.5,4.5 2.5,5 3,5 1,4 1,3 0,3 2),(4 2,3.5 1.5,4 1,4 2)),((1 2,1 1,0 0,0 2,1 2)),((0 4,1 3,0 3,0 4)),((0 4,1 5,1.5 4.5,2 5,3 5,3 4,0 4)),((1 1,2 1,1 0,1 1)),((4 1,5 0,4 0,4 1)),((4 3,4 5,5 4,5 3,4 3)))", + "MULTIPOLYGON(((2 4,1 4,1 5,3 5,2 4)),((2 4,4 4,4 3,5 3,5 2,4 1,4 2,3 2,3 3,2 2,2 4)),((2 2,2 1,0 1,0 4,1 3,1 4,2 3,1 2,2 2)),((1 4,0 4,0 5,1 4)),((0 1,1 0,0 0,0 1)),((4 1,3 1,3 2,4 1)))" +}; + +static std::string case_recursive_boxes_79[2] = +{ + // Found by bug in discard_self_turns_which_loop, it needs only checking intersection and not union + "MULTIPOLYGON(((2 3,2 2,1 2,1 4,4 4,4 3,2 3)),((2 0,0 0,0 2,1 2,1.5 1.5,2 2,2 1,1 1,2 0)),((2 0,2 1,3 2,4 2,3.5 1.5,4 1,4 0,2 0),(2 1,2.5 0.5,3 1,2 1)))", + "MULTIPOLYGON(((2 0,1 0,1 1,0 1,0 3,1 4,4 4,4 0,2 0),(2 2,1 2,1 1,2 2),(4 3,3 3,3 2,4 3)))" +}; + +static std::string case_recursive_boxes_80[2] = +{ + // Creates very small interior ring (~0) for union. This is a robustness + // problem, it should not be generated. The intersection point is a tiny + // distance away from real IP, and therefore it generates a correct + // interior ring, and is considered as valid. But if you combine this + // resulting union later with other polygons, with another rescaling model, + // it most probably will be invalid. + // These cases are found with recursive_polygons and size=4. + // For size=5 the scaling is such that it does not occur (so often) + // It needs removing the rescaling. + "MULTIPOLYGON(((3.5 2.5,4 3,4 2,3 2,3 3,3.5 2.5)))", + "MULTIPOLYGON(((1 1,1 2,2 1,1 1)),((3 2,3 3,4 3,3 2)))" +}; + +static std::string case_recursive_boxes_81[2] = +{ + "MULTIPOLYGON(((3 4,2 4,2 5,3 4)),((3 3,2 3,2 4,3 3)),((3 3,3 4,4 5,5 4,5 3,3 3),(4 4,3.5 3.5,4 3,4 4)),((2 1,2 0,1 0,1 1,0 1,1 2,3 2,4 3,4 1,2 1)))", + "MULTIPOLYGON(((2 4,2 2,1 2,0 1,0 3,1 3,1 4,2 4)),((2 4,2 5,3 4,2 4)),((3 4,5 4,5 3,3 3,3 4)),((1 4,0 4,0 5,1 5,1 4)),((2 1,2 0,0 0,0 1,2 1)),((4 2,5 2,4 1,3 1,4 2)),((4 1,5 1,4 0,4 1)))" +}; + +static std::string case_recursive_boxes_82[2] = +{ + // Contains two outgoing arcs on same ring causing current aggregation implementation to fail. + // Fixed by greatly simplifying the code, skipping aggregations and using sbs directly (which is now possible, now that isolation-information is much better) + "MULTIPOLYGON(((4 0,5 1,5 0,4 0)),((3 3,3 1,4 1,3 0,0 0,0 5,1 5,1 4,1.5 3.5,2 4,2 3,3 3),(2 2,2 1,3 2,2 2)),((2 4,3 5,4 5,3.5 4.5,5 3,3 3,3 4,2 4)),((4 4,4 5,5 5,4.5 4.5,5 4,4 4)))", + "MULTIPOLYGON(((2 4,2 5,4 5,4 4,2 4)),((2 4,2 3,5 3,5 2,4 2,4 1,1 1,1 2,0 2,0 5,1 5,1 4,2 4),(2 2,1 2,1.5 1.5,2 2),(3 2,3.5 1.5,4 2,3 2)),((4 4,5 5,5 4,4 4)))" +}; + +static std::string case_recursive_boxes_83[2] = +{ + // Needs to select on operation in cluster + "MULTIPOLYGON(((2 1,2 0,1 0,1 4,2 4,2 5,3 5,4 4,4 3,5 3,4 2,5 2,5 0,4 0,4 1,3 0,3 1,2 1),(2 3,1 3,2 2,2 3),(3 2,3 3,2 2,3 2)),((0 2,1 1,0 0,0 2)),((0 2,0 3,1 3,0 2)),((4 4,4 5,5 4,4 4)))", + "MULTIPOLYGON(((2 0,1 0,1 2,2 2,2 5,3 4,3 5,4 5,4 4,5 5,5 3,4 3,4 1,5 1,5 0,2 0),(2 1,3 2,2 2,2 1)),((0 5,1 5,1 4,0 4,0 5)),((1 1,0 1,0 2,1 1)),((1 2,0 2,1 3,1 2)))" +}; + +static std::string case_recursive_boxes_84[2] = +{ + // Need to set some ii-turns non-startable + "MULTIPOLYGON(((2 4,1 4,1 5,3 5,2 4)),((3 5,4 5,4 4,3 4,3 5)),((3 3,4 3,4 4,5 4,4.5 3.5,5 3,5 2,4 1,3 1,3 2,2 2,2 3,3 3),(4 2,3.5 1.5,4 1,4 2)),((0 3,0 4,1 4,1 3,0 3)))", + "MULTIPOLYGON(((4 4,4 5,5 5,5 4,4 4)),((0 5,1 5,1 4,0 4,0 5)),((2 0,1 0,1 1,2 1,2 2,3 2,3 0,2 0)),((2 4,2 3,1 3,2 4)),((2 4,2 5,3 5,2 4)),((2 3,2 2,1 2,2 3)),((1 3,1 1,0 1,0 3,1 3)),((5 1,5 0,4 0,4 1,5 1)))" +}; + +static std::string case_recursive_boxes_85[2] = +{ + // Contains rescaling problem + "MULTIPOLYGON(((5 2,5 3,6 3,6 2,5 2)),((6 5,6 6,7 6,7 5,6 5)),((3 6,1 6,2 7,3 7,3 6)),((3 6,3 5,2 5,2 6,2.5 5.5,3 6)))", + "MULTIPOLYGON(((2 5,2 6,3 6,2 5)),((6 1,6 2,7 2,6 1)),((5 4,5 5,6 4,5 4)),((0 6,0 7,1 7,0 6)),((3 3,3 2,2 2,3 3)),((3 3,3 4,4 5,4 4,3 3)),((4 4,5 3,4 3,4 4)))" +}; + +static std::string case_recursive_boxes_86[2] = +{ + // Positive ring and negative ring have same area. For difference, this + // needs to be handled correctly in assign_parents, + // skipping the optimization for union + "MULTIPOLYGON(((3 4,4 4,4 3,2 3,3 4)))", + "MULTIPOLYGON(((4 1,3 1,3 2,4 1)),((4 1,5 1,5 0,4 0,4 1)))" +}; + +static std::string case_recursive_boxes_87[2] = +{ + // Needs to handle ii-turns for difference like done for intersection + "MULTIPOLYGON(((5 2,5 3,6 3,5 2)),((3 4,3 3,2 3,3 4)),((3 4,2 4,3 5,3 4)),((2 4,2 3,1 3,2 4)))", + "MULTIPOLYGON(((2 0,3 1,3 0,2 0)),((6 3,6 4,7 4,7 3,6 3)),((3 9,3 10,4 9,3 9)),((8 7,8 8,9 8,8 7)))" +}; + +static std::string case_recursive_boxes_88[2] = +{ + "MULTIPOLYGON(((1 4,1 5,2 5,2 4,1 4)),((0 2,0 3,1 3,0 2)),((3 5,4 5,4 4,3 4,3 5)),((2 3,4 3,4 2,3 1,2 1,2 3),(3 3,2.5 2.5,3 2,3 3)),((4 1,3 0,3 1,4 1)),((4 2,5 2,5 0,4 0,4 2)))", + "MULTIPOLYGON(((4 0,4 1,5 1,5 0,4 0)),((3 4,3 3,1 3,1 5,3 5,2.5 4.5,3 4)),((3 4,3 5,4 5,4 4,3 4)),((1 1,2 0,1 0,1 1)),((1 1,1 2,2 2,2 1,1 1)),((1 2,0 2,0 3,1 3,1 2)),((4 4,5 4,5 2,4 2,4 4)))" +}; + +static std::string pie_21_7_21_0_3[2] = +{ + "MULTIPOLYGON(((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,3828 2144,3690 1812,3472 1527,3187 1309,2855 1171,2499 1125,2144 1171,1812 1309,1527 1527,1309 1812,1171 2144,1125 2499,1171 2855,1309 3187,2500 2500)))", + "MULTIPOLYGON(((2500 2500,1704 3295,1937 3474,2208 3586,2499 3625,2791 3586,3062 3474,3295 3295,2500 2500)),((2500 2500,3586 2791,3625 2500,3586 2208,2500 2500)))" +}; + +static std::string pie_23_19_5_0_2[2] = +{ + "MULTIPOLYGON(((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,3828 2144,3690 1812,3472 1527,3187 1309,2855 1171,2499 1125,2144 1171,1812 1309,1527 1527,1309 1812,1171 2144,1125 2499,1171 2855,1309 3187,1527 3472,1812 3690,2500 2500)))", + "MULTIPOLYGON(((2500 2500,3586 2791,3625 2500,3586 2208,3474 1937,3295 1704,3062 1525,2791 1413,2499 1375,2208 1413,1937 1525,1704 1704,1525 1937,1413 2208,1375 2500,1413 2791,1525 3062,1704 3295,1937 3474,2208 3586,2500 2500)),((2500 2500,2791 3586,3062 3474,2500 2500)))" +}; + +static std::string pie_7_14_5_0_7[2] = +{ + "MULTIPOLYGON(((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,2500 2500)))", + "MULTIPOLYGON(((2500 2500,3586 2791,3625 2500,3586 2208,3474 1937,3295 1704,3062 1525,2791 1413,2499 1375,2208 1413,1937 1525,1704 1704,1525 1937,1413 2208,1375 2500,2500 2500)),((2500 2500,1525 3062,1704 3295,1937 3474,2208 3586,2499 3625,2791 3586,3062 3474,2500 2500)))" +}; + +static std::string pie_16_16_9_0_2[2] = +{ + "MULTIPOLYGON(((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,3828 2144,3690 1812,3472 1527,3187 1309,2855 1171,2499 1125,2144 1171,1812 1309,1527 1527,2500 2500)))", + "MULTIPOLYGON(((2500 2500,3295 1704,3062 1525,2791 1413,2499 1375,2208 1413,1937 1525,1704 1704,1525 1937,1413 2208,1375 2500,1413 2791,1525 3062,1704 3295,1937 3474,2208 3586,2499 3625,2500 2500)),((2500 2500,3062 3474,3295 3295,2500 2500)))" +}; + +static std::string pie_7_2_1_0_15[2] = +{ + "MULTIPOLYGON(((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,2500 2500)))", + "MULTIPOLYGON(((2500 2500,2791 3586,3062 3474,2500 2500)),((2500 2500,3474 3062,3586 2791,3625 2500,3586 2208,3474 1937,3295 1704,3062 1525,2791 1413,2499 1375,2208 1413,1937 1525,1704 1704,1525 1937,1413 2208,1375 2500,2500 2500)))" +}; + +static std::string case_precision_m1[2] = +{ + "MULTIPOLYGON(((0 0,0 4,2 4,2 3,4 3,4 0,0 0)))", + "MULTIPOLYGON(((-1 -1,-1 8,2 8,2 7,2 3,4.0000005 2.9999995,4 7,4 8,8 8,8 -1,-1 -1)))" +}; + +static std::string case_precision_m2[2] = +{ + "MULTIPOLYGON(((0 0,0 4,2 4,2 3,4 3,4 0,0 0)),((3 6,3 7.5,4.5 7.5,4.5 6,3 6)))", + "MULTIPOLYGON(((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4.0000005 2.9999995,4 7,2 7)))" +}; + +// Case, not literally on this list but derived, to mix polygon/multipolygon in call to difference +static std::string ggl_list_20111025_vd[4] = + { + "POLYGON((0 0,0 4,4 0,0 0))", + "POLYGON((10 0,10 5,15 0,10 0))", + "MULTIPOLYGON(((0 0,0 4,4 0,0 0)))", + "MULTIPOLYGON(((10 0,10 5,15 0,10 0)))" + }; + +// Same, mail with other case with text "Say the MP is the 2 squares below and P is the blue-ish rectangle." +static std::string ggl_list_20111025_vd_2[2] = + { + "POLYGON((5 0,5 4,8 4,8 0,5 0))", + "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)),((4 0,4 2,6 2,6 0,4 0)))" + }; + +// Mail of h2 indicating that reversed order (in second polygon) has ix/ix problems +static std::string ggl_list_20120915_h2[3] = + { + "MULTIPOLYGON(((-2 5, -1 5, 0 5, 2 5, 2 -2, 1 -2, 1 -1, 0 -1,0 0, -1 0, -2 0, -2 5)))", + "MULTIPOLYGON(((0 0, 1 0, 1 -1, 0 -1, 0 0)), ((-1 5, 0 5, 0 0, -1 0, -1 5)))", + "MULTIPOLYGON(((-1 5, 0 5, 0 0, -1 0, -1 5)), ((0 0, 1 0, 1 -1, 0 -1, 0 0)))" + }; + +// Mail of volker, about another problem, but this specific example is causing two-point inner rings polygons which should be discarded +// (condition of num_points in detail/overlay/convert_ring.hpp) +static std::string ggl_list_20120221_volker[2] = + { + "MULTIPOLYGON(((1032 2130,1032 1764,2052 2712,1032 2130)),((3234 2580,2558 2690,3234 2532,3234 2580)),((2558 2690,2136 2790,2052 2712,2136 2760,2558 2690)))", + "MULTIPOLYGON(((3232 2532.469945355191,2136 2790,1032 1764,1032 1458,1032 1212,2136 2328,3232 2220.196721311475,3232 1056,1031 1056,1031 2856,3232 2856,3232 2532.469945355191),(3232 2412.426229508197,2136 2646,3232 2412.426229508197)))" + }; + +static std::string ggl_list_20140212_sybren[2] = + { + "MULTIPOLYGON(((0.494062 0.659354,0.471383 0.64654,0.446639 0.616561,0.47291 0.61171,0.495396 0.625263,0.494964 0.679709,0.494062 0.659354)))", + "MULTIPOLYGON(((0.4951091661995328 0.6614133543986973,0.495396 0.625263,0.50092 0.6492750000000001,0.494964 0.679709,0.477258 0.698703,0.4951091661995328 0.6614133543986973)),((0.452167 0.706562,0.433379 0.696888,0.442673 0.65792,0.464729 0.671387,0.452167 0.706562)))" + }; + +static std::string mail_2019_01_21_johan[4] = + { + // Contains a, b, both a and b (should have been merged), c (clip) + "MULTIPOLYGON(((1.2036811113357544 0.7535473108291626,1.1699721813201904 0.7535473108291626,1.1699721813201904 0.7663263082504272,1.2033243179321289 0.7672826647758484,1.2036811113357544 0.7535473108291626)))", + "MULTIPOLYGON(((1.2036811113357544 0.7535473108291626,1.2038091421127319 0.7486215233802795,1.1713759899139404 0.7495520114898682,1.1713759899139404 0.7535472512245178,1.2036811113357544 0.7535473108291626)))", + "MULTIPOLYGON(((1.2036811113357544 0.7535473108291626,1.1699721813201904 0.7535473108291626,1.1699721813201904 0.7663263082504272,1.2033243179321289 0.7672826647758484,1.2036811113357544 0.7535473108291626))," + "((1.2036811113357544 0.7535473108291626,1.2038091421127319 0.7486215233802795,1.1713759899139404 0.7495520114898682,1.1713759899139404 0.7535472512245178,1.2036811113357544 0.7535473108291626)))", + "MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)))" + }; + +static std::string ticket_9081[2] = + { + "MULTIPOLYGON(((0.5489109414010371 0.5774835110050927,0.4099611282054447 0.4644351568071598,0.4294011278595494 0.4843224236729239,0.4205359995313906 0.5115225580860201,0.4441572412013468 0.5184999851878852,0.5489109414010371 0.5774835110050927)),((0.562085028126843 0.5882018328808966,0.5644349663154944 0.591180348361206,0.568218114394707 0.5970364466647042,0.5838690879677763 0.6212632646137447,0.5873787029417971 0.6412877041753083,0.468699602592386 0.5866280231830688,0.4171010902425981 0.5220616039851281,0.4059124592966251 0.5563907478354578,0.3909547828925878 0.6022841397455458,0.520859401226844 0.9508041627246925,0.8595233008819849 0.8301950132755517,0.562085028126843 0.5882018328808966)))", + "MULTIPOLYGON(((0.2099392122251989 0.492066865490789,0.1124301889095737 0.5124668111209448,0.3306914939102383 0.6126684490171914,0.2099392122251989 0.492066865490789)),((0.5885369465145437 0.6478961722242873,0.5342320718598281 0.6686303269145104,0.5619623880692838 0.7033299168703926,0.5945761233023867 0.6823532655194001,0.5885369465145437 0.6478961722242873)),((0.5570738195183501 0.6001870087680015,0.5429714753344335 0.6231021858940831,0.5880357506342242 0.6450365518134291,0.5838690879677763 0.6212632646137447,0.568218114394707 0.5970364466647042,0.5570738195183501 0.6001870087680015)),((0.5498478321815098 0.5029279381860542,0.608691671498764 0.5163121433149205,0.5636607291345047 0.5894838094559455,0.8595233008819849 0.8301950132755517,0.8285440738598029 0.8412277162756114,0.9591357158116398 0.9011810663167211,0.8572649311807611 0.3566393017365032,0.5965816668471951 0.4111770689940296,0.5498478321815098 0.5029279381860542)),((0.3984249865018206 0.4526335964808558,0.3621206996557855 0.4602288471829723,0.4183516736935784 0.4730187483833363,0.4099611282054451 0.4644351568071601,0.3984249865018206 0.4526335964808558)))" + }; + +// Integer, ccw, open, reported by Volker +static std::string ticket_9942[2] = + { + "MULTIPOLYGON(((2058 1761,1996 1700,1660 1370,1324 1040,982 1148,881 981,2644 981,2338 1982)),((1996 1760,2338 2078,2674 1010,3010 1160,3254 2085,3352 2522,3427 2562,3688 2930,3688 2924,3688 2702,3439 2568,3352 2444,3218 1926,3010 998,2959 981,3773 981,3773 3702,732 3702,732 981,770 981,982 1310,1324 1148,1660 1442,1697 1472,1660 1436,1698 1473,1697 1472)))", + "MULTIPOLYGON(((646 932,646 788,870 1136)),((3032 1096,3010 1040,2981 988,3010 998)),((3688 2702,3352 2522,3032 1096,3352 1916,3688 2018)),((2981 988,2674 884,2338 1982,1996 1712,1660 1442,1324 1148,982 1310,870 1136,982 1238,1324 1136,1660 1304,1996 1460,2338 1610,2674 434)))", + }; + +// Simplified version showing the generated 'spike' which actually has an area because of the necessary rounding +static std::string ticket_9942a[2] = + { + "MULTIPOLYGON(((2058 1761,1996 1700,1660 1370,1324 1040,2644 981,2338 1982)))", + "MULTIPOLYGON(((2674 884,2338 1982,1996 1712,1660 1442,1324 1148,1324 1136,1660 1304,1996 1460,2338 1610,2674 434)))", + }; + +// Integer, ccw, open +static std::string ticket_10661[3] = + { + /* A */ "MULTIPOLYGON(((1701 985,3501 985,3501 2785,1701 2785,1701 985)))", + /* B */ "MULTIPOLYGON(((1698 1860,1698 1122,2598 1392,3492 1842,3492 32706,2598 2340,1698 1860)))", + /* C=A-B, */ + /* D */ "MULTIPOLYGON(((1698 2772,1698 1860,2598 2340,3492 2412,3492 32743,1698 2772)))" + // Reported problem was: validity of difference C-D + }; + +// Integer, ccw, open +static std::string ticket_10803[2] = + { + "MULTIPOLYGON(((3174 1374,3174 2886,1374 2886,1374 2139,3174 1374)))", + "MULTIPOLYGON(((1374 1092,1734 1092,3174 2526,3174 2886,1374 2886,1374 1092)))" + }; + +// Intersection was reported as invalid +static std::string ticket_11018[2] = + { + "MULTIPOLYGON(((66.32861177 -32.36106001,66.32805654 -32.36294657,66.32805697 -32.36294666,66.2558847 -32.60687137,66.18259719 -32.85172659,66.18259756 -32.85172667,66.10923256 -33.09561483,66.10923294 -33.09561491,66.03574675 -33.34044236,65.96214887 -33.58529255,65.96214918 -33.58529261,65.94391227 -33.64484979,65.839119 -33.032507,66.32861177 -32.36106001)),((67.77272059 -31.62519092,67.77272315 -31.62518165,67.77272398 -31.62517863,67.84057793 -31.37975346,67.90737994 -31.13429944,67.92189506 -31.0817063,68.151987 -31.013051,69.236142 -30.678138,70.320296 -31.013051,71.411955 -31.338781,72.016906 -32.187175,72.633163 -33.032507,72.464921 -34.015608,72.292755 -34.998316,71.385165 -35.656005,70.46265 -36.306671,69.236142 -36.312964,68.009631 -36.306671,67.087119 -35.656005,66.69381557 -35.37099587,66.7156576 -35.29873723,66.78843343 -35.05443368,66.86117133 -34.80910208,66.86117388 -34.80909338,66.86117494 -34.8090898,66.93281945 -34.5647568,67.00441882 -34.31942369,67.00441834 -34.31942359,67.07592335 -34.07510168,67.14737287 -33.83073849,67.21777858 -33.58537517,67.28811831 -33.34001123,67.35838201 -33.09560549,67.42858934 -32.85025274,67.49773049 -32.6058299,67.56682212 -32.36043528,67.63585135 -32.11504002,67.63585413 -32.11503015,67.63585478 -32.1150278,67.70382724 -31.86961401,67.77272059 -31.62519092)))", + "MULTIPOLYGON(((67.840578 -31.37975347,67.77272059 -31.62519092,66.61484414 -31.38427789,66.68556685 -31.13932219,67.840578 -31.37975347)))", + }; + + +// Integer, ccw, open +static std::string ticket_11674[2] = + { + "MULTIPOLYGON(((529 3217,529 998,5337 998,5337 1834,5070 2000,5337 2072,5337 3475,529 3475,529 3312,1734 2054,2934 1670,3230 1690,2934 1400,1734 1784,529 3217),(4140 2582,5071 2001,4140 1754,3231 1691,4140 2582)))", + "MULTIPOLYGON(((528 3218,528 2498,1734 1406,2556 1522,1734 1784,528 3218)),((4610 2288,5340 1178,5340 1832,4609 2289,4140 3002,2934 1574,2555 1521,2934 1400,4140 2582,4610 2288)))", + }; + +// Union was reported as invalid because of no generated interior rings, fixed +static std::string ticket_11984[2] = + { + "MULTIPOLYGON(((-104.025 72.5541,-95 67,-94 64,-95 60,-81.5804 61.9881,-75 52,-73.1862 50.0729,-75 48,-69.2 42.6,-96 56,-102 51,-119 49,-128 41,-126 33,-99 29,-61.9276 35.8291,-46 21,-30 10,-45 8,-104 6,-119 -8,-89 -18,-29 -10,-20 -9,-16 -11,-15 -13,-27 -29,-9 -13,-7 -14,-13.4737 -33.4211,-21 -34,-25 -36,-30 -40,-40 -49,-35 -50,-30 -51,-27 -53,-21 -52,-20.037 -52.642,-31.5314 -70.8413,-37.9815 -75.2274,-52.1689 -78.5148,-55 -78,-55 -79,-55 -79.1707,-112.692 -92.5385,-120 -94,-90.9143 -94.9695,-91 -95,-90 -99.5,-90 -103,-95 -114,-93 -116,-92 -117,-90 -119,-87.28 -119.68,-87 -120,-86.4444 -119.889,-82 -121,-80.821 -119.728,-77.6667 -119,-73 -119,-55 -114,-54 -114,-47 -114,-40 -121,-39.9327 -120.951,-39.3478 -121.609,-39 -123,-35.2182 -118.927,-24.536 -110.248,-22.875 -109.292,-22 -109,-22 -109,-16 -107,-9 -105,-7.83333 -104.833,-1.33333 -104.333,0.962934 -105.481,11.9682 -122.413,13 -129,20.1579 -120.053,22 -119,29.5 -115.25,30.2903 -114.968,39 -114,48 -112,47.156 -108.962,61 -117,54.9172 -103.176,65 -107,51.482 -95.3683,50.2426 -92.5515,53 -92,51.806 -91.0448,52 -91,49.1363 -88.9091,25.1429 -69.7143,22.733 -56.1314,24.9744 -49.3053,26.9174 -45.1157,27 -45,27.1481 -44.6543,33.4226 -34.0476,35.5919 -31.272,39 -29,39.4424 -26.3458,44.296 -20.136,46 -19,53 -14,53.3759 -13.4361,58.9297 -10.7874,115 13,110.286 13,114 14,112.414 14.7207,247.196 184.001,250 189,239.971 201.765,239 216,237.627 218.027,237.317 223.454,243 229)))", + "MULTIPOLYGON(((-31 6,-51 220,-84 241,-120 249,-146 224,-67 56,-74 52,-95 60,-38 10,-38 9)))", + }; + +static std::string ticket_12118[2] = + { + "MULTIPOLYGON(((13.08940410614013671875 -70.98416137695312500000,12.81384754180908203125 -67.55441284179687500000,12.60483169555664062500 -63.57923889160156250000,13.56438255310058593750 -54.91608428955078125000,13.80568027496337890625 -43.62073516845703125000,13.00057315826416015625 -33.85240554809570312500,9.29664993286132812500 -33.23409271240234375000,19.66869926452636718750 -14.42036247253417968750,-5.96064376831054687500 -17.19871711730957031250,-14.87041568756103515625 -6.99879980087280273438,-22.50806808471679687500 -27.92480468750000000000,-22.16161727905273437500 -45.15484619140625000000,-22.42436790466308593750 -54.01613616943359375000,-23.13828659057617187500 -59.28628540039062500000,-23.18314933776855468750 -68.01937866210937500000,-22.86939430236816406250 -72.78530883789062500000,-23.02970123291015625000 -72.76760864257812500000,-22.81921195983886718750 -73.54760742187500000000,-18.65677833557128906250 -73.25045776367187500000,3.16641521453857421875 -75.66014099121093750000,12.75282478332519531250 -76.71865844726562500000,13.08940410614013671875 -70.98416137695312500000)))", + "MULTIPOLYGON(((3.16641521453857421875 -75.66014099121093750000,12.75282478332519531250 -76.71865844726562500000,12.95001888275146484375 -74.61856842041015625000,3.16641521453857421875 -75.66014099121093750000)),((-22.84768676757812500000 -78.42963409423828125000,-20.92837524414062500000 -78.22530364990234375000,3.16641521453857421875 -75.66014099121093750000,-23.02970123291015625000 -72.76760864257812500000,-22.84768676757812500000 -78.42963409423828125000)))", + }; + +static std::string ticket_12125[2] = + { + "MULTIPOLYGON(((-5.96064376831054687500 -17.19871711730957031250,7.83307075500488281250 -32.98977279663085937500,8.81292819976806640625 -34.11151504516601562500,19.66869926452636718750 -14.42036247253417968750,-5.96064376831054687500 -17.19871711730957031250)),((-14.87041568756103515625 -6.99879980087280273438,-16.12161636352539062500 -18.30021858215332031250,-5.96064376831054687500 -17.19871711730957031250,-14.87041568756103515625 -6.99879980087280273438)))", + "MULTIPOLYGON(((7.83307075500488281250 -32.98977279663085937500,8.81292819976806640625 -34.11151504516601562500,13.00057315826416015625 -33.85240554809570312500,7.83307075500488281250 -32.98977279663085937500)),((-22.50806808471679687500 -27.92480468750000000000,7.83307075500488281250 -32.98977279663085937500,-14.87041568756103515625 -6.99879980087280273438,-22.50806808471679687500 -27.92480468750000000000)))", + }; + +static std::string ticket_12751[4] = + { + /* a */ "MULTIPOLYGON(((1920 1462,3720 1462,3720 3262,1920 3262,1920 1462)))", + /* b */ "MULTIPOLYGON(((1918 1957,1918 1657,2218 2189,1918 1957)),((3718 1957,3360 2233,3718 1561,3718 1957)),((3360 2233,2818 3253,2218 2189,2818 2653,3360 2233)))", + /* c=a-b */ "MULTIPOLYGON(((1920 1660,1920 1462,3720 1462,3720 3262,1920 3262,1920 1959,2218 2189,1920 1660),(3718 1561,3360 2233,3718 1957,3718 1561),(2818 2653,2218 2189,2818 3253,3360 2233,2818 2653)))", + /* d */ "MULTIPOLYGON(((1918 2155,1918 1957,2818 2653,3718 1957,3718 2154,2818 3055,1918 2155)))", + }; + +static std::string ticket_12752[2] = + { + "MULTIPOLYGON(((3232 2413,2136 2646,3232 2412,3232 2413)),((3232 2532,3232 2856,1031 2856,1031 1056,3232 1056,3232 2221,2136 2328,1032 1212,1032 1458,1032 1764,2136 2790,3232 2532)))", + "MULTIPOLYGON(((1032 2130,1032 1764,2052 2712,1032 2130)),((3234 2580,2558 2690,3234 2532,3234 2580)),((2558 2690,2136 2790,2052 2712,2136 2760,2558 2690)))" + }; + + +// Ticket for validity, input is CCW +static std::string ticket_12503[2] = + { + "MULTIPOLYGON (((15 17, 12 23, 15 20, 15 17)), ((35 23, 34 23, 34 24, 35 25, 36 25, 35 23)), ((8 6, 7 24, 10 25, 12 25, 12 23, 11 23, 10 13, 15 15, 8 6)), ((12 27, 8 31, 6 32, 6 38, 13 34, 13 31, 11 31, 12 30, 11 30, 12 29, 12 27)), ((7 24, 7 26, 6 31, 9 26, 7 24)), ((18 44, 15 45, 15 48, 18 44)), ((26 34, 18 44, 38 39, 26 34)), ((15 33, 13 34, 15 45, 15 33)), ((15 32, 15 33, 17 32, 15 32)), ((19 30, 17 32, 18 32, 16 38, 21 31, 19 30)), ((15 29, 13 30, 13 31, 15 32, 15 29)), ((15 28, 15 29, 17 29, 15 28)), ((14 27, 12 29, 13 30, 15 28, 14 27)), ((30 24, 25 24, 24 26, 25 27, 24 27, 23 28, 19 28, 19 29, 17 29, 18 30, 19 30, 22 29, 21 31, 26 34, 31 27, 28 30, 26 27, 30 24)), ((15 26, 15 28, 17 26, 15 26)), ((27 27, 31 27, 34 27, 32 26, 27 27)), ((19 25, 17 26, 19 26, 19 25)), ((41 15, 33 18, 35 23, 41 15)), ((23 24, 20 25, 19 26, 24 27, 24 26, 23 24)), ((33 15, 46 5, 48 4, 49 1, 32 13, 33 15)), ((32 23, 31 24, 32 25, 32 26, 33 25, 32 23)), ((35 23, 43 23, 44 23, 44 22, 43 22, 42 15, 35 23)), ((43 23, 36 25, 38 31, 35 25, 33 25, 34 27, 39 34, 40 39, 38 39, 44 42, 43 23)), ((48 22, 44 23, 48 46, 48 22)), ((18 11, 23 2, 15 3, 18 11)), ((29 17, 26 20, 22 23, 23 24, 25 24, 27 21, 28 20, 30 19, 29 17)), ((22 19, 21 20, 21 21, 24 19, 22 19)), ((31 23, 34 23, 31 19, 30 19, 31 22, 27 21, 30 24, 31 24, 31 23)), ((21 18, 20 21, 21 20, 21 18)), ((14 27, 15 26, 16 25, 19 25, 20 24, 22 23, 21 21, 20 21, 17 17, 15 20, 15 25, 12 25, 12 26, 14 26, 14 27), (20 21, 20 22, 17 24, 20 21)), ((22 17, 22 19, 23 18, 22 17)), ((30 15, 32 13, 31 10, 28 13, 30 15)), ((16 16, 17 17, 18 17, 16 16)), ((15 15, 15 17, 16 16, 15 15)), ((30 15, 29 16, 29 17, 30 17, 30 15)), ((33 15, 30 17, 31 19, 33 18, 33 15)), ((43 14, 44 22, 48 22, 48 4, 47 7, 42 13, 43 14)), ((43 14, 42 14, 41 15, 42 15, 43 14)), ((27 10, 25 6, 23 13, 27 11, 49 1, 24 2, 27 10)), ((28 13, 23 18, 24 19, 29 16, 28 13)), ((15 11, 15 15, 16 15, 17 13, 15 11)), ((18 11, 17 13, 19 15, 18 17, 21 18, 21 17, 20 15, 22 17, 23 13, 20 14, 18 11)), ((8 6, 8 5, 15 11, 15 3, 5 3, 8 6)))", + "MULTIPOLYGON(((13 18,18 18,18 23,13 23,13 18)))" + }; + +static std::string issue_630_a[2] = +{ + "MULTIPOLYGON(((-0.3 -0.1475,-0.3 +0.1475,+0.3 +0.1475,+0.3 -0.1475,-0.3 -0.1475)))", + "MULTIPOLYGON(((-0.605 +0.1575,+0.254777333596 +1.0172773336,+1.53436796127 -0.262313294074,+0.674590627671 -1.12209062767,-0.605 +0.1575)))" +}; + +static std::string issue_630_b[2] = +{ + "MULTIPOLYGON(((-0.3 -0.1475,-0.3 +0.1475,+0.3 +0.1475,+0.3 -0.1475,-0.3 -0.1475)))", + "MULTIPOLYGON(((-1.215 +0.7675000000000001,-0.4962799075873666 +1.486220092412633,+0.665763075292561 +0.324177109532706,-0.05295701712007228 -0.3945429828799273,-1.215 +0.7675000000000001)))" +}; + +static std::string issue_630_c[2] = +{ + "MULTIPOLYGON(((-0.3 -0.1475,-0.3 +0.1475,+0.3 +0.1475,+0.3 -0.1475,-0.3 -0.1475)))", + "MULTIPOLYGON(((-0.9099999999999999 +0.4625,-0.1912799075873667 +1.181220092412633,+0.9707630752925609 +0.01917710953270602,+0.2520429828799277 -0.6995429828799273,-0.9099999999999999 +0.4625)))" +}; + +static std::string issue_643[2] = +{ + "MULTIPOLYGON(((-0.420825839394717959862646239344 0.168094877926996288941552393226,5.29161113734201116187705338234 5.76881481261494233336861725547,12.2925110557019436896553088445 -1.37173140830596795858298264648,6.58007407896521545609402892296 -6.97245134299391278176472042105,-0.420825839394717959862646239344 0.168094877926996288941552393226)))", + "MULTIPOLYGON(((4.75985680877701196159479187986e-16 -0.26112514220036736611874061964,0 0,0.72337592336357892097709054724 0.600648602980154100450249643472,1.223386680467822174023240222 1.19163154396839887638748223253,1.72339743757206620422550713556 2.1342216197599452875977021904,1.72339742847305732453833115869 -2.01889900623749607433410346857,4.75985680877701196159479187986e-16 -0.26112514220036736611874061964)))" +}; + +static std::string bug_21155501[2] = + { + "MULTIPOLYGON(((-8.3935546875 27.449790329784214,4.9658203125 18.729501999072138,11.8212890625 23.563987128451217,9.7119140625 25.48295117535531,9.8876953125 31.728167146023935,8.3056640625 32.99023555965106,8.5693359375 37.16031654673677,-1.8896484375 35.60371874069731,-0.5712890625 32.02670629333614,-8.9208984375 29.458731185355344,-8.3935546875 27.449790329784214)))", + "MULTIPOLYGON(((4.9658203125 18.729501999072138,-3.4868710311820115 24.246968623627644,8.3589904332912 33.833614418115445,8.3056640625 32.99023555965106,9.8876953125 31.728167146023935,9.7119140625 25.48295117535531,11.8212890625 23.563987128451217,4.9658203125 18.729501999072138)),((-3.88714525609152 24.508246314579743,-8.3935546875 27.449790329784214,-8.9208984375 29.458731185355344,-0.5712890625 32.02670629333614,-1.8896484375 35.60371874069731,8.5693359375 37.16031654673677,8.362166569827938 33.883846345901595,-3.88714525609152 24.508246314579743)))", + }; + +static std::string mysql_21965285_b[2] = + { + "MULTIPOLYGON(((3 0, -19 -19, -7 3, -2 10, 15 0, 3 0)))", + "MULTIPOLYGON(((1 1, 3 0, 19 -8, -4 -3, 1 1)),((3 0, -2 7, -3 16, 1 19, 8 12, 3 0)))" + }; + +// formerly mysql_1 +static std::string mysql_23023665_7[2] = + { + "MULTIPOLYGON(((4 5,12 11,-12 -3,4 5)))", + "MULTIPOLYGON(((5 4,-14 0,1 0,5 4)),((1 6,13 0,10 12,1 6)))" + }; + +static std::string mysql_23023665_8[2] = + { + "MULTIPOLYGON(((0 0,0 40,40 40,40 0,0 0),(10 10,30 10,30 30,10 30,10 10)))", + "MULTIPOLYGON(((10 10,10 20,20 10,10 10)),((20 10,30 20,30 10,20 10)),((10 20,10 30,20 20,10 20)),((20 20,30 30,30 20,20 20)))" + }; + +static std::string mysql_23023665_9[2] = + { + "MULTIPOLYGON(((0 0, 0 40, 40 40, 40 0, 0 0),(10 10, 30 10, 30 30, 10 30, 10 10)))", + "MULTIPOLYGON(((15 10, 10 15, 10 17, 15 10)),((15 10, 10 20, 10 22, 15 10))," + "((15 10, 10 25, 10 27, 15 10)),((25 10, 30 17, 30 15, 25 10))," + "((25 10, 30 22, 30 20, 25 10)),((25 10, 30 27, 30 25, 25 10))," + "((18 10, 20 30, 19 10, 18 10)),((21 10, 20 30, 22 10, 21 10)))" + }; + +static std::string mysql_23023665_12[2] = + { + "MULTIPOLYGON(((6 7,18 14,-8 1,0 0,18 -8,6 7),(6 0,-4 3,5 3,6 0)))", + "MULTIPOLYGON(((2 3,-3 5,-10 -1,2 3)))" + }; + +static std::string mysql_regression_1_65_2017_08_31[2] = + { + "MULTIPOLYGON(((23.695652173913043 4.3478260869565215,23.333333333333336 4.166666666666667,25 0,23.695652173913043 4.3478260869565215)),((10 15,0 15,8.870967741935484 9.67741935483871,10.777777750841748 14.44444437710437,10 15)))", + "MULTIPOLYGON(((10 15,20 15,15 25,10 15)),((10 15,0 15,7 10,5 0,15 5,15.90909090909091 4.545454545454546,17 10,10 15)),((23.695652173913043 4.3478260869565215,20 2.5,25 0,23.695652173913043 4.3478260869565215)))", + }; + +#endif // BOOST_GEOMETRY_TEST_MULTI_OVERLAY_CASES_HPP diff --git a/src/boost/libs/geometry/test/algorithms/overlay/multi_overlay_common.hpp b/src/boost/libs/geometry/test/algorithms/overlay/multi_overlay_common.hpp new file mode 100644 index 000000000..5d6aa20ec --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/multi_overlay_common.hpp @@ -0,0 +1,40 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// 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) + + +#ifndef GEOMETRY_TEST_MULTI_OVERLAY_COMMON_HPP +#define GEOMETRY_TEST_MULTI_OVERLAY_COMMON_HPP + + +#include +#include + +#include +//#include + + + +template +void test_all(std::vector const& expected, double precision = 0.01) +{ + typename boost::range_const_iterator >::type iterator + = boost::begin(expected); + + typedef bg::model::multi_polygon > mp; + typedef bg::model::box

box; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("1", *iterator, + "MULTIPOLYGON(((0 1,2 5,5 3,0 1)),((1 1,5 2,5 0,1 1)))", + "MULTIPOLYGON(((3 0,0 3,4 5,3 0)))", precision); + iterator++; +} + + +#endif // GEOMETRY_TEST_MULTI_OVERLAY_COMMON_HPP diff --git a/src/boost/libs/geometry/test/algorithms/overlay/overlay.cpp b/src/boost/libs/geometry/test/algorithms/overlay/overlay.cpp new file mode 100644 index 000000000..f89bfabff --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/overlay.cpp @@ -0,0 +1,524 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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 + +// 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) + + +#include +#include +#include +#include +#include + +#include + +#if defined(TEST_WITH_SVG) +# include +#endif + +#include +#include + +#include +#include +#include + +//#include + +#if defined(TEST_WITH_SVG) +# include +#endif + +#include "multi_overlay_cases.hpp" + + +#if defined(TEST_WITH_SVG) +template +struct map_visitor +{ + map_visitor(Mapper& mapper) + : m_mapper(mapper) + , m_traverse_seq(0) + , m_do_output(true) + {} + + void print(char const* header) + {} + + template + void print(char const* header, Turns const& turns, int turn_index) + { + std::string style = "fill:rgb(0,0,0);font-family:Arial;font-size:6px"; + stream(turns, turns[turn_index], turns[turn_index].operations[0], header, style); + } + + template + void print(char const* header, Turns const& turns, int turn_index, int op_index) + { + std::string style = "fill:rgb(0,0,0);font-family:Arial;font-size:6px"; + stream(turns, turns[turn_index], turns[turn_index].operations[op_index], header, style); + } + + template + void visit_turns(int phase, Turns const& turns) + { + typedef typename boost::range_value::type turn_type; + int index = 0; + BOOST_FOREACH(turn_type const& turn, turns) + { + switch (phase) + { + case 1 : + m_mapper.map(turn.point, "fill:rgb(255,128,0);" + "stroke:rgb(0,0,0);stroke-width:1", 3); + break; + case 11 : + m_mapper.map(turn.point, "fill:rgb(92,255,0);" // Greenish + "stroke:rgb(0,0,0);stroke-width:1", 3); + break; + case 21 : + m_mapper.map(turn.point, "fill:rgb(0,128,255);" // Blueish + "stroke:rgb(0,0,0);stroke-width:1", 3); + break; + case 3 : + label_turn(index, turn); + break; + } + index++; + } + } + + template + std::string stream_turn_index(Turns const& turns, Turn const& turn, Operation const& op) + { + std::ostringstream out; + + if (turn.cluster_id >= 0) + { + out << "cl=" << turn.cluster_id << " "; + } + + // Because turn index is unknown here, and still useful for debugging, + std::size_t index = 0; + for (typename Turns::const_iterator it = turns.begin(); + it != turns.end(); ++it, ++index) + { + Turn const& t = *it; + if (&t == &turn) + { + out << index; + break; + } + } + + if (&op == &turn.operations[0]) { out << "[0]"; } + if (&op == &turn.operations[1]) { out << "[1]"; } + return out.str(); + } + + template + void visit_clusters(Clusters const& clusters, Turns const& turns) + { + typedef typename boost::range_value::type turn_type; + int index = 0; + BOOST_FOREACH(turn_type const& turn, turns) + { + if (turn.cluster_id >= 0) + { + std::cout << " TURN: " << index << " part of cluster " << turn.cluster_id << std::endl; + } + index++; + } + + for (typename Clusters::const_iterator it = clusters.begin(); it != clusters.end(); ++it) + { + std::cout << " CLUSTER " << it->first << ": "; + for (typename std::set::const_iterator sit + = it->second.turn_indices.begin(); + sit != it->second.turn_indices.end(); ++sit) + { + std::cout << " " << *sit; + } + std::cout << std::endl; + } + + std::cout << std::endl; + + } + + template + void visit_traverse(Turns const& turns, Turn const& turn, Operation const& op, const std::string& header) + { + typedef typename boost::range_value::type turn_type; + + if (! m_do_output) + { + return; + } + + std::cout << "Visit turn " << stream_turn_index(turns, turn, op) + << " " << bg::operation_char(turn.operations[0].operation) + << bg::operation_char(turn.operations[1].operation) + << " (" << bg::operation_char(op.operation) << ")" + << " " << header << std::endl; + + // Uncomment for more detailed debug info in SVG on traversal + std::string style + = header == "Visit" ? "fill:rgb(80,80,80)" : "fill:rgb(0,0,0)"; + + style += ";font-family:Arial;font-size:6px"; + + stream(turns, turn, op, header.substr(0, 1), style); + } + + template + void visit_traverse_reject(Turns const& turns, Turn const& turn, Operation const& op, + bg::detail::overlay::traverse_error_type error) + { + if (! m_do_output) + { + return; + } + std::cout << "Reject turn " << stream_turn_index(turns, turn, op) + << bg::operation_char(turn.operations[0].operation) + << bg::operation_char(turn.operations[1].operation) + << " (" << bg::operation_char(op.operation) << ")" + << " " << bg::detail::overlay::traverse_error_string(error) << std::endl; + //return; + + std::string style = "fill:rgb(255,0,0);font-family:Arial;font-size:7px"; + stream(turns, turn, op, bg::detail::overlay::traverse_error_string(error), style); + + m_do_output = false; + } + + template + void visit_traverse_select_turn_from_cluster(Turns const& turns, Turn const& turn, Operation const& op) + { + std::cout << "Visit turn from cluster " << stream_turn_index(turns, turn, op) + << " " << bg::operation_char(turn.operations[0].operation) + << bg::operation_char(turn.operations[1].operation) + << " (" << bg::operation_char(op.operation) << ")" + << std::endl; + return; + } + + template + void stream(Turns const& turns, Turn const& turn, Operation const& op, const std::string& header, const std::string& style) + { + std::ostringstream out; + out << m_traverse_seq++ << " " << header + << " " << stream_turn_index(turns, turn, op); + + out << " " << bg::visited_char(op.visited); + + add_text(turn, out.str(), style); + } + + template + bool label_operation(Turn const& turn, int index, std::ostream& os) + { + os << bg::operation_char(turn.operations[index].operation); + bool result = false; + if (! turn.discarded) + { + if (turn.operations[index].enriched.next_ip_index != -1) + { + os << "->" << turn.operations[index].enriched.next_ip_index; + if (turn.operations[index].enriched.next_ip_index != -1) + { + result = true; + } + } + else + { + os << "->" << turn.operations[index].enriched.travels_to_ip_index; + if (turn.operations[index].enriched.travels_to_ip_index != -1) + { + result = true; + } + } + + os << " {" << turn.operations[index].enriched.region_id + << (turn.operations[index].enriched.isolated ? " ISO" : "") + << "}"; + + if (! turn.operations[index].enriched.startable) + { + os << "$"; + } + } + + return result; + } + + template + void label_turn(int index, Turn const& turn) + { + std::ostringstream out; + out << index << " "; + if (turn.cluster_id != -1) + { + out << " c=" << turn.cluster_id << " "; + } + bool lab1 = label_operation(turn, 0, out); + out << " / "; + bool lab2 = label_operation(turn, 1, out); + if (turn.discarded) + { + out << "!"; + } + if (turn.has_colocated_both) + { + out << "+"; + } + bool const self_turn = bg::detail::overlay::is_self_turn(turn); + if (self_turn) + { + out << "@"; + } + + std::string font8 = "font-family:Arial;font-size:6px"; + std::string font6 = "font-family:Arial;font-size:4px"; + std::string style = "fill:rgb(0,0,255);" + font8; + if (self_turn) + { + if (turn.discarded) + { + style = "fill:rgb(128,28,128);" + font6; + } + else + { + style = "fill:rgb(255,0,255);" + font8; + } + } + else if (turn.discarded) + { + style = "fill:rgb(92,92,92);" + font6; + } + else if (turn.cluster_id != -1) + { + style = "fill:rgb(0,0,255);" + font8; + } + else if (! lab1 || ! lab2) + { + style = "fill:rgb(0,0,255);" + font6; + } + + add_text(turn, out.str(), style); + } + + template + void add_text(Turn const& turn, std::string const& text, std::string const& style) + { + int const margin = 5; + int const lineheight = 6; + double const half = 0.5; + double const ten = 10; + + // Map characteristics + // Create a rounded off point + std::pair p + = std::make_pair( + boost::numeric_cast(half + + ten * bg::get<0>(turn.point)), + boost::numeric_cast(half + + ten * bg::get<1>(turn.point)) + ); + m_mapper.text(turn.point, text, style, margin, m_offsets[p], lineheight); + m_offsets[p] += lineheight; + } + + + Mapper& m_mapper; + std::map, int> m_offsets; + int m_traverse_seq; + bool m_do_output; + +}; +#endif + +template +void test_overlay(std::string const& caseid, + std::string const& wkt1, std::string const& wkt2, + double expected_area, + std::size_t expected_clip_count, + std::size_t expected_hole_count) +{ + Geometry g1; + bg::read_wkt(wkt1, g1); + + Geometry g2; + bg::read_wkt(wkt2, g2); + + // Reverse if necessary + bg::correct(g1); + bg::correct(g2); + +#if defined(TEST_WITH_SVG) + bool const ccw = bg::point_order::value == bg::counterclockwise; + bool const open = bg::closure::value == bg::open; + + std::ostringstream filename; + filename << "overlay" + << "_" << caseid + << "_" << string_from_type::type>::name() + << (ccw ? "_ccw" : "") + << (open ? "_open" : "") +#if defined(BOOST_GEOMETRY_USE_RESCALING) + << "_rescaled" +#endif + << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + typedef bg::svg_mapper::type> svg_mapper; + + svg_mapper mapper(svg, 500, 500); + mapper.add(g1); + mapper.add(g2); + + // Input shapes in green (src=0) / blue (src=1) + mapper.map(g1, "fill-opacity:0.5;fill:rgb(153,204,0);" + "stroke:rgb(153,204,0);stroke-width:3"); + mapper.map(g2, "fill-opacity:0.3;fill:rgb(51,51,153);" + "stroke:rgb(51,51,153);stroke-width:3"); +#endif + + + typedef typename boost::range_value::type geometry_out; + typedef bg::detail::overlay::overlay + < + Geometry, Geometry, + bg::detail::overlay::do_reverse::value>::value, + OverlayType == bg::overlay_difference + ? ! bg::detail::overlay::do_reverse::value>::value + : bg::detail::overlay::do_reverse::value>::value, + bg::detail::overlay::do_reverse::value>::value, + geometry_out, + OverlayType + > overlay; + + typedef typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy_type; + + strategy_type strategy; + + typedef typename bg::rescale_overlay_policy_type + < + Geometry, + Geometry + >::type rescale_policy_type; + + rescale_policy_type robust_policy + = bg::get_rescale_policy(g1, g2); + +#if defined(TEST_WITH_SVG) + map_visitor visitor(mapper); +#else + bg::detail::overlay::overlay_null_visitor visitor; +#endif + + Geometry result; + overlay::apply(g1, g2, robust_policy, std::back_inserter(result), + strategy, visitor); + + std::string message; + bool const valid = check_validity::apply(result, caseid, g1, g2, message); + BOOST_CHECK_MESSAGE(valid, + "overlay: " << caseid << " not valid: " << message + << " type: " << (type_for_assert_message())); + + BOOST_CHECK_CLOSE(bg::area(result), expected_area, 0.001); + BOOST_CHECK_MESSAGE((bg::num_interior_rings(result) == expected_hole_count), + caseid + << " hole count: detected: " << bg::num_interior_rings(result) + << " expected: " << expected_hole_count); + BOOST_CHECK_MESSAGE((result.size() == expected_clip_count), + caseid + << " clip count: detected: " << result.size() + << " expected: " << expected_clip_count); + +#if defined(TEST_WITH_SVG) + mapper.map(result, "fill-opacity:0.2;stroke-opacity:0.4;fill:rgb(255,0,0);" + "stroke:rgb(255,0,255);stroke-width:8"); + +#endif +} + +#define TEST_INTERSECTION(caseid, area, clips, holes) (test_overlay) \ + ( #caseid "_int", caseid[0], caseid[1], area, clips, holes) +#define TEST_UNION(caseid, area, clips, holes) (test_overlay) \ + ( #caseid "_union", caseid[0], caseid[1], area, clips, holes) +#define TEST_DIFFERENCE_A(caseid, area, clips, holes) (test_overlay) \ + ( #caseid "_diff_a", caseid[0], caseid[1], area, clips, holes) +#define TEST_DIFFERENCE_B(caseid, area, clips, holes) (test_overlay) \ + ( #caseid "_diff_b", caseid[1], caseid[0], area, clips, holes) + +#define TEST_INTERSECTION_WITH(caseid, index1, index2, area, clips, holes) (test_overlay) \ + ( #caseid "_int_" #index1 "_" #index2, caseid[index1], caseid[index2], area, clips, holes) +#define TEST_UNION_WITH(caseid, index1, index2, area, clips, holes) (test_overlay) \ + ( #caseid "_union" #index1 "_" #index2, caseid[index1], caseid[index2], area, clips, holes) + +template +void test_all() +{ + typedef bg::model::point point_type; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + + TEST_UNION(case_multi_simplex, 14.58, 1, 0); + TEST_INTERSECTION(case_multi_simplex, 6.42, 2, 0); + + TEST_DIFFERENCE_A(case_multi_simplex, 5.58, 5, 0); + TEST_DIFFERENCE_B(case_multi_simplex, 2.58, 4, 0); + + // Contains 5 clusters, needing immediate selection of next turn + TEST_UNION_WITH(case_58_multi, 0, 3, 19.8333333, 2, 0); + + // Contains many clusters, needing to exclude u/u turns + TEST_UNION(case_recursive_boxes_3, 56.5, 17, 6); + + // Contains 4 clusters, one of which having 4 turns + TEST_UNION(case_recursive_boxes_7, 7.0, 2, 0); + + // Contains 5 clusters, needing immediate selection of next turn + TEST_UNION(case_89_multi, 6.0, 1, 0); + + // Needs ux/next_turn_index==-1 to be filtered out + TEST_INTERSECTION(case_77_multi, 9.0, 5, 0); + TEST_UNION(case_101_multi, 22.25, 1, 3); + TEST_INTERSECTION(case_101_multi, 4.75, 4, 0); + + TEST_INTERSECTION(case_recursive_boxes_11, 1.0, 2, 0); + TEST_INTERSECTION(case_recursive_boxes_30, 6.0, 4, 0); + + TEST_UNION(case_recursive_boxes_4, 96.75, 1, 2); + TEST_INTERSECTION_WITH(case_58_multi, 2, 6, 13.25, 1, 1); + TEST_INTERSECTION_WITH(case_72_multi, 1, 2, 6.15, 3, 1); + TEST_UNION(case_recursive_boxes_12, 6.0, 6, 0); + TEST_UNION(case_recursive_boxes_13, 10.25, 3, 0); + + +// std::cout +// << " \"" +// << bg::inverse(case_65_multi[0], 1.0) +// << "\"" << std::endl; +} + +int test_main(int, char* []) +{ + test_all(); +// test_all(); + return 0; + } diff --git a/src/boost/libs/geometry/test/algorithms/overlay/overlay_cases.hpp b/src/boost/libs/geometry/test/algorithms/overlay/overlay_cases.hpp new file mode 100644 index 000000000..65bea7fbb --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/overlay_cases.hpp @@ -0,0 +1,1394 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test +// +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2015, 2016. +// Modifications copyright (c) 2015-2016, 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 +// http://www.boost.org/LICENSE_1_0.txt) + + +#ifndef BOOST_GEOMETRY_TEST_OVERLAY_CASES_HPP +#define BOOST_GEOMETRY_TEST_OVERLAY_CASES_HPP + +#include + +// For case 1..79, See powerpoint doc/other/test_cases/overlay_cases.ppt + +static std::string case_1[2] = { + "POLYGON((0 1,2 5,5 3,0 1))", + "POLYGON((3 0,0 3,4 5,3 0))" }; + +static std::string ccw_case_1[2] = { + "POLYGON((0 1,5 3,2 5,0 1))", + "POLYGON((3 0,4 5,0 3,3 0))" }; + +static std::string open_case_1[2] = { + "POLYGON((0 1,2 5,5 3))", + "POLYGON((3 0,0 3,4 5))" }; + + +static std::string case_2[2] = { + "POLYGON((0 2,2 5,5 3,3 0,0 2))", + "POLYGON((0 4,4 5,5 1,1 0,0 4))" }; + +static std::string case_3[2] = { + "POLYGON((1 2,2 4,4 3,3 1,1 2))", + "POLYGON((1 1,1 4,4 4,4 1,1 1))" }; + +static std::string case_3_sph[2] = { + "POLYGON((1 2,2 4.0012148518458881,4 3,3.0001521347633209 1.0003046174216719,1 2))", + "POLYGON((1 1,1 4,4 4,4 1,1 1))" }; + +static std::string case_3_2[2] = { + "POLYGON((1 1,1 2,1 4,2 4,4 4,4 3,4 1,3 1,1 1))", + "POLYGON((1 1,1 4,4 4,4 1,1 1))" }; + +static std::string case_3_2_sph[2] = { + "POLYGON((1 1,1 2,1 4,2 4.0012148518458881,4 4, 4 3,4 1,3.0001521347633209 1.0003046174216719,1 1))", + "POLYGON((1 1,1 4,4 4,4 1,1 1))" }; + +static std::string case_4[2] = { + "POLYGON((0 2,2 5,5 3,3 0,0 2))", + "POLYGON((0 4,4 5,5 1,1 0,0 4),(1 1,2 1,2 2,1 2,1 1),(3 3,4 3,4 4,3 4,3 3))" }; + +static std::string case_5[2] = { + "POLYGON((0 4,1 5,2.5 4,3.5 5,5 4,4 3,5 2,4 1,3.5 0,3 1,2.5 0,2 1,1.5 0,1 3.5,0.25 3,1 2.5,0 2,0 4))", + "POLYGON((0.5 0.5,0.5 4.5,4.5 4.5,4.5 0.5,0.5 0.5))" + }; + +static std::string case_6[2] = { + "POLYGON((0 1,2 5,5 2,0 1))", + "POLYGON((1 3,2 5,5 2,1 3))" }; + +static std::string case_6_sph[2] = { + "POLYGON((0 1,2 5,5 2,0 1))", + "POLYGON((0.99816884334995659 3.0004544452169379,2 5,5 2,0.99816884334995659 3.0004544452169379))" }; + +static std::string case_7[2] = { + "POLYGON((0 1,1 3,5 2,0 1))", + "POLYGON((1 3,2 5,5 2,1 3))" }; + +static std::string case_8[2] = { + "POLYGON((0 0,0 4,4 0,0 0))", + "POLYGON((1 3,4 4,3 1,1 3))" }; + +static std::string case_8_sph[2] = { + "POLYGON((0 0,0 4,4 0,0 0))", + "POLYGON((1.0023984691325358 3.0008039480973441,4 4,3.0005710779764270 1.0017165445544389,1.0023984691325358 3.0008039480973441))" }; + +static std::string case_9[2] = { + "POLYGON((0 0,0 4,4 0,0 0))", + "POLYGON((2 2,2 4,5 4,2 2))" }; + +static std::string case_9_sph[2] = { + "POLYGON((0 0,0 4,4 0,0 0))", + "POLYGON((2.0021918671997510 2.0014662914956771,2 4,5 4,2.0021918671997510 2.0014662914956771))" }; + +static std::string ccw_case_9[2] = { + "POLYGON((0 0,4 0,0 4,0 0))", + "POLYGON((2 2,5 4,2 4,2 2))" }; + +static std::string open_case_9[2] = { + "POLYGON((0 0,0 4,4 0))", + "POLYGON((2 2,2 4,5 4))" }; + +static std::string case_10[2] = { + "POLYGON((0 0,2 4,4 0,0 0))", + "POLYGON((1 2,2 5,3 2,2 4,1 2))" }; + +static std::string case_10_sph[2] = { + "POLYGON((0 0,2 4,4 0,0 0))", + "POLYGON((1.0027234797707729 2.0081941097810105,2 5,2.9972765202292275 2.0081941097810105,2 4,1.0027234797707729 2.0081941097810105))" }; + +static std::string case_11[2] = { + "POLYGON((0 0,0 4,4 0,0 0))", + "POLYGON((1 2,2 2,2 1,1 1))" }; + +static std::string case_11_sph[2] = { + "POLYGON((0 0,0 4,4 0,0 0))", + "POLYGON((1 2,2 2.0036594926050890,2 1,1 1))" }; + +static std::string case_12[2] = { + "POLYGON((0 1,1 4,2 2,3 4,4 1,0 1))", + "POLYGON((0 3,2 4,4 3,0 3))" }; + +static std::string case_13[2] = { + "POLYGON((0 1,1 2,3 0,0 1))", + "POLYGON((0 3,2 3,2 1,0 3))" }; + +static std::string case_13_sph[2] = { + "POLYGON((0 1,1 2,3 0,0 1))", + "POLYGON((0 2.9977189008308094,2 3,2 1.0004570537241211,0 2.9977189008308094))" }; + +static std::string case_14[2] = { + "POLYGON((0 0,0 4,2 2,4 0,0 0))", + "POLYGON((1 3,4 4,3 1,1 3))" }; + +static std::string case_14_sph[2] = { + "POLYGON((0 0,0 4,2 2.0036594926050877,4 0,0 0))", + "POLYGON((1.0023984691325358 3.0008039480973441,4 4,3.0005710779764270 1.0017165445544389,1.0023984691325358 3.0008039480973441))" }; + +static std::string case_15[2] = { + "POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))", + "POLYGON((1 3,4 4,3 1,1 3))" }; + +static std::string case_15_sph[2] = { + "POLYGON((0 0,0 4,1.5 2.5037147591481679,2.5 1.5031461368777814,4 0,0 0))", + "POLYGON((1.0023984691325358 3.0008039480973441,4 4,3.0005710779764270 1.0017165445544389,1.0023984691325358 3.0008039480973441))" }; + +static std::string case_16[2] = { + "POLYGON((1 2,3 4,2 1,1 2))", + "POLYGON((1 0,1 2,2 1,3 4,2 3,3 5,4 0,1 0))" }; + +static std::string case_16_sph[2] = { + "POLYGON((1 2,3 4,2 1,1 2))", + "POLYGON((1 0,1 2,2 1,3 4,2.0013644968330810 3.0027358616998980,3 5,4 0,1 0))" }; + +static std::string case_17[2] = { + "POLYGON((0 0,0 4,4 0,0 0))", + "POLYGON((1 1,1 3,3 1,1 1))" }; + +static std::string case_17_sph[2] = { + "POLYGON((0 0,0 4,4 0,0 0))", + "POLYGON((1 1,1 3.0031983963093531,3 1.0022887548647623,1 1))" }; + +static std::string case_18[2] = { + "POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))", + "POLYGON((1 1,1 3,3 1,1 1))" }; + +static std::string case_18_sph[2] = { + "POLYGON((0 0,0 4,1.5 2.5037147591481679,2.5 1.5031461368777814,4 0,0 0))", + "POLYGON((1 1,1 3.0031983963093531,3 1.0022887548647623,1 1))" }; + +static std::string case_19[2] = { + "POLYGON((2 0,1 3,5 2,2 0))", + "POLYGON((1 3,2 5,5 2,1 3))" }; + +static std::string case_20[2] = { + "POLYGON((2 0,1 3,5 2,2 0))", + "POLYGON((2 0,1 3,5 2,2 0))" }; + +static std::string case_21[2] = { + "POLYGON((1 0,0 5,5 2,1 0),(2 1,3 2,1 3,2 1))", + "POLYGON((2 1,1 3,3 2,2 1))" }; + +static std::string case_22[2] = { + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((2 4,5 5,4 2,2 4))" }; + +static std::string case_23[2] = { + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((3 3,4 2,1 1,3 3))" }; + +static std::string case_24[2] = { + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((2 2,4 2,1 1,2 2))" }; + +static std::string case_25[2] = { + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((3 1,4 2,5 0,3 1))" }; + +static std::string case_26[2] = { + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((3 1,4 2,5 4,4 0,3 1))" }; + +static std::string case_27[2] = { + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((1 1,4 2,5 0,1 1))" }; + +static std::string case_28[2] = { + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((1 1,4 2,5 4,5 0,1 1))" }; + +static std::string case_29[2] = { + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((4 4,5 1,4 2,1 1,4 4))" }; + +static std::string case_30[2] = { + "POLYGON((1 0,0 3,2 2,3 3,1 0))", + "POLYGON((1 2,2 2,2 4,4 3,3 1,1 2))" }; + +static std::string case_31[2] = { + "POLYGON((0 0,0 3,2 2,0 0))", + "POLYGON((4 1,2 2,3 3,4 1))" }; + +static std::string case_32[2] = { + "POLYGON((0 0,0 3,2 2,0 0))", + "POLYGON((4 1,3 0,2 2,4 1))" }; + +static std::string case_33[2] = { + "POLYGON((0 0,0 3,2 2,0 0))", + "POLYGON((3 3,3 0,2 2,3 3))" }; + +static std::string case_34[2] = { + "POLYGON((2 0,0 3,4 2,2 0))", + "POLYGON((2 1,4 2,5 3,4 1,2 1))" }; + +static std::string case_35[2] = { + "POLYGON((1 0,0 3,5 3,4 2,5 1,1 0))", + "POLYGON((2 2,4 2,4 1,2 2))" }; + +static std::string case_36[2] = { + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((1 5,5 5,4 2,3 3,2 1,1 2,1 5))" }; + +static std::string case_37[2] = { + "POLYGON((4 0,2 2,5 5,4 0))", + "POLYGON((0 2,4 3,2 2,4 1,0 2))" }; + +static std::string case_38[2] = { + "POLYGON((4 0,3 3,2 2,4 5,5 2,4 0))", + "POLYGON((1 1,1 3,4 4,3 3,4 2,1 1))" }; + +static std::string case_39[2] = { + "POLYGON((0 4,4 8,7 7,8 4,5 3,4 0,0 4))", + "POLYGON((0 4,4 8,5 5,8 4,7 1,4 0,0 4))" }; + +static std::string case_40[2] = { + "POLYGON((0 1,1 2,2 1,3 2,4 1,5 2,4 0,2 0,0 1))", + "POLYGON((0 3,2 4,4 4,5 2,4 3,3 2,2 3,1 2,0 3))" }; + +static std::string case_41[2] = { + "POLYGON((3 1,1 4,3 3.5,5 3,3 1))", + "POLYGON((3 1,1 4,5 3,4 2,3 1))" }; + +static std::string case_42[2] = { + "POLYGON((3 1,1 4,3 3.5,5 3,5 3,3 1))", + "POLYGON((3 1,1 4,1 4,5 3,4 2,3 1))" }; + +// keyholing +static std::string case_43[2] = { + "POLYGON((1 2,1 1,2 1,2 2.25,3 2.25,3 0,0 0,0 3,3 3,2.75 2,1 2))", + "POLYGON((1.5 1.5,1.5 2.5,2.5 2.5,2.5 1.5,1.5 1.5))" }; +// self-tangency + +static std::string case_44[2] = { + "POLYGON((0 0,0 3,3 3,3 2,0 1.5,3 1,3 0,0 0))", + "POLYGON((1 1,1 2,2 2,2 1,1 1))" }; +// self-intersection + +static std::string case_45[2] = { + "POLYGON((0.5 0,0.5 3,3 3,3 2,0 1.5,3 1,3 0,0.5 0))", + "POLYGON((1 1,1 2,2 2,2 1,1 1))" }; +// self-tangent + +static std::string case_46[2] = { + "POLYGON((2 0,2 3,5 3,5 2,2 1.5,5 1,5 0,2 0))", + "POLYGON((1.5 1,1.5 2,2.5 2,2.5 1,1.5 1))" }; +// self-tangent + +static std::string case_47[2] = { + "POLYGON((2.5 0,2.5 3,5 3,5 2,2 1.5,5 1,5 0,2.5 0))", + "POLYGON((2 1,2 2,3 2,3 1,2 1))" }; + +static std::string case_49[2] = { + "POLYGON((1 0,1 1,2 2,3 3,4 3,4 0,1 0))", + "POLYGON((0 2,2 5,5 2,5 0,2 0,2 2,0 2))" }; + + +// 50, collinear opposite +static std::string case_50[2] = { + "POLYGON((0 0,0 3,2 3,4 3,4 0,0 0))", + "POLYGON((0 3,0 5,5 5,5 0,4 0,4 3,2 3,0 3))" }; + +// 51, fit +static std::string case_51[2] = { + "POLYGON((0 0,0 5,5 5,5 0,0 0),(4 1,3 4,1 2,4 1))", + "POLYGON((1 2,3 4,4 1,1 2))" }; + +// 52, partially equal, touching each other +static std::string case_52[2] = { + "POLYGON((0 0,1 4,3 1,4 4,1 4,5 5,5 0,0 0))", + "POLYGON((0 0,1 4,3 1,4 4,1 4,5 5,4 1,0 0))" }; + +// 53, wrapping a box, self-touching +static std::string case_53[3] = { + "POLYGON((2 2,2 3,3 3,3 2,2 2))", + // ST self-tangent ext. ring, ST_IsValid=false + "POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,3 2,3 1,4 1,4 4,1 4,1 3,2 3,2 2,0 2))", + // IET tangent ext/int ring, ST_IsValid=true + "POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,0 2),(1 3,2 3,2 2,3 2,3 1,4 1,4 4,1 4,1 3))" + }; + +static std::string case_54[4] = { + // ST: self-tangent ext. ring + "POLYGON((2 2,2 3,4 3,4 0,1 0,1 2,2 2,2 1,3 1,3 2,2 2))", + // IET: tangent ext/int ring + "POLYGON((2 2,2 3,4 3,4 0,1 0,1 2,2 2),(2 1,3 1,3 2,2 2,2 1))", + // other like in case53 + case_53[1], // ST + case_53[2] // IET + }; + +static std::string case_55[4] = { + // ST: self-tangent ext. ring + "POLYGON((2 2,3 3,4 3,4 0,1 0,1 1,2 2,2 1,3 1,3 2,2 2))", + // IET: tangent ext/int ring + "POLYGON((2 2,3 3,4 3,4 0,1 0,1 1,2 2),(2 1,3 1,3 2,2 2,2 1))", + // ST: self-tangent ext. ring + "POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,3 1,4 1,4 4,1 4,1 3,2 2,0 2))" , + // IET: tangent ext/int ring + "POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,0 2),(1 3,2 2,3 1,4 1,4 4,1 4,1 3))" + + // B, not a 4-fold intersection + //"POLYGON((2 2,3 3,4 3,4 0,1 0,1 1,2 2),(2 1,3 1,3 2,2.0 1.9,2 1))", + //"POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,0 2),(1 3,2.1 2.1,3 1,4 1,4 4,1 4,1 3))" + // C, not a 4-fold intersection, + //"POLYGON((2 2,3 3,4 3,4 0,1 0,1 1,2 2),(2 1,3 1,3 2,2.0 1.9,2 1))", + //"POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,0 2),(1 3,1.9 1.9,3 1,4 1,4 4,1 4,1 3))" + }; + +static std::string case_56[2] = { + "POLYGON((0 0,0 1,2 3,3 0,4 2,5 0,0 0))", + //"POLYGON((0 -1,0 1,2 3,3 0,4 2,5 -1,0 -1))", + //"POLYGON((0 1,0 4,5 4,5 0,3 0,4 1,4 3,2 3,2 1,3 0,0 0))" + "POLYGON((1 0,1 4,5 4,5 0,3 0,4 1,4 3,2 3,2 1,3 0,1 0))" + }; + +static std::string case_57[2] = { + case_56[0], + //"POLYGON((0 2,4 5,5 1,0 2))" + //"POLYGON((0 -1,0 1,2 3,3 0,4 2,5 -1,0 -1))", + //"POLYGON((0 0,0 1,2 3,3 0,4 2,6 0,0 0))", + "POLYGON((0 0,4 5,5 0,0 0))" + }; + +// Case 58, either one ring with self-tangencies defining holes, +// or three inner rings tangent to outer ring +static std::string case_58[3] = { + "POLYGON((3 3,3 4,4 4,4 3,3 3))", + // ST: self-tangent + "POLYGON((0 2,0 5,4 4,1 4,1 3,4 4,2 3,2 2,4 4,3 2,4 2,4 4,5 0,0 2))", + // IET: inner/ext tangency (the correct version) + "POLYGON((0 2,0 5,4 4,5 0,0 2),(4 4,1 4,1 3,4 4),(4 4,2 3,2 2,4 4),(4 4,3 2,4 2,4 4))" + }; + +static std::string case_59[3] = { + "POLYGON((0.5 3,3.5 3.5,3 0.5,2 2,0.5 3))", + case_53[1], // ST: self-tangent + case_53[2] // IET: inner/ext tangency + }; +static std::string case_60[3] = { + "POLYGON((1 3,5 5,3 1,1 3))", + case_53[1], // ST: self-tangent + case_53[2] // IET: inner/ext tangency + }; + +// 60-..., actually there are multi-polygons but expressed here using self-tangencies +static std::string case_61[2] = { + "POLYGON((1 1,1 2,2 2,2 3,3 3,3 2,2 2,2 1,1 1))", + "POLYGON((1 2,1 3,2 3,2 4,3 4,3 3,2 3,2 2,1 2))" + }; + +// 62..69 TODO, most are multi but can be expressed by self-tangent-polygon as well + +static std::string case_70[2] = { + "POLYGON((1 0,1 3,4 3,4 0,1 0),(2 1,3 1,3 2,2 2,2 1))", + "POLYGON((1 0,1 2,4 2,4 0,3 0,3 1,2 1,2 0,1 0))" + }; + +static std::string case_71[2] = { + "POLYGON((0 0,0 3,1 3,1 1,3 1,3 2,2 2,2 3,3 3,3 2,4 2,4 0,0 0))", + "POLYGON((0 2,0 3,3 3,3 2,0 2))" + }; + +static std::string case_72[2] = { + "POLYGON((0 3,4 4,3 0,3 3,2 1,1 2,3 3,0 3))", + "POLYGON((0 0,1 4,3 3,4 1,0 0))" + }; + +// 73..78: multi + +static std::string case_79[2] = { + "POLYGON((0 0,0 5,5 5,5 3,2 3,2 2,5 2,5 0,0 0))", + "POLYGON((0 0,0 5,5 5,5 0,2 0,2 2,1 2,1 0,0 0))" + }; + +// Two colocations of interior/exterior ring +static std::string case_80[2] = { + "POLYGON((0 5,5 10,10 5,5 0,0 5),(10 5,4 6,5 4,10 5))", + "POLYGON((10 0,10 10,20 10,20 0,10 0),(10 5,15 3,18 8,10 5))" + }; + +// Interior ring touches other ring in the middle +static std::string case_81[2] = { + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 4,2 7,5 1,10 4))", + "POLYGON((10 0,10 10,20 10,20 0,10 0),(10 6,15 3,18 8,10 6))" + }; + + +// Missing intersection, simpler version of case_108_multi +static std::string case_82[3] = { + "POLYGON((4 4,4 3,1 3,1 2,0 2,0 6,1 6,2 5,2 4,4 4),(2 4,1 4,1.5 3.5,2 4))", + "POLYGON((3 6,3 5,5 5,5 0,4 0,4 1,2 1,2 3,2 4,1 3,1 5,2 6,3 6),(3 3,3 2,4 2,4 4,2 4,3 3))", + "POLYGON((3 6,3 5,5 5,5 1, 2 1,2 3,2 4,1 3,1 5,2 6,3 6),(3 3,3 2,4 2,4 4,2 4,3 3))" + }; + +static std::string case_83[2] = { + "POLYGON((2 4,2 2,0 2,0 6,2 4),(2 4,1 4,1.5 3.5,2 4))", + "POLYGON((5 6,5 0,2 4,1 3,0 6,5 6))" + }; + + +// Cases for u/u touches creating interior rings (originally they were called 80-89. +// but in another branch - now renamed to 90-99) + +static std::string case_90[2] = + { + // union has one polygon with two holes; one of them is + // touching the exterior ring + // reported by MySQL QA on Aug 19, 2015 + "POLYGON((0 6,-11 -6,6 0,0 6),(3 1,5 0,-2 0,3 1))", + "POLYGON((5 4,6 0,9 12,-7 -12,5 -19,5 4))" + }; + +static std::string case_91[2] = + { + // union has a polygon with one hole touching the exterior ring + "POLYGON((0 0,10 10,20 0,0 0))", + "POLYGON((10 5,30 10,20 0,20 5,10 5))" + }; + +static std::string case_92[2] = + { + "POLYGON((0 0,10 10,20 0,0 0))", + "POLYGON((10 10,30 10,20 0,20 5,10 10))" + }; + +static std::string case_93[2] = + { + // union as a single polygon and two holes both touching the + // exterior ring at vertices + "POLYGON((0 0,10 10,20 0,0 0))", + "POLYGON((10 5,20 7,10 10,30 10,20 0,20 5,10 5))" + }; + +static std::string case_94[2] = + { + "POLYGON((0 0,10 10,20 0,0 0))", + "POLYGON((15 5,20 7,10 10,30 10,20 0,20 5,15 5))" + }; + +static std::string case_95[2] = + { + // union has a single polygon and two holes that touch each + // other at a vertex + "POLYGON((0 0,0 40,40 40,40 0,0 0),(10 10,30 10,30 30,10 30,10 10))", + "POLYGON((5 15,5 30,30 15,5 15))" + }; + +static std::string case_96[2] = + { + "POLYGON((0 0,0 40,40 40,40 0,20 0,0 0),(10 10,20 0,30 10,30 30,10 30,10 10))", + "POLYGON((10 10,10 30,30 30,30 10,10 10))" + }; + +static std::string case_97[2] = + { + "POLYGON((0 5,-6 -17,12 17,0 5),(4 6,5 5,0 1,4 6))", + "POLYGON((3 9,-15 -5,13 -11,3 9))" + }; + +static std::string case_98[2] = + { + "POLYGON((5 6,-15 -13,1 -8,5 6))", + "POLYGON((0 8,-19 6,18 -17,20 8,11 17,0 8),(3 2,3 -1,1 0,3 2),(1 3,4 4,0 -1,1 3))" + }; + +static std::string case_99[2] = + { + "POLYGON((0 0,0 40,40 40,40 0,0 0),(10 10,20 19,20 20,10 10),(20 20,30 30,20 21,20 20))", + "POLYGON((10 10,10 30,30 30,30 10,10 10))" + }; + +static std::string case_100[2] = + { + "POLYGON((2 1,4 1,4 3,2 3,2 1),(3 1.5,4 3,2.5 2.5,3 1.5))", + "POLYGON((4 0,8 0,8 4,4 4,4 0))" + }; + +static std::string case_101[2] = +{ + // Smaller adapted version of case_recursive_boxes_34, with only one cluster + "POLYGON((0 1,0 5,5 5,5 1,0 1))", + "POLYGON((3 6,4 5,5 4,3 2,1 4,3 6),(4 5,3 4,3.5 3.5,4 4,4 5))" +}; + +static std::string case_102[2] = +{ + // Smaller adapted version of case_recursive_boxes_34, with only one cluster + "POLYGON((1.25 3.75,1.25 5,5 5,5 3.75,1.25 3.75))", + "POLYGON((3 6,4 5,5 4,3 2,1 4,3 6),(4 5,3 4,3.5 3.5,4 4,4 5))" +}; + +static std::string case_103[2] = +{ + // intersection + // all points of [1] the same as some points of [0] + "POLYGON((0 0,0 1,1 1,1 0,0 0))", + "POLYGON((0 0,0 1,1 0,0 0))" +}; + +static std::string case_104[2] = +{ + // union in hole + // all points of [1] the same as some points of [0] + "POLYGON((0 0,0 10,10 10,10 0,0 0),(1 1,9 1,9 9,1 9,1 1))", + "POLYGON((1 1,1 9,9 9,9 1,1 1))" +}; + +static const std::string case_105[2] = +{ + // Multiple touching interiors + "POLYGON((0 0,0 10,10 10,10 0,0 0),(3 3,7 3,7 7,3 7,3 3))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(1 5,2 4,3 5,2 6,1 5),(4 2,5 1,6 2,5 3,4 2),(4 8,5 7,6 8,5 9,4 8),(7 5,8 4,9 5,8 6,7 5))" +}; + +static const std::string case_106[2] = +{ + // Smaller adapted version of case_126_multi + "POLYGON((5 5,5 10,10 10,10 5,5 5),(9 8,7 9,5 8,7 7,9 8))", + "POLYGON((0 3,6 3,6 9,0 9,0 3))" +}; + +static const std::string case_107[2] = +{ + // Same but with hole in second polygon too + "POLYGON((5 5,5 10,10 10,10 5,5 5),(9 8,7 9,5 8,7 7,9 8))", + "POLYGON((0 3,6 3,6 9,0 9,0 3),(2 6,4 7,6 6,4 5,2 6))" +}; + +static const std::string case_108[2] = +{ + "POLYGON((0 1,0 2,1 2,1 3,2 3,2 2,3 2,3 1,2 1,2 0,1 0,1 1,0 1))", + "POLYGON((1 1,1 2,2 2,2 1,1 1))" +}; + +static std::string case_many_situations[2] = { + "POLYGON((2 6,2 14,10 18,18 14,18 6,16 5,14 4,12 3,10 2,8 3,6 4,4 5,2 6))", + "POLYGON((2 6,2 7,2 8,2 9,2 10,2 11,2 12,1 14" + ",4 14,4 15,7 15,7 18,8 17,9 20,10 18" + ",10 15.5,11 17.5,12 17,11 15,12 14.5,13 16.5,14 18.5,15 18,14 16,15 15.5,16 17.5,18 14" + ",19 13,17 11,19 9,19 7" + ",17 5,16 5,15 4.5,13 3.5,11 2.5,10 2" + ",8 3,6 4,4 5,2 6))" }; + +static std::string collinear_overlaps[2] = { + "POLYGON((0 2,0 4,2 4,2 5,0 5,0 7,2 7,2 8,6 8,6 7,8 7,8 5,6 5,6 4,8 4,8 2,6 2,6 1,2 1,2 2,0 2))", + "POLYGON((3 0,3 2,1 2,1 3,3 3,3 4,1 4,1 5,3 5,3 6,1 6,1 7,3 7,3 9,5 9,5 7,7 7,7 6,5 6,5 5,7 5,7 4,5 4,5 3,7 3,7 2,5 2,5 0,3 0))" }; + +static std::string simplex_spike[2] = { + "POLYGON((0 1,2 5,5 3,0 1))", + "POLYGON((4 0,0 3,4 5,4 2,6 5,4 2,4 0))" }; + +static std::string line_line1[2] = { + "LINESTRING(0 1,2 5,5 3)", "LINESTRING(3 0,0 3,4 5)"}; + + + +// Pies +static std::string pie_23_16_16[2] = { + "POLYGON((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,3828 2144,3690 1812,3472 1527,3187 1309,2855 1171,2499 1125,2144 1171,1812 1309,1527 1527,1309 1812,1171 2144,1125 2499,1171 2855,1309 3187,1527 3472,1812 3690,2500 2500))", + "POLYGON((2500 2500,1525 1937,1413 2208,1375 2499,1413 2791,1525 3062,1704 3295,1937 3474,2208 3586,2499 3625,2791 3586,3062 3474,3295 3295,3474 3062,3586 2791,3625 2500,3586 2208,2500 2500))" + }; + +static std::string pie_16_4_12[2] = { + "POLYGON((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,3828 2144,3690 1812,3472 1527,3187 1309,2855 1171,2499 1125,2144 1171,1812 1309,1527 1527,2500 2500))", + "POLYGON((2500 2500,2500 1375,2208 1413,1937 1525,1704 1704,2500 2500))" + }; + +static std::string pie_4_13_15[2] = { + "POLYGON((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,2500 2500))", + "POLYGON((2500 2500,1704 1704,1525 1937,1413 2208,1375 2499,1413 2791,1525 3062,1704 3295,1937 3474,2208 3586,2499 3625,2791 3586,3062 3474,3295 3295,2500 2500))" + }; + +static std::string pie_16_2_15_0[2] = { + "POLYGON((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,3828 2144,3690 1812,3472 1527,3187 1309,2855 1171,2499 1125,2144 1171,1812 1309,1527 1527,2500 2500))", + "POLYGON((2500 2500,1704 1704,1525 1937,2500 2500))" + }; + +static std::string pie_2_3_23_0[2] = +{ + "POLYGON((2500 2500,2855 3828,2500 3875,2500 2500))", + "POLYGON((2500 2500,2791 3586,2499 3625,2208 3586,2500 2500))" +}; + +// Shifted pies +static std::string pie_20_20_7_100[2] = { + "POLYGON((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,3828 2144,3690 1812,3472 1527,3187 1309,2855 1171,2499 1125,2144 1171,1812 1309,1527 1527,1309 1812,1171 2144,1125 2499,1171 2855,2500 2500))", + "POLYGON((2500 2600,3586 2308,3474 2037,3295 1804,3062 1625,2791 1513,2499 1475,2208 1513,1937 1625,1704 1804,1525 2037,1413 2308,1375 2600,1413 2891,1525 3162,1704 3395,1937 3574,2208 3686,2499 3725,2791 3686,3062 3574,2500 2600))" + }; + +static std::string pie_23_23_3_2000[2] = { + "POLYGON((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,3828 2144,3690 1812,3472 1527,3187 1309,2855 1171,2499 1125,2144 1171,1812 1309,1527 1527,1309 1812,1171 2144,1125 2499,1171 2855,1309 3187,1527 3472,1812 3690,2500 2500))", + "POLYGON((2500 3500,3295 4295,3474 4062,3586 3791,3625 3500,3586 3208,3474 2937,3295 2704,3062 2525,2791 2413,2499 2375,2208 2413,1937 2525,1704 2704,1525 2937,1413 3208,1375 3500,1413 3791,1525 4062,1704 4295,1937 4474,2208 4586,2499 4625,2791 4586,2500 3500))" + }; + +static std::string pie_23_21_12_500[2] = { + "POLYGON((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,3828 2144,3690 1812,3472 1527,3187 1309,2855 1171,2499 1125,2144 1171,1812 1309,1527 1527,1309 1812,1171 2144,1125 2499,1171 2855,1309 3187,1527 3472,1812 3690,2500 2500))", + "POLYGON((2500 3000,2500 1875,2208 1913,1937 2025,1704 2204,1525 2437,1413 2708,1375 3000,1413 3291,1525 3562,1704 3795,1937 3974,2208 4086,2499 4125,2791 4086,3062 3974,3295 3795,3474 3562,3586 3291,3625 3000,3586 2708,3474 2437,2500 3000))" + }; + +// Self-tangent pies (but as single-polygon, this one is NOT VALID and (therefore) (currently) NOT WORKING) +static std::string pie_5_12_12_0_7s[2] = +{ + "POLYGON((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,2500 2500))", + "POLYGON((2500 2500,2500 1375,2208 1413,1937 1525,1704 1704,1525 1937,1413 2208,1375 2500,1413 2791,1525 3062,1704 3295,1937 3474,2208 3586,2500 2500,2791 3586,3062 3474,3295 3295,3474 3062,3586 2791,3625 2500,3586 2208,2500 2500))" +}; + + +// Cases coming from High volume (hv) tests +static std::string hv_1[2] = { + "POLYGON((24.995166778564453 50.011310577392578,46.630809783935547 37.494682312011719,46.661380767822266 12.499360084533691,25.003841400146484 0.020658308640122414,3.3419711589813232 12.491842269897461,3.3638687133789062 37.487174987792969,24.995166778564453 50.011310577392578))", + "POLYGON((25.025228500366211 49.992599487304688,46.6719970703125 37.482185363769531,46.631874084472656 12.480358123779297,24.974153518676758 -0.011088892817497253,3.3419976234436035 12.524576187133789,3.3529467582702637 37.526435852050781,25.025228500366211 49.992599487304688))" + }; + +static std::string hv_2[2] = { + "POLYGON((24.988700866699219 49.986705780029297,46.643772125244141 37.5079345703125,46.645118713378906 12.514699935913086,25.010652542114258 0.00024537215358577669,3.3652000427246094 12.495694160461426,3.3445985317230225 37.488922119140625,24.988700866699219 49.986705780029297))", + "POLYGON((24.993022918701172 49.977996826171875,46.643772125244141 37.503200531005859,46.634654998779297 12.51569938659668,25.005790710449219 0.0029967525042593479,3.3705389499664307 12.504646301269531,3.348651647567749 37.492141723632812,24.993022918701172 49.977996826171875))" + }; + +static std::string hv_3[2] = { + "POLYGON((25.007728576660156 49.988899230957031,46.667163848876953 37.501667022705078,46.637229919433594 12.500443458557129,24.993251800537109 -0.01356174610555172,3.3565254211425781 12.512973785400391,3.3410670757293701 37.514209747314453,25.007728576660156 49.988899230957031))", + "POLYGON((24.998353958129883 49.993511199951172,46.659591674804688 37.507373809814453,46.646518707275391 12.505118370056152,25.002584457397461 -0.0109936548396945,3.3565335273742676 12.501456260681152,3.3392288684844971 37.503707885742188,24.998353958129883 49.993511199951172))" + }; + +static std::string hv_4[2] = { + "POLYGON((25.009130477905273 50.022209167480469,46.670387268066406 37.500617980957031,46.666873931884766 12.480625152587891,24.992231369018555 -0.017777863889932632,3.3260366916656494 12.495262145996094,3.3394229412078857 37.515254974365234,25.009130477905273 50.022209167480469))", + "POLYGON((25.00263786315918 50.019630432128906,46.669231414794922 37.507579803466797,46.666202545166016 12.487733840942383,24.997152328491211 -0.020060751587152481,3.3308455944061279 12.492485046386719,3.3333024978637695 37.5123291015625,25.00263786315918 50.019630432128906))" + }; + +static std::string hv_5[2] = { + "POLYGON((24.987522125244141 49.997768402099609,46.643741607666016 37.509471893310547,46.654956817626953 12.510490417480469,25.011669158935547 -0.00019846600480377674,3.3563058376312256 12.489578247070313,3.3433761596679687 37.488559722900391,24.987522125244141 49.997768402099609))", + "POLYGON((25.005760192871094 50.008182525634766,46.648590087890625 37.491542816162109,46.655918121337891 12.489977836608887,24.994773864746094 0.0050580352544784546,3.3391191959381104 12.499494552612305,3.3574333190917969 37.501052856445312,25.005760192871094 50.008182525634766))" + }; + +static std::string hv_6[2] = { + "POLYGON((25.011470794677734 50.017532348632813,42.678981781005859 42.661365509033203,50.017532348632813 24.986530303955078,42.661365509033203 7.3190178871154785,24.986530303955078 -0.019533095881342888,7.3190178871154785 7.336634635925293,-0.019533095881342888 25.011470794677734,7.336634635925293 42.678981781005859,25.011470794677734 50.017532348632813))", + "POLYGON((25.002880096435547 50.013965606689453,46.671913146972656 37.507381439208984,46.660655975341797 12.488155364990234,24.9951171875 -0.024483053013682365,3.3334629535675049 12.494877815246582,3.3299689292907715 37.514102935791016,25.002880096435547 50.013965606689453))" + }; + +static std::string hv_7[2] = { + "POLYGON((24.983684539794922 49.995647430419922,46.643482208251953 37.513137817382813,46.654392242431641 12.51393985748291,25.014318466186523 -0.0027416276279836893,3.3589246273040771 12.487411499023438,3.3391971588134766 37.486602783203125,24.983684539794922 49.995647430419922))", + "POLYGON((24.990163803100586 49.9993896484375,46.655281066894531 37.512466430664062,46.654388427734375 12.506458282470703,25.007841110229492 -0.012621366418898106,3.3524465560913086 12.491152763366699,3.3338801860809326 37.497154235839844,24.990163803100586 49.9993896484375))" + }; + +static std::string dz_1[2] = { + "POLYGON((30.526203155517578 56.781166076660156,38.987510681152344 58.710700988769531,41.042613983154297 50.279010772705078,48.390048980712891 45.660350799560547,43.881126403808594 38.245067596435547,45.810657501220703 29.783760070800781,37.378971099853516 27.728654861450195,32.760307312011719 20.381219863891602,25.345026016235352 24.890144348144531,16.883718490600586 22.960611343383789,14.828612327575684 31.392299652099609,7.481177806854248 36.010959625244141,11.990103721618652 43.426242828369141,10.060568809509277 51.887550354003906,18.492258071899414 53.942657470703125,23.110919952392578 61.290092468261719,30.526203155517578 56.781166076660156))", + "POLYGON((12.580197334289551 33.274467468261719,14.852641105651855 24.577714920043945,21.524574279785156 30.601236343383789,18.734457015991211 22.056488037109375,27.603805541992188 23.51667594909668,20.636968612670898 17.836828231811523,28.887777328491211 14.270085334777832,19.956142425537109 13.258448600769043,24.968837738037109 5.7971897125244141,16.908138275146484 9.7749528884887695,17.091224670410156 0.78807485103607178,12.460672378540039 8.4923257827758789,7.7560214996337891 0.83309894800186157,8.0257854461669922 9.8177928924560547,-0.072908863425254822 5.9179673194885254,5.0115232467651367 13.330527305603027,-3.9099369049072266 14.42827033996582,4.3748917579650879 17.915260314941406,-2.5368332862854004 23.662046432495117,6.3180174827575684 22.116373062133789,3.6104514598846436 30.687637329101563,10.223971366882324 24.600040435791016,12.580197334289551 33.274467468261719))" + }; + +static std::string dz_2[2] = { + "POLYGON((24.587966918945313 61.027225494384766,32.1783447265625 62.988296508789063,34.655326843261719 55.550270080566406,41.730445861816406 52.173538208007812,38.846851348876953 44.883510589599609,42.096187591552734 37.748981475830078,35.201282501220703 34.018035888671875,33.104434967041016 26.46403694152832,25.42442512512207 28.037921905517578,18.962528228759766 23.599054336547852,14.090974807739258 29.741334915161133,6.2876262664794922 30.494592666625977,6.5039811134338379 38.331226348876953,1.0104535818099976 43.924152374267578,6.2134823799133301 49.788291931152344,5.6002583503723145 57.603889465332031,13.355405807495117 58.751640319824219,17.909420013427734 65.132911682128906,24.587966918945313 61.027225494384766))", + "POLYGON((43.551433563232422 47.905071258544922,46.384872436523438 39.57366943359375,53.589195251464844 44.627212524414063,50.984420776367188 36.221515655517578,59.783241271972656 36.075325012207031,52.735191345214844 30.806018829345703,59.767654418945313 25.51593017578125,50.968441009521484 25.395713806152344,53.548389434814453 16.982362747192383,46.359016418457031 22.057153701782227,43.500991821289063 13.734155654907227,40.667552947998047 22.065553665161133,33.463230133056641 17.012012481689453,36.068000793457031 25.417709350585938,27.269184112548828 25.563901901245117,34.317234039306641 30.833206176757812,27.284770965576172 36.123294830322266,36.083980560302734 36.243511199951172,33.504035949707031 44.6568603515625,40.693408966064453 39.582073211669922,43.551433563232422 47.905071258544922))" + }; + +static std::string dz_3[2] = { + "POLYGON((20.813335418701172 73.060707092285156,22.815366744995117 61.968788146972656,31.383756637573242 69.291458129882813,28.001794815063477 58.539661407470703,38.991741180419922 61.041633605957031,31.000555038452148 53.093067169189453,41.894393920898437 50.201171875,31.124666213989258 46.876754760742188,39.426750183105469 39.253490447998047,28.345697402954102 41.314804077148438,32.154121398925781 30.706569671630859,23.300275802612305 37.681396484375,21.742572784423828 26.518407821655273,17.144247055053711 36.808895111083984,10.5772705078125 27.648460388183594,11.287883758544922 38.897186279296875,1.2160475254058838 33.837848663330078,7.0728073120117187 43.467861175537109,-4.1965517997741699 43.668655395507812,5.4646410942077637 49.473834991455078,-4.4205660820007324 54.888763427734375,6.8317971229553223 55.539215087890625,0.59532338380813599 64.927780151367187,10.861076354980469 60.274494171142578,9.7020368576049805 71.485885620117188,16.629419326782227 62.594875335693359,20.813335418701172 73.060707092285156))", + "POLYGON((1.6459450721740723 46.720386505126953,10.693820953369141 61.892372131347656,7.2385158538818359 44.568569183349609,23.921955108642578 50.3751220703125,10.139513969421387 39.325347900390625,26.652151107788086 33.049518585205078,8.9915294647216797 33.444084167480469,17.606916427612305 18.02239990234375,4.3317174911499023 29.676681518554687,1.0186206102371216 12.32512378692627,-1.6595441102981567 29.785955429077148,-15.35089111328125 18.623508453369141,-6.1788778305053711 33.720771789550781,-23.842140197753906 33.970470428466797,-7.1116366386413574 39.639987945556641,-20.481979370117188 51.184993743896484,-4.0213727951049805 44.773937225341797,-6.8426628112792969 62.212215423583984,1.6459450721740723 46.720386505126953))" + }; + +static std::string dz_4[2] = { + "POLYGON((36.179050445556641 50.613166809082031,40.804176330566406 39.819438934326172,52.211421966552734 42.607097625732422,48.816398620605469 31.365650177001953,59.346733093261719 26.168684005737305,49.520126342773438 19.73951530456543,54.246284484863281 8.9896402359008789,42.586078643798828 10.381030082702637,39.296642303466797 -0.89176815748214722,31.258771896362305 7.6691346168518066,21.492900848388672 1.1480809450149536,20.83837890625 12.87275505065918,9.1656351089477539 14.154719352722168,16.200717926025391 23.557058334350586,8.0829076766967773 32.042194366455078,19.515800476074219 34.722743988037109,18.751338958740234 46.440761566162109,29.232465744018555 41.145256042480469,36.179050445556641 50.613166809082031))", + "POLYGON((20.486696243286133 60.650150299072266,24.282432556152344 49.304500579833984,34.362251281738281 55.748767852783203,30.764263153076172 44.3388671875,42.706855773925781 43.627620697021484,33.089447021484375 36.511661529541016,42.333145141601563 28.916570663452148,30.369846343994141 28.81260871887207,33.383872985839844 17.234743118286133,23.644252777099609 24.182485580444336,19.277351379394531 13.044195175170898,15.48161506652832 24.389842987060547,5.40179443359375 17.945577621459961,8.9997835159301758 29.355476379394531,-2.9428071975708008 30.06672477722168,6.6745977401733398 37.182682037353516,-2.5690991878509521 44.777774810791016,9.394200325012207 44.881736755371094,6.3801741600036621 56.459602355957031,16.119794845581055 49.511859893798828,20.486696243286133 60.650150299072266))" + }; + +static std::string case_precision_1[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4.000005 2.99999,2 3,2 7))" +}; + +static std::string case_precision_2[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4 2.999995,2 3,2 7))" +}; + +static std::string case_precision_3[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4.0000001 2.99999995,2 3,2 7))" +}; + +static std::string case_precision_4[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4 3.00000001,2 3,2 7))" +}; + +static std::string case_precision_5[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4 3,2.0000005 2.9999995,2 7))" +}; + +static std::string case_precision_6[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,2 8,2 7,2 3,4.0000005 2.9999995,4 7,4 8,8 8,8 -1,-1 -1))" +}; + +static std::string case_precision_7[2] = +{ + // Needs larger margin for sectionalize (long double only) + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4 3.00000002,2 3,2 7))" +}; + +static std::string case_precision_8[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4.00000006 3.00000009,4 7,2 7))" +}; + +static std::string case_precision_9[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,3.99999 2.999995,4 7,2 7))" +}; + +static std::string case_precision_10[2] = +{ + // Needs 1.0e-5 for threshold in double + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4.000006 2.999991,4 7,2 7))" +}; + +static std::string case_precision_11[2] = +{ + // Needs ~0.5 for threshold in side_by_generic_form + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4.00000000000000089 2.99999999999999201,4 7,2 7))" +}; + +static std::string case_precision_12[2] = +{ + // Needs threshold for threshold a2 + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((1 1,2.99999999999999731e-12 1.00000000001,2.99999999999999731e-12 3.00000000001,1 3,1 1))" +}; + +static std::string case_precision_13[2] = +{ + // Needs threshold for threshold a2 + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((1 1,9.99999999999999912e-06 1,9.99999999999999912e-06 3,1 3,1 1))" +}; + +static std::string case_precision_14[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4.00000079999999958 3.00000020000000012,2 3,2 7))" +}; + +static std::string case_precision_15[2] = +{ + // Needs handling of side_value + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,3.99999599999999988 3.00000499999999981,4 7,2 7))" +}; + +static std::string case_precision_16[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4 2.99999940000000009,4 7,2 7))" +}; + +static std::string case_precision_17[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4 3.00000499999999999,4 7,2 7))" +}; + +static std::string case_precision_18[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2.00000199999999984 3.00000400000000012,4 3,4 7,2 7))" +}; + +static std::string case_precision_19[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,1.99999199999999999 2.99999400000000005,4 3,4 7,2 7))" +}; + +static std::string case_precision_20[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4 3,2.00000000000000044 3,2 7))" +}; + +static std::string case_precision_21[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4 3.00001000000000007,2 3,2 7))" +}; + +static std::string case_precision_22[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4.00000000200000017 2.99999999000000006,4 7,2 7))" +}; + +static std::string case_precision_23[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,3.99998999999999993 2.99998999999999993,4 7,2 7))" +}; + +static std::string case_precision_24[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4 3.000001,2 3,2 7))" +}; + +static std::string case_precision_25[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4 3.00001,2 3,2 7))" +}; + +static std::string case_precision_26[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,3.999991 2.999991,4 7,2 7))" +}; + + +// ticket_17 is keyholed, so has a hole formed by an deliberate intersection +// This will fail the intersection/traversal process +static std::string ticket_17[2] = { + "POLYGON ((-122.28139163 37.37319149,-122.28100699 37.37273669,-122.28002186 37.37303123,-122.27979681 37.37290072,-122.28007349 37.37240493,-122.27977334 37.37220360,-122.27819720 37.37288580,-122.27714184 37.37275161,-122.27678628 37.37253167,-122.27766437 37.37180973,-122.27804382 37.37121453,-122.27687664 37.37101354,-122.27645829 37.37203386,-122.27604423 37.37249110,-122.27632234 37.37343339,-122.27760980 37.37391082,-122.27812478 37.37800320,-122.26117222 37.39121007,-122.25572289 37.39566631,-122.25547269 37.39564971,-122.25366304 37.39552993,-122.24919976 37.39580268,-122.24417933 37.39366907,-122.24051443 37.39094143,-122.23246277 37.38100418,-122.23606766 37.38141338,-122.24001587 37.37738940,-122.23666848 37.37609347,-122.23057450 37.37882170,-122.22679803 37.37807143,-122.22525727 37.37448817,-122.22523229 37.37443000,-122.23083199 37.37609347,-122.23033486 37.37777891,-122.23169030 37.37732117,-122.23229178 37.37709687,-122.23237761 37.37631249,-122.23297776 37.37438834,-122.23872850 37.37165986,-122.24044511 37.36934068,-122.24671067 37.36865847,-122.24825570 37.36981819,-122.25151719 37.36947713,-122.25357721 37.36756706,-122.26001451 37.36579354,-122.25615213 37.36545239,-122.25486458 37.36245083,-122.25357721 37.36108651,-122.25194642 37.36013139,-122.24885652 37.35958557,-122.24911401 37.35849399,-122.25357721 37.35808470,-122.25675286 37.35897159,-122.25855539 37.35753887,-122.26181687 37.35828939,-122.26713837 37.35897159,-122.26782510 37.36108651,-122.26662339 37.36456559,-122.27288911 37.36722601,-122.27366159 37.36531602,-122.27168740 37.36470213,-122.27391900 37.36374701,-122.27074326 37.36245083,-122.27134408 37.35951742,-122.27426240 37.36135926,-122.27709482 37.36115474,-122.27966974 37.36231438,-122.27958391 37.36463382,-122.27572152 37.36463382,-122.27563569 37.36524779,-122.27700899 37.36593000,-122.27709482 37.36763529,-122.27554978 37.36838573,-122.27667254 37.36931478,-122.27677932 37.36932073,-122.27769362 37.36853987,-122.27942490 37.36830803,-122.28178776 37.36677917,-122.28509559 37.36443500,-122.28845129 37.36413744,-122.29194403 37.36695946,-122.29382577 37.36726817,-122.29600414 37.36898512,-122.29733083 37.36995398,-122.29593239 37.37141436,-122.29416649 37.37075898,-122.29325026 37.37108436,-122.29652910 37.37311697,-122.29584237 37.37374461,-122.29537583 37.37573372,-122.29487677 37.37752502,-122.30923212 37.37593011,-122.31122484 37.38230086,-122.31467994 37.38092472,-122.31715663 37.38252181,-122.32307970 37.38166978,-122.31985618 37.37667694,-122.32210304 37.37580220,-122.32581446 37.37589532,-122.32401730 37.37331839,-122.32960417 37.37189020,-122.33465527 37.37331906,-122.33425328 37.37623680,-122.33620676 37.37726132,-122.33397986 37.37822382,-122.33358918 37.38036590,-122.33202637 37.37986918,-122.33147954 37.38101784,-122.33394080 37.38198017,-122.33545239 37.38587943,-122.33478058 37.38785697,-122.33386050 37.38723721,-122.33350041 37.38571137,-122.33122003 37.38548891,-122.33140008 37.38650606,-122.33366042 37.38817490,-122.33244019 37.39157602,-122.33298157 37.39419201,-122.33164013 37.39477028,-122.33202017 37.39518351,-122.33358038 37.39499282,-122.33376050 37.39597811,-122.33550067 37.39734478,-122.33556069 37.39481797,-122.33344040 37.39292676,-122.33638094 37.38892189,-122.34240644 37.38852719,-122.34906293 37.38726898,-122.35072321 37.39338769,-122.34910291 37.39445252,-122.34796272 37.39410291,-122.34449043 37.39640534,-122.34500223 37.39729709,-122.34936291 37.39670910,-122.35098322 37.39531066,-122.35364623 37.39554510,-122.35434369 37.39612111,-122.35798429 37.39600988,-122.35768430 37.39478621,-122.36334519 37.39206871,-122.36604726 37.39203267,-122.36778592 37.39335592,-122.36518870 37.40022011,-122.36554552 37.40247752,-122.36370519 37.40331974,-122.36270506 37.40530591,-122.36320512 37.40670418,-122.36149849 37.40851392,-122.36730580 37.41054938,-122.37263720 37.41378932,-122.37161871 37.42076600,-122.36566153 37.42006292,-122.36520547 37.42742106,-122.37165953 37.43661157,-122.35943972 37.44459022,-122.35356359 37.44600810,-122.33792254 37.45796329,-122.35228518 37.47478091,-122.35127080 37.48181199,-122.34867342 37.48487322,-122.34359717 37.48801082,-122.33388431 37.48677650,-122.33142321 37.48429747,-122.32929580 37.48473149,-122.32609609 37.48291144,-122.32344850 37.48228229,-122.31924364 37.48410234,-122.31677299 37.48114051,-122.31431751 37.47848973,-122.31259201 37.47682190,-122.31515972 37.47568196,-122.31691389 37.47360309,-122.31292494 37.46960081,-122.31130153 37.46937743,-122.30889894 37.47124987,-122.30612839 37.47011613,-122.30149630 37.46568378,-122.30064277 37.46363784,-122.29283821 37.45922376,-122.28630141 37.45415497,-122.28883099 37.44629920,-122.28316717 37.44197138,-122.27554148 37.42297597,-122.25597410 37.40553692,-122.25196579 37.40129593,-122.25012043 37.40049143,-122.24823207 37.39897758,-122.24754551 37.39740941,-122.24778582 37.39621607,-122.24934787 37.39599102,-122.25005170 37.39871849,-122.25222328 37.39863668,-122.25342491 37.39737529,-122.25520162 37.39667289,-122.25528737 37.39522726,-122.27747460 37.37809616,-122.27977493 37.37858717,-122.28157729 37.37920106,-122.28322534 37.37952846,-122.28416939 37.38092656,-122.28621223 37.37984219,-122.28638389 37.37613857,-122.28382607 37.37843722,-122.27930278 37.37718220,-122.28196361 37.37652740,-122.28295058 37.37568167,-122.28216101 37.37523148,-122.28114822 37.37543608,-122.27934569 37.37528613,-122.27996369 37.37448121,-122.28104521 37.37454944,-122.28185197 37.37422883,-122.28290767 37.37474038,-122.28376597 37.37467224,-122.28428104 37.37399012,-122.28402346 37.37338989,-122.28610922 37.37364914,-122.28651264 37.37327388,-122.28672722 37.37207343,-122.28628398 37.37205448,-122.28574460 37.37166682,-122.28479711 37.37200981,-122.28327731 37.37137228,-122.28285511 37.37100700,-122.28279409 37.37125669,-122.28315527 37.37173756,-122.28321872 37.37220569,-122.28187007 37.37231918,-122.28193109 37.37294908,-122.28139163 37.37319149))", + "BOX(-122.280 37.377,-122.277 37.379)"}; + +static std::string snl_1[2] = { + "POLYGON((184913.4512 606985.7794,184912.9 606987.146,184904.4135 606987.6514,184901.8476 607014.5934,184916.3978 607021.0602,184927.7148 607008.1264,184926.0981 606998.4262,184913.4512 606985.7794),(184907.556 607013.301,184905.782 607009.972,184906.004 607005.978,184908.444 606998.877,184912.215 606994.218,184919.314 606993.996,184922.42 606995.771,184925.747 606998.877,184926.413 607002.872,184925.747 607007.753,184922.42 607012.191,184917.096 607015.298,184911.771 607015.298,184907.556 607013.301))", + "POLYGON((184861.118 606901.158,184893.787 606898.483,184925.043 606913.4,184927.174 606951.759,184912.9 606987.146,184877.87 606989.232,184885.103 607023.774,184899.058 607022.743,184906.008 607044.948,184966.465 607025.02,184968.442 606961.3,185024.768 606947.402,185024.544 606941.355,185027.007 606937.323,185030.366 606934.187,185035.516 606933.963,185040.442 606935.531,185042.905 606939.115,185088.364 606931.385,185089.139 607015.509,185095.2 607011.3,185118.827 606995.545,185126.813 606991.995,185177.727 606973.799,185181.482 606966.676,185193.571 606977.795,185193.711 606960.3,185189.352 606779.02,185167.515 606783.844,185086.96 606801.241,185011.707 606817.809,185000 606819.304,184994.034 606819.794,184976.398 606819.572,184956.654 606817.131,184934.913 606813.137,184893.097 606804.927,184884.445 606831.555,184866.919 606883.481,184861.118 606901.158),(184907.556 607013.301,184905.782 607009.972,184906.004 607005.978,184908.444 606998.877,184912.215 606994.218,184919.314 606993.996,184922.42 606995.771,184925.747 606998.877,184926.413 607002.872,184925.747 607007.753,184922.42 607012.191,184917.096 607015.298,184911.771 607015.298,184907.556 607013.301))"}; + + +// Isovist (submitted by Brandon during Formal Review) +static std::string isovist[2] = + { + "POLYGON((37.29449462890625 1.7902572154998779, 46.296027072709599 -2.4984308554828116, 45.389434814453125 -4.5143837928771973, 47.585065917176543 -6.1314922196594779, 46.523914387974358 -8.5152102535033496, 42.699958801269531 -4.4278755187988281, 42.577877044677734 -4.4900407791137695, 42.577911376953125 -4.4901103973388672, 40.758884429931641 -5.418975830078125, 40.6978759765625 -5.4500408172607422, 41.590042114257813 -7.2021245956420898, 57.297810222148939 -37.546793343968417, 50.974888957147442 -30.277285722290763, 37.140213012695313 1.3446992635726929, 37.000419616699219 1.664225697517395, 37.29449462890625 1.7902572154998779))", + "POLYGON((43.644271850585938 0.96149998903274536,43.764598846435547 0.93951499462127686,49.071769542946825 0.61489892713413252,48.43512638981781 -0.81299959072453376,47.830955505371094 -0.69758313894271851,47.263670054709685 -1.784876824891044,46.695858001708984 -1.6093428134918213,45.389434814453125 -4.5143837928771973,47.604561877161387 -6.087697464505224,46.559533858616469 -8.435196445683264,42.699958801269531 -4.4278755187988281,42.577877044677734 -4.4900407791137695,42.577911376953125 -4.4901103973388672,40.758884429931641 -5.418975830078125,40.6978759765625 -5.4500408172607422,41.590042114257813 -7.2021245956420898,57.524304765518266 -37.807195733984784,41.988733475572282 -19.945838749437218,41.821544647216797 -19.211688995361328,40.800632476806641 -17.208097457885742,39.966808319091797 -17.625011444091797,38.823680877685547 -16.296066284179688,37.326129913330078 -17.190576553344727,35.963497161865234 -15.476018905639648,35.656356811523438 -15.66030216217041,34.931102752685547 -16.223842620849609,34.634240447128811 -15.85007183479255,34.886280059814453 -14.120697975158691,34.658355712890625 -13.81736946105957,34.328716278076172 -13.992490768432617,33.598796844482422 -14.546377182006836,33.164891643669634 -14.000060288415174,33.566280364990234 -12.450697898864746,33.339523315429688 -12.147735595703125,32.998821258544922 -12.323249816894531,32.274600982666016 -12.879127502441406,31.682494778186321 -12.133624901803865,32.226280212402344 -10.790698051452637,32.000633239746094 -10.488097190856934,31.669155120849609 -10.653837203979492,30.947774887084961 -11.208560943603516,30.207040612748258 -10.275926149505661,30.896280288696289 -9.1206979751586914,30.670633316040039 -8.8180980682373047,30.339155197143555 -8.9838371276855469,29.619997024536133 -9.5368013381958008,29.135100397190627 -8.9262827849488211,32.718830108642578 -4.3281683921813965,32.708168029785156 -2.3611698150634766,32.708126068115234 -2.3611700534820557,32.708126068115234 -2.3611266613006592,30.501169204711914 -2.3718316555023193,27.069889344709196 -4.2926591211028242,26.472516656201325 -3.5380830513658776,36.954700469970703 1.2597870826721191,37.140213012695313 1.3446992635726929,37.000419616699219 1.664225697517395,37.29449462890625 1.7902572154998779,37.43402099609375 1.470055103302002,51.370888500897557 7.4163459734570729,51.20102152843122 7.1738039562841562,42.721500396728516 3.6584999561309814,42.721500396728516 2.2342472076416016,42.399410247802734 1.4956772327423096,43.644271850585938 0.96149998903274536))" + }; + +static std::string ggl_list_20110306_javier[2] = + { + "POLYGON((-2 2,2002 2,2002 -2002,-2 -2002,-2 2),(0 -147.00000000000003,0 -2000,2000 -2000,2000 0,104 0,440 -240,400 -280,0 -147.00000000000003))", + "POLYGON((359.99000000000001 -280,0 -182,0 -147,400.00999999999999 -280,359.99000000000001 -280))" + }; + +static std::string ggl_list_20110307_javier[2] = + { + "POLYGON((-2 2, 1842 2, 1842 -2362, -2 -2362, -2 2), (0 0, 0 -2360, 1840 -2360, 1840 0, 0 0))", + // "POLYGON((-0.01 -1960, 0 -1960, 0 -1880, 0.01 -1960, -0.01 -1960))" + "POLYGON ((-0.01 -1960, 80.01 -1960, 0 -1880, -0.01 -1960))" + }; + + +static std::string ggl_list_20110627_phillip[2] = + { + "POLYGON((537.99678544791459 124.30517362077681,437.36539413622404 142.02728895075373,456.33031803043468 249.50296671450121,556.96217263181723 231.78347688272990,537.99678544791459 124.30517362077681))", + "POLYGON((437.35 142.03,461.94 281.32,564.5 263.26,539.9 123.97,437.35 142.03))" + }; + +static std::string ggl_list_20110716_enrico[2] = + { + "POLYGON((1.83691e-014 -300,-259.808 -150,-259.808 150,-5.51073e-014 300,259.808 150,259.808 -150,9.18455e-014 -300,1.83691e-014 -300),(7.65379e-014 -250,216.506 -125,216.506 125,-4.59227e-014 250,-216.506 125,-216.506 -125,1.53076e-014 -250,7.65379e-014 -250))", + "POLYGON((1.83691e-014 -300,-259.808 -150,-216.506 -125,-216.506 125,-259.808 150,-5.51073e-014 300,-4.59227e-014 250,216.506 125,259.808 150,259.808 -150,216.506 -125,7.65379e-014 -250,9.18455e-014 -300,1.83691e-014 -300),(6.12303e-014 -200,173.205 -100,173.205 100,-3.67382e-014 200,-173.205 100,-173.205 -100,1.22461e-014 -200,6.12303e-014 -200))" + }; + + +// Send on ggl-list by Christoph/Angus at 2011-08-19/20 +// This polygon combination fails to union in but do in or +// It had previosly an error which has been fixed at 2011-08-30 +static std::string ggl_list_20110820_christophe[2] = +{ + "POLYGON((17.763942722600319 32.23605727739968,19.192448808558737 30.807551191441263,16.000000000000000 30.000000000000000,17.763942722600319 32.236057277399681))", + "POLYGON((0.24806946917841693 26.015444246572663,31.751930530821582 33.984555753427337,32.248069469178418 30.015444246572663,0.24806946917841693 26.015444246572663))" +}; + +static std::string ggl_list_20131119_james[2] = +{ + "POLYGON((7 8,6.42705 6.23664,4.92705 5.14683,3.07295 5.14683,1.57295 6.23664,1 8,1.57295 9.76336,3.07295 10.8532,4.92705 10.8532,6.42705 9.76336,7 8))", + "POLYGON((4 4,4 8,12 8,12 4,4 4))" +}; + +static std::string ggl_list_20140223_shalabuda[2] = +{ + "POLYGON((-7.1621621621621605058294335322 43.228378378378366164724866394, -4.52438675915238786018335304107 30.5670564439314631499655661173, -4.16280147451538873326626344351 27.5407467090450168711868172977, -6.19047619047618891130468909978 36.7666666666666515084216371179, -7.1621621621621605058294335322 43.228378378378366164724866394))", + "POLYGON((-8.16216216216216139400785323232 49.8783783783783789544941100758, -3.16280147451538873326626344351 44.228378378378366164724866394, 1 -10.5499999999999971578290569596, -1 2.25, -8.16216216216216139400785323232 49.8783783783783789544941100758))", +}; + + +static std::string ggl_list_20140321_7415963[2] = +{ + "POLYGON((-6.0 3.2500000000000013, -9.0 3.2500000000000022, -9.0 6.5, -6.0 6.5, -6.0 3.2500000000000013))", + "POLYGON((-3.0 0.0, -6.0 0.0, -6.0 3.2500000000000013, -3.0 3.2500000000000009, -3.0 0.0))", +}; + +// GEOS "TestOverlay" test. +// Note that the first one WAS invalid and is made valid using SQL Server 2008 Spatial MakeValid() function +static std::string geos_1[2] = + { + // Original: POLYGON((5417148.108 5658342.603,5417139.016 5658338.009,5417126.791 5658331.833,5417116.292 5658327.518,5417112.871 5658325.598,5417110.25 5658324.127,5417106.071 5658321.781,5417104.226 5658320.745,5417093.266 5658315.008,5417091.265 5658313.961,5417085.335 5658310.857,5417060.44 5658326.26,5417064.68 5658327.52,5417088.83 5658336.46,5417088.52 5658337.31,5417102.92 5658342.65,5417103.26 5658341.83,5417111.76 5658345.51,5417121.662 5658349.583,5417121.878 5658349.672,5417125.217 5658351.119,5417131.761 5658353.388,5417137.589 5658356.276,5417142.166 5658359.67,5417146.599 5658364.988,5417151.395 5658370.641,5417150.853 5658371.392,5417152.59741167 5658373.52811061,5417154.92 5658376.37,5417155.18955743 5658376.89699992,5417154.919 5658376.371,5417155.814 5658378.111,5417157.051 5658380.297,5417158.004 5658382.304,5417159.014 5658384.47,5417159.775 5658386.619,5417160.629 5658389.278,5417161.5 5658399.49,5417160.773 5658404.194,5417159.41 5658413.02,5417158.853 5658414.442,5417153.671 5658427.659,5417153.67051161 5658427.6586943,5417153.67 5658427.66,5417152.73 5658427.07,5417149.993 5658436.599,5417148.81 5658439.42,5417149.233 5658439.67,5417148.36 5658440.81,5417146.41 5658446.6,5417144.321 5658453.127,5417144.32092232 5658453.13043826,5417154.59 5658458.01,5417154.99551047 5658455.8409905,5417155.446 5658453.413,5417157.23981414 5658448.75748237,5417157.22660892 5658448.57861162,5417157.22660849 5658448.57860592,5417157.22660865 5658448.57860812,5417157.128 5658447.265,5417157.64950997 5658446.06368023,5417157.64950961 5658446.06368108,5417158.314 5658444.533,5417172.322 5658417.957,5417174.99 5658418.57,5417175.23 5658417.74,5417176.696 5658412.61,5417177.875 5658408.488,5417178.76 5658405.39,5417178.1 5658393.55,5417178.08 5658393.36,5417177.11 5658384.95,5417178.151 5658384.915,5417178.14836289 5658384.91508866,5417178.12 5658384.83,5417177.91415246 5658383.81114117,5417176.927 5658378.944,5417176.603 5658377.341,5417176.73975922 5658378.01762048,5417176.6 5658377.34,5417176.51210558 5658376.89535766,5417176.428 5658376.483,5417175.235 5658370.602,5417171.577 5658362.886,5417170.762 5658360.107,5417168.522 5658357.989,5417166.042 5658355.047,5417164.137 5658352.264,5417162.642 5658351.593,5417160.702 5658350.843,5417160.05417889 5658350.5823586,5417158.82 5658350.09,5417158.82103105 5658350.0862195,5417159.50373263 5658350.36089455,5417158.818 5658350.085,5417159.055 5658349.214,5417155.754 5658347.679,5417156.78066321 5658348.15640928,5417155.7525011 5658347.6811561,5417155.161 5658348.532,5417149.028 5658343.237,5417152.26877967 5658346.03496647,5417149.03 5658343.24,5417148.78133339 5658343.06701453,5417148.108 5658342.603)) + "POLYGON((5417085.33499 5658310.85699,5417060.44 5658326.26001,5417064.67999 5658327.52002,5417088.82999 5658336.46002,5417088.51999 5658337.31,5417102.92001 5658342.65002,5417103.26001 5658341.83002,5417111.76001 5658345.51001,5417121.66199 5658349.58301,5417121.87799 5658349.672,5417125.21701 5658351.11902,5417131.76099 5658353.388,5417137.58899 5658356.276,5417142.16599 5658359.66998,5417146.599 5658364.98798,5417151.39499 5658370.64099,5417150.853 5658371.39203,5417152.59741 5658373.52814,5417154.92001 5658376.37,5417155.18806 5658376.89407,5417155.814 5658378.11102,5417157.05099 5658380.297,5417158.004 5658382.30402,5417159.01401 5658384.46997,5417159.77499 5658386.61902,5417160.629 5658389.27802,5417161.5 5658399.48999,5417160.77301 5658404.19397,5417159.41 5658413.02002,5417158.853 5658414.44202,5417153.67099 5658427.659,5417153.6705 5658427.65869,5417153.67001 5658427.65997,5417152.73001 5658427.07001,5417149.99301 5658436.599,5417148.81 5658439.41998,5417149.233 5658439.66998,5417148.35999 5658440.81,5417146.41 5658446.59998,5417144.32101 5658453.12701,5417144.32092 5658453.13043,5417154.59 5658458.01001,5417154.99551 5658455.841,5417155.44601 5658453.41302,5417157.23981 5658448.75751,5417157.22662 5658448.57861,5417157.12799 5658447.26501,5417157.64951 5658446.06366,5417158.314 5658444.53302,5417172.32199 5658417.95697,5417174.98999 5658418.57001,5417175.23001 5658417.73999,5417176.69601 5658412.60999,5417177.875 5658408.48798,5417178.76001 5658405.39001,5417178.10001 5658393.54999,5417178.07999 5658393.35999,5417177.10999 5658384.95001,5417178.14837 5658384.91507,5417178.12 5658384.83002,5417177.91415 5658383.81116,5417176.927 5658378.94397,5417176.603 5658377.341,5417176.73975 5658378.01764,5417176.60001 5658377.34003,5417176.51212 5658376.89539,5417176.42801 5658376.48297,5417175.23499 5658370.60199,5417171.577 5658362.88599,5417170.76199 5658360.10699,5417168.522 5658357.98901,5417166.04199 5658355.047,5417164.13699 5658352.26398,5417162.642 5658351.59302,5417160.702 5658350.84302,5417160.05417 5658350.58234,5417158.82001 5658350.09003,5417158.82104 5658350.08625,5417158.81799 5658350.08502,5417159.05499 5658349.21399,5417155.754 5658347.67902,5417156.78067 5658348.15643,5417155.7525 5658347.68115,5417155.16101 5658348.53198,5417149.02802 5658343.237,5417152.26877 5658346.03497,5417149.03 5658343.23999,5417148.78134 5658343.06702,5417148.108 5658342.60303,5417139.01599 5658338.00897,5417126.79099 5658331.83301,5417116.29199 5658327.51801,5417112.871 5658325.59802,5417110.25 5658324.12701,5417106.07101 5658321.78101,5417104.22601 5658320.745,5417093.26599 5658315.008,5417091.26501 5658313.961,5417085.33499 5658310.85699))", + "POLYGON((5417148.36 5658440.81,5417146.41 5658446.6,5417144.321 5658453.127,5417144.32092 5658453.13044,5417154.59 5658458.01,5417154.99551 5658455.84099,5417155.446 5658453.413,5417157.23981 5658448.75748,5417157.22661 5658448.57861,5417157.128 5658447.265,5417157.64951 5658446.06368,5417158.31 5658444.53,5417172.32 5658417.96,5417172.32037 5658417.96009,5417172.322 5658417.957,5417174.99 5658418.57,5417175.23 5658417.74,5417176.696 5658412.61,5417177.875 5658408.488,5417178.76 5658405.39,5417178.1 5658393.55,5417178.08 5658393.36,5417177.11 5658384.95,5417178.14836 5658384.91509,5417178.12 5658384.83,5417177.91415 5658383.81114,5417176.927 5658378.944,5417176.73976 5658378.01762,5417176.6 5658377.34,5417176.51211 5658376.89536,5417176.428 5658376.483,5417175.235 5658370.602,5417171.577 5658362.886,5417171.26172 5658361.81094,5417170.76 5658360.11,5417168.52 5658357.99,5417166.04 5658355.05,5417165.25343 5658353.89499,5417164.137 5658352.264,5417162.642 5658351.593,5417160.702 5658350.843,5417160.05418 5658350.58236,5417158.82 5658350.09,5417158.82103 5658350.08622,5417158.818 5658350.085,5417159.055 5658349.214,5417156.78066 5658348.15641,5417155.7525 5658347.68116,5417155.161 5658348.532,5417152.26878 5658346.03497,5417149.03 5658343.24,5417148.78133 5658343.06701,5417148.108 5658342.603,5417139.016 5658338.009,5417126.791 5658331.833,5417121.76604 5658329.76779,5417116.29 5658327.52,5417112.87 5658325.6,5417110.25 5658324.13,5417106.60319 5658322.07976,5417106.071 5658321.781,5417105.81727 5658321.63853,5417104.23 5658320.75,5417093.61267 5658315.18946,5417093.266 5658315.008,5417091.265 5658313.961,5417085.9075 5658311.15667,5417085.34 5658310.86,5417060.44 5658326.26,5417064.68 5658327.52,5417088.83 5658336.46,5417088.52 5658337.31,5417102.92 5658342.65,5417103.26 5658341.83,5417111.76 5658345.51,5417121.66 5658349.58,5417121.88 5658349.67,5417125.22 5658351.12,5417125.33012 5658351.15822,5417131.761 5658353.388,5417137.589 5658356.276,5417139.98755 5658358.0546,5417142.17 5658359.67,5417145.96673 5658364.22951,5417146.599 5658364.988,5417147.11101 5658365.5915,5417151.4 5658370.64,5417151.13021 5658371.0079,5417150.853 5658371.392,5417152.5974 5658373.5281,5417154.92 5658376.37,5417155.18956 5658376.897,5417155.814 5658378.111,5417157.051 5658380.297,5417158.004 5658382.304,5417159.014 5658384.47,5417159.36624 5658385.46469,5417159.78 5658386.62,5417160.63 5658389.28,5417161.5 5658399.49,5417160.773 5658404.194,5417159.41 5658413.02,5417158.853 5658414.442,5417153.671 5658427.659,5417153.67051 5658427.65869,5417153.67 5658427.66,5417152.73 5658427.07,5417149.993 5658436.599,5417148.81 5658439.42,5417149.233 5658439.67,5417148.36 5658440.81))" + }; + +// Coming from "robustness.xml" +static std::string geos_2[2] = + { + "POLYGON((742605.987032656 5087763.72510381,742599.903121688 5087760.56016809,742598.666141033 5087762.50894352,742591.100910753 5087758.50480931,742586.861672536 5087766.63211263,742591.417801844 5087769.04526206,742592.428792606 5087767.35034731,742601.541294342 5087772.18101105,742605.987032656 5087763.72510381))", + "POLYGON((742601.541294537 5087772.18101068,742592.428792606 5087767.35034731,742589.944404072 5087771.51539701,742583.880455986 5087782.54873438,742582.81550675 5087784.27809355,742583.216887765 5087784.43459684,742582.99081514 5087785.0349637,742592.341351823 5087789.67654,742593.375823205 5087787.7060691,742599.28794443 5087776.4640487,742601.541294537 5087772.18101068))" + }; + +// Coming from "robustness.xml" +static std::string geos_3[2] = + { + "POLYGON ((613697.0000000041909516 2369267.9999981997534633, 613797.0000000043073669 2368322.9999981978908181, 613643.0000000041909516 2367807.9999981969594955, 613674.0000000041909516 2367405.9999981969594955, 613400.0000000041909516 2367299.9999981955625117, 613200.0000000040745363 2366813.9999981950968504, 613252.0000000040745363 2366474.9999981927685440, 613094.0000000040745363 2366400.9999981927685440, 612695.0000000039581209 2365506.9999981909058988, 612326.0000000038417056 2365402.9999981909058988, 612145.0000000037252903 2365470.9999981913715601, 612061.0000000037252903 2365967.9999981918372214, 611724.0000000036088750 2366168.9999981927685440, 611334.0000000034924597 2366316.9999981927685440, 610743.0000000033760443 2366221.9999981932342052, 610174.0000000031432137 2366305.9999981927685440, 609973.0000000031432137 2367066.9999981955625117, 609073.0000000027939677 2367938.9999981974251568, 609061.0000000027939677 2368332.9999981974251568, 609151.0000000027939677 2368684.9999981992878020, 608919.0000000027939677 2368811.9999982002191246, 608801.0000000026775524 2369192.9999982002191246, 609161.0000000027939677 2369096.9999982006847858, 609161.0000000027939677 2369509.9999982025474310, 609857.0000000030267984 2369498.9999982011504471, 609762.0000000030267984 2369689.9999982020817697, 610796.0000000033760443 2369794.9999982025474310, 611332.0000000034924597 2370097.9999982025474310, 613149.0000000040745363 2370460.9999982034787536, 613613.0000000041909516 2369720.9999982016161084, 613697.0000000041909516 2369267.9999981997534633))", + "POLYGON ((607216.0000000019790605 2370623.9999982002191246, 608128.0000000019790605 2370312.9999982002191246, 608317.0000000030267984 2370101.9999982002191246, 608328.0000000030267984 2369868.9999982002191246, 608644.0000000030267984 2369847.9999982002191246, 608801.0000000030267984 2369192.9999982002191246, 608919.0000000030267984 2368811.9999982002191246, 609151.0000000030267984 2368684.9999982002191246, 609061.0000000030267984 2368332.9999982002191246, 608602.0000000030267984 2368124.9999982002191246, 607980.0000000019790605 2367585.9999982002191246, 607295.0000000019790605 2367062.9999981899745762, 606251.0000000019790605 2366697.9999981899745762, 605456.0000000019790605 2367679.9999982002191246, 605108.0000000019790605 2368377.9999982002191246, 604906.0000000019790605 2369083.9999982002191246, 604191.0000000010477379 2369719.9999982002191246, 604107.0000000010477379 2370057.9999982002191246, 604264.0000000010477379 2370397.9999982002191246, 604141.0000000010477379 2370768.9999982002191246, 604561.0000000010477379 2370448.9999982002191246, 604940.0000000019790605 2370406.9999982002191246, 605460.0000000019790605 2370792.9999982002191246, 605942.0000000019790605 2370945.9999982099980116, 606364.0000000019790605 2370892.9999982002191246, 606881.0000000019790605 2370988.9999982002191246, 607216.0000000019790605 2370623.9999982002191246))" + }; + +// Coming from "TestRobustOverlayFixed.xml" +static std::string geos_4[2] = + { + "POLYGON ((545 317, 617 379, 581 321, 545 317))", + "POLYGON ((484 290, 558 359, 543 309, 484 290))" + }; + +static std::string ticket_5103[2] = + { + "POLYGON((-92810838 3618230,-94606872 1822196,-94999302 2214626,-93203268 4010660,-92810838 3618230))", + "POLYGON((-95269304 222758,-95260668 419862,-95234760 615696,-95192088 808228,-95132906 996442,-95057214 1178814,-94966028 1354074,-94860110 1520444,-94739968 1676908,-94606618 1822450,-94999048 2214880,-95165164 2033778,-95314770 1838706,-95446850 1631442,-95560388 1413510,-95654368 1186434,-95728282 951992,-95781368 711962,-95813626 468376,-95824294 222758,-95269304 222758))" + }; + +static std::string ticket_6958[2] = + { + "POLYGON((0.63872330997599124913 0.25963790394761232516 , 0.51901482278481125832 0.36860892060212790966 , 0.24443514109589159489 0.62663296470418572426 , 0.41175117865081167778 0.47178476291601745274 , 0.63872330997599124913 0.25963790394761232516))", + "POLYGON((0.52364358028948876367 0.36823021165656988352 , 0.7762673462275415659 0.13443113025277850237 , 0.59446187055393329146 0.29992923303868185281 , 0.52364358028948876367 0.36823021165656988352))" + }; + +static std::string ticket_7462[2] = + { + "POLYGON((0 0 , -0.3681253195 0.9297761917 , 2.421203136 2.034152031 , 2.789328575 1.104375958 , 0 0))", + "POLYGON((2.76143527 1.093332171 , 2.076887131 1.822299719 , 4.263789177 3.875944376 , 4.948337555 3.146976948 , 2.76143527 1.093332171))" + }; + +// Ticket 8310 https://svn.boost.org/trac/boost/ticket/8310 +// The problem was in disjoint, "point_on_border" on the smallest polygon +// is not considered as "within" the other, though there are no further intersection points. +static std::string ticket_8310a[2] = + { + "POLYGON(( -2.559375047683716 -0.615625500679016, -2.559375047683716 0.384374797344208, 7.940625190734863 0.384374588727951, 7.940625190734863 -0.615625441074371, -2.559375047683716 -0.615625500679016 ))", + "POLYGON(( 1.000000000000000 0.384374707937241, 1.000000000000000 0.000000000000000, 0.000000000000000 0.000000000000000, 0.000000000000000 0.384374737739563, 1.000000000000000 0.384374707937241 ))" + }; +static std::string ticket_8310b[2] = + { + "POLYGON(( -2.592187881469727 -0.626561701297760, -2.592187643051147 0.373438000679016, 7.907812595367432 0.373437851667404, 7.907812595367432 -0.626561224460602, -2.592187881469727 -0.626561701297760 ))", + "POLYGON(( 0.000000000000000 0.373437941074371, 1.000000000000000 0.373437792062759, 1.000000000000000 0.000000000000000, 0.000000000000000 0.000000000000000, 0.000000000000000 0.373437941074371 ))" + }; +static std::string ticket_8310c[2] = + { + "POLYGON(( 5.204249382019043 3.531043529510498, 5.204247951507568 2.531045675277710, -5.295750617980957 2.531046152114868, -5.295751094818115 3.531045913696289, 5.204249382019043 3.531043529510498 ))", + "POLYGON(( 1.000000000000000 2.531045913696289, 1.000000000000000 3.000000000000000, 2.000000000000000 3.000000000000000, 2.000000000000000 2.531045913696289, 1.000000000000000 2.531045913696289 ))" + }; + +static std::string ticket_8254[2] = + { + "POLYGON((0 0,-0.27224111308522275232 0.19250353717521062613,-0.27224111308522275232 0.96219700082478931691,0 1.154700537999999943,0 0))", + "POLYGON((-0.27224111308522286334 0.57751061210314269534,-0.27201435369399112885 0.57735026899999997152,-0.27224111308522280783 0.57718992589685735872,-0.27224111308522286334 0.57751061210314269534))" + }; + +static std::string ticket_8652[2] = + { + "POLYGON((0 0, 0.05 0.04, 0.05 0, 0 0))", + "POLYGON((0.02 -2.77556e-17, 0.05 0.02, 0.05 -2.77556e-17, 0.02 -2.77556e-17))" + }; + +static std::string ticket_9756[2] = +{ + // NOTE: these polygons are not closed. That is the reason the union failed for the library user. + // the unit test calls "correct" so this test is not a problem for the library. The ticket is closed as invalid. + "POLYGON((440820.110024126 4047009.80267429, 440806.545727707 4046942.39533656, 440797.171880196 4046895.8425726, 440804.202135392 4046888.73092639, 440813.573458131 4046935.27114371, 440827.140279322 4047002.69102807))", + "POLYGON((440855.857887967 4046932.1248641, 440813.740724389 4046942.21109839, 440806.376538684 4046935.44583646, 440848.493702262 4046925.35960217))", +}; + +static std::string issue_548[2] = +{ + "POLYGON((143526.96086588613 113763.64549686472, 76161.913300625194 96673.360975963747,76161.913300625194 71504.239234902911,145207.72299290277 81831.630077016118,143526.96086588613 113763.64549686472))", + "POLYGON((-47053.678255174891 -657486.29482312244,-610948.08772840793 300004.45446108561,-132202.71308630385 581951.65919770207,431691.69638692908 -375539.09008650586,-47053.678255174891 -657486.29482312244))" +}; + +static std::string issue_566_a[2] = +{ + "POLYGON((16.8739 0.353458,8.80872e-14 5.50545e-15,0.266003 -12.6988,17.1399 -12.3454,16.8739 0.353458))", + "POLYGON((-4.53257e-19 2.16383e-17,9.99781 0.209424,10.1459 -6.86009,0.148086 -7.06952,-4.53257e-19 2.16383e-17))" +}; + +static std::string issue_566_b[2] = +{ + "POLYGON((16.8739 0.353458,0 0,0.266003 -12.6988,17.1399 -12.3454,16.8739 0.353458))", + "POLYGON((0 0,0.148086 -7.06952,10.1459 -6.86009,9.99781 0.209424,0 0))" +}; + +static std::string ggl_list_20120229_volker[3] = + { + "POLYGON((1716 1554,2076 2250,2436 2352,2796 1248,3156 2484,3516 2688,3516 2688,3156 2484,2796 1248,2436 2352,2076 2250, 1716 1554))", + "POLYGON((2500 1600,2500 2300,3200 2300,3200 1600,2500 1600))", + "POLYGON((1716 1554,2076 2250,2436 2352,2796 1248,3156 2484,3516 2688,3156 2483,2796 1247,2436 2351,2076 2249, 1716 1554))", + }; + +static std::string ggl_list_20120717_volker[2] = + { + "POLYGON((1031 1056,3232 1056,3232 2856,1031 2856))", + "POLYGON((1032 1458,1032 1212,2136 2328,3234 2220,3234 2412,2136 2646))" + }; + +static std::string ggl_list_20190307_matthieu_1[2] = + { + "POLYGON((-1.00000010731 -0.713619134602,-1.00000012822 -0.493922219801,-0.598172925227 0.100631982002,-1.00000012886 -0.0624283708015,-1.00000011994 0.0862738908136,-0.440262107798 0.31341400405,-0.360828341246 0.292948255722,-0.357275641893 0.210997365241,-0.970143533681 -0.695818118925,-1.00000010731 -0.713619134602))", + "POLYGON((-0.999999965066 -0.493921978401,-0.909999987372 -0.360755621066,-0.909999996424 -0.91000000872,0.91000000872 -0.909999996424,0.909999996424 0.91000000872,-0.909999996424 0.91000000872,-0.909999911756 -0.0259065349961,-0.999999867625 -0.0624282647935,-1 1,1 1,1 -1,-1 -1,-0.999999965066 -0.493921978401))" + }; + +static std::string ggl_list_20190307_matthieu_2[2] = + { + "POLYGON((-2 -2,-2 2,2 2,2 -2,-2 -2))", + "POLYGON((-0.430323140092 -0.999999912736,-1 -1,-1 1,1 1,1 -1,0.431066411049 -0.999999901684,0.43106695576 -1.00000010168,-0.43032321787 -1.00000011274,-0.430323140092 -0.999999912736),(0.135529235005 0.316180944443,-0.949848473072 -0.124261498451,-0.47733861208 -0.590634822845,0.135529235005 0.316180944443))" + }; + +static std::string buffer_rt_a[2] = + { + "POLYGON((1 7,1 8,1.0012 8.04907,1.00482 8.09802,1.01082 8.14673,1.01921 8.19509,1.02997 8.24298,1.04306 8.29028,1.05846 8.33689,1.07612 8.38268,1.09601 8.42756,1.11808 8.4714,1.14227 8.5141,1.16853 8.55557,1.19679 8.5957,1.22699 8.63439,1.25905 8.67156,1.29289 8.70711,1.32844 8.74095,1.36561 8.77301,1.4043 8.80321,1.44443 8.83147,1.4859 8.85773,1.5286 8.88192,1.57244 8.90399,1.61732 8.92388,1.66311 8.94154,1.70972 8.95694,1.75702 8.97003,1.80491 8.98079,1.85327 8.98918,1.90198 8.99518,1.95093 8.9988,2 9,3 9,3.04907 8.9988,3.09802 8.99518,3.14673 8.98918,3.19509 8.98079,3.24298 8.97003,3.29028 8.95694,3.33689 8.94154,3.38268 8.92388,3.42756 8.90399,3.4714 8.88192,3.5141 8.85773,3.55557 8.83147,3.5957 8.80321,3.63439 8.77301,3.67156 8.74095,3.70711 8.70711,3.74095 8.67156,3.77301 8.63439,3.80321 8.5957,3.83147 8.55557,3.85773 8.5141,3.88192 8.4714,3.90399 8.42756,3.92388 8.38268,3.94154 8.33689,3.95694 8.29028,3.97003 8.24298,3.98079 8.19509,3.98918 8.14673,3.99518 8.09802,3.9988 8.04907,4 8,4 7,3.9988 6.95093,3.99518 6.90198,3.98918 6.85327,3.98079 6.80491,3.97003 6.75702,3.95694 6.70972,3.94154 6.66311,3.92388 6.61732,3.90399 6.57244,3.88192 6.5286,3.85773 6.4859,3.83147 6.44443,3.80321 6.4043,3.77301 6.36561,3.74095 6.32844,3.70711 6.29289,3.67156 6.25905,3.63439 6.22699,3.5957 6.19679,3.55557 6.16853,3.5141 6.14227,3.4714 6.11808,3.42756 6.09601,3.38268 6.07612,3.33689 6.05846,3.29028 6.04306,3.24298 6.02997,3.19509 6.01921,3.14673 6.01082,3.09802 6.00482,3.04907 6.0012,3 6,2 6,1.95093 6.0012,1.90198 6.00482,1.85327 6.01082,1.80491 6.01921,1.75702 6.02997,1.70972 6.04306,1.66311 6.05846,1.61732 6.07612,1.57244 6.09601,1.5286 6.11808,1.4859 6.14227,1.44443 6.16853,1.4043 6.19679,1.36561 6.22699,1.32844 6.25905,1.29289 6.29289,1.25905 6.32844,1.22699 6.36561,1.19679 6.4043,1.16853 6.44443,1.14227 6.4859,1.11808 6.5286,1.09601 6.57244,1.07612 6.61732,1.05846 6.66311,1.04306 6.70972,1.02997 6.75702,1.01921 6.80491,1.01082 6.85327,1.00482 6.90198,1.0012 6.95093,1 7))", + "POLYGON((3 6,4 6,4.04907 5.9988,4.09802 5.99518,4.14673 5.98918,4.19509 5.98079,4.24298 5.97003,4.29028 5.95694,4.33689 5.94154,4.38268 5.92388,4.42756 5.90399,4.4714 5.88192,4.5141 5.85773,4.55557 5.83147,4.5957 5.80321,4.63439 5.77301,4.67156 5.74095,4.70711 5.70711,4.74095 5.67156,4.77301 5.63439,4.80321 5.5957,4.83147 5.55557,4.85773 5.5141,4.88192 5.4714,4.90399 5.42756,4.92388 5.38268,4.94154 5.33689,4.95694 5.29028,4.97003 5.24298,4.98079 5.19509,4.98918 5.14673,4.99518 5.09802,4.9988 5.04907,5 5,5 4,4.9988 3.95093,4.99518 3.90198,4.98918 3.85327,4.98079 3.80491,4.97003 3.75702,4.95694 3.70972,4.94154 3.66311,4.92388 3.61732,4.90399 3.57244,4.88192 3.5286,4.85773 3.4859,4.83147 3.44443,4.80321 3.4043,4.77301 3.36561,4.74095 3.32844,4.70711 3.29289,4.67156 3.25905,4.63439 3.22699,4.5957 3.19679,4.55557 3.16853,4.5141 3.14227,4.4714 3.11808,4.42756 3.09601,4.38268 3.07612,4.33689 3.05846,4.29028 3.04306,4.24298 3.02997,4.19509 3.01921,4.14673 3.01082,4.09802 3.00482,4.04907 3.0012,4 3,3 3,3 3,2 3,1.95093 3.0012,1.90198 3.00482,1.85327 3.01082,1.80491 3.01921,1.75702 3.02997,1.70972 3.04306,1.66311 3.05846,1.61732 3.07612,1.57244 3.09601,1.5286 3.11808,1.4859 3.14227,1.44443 3.16853,1.4043 3.19679,1.36561 3.22699,1.32844 3.25905,1.29289 3.29289,1.25905 3.32844,1.22699 3.36561,1.19679 3.4043,1.16853 3.44443,1.14227 3.4859,1.11808 3.5286,1.09601 3.57244,1.07612 3.61732,1.05846 3.66311,1.04306 3.70972,1.02997 3.75702,1.01921 3.80491,1.01082 3.85327,1.00482 3.90198,1.0012 3.95093,1 4,1 5,1.0012 5.04907,1.00482 5.09802,1.01082 5.14673,1.01921 5.19509,1.02997 5.24298,1.04306 5.29028,1.05846 5.33689,1.07612 5.38268,1.09601 5.42756,1.11808 5.4714,1.14227 5.5141,1.16853 5.55557,1.19679 5.5957,1.22699 5.63439,1.25905 5.67156,1.29289 5.70711,1.32844 5.74095,1.36561 5.77301,1.4043 5.80321,1.44443 5.83147,1.4859 5.85773,1.5286 5.88192,1.57244 5.90399,1.61732 5.92388,1.66311 5.94154,1.70972 5.95694,1.75702 5.97003,1.80491 5.98079,1.85327 5.98918,1.90198 5.99518,1.95093 5.9988,2 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6,3 6))" + }; + +static std::string buffer_rt_f[2] = + { + "POLYGON((-0.29999999999999999 6.0000000000000000,-0.29999999999999999 7.0000000000000000,-0.30000000000000027 7.7242640687119302,0.21213203435596423 7.2121320343559638,1.2121320343559643 6.2121320343559638,1.7242640687119293 5.7000000000000002,1.0000000000000000 5.7000000000000002,0.00000000000000000 5.7000000000000002,-0.30000000000000027 5.7000000000000002,-0.29999999999999999 6.0000000000000000))", + "POLYGON((1.3000000000000000 9.0000000000000000,1.3000000000000000 8.0000000000000000,1.3000000000000007 7.7000000000000002,1.0000000000000000 7.7000000000000002,0.00000000000000000 7.7000000000000002,-0.29999999999999982 7.7000000000000002,-0.29999999999999999 8.0000000000000000,-0.29999999999999999 9.0000000000000000,-0.29999999999999982 9.3000000000000007,0.00000000000000000 9.3000000000000007,1.0000000000000000 9.3000000000000007,1.3000000000000007 9.3000000000000007,1.3000000000000000 9.0000000000000000))" + }; + +static std::string buffer_rt_g[2] = + { + "POLYGON((2.0 8.0,2.0 9.0,2.0 10.0,3.0 10.0,4.0 10.0,6.4142135623730958 10.0,4.7071067811865479 8.2928932188134521,3.7071067811865475 7.2928932188134521,2.0 5.5857864376269051,2.0 8.0))", + "POLYGON((0.0 6.0,0.0 7.0,0.0 8.0,1.0 8.0,2.0 8.0,4.4142135623730958 8.0,2.7071067811865475 6.2928932188134521,1.7071067811865475 5.2928932188134521,-0.0 3.5857864376269042,0.0 6.0))" + }; + +static std::string buffer_rt_g_boxes[5] = + { + "POLYGON((0 0,0 4,4 4,4 0,0 0))", + "POLYGON((2 2,2 4,6 4,6 2,2 2))", + "POLYGON((2 2,2 4,6 4,8 4,8 2,2 2))", + "POLYGON((2 2,2 4,6 4,6 6,8 6,8 2,2 2))", + + "POLYGON((0 0,0 4,4 4,4 5,5 5,5 1,4 1,4 0,0 0))" + }; + +// From buffer-robustness-test with segment-intersection "touching" with r ~ 1.16 +static std::string buffer_rt_i[2] = + { + "POLYGON((1.0 1.0,1.0 2.0,1.0 3.0,2.0 3.0,3.0 3.0,5.4142135623730949 3.0,3.7071067811865475 1.2928932188134525,2.7071067811865475 0.29289321881345254,1.0 -1.4142135623730949,1.0 1.0))", + "POLYGON((2.0 2.0,2.0 3.0,2.0 4.0,3.0 4.0,4.0 4.0,6.4142135623730958 4.0,4.7071067811865479 2.2928932188134525,3.7071067811865475 1.2928932188134525,2.0 -0.41421356237309387,2.0 2.0))" + }; + +// Idem, but with a touch-in-the-middle +static std::string buffer_rt_j[2] = + { + "POLYGON((1.0 4.0,1.0 5.0,1.0 6.0,2.0 6.0,3.0 6.0,5.4142135623730967 6.0,3.7071067811865475 4.2928932188134521,2.7071067811865475 3.2928932188134525,1.0 1.5857864376269055,1.0 4.0))", + "POLYGON((-1.0 2.0,-1.0 3.0,-1.0 4.0,0.00 4.0,1.0 4.0,3.4142135623730949 4.0,1.7071067811865475 2.2928932188134525,0.70710678118654746 1.2928932188134525,-1.0 -0.41421356237309492,-1.0 2.0))" + }; + +// Nearly-collinear (two segments as-if meeting but not really) +static std::string buffer_rt_l[2] = + { + "POLYGON((1.0 5.0,1.0 6.0,1.0 8.4142135623730958,2.7071067811865475 6.7071067811865479,3.7071067811865475 5.7071067811865479,5.4142135623730958 4.0,3.0 4.0,2.0 4.0,1.0 4.0,1.0 5.0))", + "POLYGON((5.0 1.0,5.0 2.0,5.0 4.4142135623730958,6.7071067811865479 2.7071067811865475,7.7071067811865479 1.7071067811865475,9.4142135623730958 0.00,7.0 0.0,6.0 0.0,5.0 0.0,5.0 1.0))" + }; + +static std::string buffer_rt_m1[2] = + { + "POLYGON((3.0 2.0,3.0 3.0,3.0 5.4142135623730940,4.7071067811865479 3.7071067811865475,5.7071067811865479 2.7071067811865475,7.4142135623730940 1.0,5.0 1.0,4.0 1.0,3.0 1.0,3.0 2.0))", + "POLYGON((0.29289321881345254 2.7071067811865475,1.2928932188134525 3.7071067811865475,3.0 5.4142135623730949,3.0 3.0,3.0 2.0,3.0 1.0,2.0 1.0,1.0 1.0,-1.4142135623730949 1.0,0.29289321881345254 2.7071067811865475))" + }; + +static std::string buffer_rt_m2[2] = + { + "POLYGON((-0.70710678118654746 3.7071067811865475,0.29289321881345254 4.7071067811865479,2.0 6.4142135623730967,2.0 4.0,2.0 3.0,2.0 2.0,1.0 2.0,0.00 2.0,-2.4142135623730949 2.0,-0.70710678118654746 3.7071067811865475))", + "POLYGON((2.2928932188134525 6.7071067811865479,3.2928932188134525 7.7071067811865479,5.0 9.4142135623730958,5.0 7.0,5.0 6.0,5.0 6.0,5.0 5.0,5.0 4.0,4.0 4.0,3.0 4.0,2.0 4.0,2.0 5.0,2.0 6.0,2.0 6.4142135623730958,2.2928932188134525 6.7071067811865479))" + }; + + +static std::string buffer_rt_n[2] = + { + "POLYGON((-0.70710678118654746 0.70710678118654746,0.29289321881345254 1.7071067811865475,2.0 3.4142135623730949,2.0 1.0,2.0 0.0,2.0 -1.0,1.0 -1.0,0.00 -1.0,-2.4142135623730949 -1.0,-0.70710678118654746 0.70710678118654746))", + "POLYGON((2.2928932188134525 3.7071067811865475,3.2928932188134525 4.7071067811865479,5.0 6.4142135623730958,5.0 4.0,5.0 3.0,5.0 2.0,4.0 2.0,3.0 2.0,0.58578643762690574 2.0,2.2928932188134525 3.7071067811865475))" + }; + +static std::string buffer_rt_q[2] = + { + "POLYGON((6.0 6.0,7.0 6.0,9.4142135623730958 6.0,7.7071067811865479 4.2928932188134521,6.7071067811865479 3.2928932188134525,6.4142135623730949 3.0,6.0 3.0,5.0 3.0,4.0 3.0,4.0 4.0,4.0 5.0,4.0 6.0,5.0 6.0,6.0 6.0))", + "POLYGON((3.0 2.0,3.0 3.0,3.0 4.0,4.0 4.0,5.0 4.0,7.4142135623730958 4.0,5.7071067811865479 2.2928932188134525,4.7071067811865479 1.2928932188134525,3.0 -0.41421356237309581,3.0 2.0))" + }; + +static std::string buffer_rt_r[2] = + { + "POLYGON((3.7071067811865475 0.29289321881345254,2.7071067811865475 -0.70710678118654746,2.0 -1.4142135623730949,1.2928932188134525 -0.70710678118654746,0.29289321881345254 0.29289321881345254,-0.41421356237309492 1.0,0.29289321881345254 1.7071067811865475,1.2928932188134525 2.7071067811865475,2.0000000000000004 3.4142135623730954,2.7071067811865475 2.7071067811865475,3.7071067811865475 1.7071067811865475,4.4142135623730958 1.0000000000000004,3.7071067811865475 0.29289321881345254))", + "POLYGON((5.7071067811865479 2.2928932188134525,4.7071067811865479 1.2928932188134525,4.4142135623730958 1.0,4.0 1.0,3.0 1.0,1.3819660112501053 1.0,2.1055728090000843 2.4472135954999579,3.1055728090000843 4.4472135954999583,3.7260485282911020 5.6881650340819956,4.7071067811865479 4.7071067811865479,5.7071067811865479 3.7071067811865475,6.4142135623730958 3.0,5.7071067811865479 2.2928932188134525))" + }; + + +static std::string buffer_rt_t[2] = + { + "POLYGON((0.00000000000000000 3.0,0.00000000000000000 4.0,0.00000000000000000 6.4142135623730958,1.7071067811865475 4.7071067811865479,2.7071067811865475 3.7071067811865475,4.4142135623730940 2.0,2.0 2.0,1.0 2.0,-0.00000000000000000 2.0,0.00000000000000000 3.0))", + "POLYGON((1.7071067811865475 3.2928932188134525,0.70710678118654746 2.2928932188134525,-1.0 0.58578643762690508,-1.0 3.0,-1.0 4.0,-1.0 4.0,-1.0 5.0,-1.0 7.4142135623730958,0.70710678118654746 5.7071067811865479,1.7071067811865475 4.7071067811865479,2.4142135623730954 4.0,1.7071067811865475 3.2928932188134525))" + }; + +// Two circles, causing problems in sectionalize. Fixed by adding small buffer +static std::string buffer_mp1[2] = + { + "POLYGON((7 5,6.989043790736547 4.790943073464693,6.956295201467611 4.584176618364482,6.902113032590307 4.381966011250105,6.827090915285202 4.1865267138484,6.732050807568878 4,6.618033988749895 3.824429495415054,6.486289650954788 3.661738787282284,6.338261212717717 3.513710349045212,6.175570504584946 3.381966011250105,6 3.267949192431122,5.8134732861516 3.172909084714799,5.618033988749895 3.097886967409693,5.415823381635519 3.043704798532389,5.209056926535308 3.010956209263453,5.000000000000001 3,4.790943073464693 3.010956209263453,4.584176618364483 3.043704798532389,4.381966011250106 3.097886967409693,4.186526713848401 3.172909084714798,4.00 3.267949192431122,3.824429495415055 3.381966011250104,3.661738787282284 3.513710349045211,3.513710349045212 3.661738787282284,3.381966011250105 3.824429495415053,3.267949192431122 4,3.172909084714798 4.1865267138484,3.097886967409693 4.381966011250106,3.043704798532389 4.584176618364483,3.010956209263453 4.790943073464694,3 5.00,3.010956209263453 5.209056926535308,3.043704798532389 5.415823381635521,3.097886967409694 5.618033988749897,3.172909084714799 5.813473286151603,3.267949192431124 6.00,3.381966011250107 6.175570504584949,3.513710349045214 6.338261212717719,3.661738787282286 6.486289650954791,3.824429495415056 6.618033988749897,4.00 6.732050807568879,4.186526713848402 6.827090915285202,4.381966011250107 6.902113032590307,4.584176618364483 6.956295201467611,4.790943073464693 6.989043790736547,5 7,5.209056926535306 6.989043790736547,5.415823381635518 6.956295201467611,5.618033988749893 6.902113032590307,5.813473286151598 6.827090915285202,6.00 6.732050807568879,6.175570504584943 6.618033988749897,6.338261212717713 6.486289650954792,6.486289650954785 6.33826121271772,6.618033988749891 6.175570504584951,6.732050807568874 6.00,6.827090915285199 5.813473286151607,6.902113032590305 5.618033988749902,6.95629520146761 5.415823381635526,6.989043790736545 5.209056926535316,7 5))", + "POLYGON((9 7,8.989043790736547 6.790943073464693,8.956295201467611 6.584176618364482,8.902113032590307 6.381966011250105,8.827090915285202 6.1865267138484,8.732050807568877 6,8.618033988749895 5.824429495415053,8.486289650954788 5.661738787282284,8.338261212717717 5.513710349045212,8.175570504584947 5.381966011250105,8 5.267949192431122,7.8134732861516 5.172909084714799,7.618033988749895 5.097886967409693,7.415823381635519 5.043704798532389,7.209056926535308 5.010956209263453,7.000000000000001 5,6.790943073464693 5.010956209263453,6.584176618364483 5.043704798532389,6.381966011250106 5.097886967409693,6.186526713848401 5.172909084714798,6.00 5.267949192431122,5.824429495415055 5.381966011250104,5.661738787282284 5.513710349045211,5.513710349045212 5.661738787282284,5.381966011250105 5.824429495415053,5.267949192431122 6,5.172909084714798 6.1865267138484,5.097886967409693 6.381966011250106,5.043704798532389 6.584176618364483,5.010956209263453 6.790943073464694,5 7.00,5.010956209263453 7.209056926535308,5.043704798532389 7.415823381635521,5.097886967409694 7.618033988749897,5.172909084714799 7.813473286151603,5.267949192431124 8.00,5.381966011250107 8.175570504584949,5.513710349045214 8.338261212717718,5.661738787282286 8.486289650954792,5.824429495415057 8.618033988749897,6.00 8.732050807568879,6.186526713848402 8.827090915285202,6.381966011250107 8.902113032590307,6.584176618364483 8.956295201467611,6.790943073464693 8.989043790736547,7 9,7.209056926535306 8.989043790736547,7.415823381635518 8.956295201467611,7.618033988749893 8.902113032590307,7.813473286151598 8.827090915285202,8.00 8.732050807568879,8.175570504584943 8.618033988749897,8.338261212717713 8.486289650954792,8.486289650954785 8.33826121271772,8.618033988749891 8.17557050458495,8.732050807568875 8.00,8.827090915285199 7.813473286151607,8.902113032590306 7.618033988749902,8.95629520146761 7.415823381635526,8.989043790736545 7.209056926535316,9 7))" + }; + +// Union of two circles, unioned with third circle, having undetected inner polygon +// This is a robustness issue in get_turn_info, collinear_opposite, fixed by checking consistency +static std::string buffer_mp2[2] = + { + "POLYGON((7 8,6.9949042292205075 7.8573216336015355,6.9796428837618656 7.7153703234534294,6.954293731942319 7.5748694208940464,6.918985947228995 7.4365348863171405,6.8738994499995236 7.301071640801803,6.8192639907090369 7.1691699739962269,6.7553579791345113 7.0415020265598862,6.682507065662362 6.9187183650888047,6.6010824818487208 6.8014446669773063,6.5114991487085163 6.6902785321094296,6.4142135623730949 6.5857864376269051,6.3097214678905704 6.4885008512914837,6.1985553330226946 6.3989175181512792,6.0812816349111953 6.317492934337638,5.9584979734401138 6.2446420208654887,5.8308300260037731 6.180736009290964,5.698928359198197 6.1261005500004764,5.5634651136828603 6.081014052771005,5.4251305791059536 6.045706268057681,5.2846296765465715 6.0203571162381344,5.1426783663984654 6.0050957707794925,5.0000000000000009 6,4.8573216336015363 6.0050957707794925,4.7153703234534312 6.0203571162381344,4.5748694208940481 6.045706268057681,4.4365348863171423 6.081014052771005,4.3010716408018048 6.1261005500004764,4.1691699739962287 6.1807360092909622,4.041502026559888 6.2446420208654878,3.9187183650888064 6.3174929343376363,3.8014446669773077 6.3989175181512783,3.6902785321094314 6.4885008512914819,3.5857864376269064 6.5857864376269033,3.4885008512914846 6.6902785321094278,3.3989175181512805 6.8014446669773045,3.3174929343376389 6.9187183650888029,3.2446420208654896 7.0415020265598844,3.180736009290964 7.1691699739962251,3.1261005500004773 7.3010716408018013,3.0810140527710059 7.4365348863171379,3.0457062680576819 7.5748694208940437,3.0203571162381349 7.7153703234534268,3.0050957707794934 7.8573216336015328,3 7.9999999999999973,3.0050957707794925 8.1426783663984619,3.0203571162381344 8.284629676546567,3.0457062680576801 8.4251305791059501,3.0810140527710042 8.5634651136828559,3.1261005500004755 8.6989283591981934,3.1807360092909618 8.8308300260037704,3.2446420208654869 8.9584979734401102,3.3174929343376358 9.0812816349111927,3.398917518151277 9.198555333022691,3.488500851291481 9.3097214678905669,3.5857864376269024 9.4142135623730923,3.6902785321094269 9.5114991487085145,3.8014446669773028 9.601082481848719,3.918718365088802 9.6825070656623602,4.0415020265598844 9.7553579791345104,4.169169973996226 9.819263990709036,4.301071640801803 9.8738994499995236,4.4365348863171405 9.918985947228995,4.5748694208940472 9.9542937319423199,4.7153703234534312 9.9796428837618656,4.8573216336015381 9.9949042292205075,5.0000000000000036 10,5.142678366398469 9.9949042292205075,5.284629676546575 9.9796428837618656,5.425130579105959 9.9542937319423181,5.5634651136828657 9.9189859472289932,5.6989283591982032 9.8738994499995201,5.8308300260037802 9.8192639907090324,5.9584979734401209 9.7553579791345069,6.0812816349112033 9.6825070656623566,6.1985553330227017 9.6010824818487137,6.3097214678905784 9.5114991487085092,6.4142135623731038 9.4142135623730869,6.5114991487085252 9.3097214678905598,6.6010824818487288 9.1985553330226821,6.68250706566237 9.0812816349111838,6.7553579791345184 8.9584979734400996,6.8192639907090431 8.830830026003758,6.873899449999529 8.698928359198181,6.9189859472290003 8.5634651136828417,6.9542937319423235 8.4251305791059359,6.9796428837618683 8.284629676546551,6.9949042292205084 8.1426783663984441,7 8))", + "POLYGON((7.281120925915111 9.019979886500282,7.142678366398465 9.005095770779493,7.000000000000001 9,6.857321633601536 9.005095770779493,6.715370323453431 9.020357116238134,6.574869420894048 9.04570626805768,6.436534886317142 9.081014052771005,6.301071640801805 9.126100550000476,6.169169973996229 9.180736009290962,6.041502026559888 9.244642020865488,5.918718365088806 9.317492934337636,5.801444666977307 9.398917518151277,5.690278532109431 9.488500851291482,5.585786437626906 9.585786437626904,5.488500851291485 9.690278532109428,5.398917518151281 9.801444666977304,5.317492934337639 9.918718365088804,5.24464202086549 10.04150202655988,5.180736009290964 10.16916997399622,5.126100550000477 10.3010716408018,5.081014052771006 10.43653488631714,5.045706268057682 10.57486942089405,5.020357116238134 10.71537032345343,5.005095770779493 10.85732163360153,5 11,5.005095770779493 11.14267836639846,5.020357116238134 11.28462967654657,5.04570626805768 11.42513057910595,5.081014052771004 11.56346511368286,5.126100550000476 11.69892835919819,5.180736009290962 11.83083002600377,5.244642020865487 11.95849797344011,5.317492934337636 12.08128163491119,5.398917518151277 12.19855533302269,5.488500851291481 12.30972146789057,5.585786437626902 12.41421356237309,5.690278532109427 12.51149914870852,5.801444666977303 12.60108248184872,5.918718365088802 12.68250706566236,6.041502026559884 12.75535797913451,6.169169973996226 12.81926399070904,6.301071640801803 12.87389944999952,6.436534886317141 12.918985947229,6.574869420894047 12.95429373194232,6.715370323453431 12.97964288376187,6.857321633601538 12.99490422922051,7.000000000000004 13,7.142678366398469 12.99490422922051,7.284629676546575 12.97964288376187,7.425130579105959 12.95429373194232,7.563465113682866 12.91898594722899,7.698928359198203 12.87389944999952,7.83083002600378 12.81926399070903,7.958497973440121 12.75535797913451,8.081281634911203 12.68250706566236,8.198555333022702 12.60108248184871,8.309721467890579 12.51149914870851,8.414213562373103 12.41421356237309,8.511499148708525 12.30972146789056,8.60108248184873 12.19855533302268,8.682507065662371 12.08128163491118,8.755357979134519 11.9584979734401,8.819263990709043 11.83083002600376,8.873899449999529 11.69892835919818,8.918985947229 11.56346511368284,8.954293731942324 11.42513057910594,8.979642883761869 11.28462967654655,8.994904229220509 11.14267836639844,9 11,8.994904229220508 10.85732163360154,8.979642883761866 10.71537032345343,8.954293731942318 10.57486942089405,8.918985947228995 10.43653488631714,8.873899449999524 10.3010716408018,8.819263990709036 10.16916997399623,8.755357979134512 10.04150202655989,8.718879074084889 9.980020113499718,8.857321633601538 9.994904229220508,9.000000000000004 10,9.142678366398469 9.994904229220508,9.284629676546576 9.979642883761866,9.425130579105959 9.954293731942318,9.563465113682865 9.918985947228993,9.698928359198204 9.87389944999952,9.830830026003779 9.819263990709032,9.958497973440121 9.755357979134507,10.0812816349112 9.682507065662357,10.1985553330227 9.601082481848714,10.30972146789058 9.511499148708509,10.4142135623731 9.414213562373087,10.51149914870853 9.30972146789056,10.60108248184873 9.198555333022682,10.68250706566237 9.081281634911184,10.75535797913452 8.9584979734401,10.81926399070904 8.830830026003758,10.87389944999953 8.698928359198181,10.918985947229 8.563465113682842,10.95429373194232 8.425130579105936,10.97964288376187 8.284629676546551,10.99490422922051 8.142678366398444,11 8,10.99490422922051 7.857321633601536,10.97964288376187 7.715370323453429,10.95429373194232 7.574869420894046,10.918985947229 7.436534886317141,10.87389944999952 7.301071640801803,10.81926399070904 7.169169973996227,10.75535797913451 7.041502026559886,10.68250706566236 6.918718365088805,10.60108248184872 6.801444666977306,10.51149914870852 6.69027853210943,10.4142135623731 6.585786437626905,10.30972146789057 6.488500851291484,10.1985553330227 6.398917518151279,10.0812816349112 6.317492934337638,9.958497973440114 6.244642020865489,9.830830026003774 6.180736009290964,9.698928359198197 6.126100550000476,9.56346511368286 6.081014052771005,9.425130579105954 6.045706268057681,9.284629676546571 6.020357116238134,9.142678366398465 6.005095770779493,9.000000000000002 6,8.857321633601536 6.005095770779493,8.715370323453431 6.020357116238134,8.574869420894048 6.045706268057681,8.436534886317142 6.081014052771005,8.301071640801805 6.126100550000476,8.169169973996228 6.180736009290962,8.041502026559888 6.244642020865488,7.918718365088806 6.317492934337636,7.801444666977307 6.398917518151278,7.690278532109431 6.488500851291482,7.585786437626906 6.585786437626903,7.488500851291485 6.690278532109428,7.398917518151281 6.801444666977305,7.317492934337639 6.918718365088803,7.24464202086549 7.041502026559884,7.180736009290964 7.169169973996225,7.126100550000477 7.301071640801801,7.081014052771006 7.436534886317138,7.045706268057682 7.574869420894044,7.020357116238134 7.715370323453427,7.005095770779493 7.857321633601533,7 7.999999999999997,7.005095770779493 8.142678366398462,7.020357116238134 8.284629676546567,7.04570626805768 8.42513057910595,7.081014052771004 8.563465113682856,7.126100550000476 8.698928359198193,7.180736009290962 8.83083002600377,7.244642020865487 8.95849797344011,7.281120925915111 9.019979886500282))" + }; + +static std::string collinear_opposite_right[2] = + { + "POLYGON((7 6,7 8,8 9,8 5,7 6))", + "POLYGON((5.9 5.9,5.9 10.1,7 9,7 7,5.9 5.9))" + }; + +static std::string collinear_opposite_left[2] = + { + "POLYGON((7 6,7 8,6 9,8 11,8 5,7 6))", + "POLYGON((5 7,7 9,7 7,9 5,8 4,5 7))" + }; + +static std::string collinear_opposite_straight[2] = + { + "POLYGON((7 6,7 8,7 9,8 8,8 7,7 6))", + "POLYGON((6 6,6 9,7 10,7 7,7 5,6 6))" + }; + +static std::string ticket_9081_15[2] = + { + "POLYGON((0.6733025292237357 0.1677633042748119,0.4903155795903966 0.2232818375071136,0.4271130992272586 0.3070047723327289,0.786116554767879 0.3837165261542967,0.6733025292237357 0.1677633042748119))", + "POLYGON((0.6331466887796691 0.351029969741811,0.7496863892358909 0.3759321389935647,0.7688695634785153 0.35070163001261,0.7290398105918782 0.2744578879686089,0.6331466887796691 0.351029969741811))" + }; + +static std::string ticket_9081_314[2] = + { + "POLYGON((0.4397162028773298 0.5045841729755439,0.8281201612335258 0.8974555101699454,0.7367863490883197 0.2443919592743702,0.4397162028773298 0.5045841729755439))", + "POLYGON((0.5414573257656662 0.6074955108670699,0.5789048944501695 0.6005510671998147,0.6254781598681494 0.5392960142449524,0.7838704066548215 0.5810567836448409,0.7367863490883197 0.2443919592743702,0.4522347054548293 0.4936197023297791,0.4539963238827925 0.4940841246816053,0.4402150043376781 0.5050887115944368,0.5414573257656662 0.6074955108670699))" + }; + +static std::string ticket_9081_6690[2] = + { + "POLYGON((0.5489109414010371 0.5774835110050927,0.4099611282054447 0.4644351568071598,0.4294011278595494 0.4843224236729239,0.4205359995313906 0.5115225580860201,0.4441572412013468 0.5184999851878852,0.5489109414010371 0.5774835110050927))", + "POLYGON((0.3984249865018206 0.4526335964808558,0.3621206996557855 0.4602288471829723,0.4183516736935784 0.4730187483833363,0.4099611282054451 0.4644351568071601,0.3984249865018206 0.4526335964808558))" + }; + +static std::string ticket_9563[2] = + { + "POLYGON((16.4030230586813990 21.4147098480789640, 17.3451877762964380 14.8677773110138890, 11.9421647176150360 6.4530674629349205, 5.5969769413186015 4.5852901519210345, 4.6548122237035621 11.1322226889861170, 10.0578352823849610 19.5469325370650790, 16.4030230586813990 21.4147098480789640, 16.4030230586813990 21.4147098480789640))", + "POLYGON((16.4030230586814020 21.414709848078967, 17.7828326880709360 18.936596729241124, 17.3451877762964410 14.867777311013885, 15.2073549240394820 10.298488470659295, 11.9421647176150340 6.4530674629349125, 8.4245222359685457 4.3618917414181650, 5.5969769413185944 4.5852901519210292, 4.2171673119290620 7.0634032707588670, 4.6548122237035567 11.132222688986115, 6.7926450759605128 15.701511529340699, 10.0578352823849570 19.546932537065082, 13.5754777640314510 21.638108258581831, 16.4030230586814020 21.414709848078967))" + }; + +static std::string ticket_10108_a[2] = + { + "POLYGON((-0.85012528418186883439 0.66468648958045217778 , -1.0190633474909247536 0.58375169123203618504 , -0.81735787096893253167 0.85208889314502478385 , -0.85012528418186883439 0.66468648958045217778))", + "POLYGON((-1.0898104946524889147 1.0651111163194444398 , -1.0543813205484939832 0.82438792455048248708 , -0.81735787088719669136 0.8520888930811181261 , -1.0898104946524889147 1.0651111163194444398))" + }; +static std::string ticket_10108_b[2] = + { + "POLYGON((818.61020100991334 686.40744987236633, 818.94520828641623 714.37814489343316, 857.67308553468195 713.83138513092547, 857.33807828316174 685.94987141847253, 818.61020100991334 686.40744987236633))", + "POLYGON((857.33807828316174 685.94987141847253, 857.64395373587263 711.40684463430682, 910.49336536223325 710.67130033421233, 910.18750000000000 685.32544378698219, 857.33807828316174 685.94987141847253))" + }; + +// Rescaling problem (fixed in 1.58) +static std::string ticket_10747_a[2] = + { + "POLYGON((0 33554432,0 0,33554432 0,33554432 33554432,0 33554432))", + "POLYGON((25165824 25165824,41943040 25165824,41943040 41943040,25165824 41943040,25165824 25165824))" + }; +static std::string ticket_10747_b[2] = + { + "POLYGON((0 335544320,0 0,335544320 0,335544320 335544320,0 335544320))", + "POLYGON((251658240 251658240,419430400 251658240,419430400 419430400,251658240 419430400,251658240 251658240))" + }; +static std::string ticket_10747_c[2] = + { + "POLYGON((0 16777216,0 0,16777216 0,16777216 16777216,0 16777216))", + "POLYGON((12582912 12582912,20971520 12582912,20971520 20971520,12582912 20971520,12582912 12582912))" + }; +static std::string ticket_10747_d[2] = + { + "POLYGON((0 3355443,0 0,3355443 0,3355443 3355443,0 3355443))", + "POLYGON((2516582 2516582,4194304 2516582,4194304 4194304,2516582 4194304,2516582 2516582))" + }; +static std::string ticket_10747_e[2] = + { + "POLYGON((0 0.00000033554432,0 0,0.00000033554432 0,0.00000033554432 0.00000033554432,0 0.00000033554432))", + "POLYGON((0.00000025165824 0.00000025165824,0.00000041943040 0.00000025165824,0.00000041943040 0.00000041943040,0.00000025165824 0.00000041943040,0.00000025165824 0.00000025165824))" + }; + +static std::string ticket_10658[2] = + { + "POLYGON((516 1608,1308 1932,2094 2466,2094 32767,516 32767,516 1608))", + "POLYGON((516 2484,1308 3066,2094 3150,2094 32767,516 32767,516 2484))" + }; + +static std::string ticket_10835[3] = + { + "MULTILINESTRING((5239 2113,1020 2986))", + "POLYGON((5233 2113,5200 2205,1020 2205,1020 2022,5200 2022))", + "POLYGON((5233 2986,5200 3078,1020 3078,1020 2895,5200 2895))" + }; + +static std::string ticket_10866[2] = + { + "POLYGON((8126 3.18455e+07,8127 3.18455e+07,8129 3.18455e+07,8130 3.18455e+07,8130 -146305,8129 -146306,8127 -146306,8126 -146305,8126 3.18455e+07))", + "POLYGON((5.12064e+07 -146302,5.12064e+07 -146303,5.12064e+07 -146305,5.12064e+07 -146306,8127 -146306,8126 -146305,8126 -146303,8127 -146302,5.12064e+07 -146302))" + }; + +static std::string ticket_10868[2] = + { + "POLYGON((42817136 -3774506,43029074 -3929862,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575,35332375 2413654,35725796 2024148))", + "POLYGON((-33386239 -33721784,33721785 -33386239,33386240 33721785,-33721784 33386240))" + }; + +static std::string ticket_11121[2] = + { + "POLYGON((-8042 -1485,-8042 250,-8042 250,15943 254,15943 -1485,-8042 -1485))", + "POLYGON((-7901 -1485,-7901 529,-7901 529,15802 544,15802 -1485,-7901 -1485))" + }; + + +static std::string ticket_11576[2] = + { + "POLYGON((-0 0,0.0030892383152813277 0,0.0017033357506405240 0.0015364430953530355,-0 0))", + "POLYGON((0.0016845031281539609 0.0015194556912103366,0.00079878052059454633 0.00072051609032968962,0.0023117731015916947 0.00082400923980274917,0.0016845031281539609 0.0015194556912103366))" + }; + +static std::string ticket_11725[2] = + { + "POLYGON((0 0, 0 1, 3 1, 3 0, 0 0))", + "POLYGON((0 1, 0 3, 3 3, 3 1, 2 2, 1 2 , 1 1, 0 1))" + }; + +// Integer, ccw, open +static std::string ticket_11676[2] = + { + "POLYGON((1920 1660,1920 1462,3720 1462,3720 3262,1920 3262,1920 1959,2218 2189,1920 1660),(3718 1561,3360 2233,3718 1957,3718 1561),(2818 2653,2218 2189,2818 3253,3360 2233,2818 2653))", + "POLYGON((1918 2155,1918 1957,2818 2653,3718 1957,3718 2154,2818 3055,1918 2155))", + }; + +static std::string mysql_21964079_1[2] = + { + "POLYGON((7 3,0 10,0 -6,9 -5, 7 7, 7 3), (0 8, 2 3, 2 -2, 0 8))", + "POLYGON((0 8,-8 14,-11 18,-19 11, -3 1, 0 8))" + }; + +static std::string mysql_21964079_2[2] = + { + "POLYGON((0 0,0 10,10 10,10 0,0 0), (0 8, 4 4, 4 6, 0 8))", + "POLYGON((0 8,-8 8,-10 4,0 8))" + }; + +static std::string mysql_21964049[2] = + { + "POLYGON((7 0,10 -3,7 1,7 0))", + "POLYGON((7 4,-14 10,7 -17,7 4),(7 1,0 3,-2 4,7 1))" + }; + +static std::string mysql_21964465[2] = + { + "POLYGON((0 0,0 10,10 10,10 0, 0 0), (0 8, 4 4, 4 6, 0 8))", + "POLYGON((0 8,-8 8,-2 2,0 8))", + }; + +static std::string mysql_21977775[2] = + { + "POLYGON((8 6, 5 7, -1 4, -8 -7, 0 -17, 8 6), (3 6, 5 5, 0 -2, 3 6))", + "POLYGON((3 3, -17 11, -8 -3, 3 3))", + }; + +static std::string mysql_21965285[2] = + { + "POLYGON((7 3, 0 10, 0 -6, 9 -5, 7 7, 7 3), (0 8, 2 3, 2 -2, 0 8))", + "POLYGON((0 6, 0 8, -14 13, 0 6))", + }; + +static std::string mysql_21965285_b_inv[2] = + { + "POLYGON((3 0, -19 -19, -7 3, -2 10, 15 0, 3 0))", + "POLYGON((-20 -20,-20 20,20 20,20 -20,-20 -20),(1 1, -4 -3, 19 -8, 3 0, 1 1),(3 0, 8 12, 1 19, -3 16, -2 7, 3 0))" + }; + +static std::string mysql_23023665_1[2] = + { + "POLYGON((7 3,0 10,0 -6,9 -5,7 7,7 3),(0 8,2 3,2 -2,0 8))", + "POLYGON((0 8,-8 14,-11 18,-19 11,-3 1,0 8))" + }; + +static std::string mysql_23023665_2[2] = + { + "POLYGON((0 0,0 10,10 10,10 0,0 0),(0 8,4 4,4 6,0 8))", + "POLYGON((0 8,-8 8,-10 4,0 8))" + }; + +static std::string mysql_23023665_3[2] = + { + "POLYGON((5 0,15 18,-14 11,5 0),(0 3,-1 4,5 0,0 3))", + "POLYGON((6 0,-5 0,-1 -12,6 0))" + }; + +// mysql_23023665_4 was duplicate with mysql_21964049 + +static std::string mysql_23023665_5[2] = + { + "POLYGON((8 6,5 7,-1 4,-8 -7,0 -17,8 6),(3 6,5 5,0 -2,3 6))", + "POLYGON((3 5,-17 11,-8 -3,3 5))" + }; + +static std::string mysql_23023665_6[2] = + { + "POLYGON((6 7,18 14, -8 1, 0 0, 18 -8, 6 7), (6 0, -4 3, 5 3, 6 0))", + "POLYGON((2 3,-3 5,-10 -1,2 3))" + }; + +static std::string mysql_23023665_10[2] = + { + "POLYGON((0 5, -6 -17, 12 17, 0 5),(4 6, 5 5, 0 1, 4 6))", + "POLYGON((3 9, -15 -5, 13 -11, 3 9))" + }; + +static std::string mysql_23023665_11[2] = + { + "POLYGON((5 6,-15 -13,1 -8,5 6))", + "POLYGON((0 8,-19 6,18 -17,20 8,11 17,0 8),(3 2,3 -1,1 0,3 2),(1 3,4 4,0 -1,1 3))" + }; + +static std::string mysql_23023665_13[2] = +{ + "POLYGON((6 7,18 14,-8 1,0 0,18 -8,6 7),(6 0,-4 3,5 3,6 0))", + "POLYGON((0 7,-5 6,11 -13,0 7))" +}; + +#endif // BOOST_GEOMETRY_TEST_OVERLAY_CASES_HPP diff --git a/src/boost/libs/geometry/test/algorithms/overlay/overlay_common.hpp b/src/boost/libs/geometry/test/algorithms/overlay/overlay_common.hpp new file mode 100644 index 000000000..01fd109e5 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/overlay_common.hpp @@ -0,0 +1,464 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// 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) + + +#ifndef BOOST_GEOMETRY_TEST_OVERLAY_COMMON_HPP +#define BOOST_GEOMETRY_TEST_OVERLAY_COMMON_HPP + + +#if defined(_MSC_VER) +// We deliberately mix float/double's here so turn off warning +#pragma warning( disable : 4244 ) + +#endif // defined(_MSC_VER) + + + +#include +#include + +#include + + +#include +#include + + +#if defined(TEST_WITH_SVG) +# include +#endif + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + + + +template +void test_overlay(std::string const& id, T const& expected, + std::string const& wkt1, std::string const& wkt2, + double precision = 0.001) +{ + if (wkt1.empty() || wkt2.empty()) + { + return; + } + + G1 g1; + bg::read_wkt(wkt1, g1); + + G2 g2; + bg::read_wkt(wkt2, g2); + + bg::correct(g1); + bg::correct(g2); + + //std::cout << bg::wkt(g1) << std::endl; + //std::cout << bg::wkt(g2) << std::endl; + + // Try the overlay-function in both ways + std::string caseid = id; +//goto case_reversed; + +#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION + std::cout << std::endl << std::endl << "# " << caseid << std::endl; +#endif + Functor::template apply(caseid, expected, g1, g2, precision); + +#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION + return; +#endif + +//case_reversed: +#if ! defined(BOOST_GEOMETRY_TEST_OVERLAY_NOT_EXCHANGED) + caseid = id + "_rev"; +#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION + std::cout << std::endl << std::endl << "# " << caseid << std::endl; +#endif + + Functor::template apply(caseid, expected, g2, g1, precision); +#endif +} + + +#if ! defined(BOOST_GEOMETRY_TEST_MULTI) + +template +void test_all(std::vector const& expected) +{ + typedef bg::model::polygon

polygon; + typedef bg::model::linestring

linestring; + typedef bg::model::box

box; + + // compilation test only, will not output + //test_overlay("", "", "", ""); + typename boost::range_const_iterator >::type iterator + = boost::begin(expected); + + +#ifndef ONLY_CASE_BRANDON + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("1", *iterator, + "POLYGON((0 1,2 5,5 3,0 1))", + "POLYGON((3 0,0 3,4 5,3 0))"); + iterator++; + + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("2", *iterator, + "POLYGON((0 2,2 5,5 3,3 0,0 2))", + "POLYGON((0 4,4 5,5 1,1 0,0 4))"); + iterator++; + + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("3", *iterator, + "POLYGON((1 2,2 4,4 3,3 1,1 2))", + "POLYGON((1 1,1 4,4 4,4 1,1 1))"); + test_overlay("3b", *iterator, + "POLYGON((1 2,2 4,4 3,3 1,1 2))", + "BOX(1 1,4 4)"); + iterator++; + + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("4", *iterator, + "POLYGON((0 2,2 5,5 3,3 0,0 2))", + "POLYGON((0 4,4 5,5 1,1 0,0 4),(1 1,2 1,2 2,1 2,1 1),(3 3,4 3,4 4,3 4,3 3))"); + iterator++; + + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("5", *iterator, + "POLYGON((0 4,1 5,2.5 4,3.5 5,5 4,4 3,5 2,4 1,3.5 0,3 1,2.5 0,2 1,1.5 0,1 3.5,0.25 3,1 2.5,0 2,0 4))", + "POLYGON((0.5 0.5,0.5 4.5,4.5 4.5,4.5 0.5,0.5 0.5))" + ); + test_overlay("5b", *iterator, + "POLYGON((0 4,1 5,2.5 4,3.5 5,5 4,4 3,5 2,4 1,3.5 0,3 1,2.5 0,2 1,1.5 0,1 3.5,0.25 3,1 2.5,0 2,0 4))", + "BOX(0.5 0.5,4.5 4.5)" + ); + iterator++; + + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("6", *iterator, + "POLYGON((0 1,2 5,5 2,0 1))", + "POLYGON((1 3,2 5,5 2,1 3))"); + iterator++; + + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("7", *iterator, + "POLYGON((0 1,1 3,5 2,0 1))", + "POLYGON((1 3,2 5,5 2,1 3))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("8", *iterator, + "POLYGON((0 0,0 4,4 0,0 0))", + "POLYGON((1 3,4 4,3 1,1 3))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("9", *iterator, + "POLYGON((0 0,0 4,4 0,0 0))", + "POLYGON((2 2,2 4,5 4,2 2))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("10", *iterator, + "POLYGON((0 0,2 4,4 0,0 0))", + "POLYGON((1 2,2 5,3 2,2 4,1 2))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("11", *iterator, + "POLYGON((0 0,0 4,4 0,0 0))", + "POLYGON((1 2,2 2,2 1,1 1))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("12", *iterator, + "POLYGON((0 1,1 4,2 2,3 4,4 1,0 1))", + "POLYGON((0 3,2 4,4 3,0 3))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("13", *iterator, + "POLYGON((0 1,1 2,3 0,0 1))", + "POLYGON((0 3,2 3,2 1,0 3))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("14", *iterator, + "POLYGON((0 0,0 4,2 2,4 0,0 0))", + "POLYGON((1 3,4 4,3 1,1 3))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("15", *iterator, + "POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))", + "POLYGON((1 3,4 4,3 1,1 3))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("16", *iterator, + "POLYGON((1 2,3 4,2 1,1 2))", + "POLYGON((1 0,1 2,2 1,3 4,2 3,3 5,4 0,1 0))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("17", *iterator, + "POLYGON((0 0,0 4,4 0,0 0))", + "POLYGON((1 1,1 3,3 1,1 1))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("18", *iterator, + "POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))", + "POLYGON((1 1,1 3,3 1,1 1))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("19", *iterator, + "POLYGON((2 0,1 3,5 2,2 0))", + "POLYGON((1 3,2 5,5 2,1 3))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("20", *iterator, + "POLYGON((2 0,1 3,5 2,2 0))", + "POLYGON((2 0,1 3,5 2,2 0))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("21", *iterator, + "POLYGON((1 0,0 5,5 2,1 0),(2 1,3 2,1 3,2 1))", + "POLYGON((2 1,1 3,3 2,2 1))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("22", *iterator, + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((2 4,5 5,4 2,2 4))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("23", *iterator, + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((3 3,4 2,1 1,3 3))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("24", *iterator, + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((2 2,4 2,1 1,2 2))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("25", *iterator, + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((3 1,4 2,5 0,3 1))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("26", *iterator, + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((3 1,4 2,5 4,4 0,3 1))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("27", *iterator, + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((1 1,4 2,5 0,1 1))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("28", *iterator, + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((1 1,4 2,5 4,5 0,1 1))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("29", *iterator, + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((4 4,5 1,4 2,1 1,4 4))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("30", *iterator, + "POLYGON((1 0,0 3,2 2,3 3,1 0))", + "POLYGON((1 2,2 2,2 4,4 3,3 1,1 2))"); + iterator++; + + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("31", *iterator, + "POLYGON((0 0,0 3,2 2,0 0))", + "POLYGON((4 1,2 2,3 3,4 1))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("32", *iterator, + "POLYGON((0 0,0 3,2 2,0 0))", + "POLYGON((4 1,3 0,2 2,4 1))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("33", *iterator, + "POLYGON((0 0,0 3,2 2,0 0))", + "POLYGON((3 3,3 0,2 2,3 3))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("34", *iterator, + "POLYGON((2 0,0 3,4 2,2 0))", + "POLYGON((2 1,4 2,5 3,4 1,2 1))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("35", *iterator, + "POLYGON((1 0,0 3,5 3,4 2,5 1,1 0))", + "POLYGON((2 2,4 2,4 1,2 2))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("36", *iterator, + "POLYGON((1 0,0 3,4 2,1 0))", + "POLYGON((1 5,5 5,4 2,3 3,2 1,1 2,1 5))"); + iterator++; + + // 37,38 in PPT but not yet implemented + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("37", *iterator, + "POLYGON((4 0,2 2,5 5,4 0))", + "POLYGON((0 2,4 3,2 2,4 1,0 2))"); + iterator++; + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("38", *iterator, + "POLYGON((4 0,3 3,2 2,4 5,5 2,4 0))", + "POLYGON((1 1,1 3,4 4,3 3,4 2,1 1))"); + iterator++; + + + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("39", *iterator, + "POLYGON((0 4,4 8,7 7,8 4,5 3,4 0,0 4))", + "POLYGON((0 4,4 8,5 5,8 4,7 1,4 0,0 4))"); + iterator++; + + // keyholing + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("43", *iterator, + "POLYGON((1 2,1 1,2 1,2 2.25,3 2.25,3 0,0 0,0 3,3 3,2.75 2,1 2))", + "POLYGON((1.5 1.5,1.5 2.5,2.5 2.5,2.5 1.5,1.5 1.5))"); + iterator++; + + // self-tangency + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("44", *iterator, + "POLYGON((0 0,0 3,3 3,3 2,0 1.5,3 1,3 0,0 0))", + "POLYGON((1 1,1 2,2 2,2 1,1 1))"); + iterator++; + + // self-intersection + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("45", *iterator, + "POLYGON((0.5 0,0.5 3,3 3,3 2,0 1.5,3 1,3 0,0.5 0))", + "POLYGON((1 1,1 2,2 2,2 1,1 1))"); + iterator++; + + // self-tangent + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("46", *iterator, + "POLYGON((2 0,2 3,5 3,5 2,2 1.5,5 1,5 0,2 0))", + "POLYGON((1.5 1,1.5 2,2.5 2,2.5 1,1.5 1))"); + iterator++; + + // self-tangent + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("47", *iterator, + "POLYGON((2.5 0,2.5 3,5 3,5 2,2 1.5,5 1,5 0,2.5 0))", + "POLYGON((2 1,2 2,3 2,3 1,2 1))"); + iterator++; + + + // 49, all + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("49", *iterator, + "POLYGON((2 6,2 14,10 18,18 14,18 6,16 5,14 4,12 3,10 2,8 3,6 4,4 5,2 6))", + "POLYGON((2 6,2 7,2 8,2 9,2 10,2 11,2 12,1 14" + ",4 14,4 15,7 15,7 18,8 17,9 20,10 18" + ",10 15.5,11 17.5,12 17,11 15,12 14.5,13 16.5,14 18.5,15 18,14 16,15 15.5,16 17.5,18 14" + ",19 13,17 11,19 9,19 7" + ",17 5,16 5,15 4.5,13 3.5,11 2.5,10 2" + ",8 3,6 4,4 5,2 6))"); + iterator++; + + + // ticket #17 + BOOST_ASSERT(iterator != boost::end(expected)); + std::string const ticket17 = "POLYGON ((-122.28139163 37.37319149,-122.28100699 37.37273669,-122.28002186 37.37303123,-122.27979681 37.37290072,-122.28007349 37.37240493,-122.27977334 37.37220360,-122.27819720 37.37288580,-122.27714184 37.37275161,-122.27678628 37.37253167,-122.27766437 37.37180973,-122.27804382 37.37121453,-122.27687664 37.37101354,-122.27645829 37.37203386,-122.27604423 37.37249110,-122.27632234 37.37343339,-122.27760980 37.37391082,-122.27812478 37.37800320,-122.26117222 37.39121007,-122.25572289 37.39566631,-122.25547269 37.39564971,-122.25366304 37.39552993,-122.24919976 37.39580268,-122.24417933 37.39366907,-122.24051443 37.39094143,-122.23246277 37.38100418,-122.23606766 37.38141338,-122.24001587 37.37738940,-122.23666848 37.37609347,-122.23057450 37.37882170,-122.22679803 37.37807143,-122.22525727 37.37448817,-122.22523229 37.37443000,-122.23083199 37.37609347,-122.23033486 37.37777891,-122.23169030 37.37732117,-122.23229178 37.37709687,-122.23237761 37.37631249,-122.23297776 37.37438834,-122.23872850 37.37165986,-122.24044511 37.36934068,-122.24671067 37.36865847,-122.24825570 37.36981819,-122.25151719 37.36947713,-122.25357721 37.36756706,-122.26001451 37.36579354,-122.25615213 37.36545239,-122.25486458 37.36245083,-122.25357721 37.36108651,-122.25194642 37.36013139,-122.24885652 37.35958557,-122.24911401 37.35849399,-122.25357721 37.35808470,-122.25675286 37.35897159,-122.25855539 37.35753887,-122.26181687 37.35828939,-122.26713837 37.35897159,-122.26782510 37.36108651,-122.26662339 37.36456559,-122.27288911 37.36722601,-122.27366159 37.36531602,-122.27168740 37.36470213,-122.27391900 37.36374701,-122.27074326 37.36245083,-122.27134408 37.35951742,-122.27426240 37.36135926,-122.27709482 37.36115474,-122.27966974 37.36231438,-122.27958391 37.36463382,-122.27572152 37.36463382,-122.27563569 37.36524779,-122.27700899 37.36593000,-122.27709482 37.36763529,-122.27554978 37.36838573,-122.27667254 37.36931478,-122.27677932 37.36932073,-122.27769362 37.36853987,-122.27942490 37.36830803,-122.28178776 37.36677917,-122.28509559 37.36443500,-122.28845129 37.36413744,-122.29194403 37.36695946,-122.29382577 37.36726817,-122.29600414 37.36898512,-122.29733083 37.36995398,-122.29593239 37.37141436,-122.29416649 37.37075898,-122.29325026 37.37108436,-122.29652910 37.37311697,-122.29584237 37.37374461,-122.29537583 37.37573372,-122.29487677 37.37752502,-122.30923212 37.37593011,-122.31122484 37.38230086,-122.31467994 37.38092472,-122.31715663 37.38252181,-122.32307970 37.38166978,-122.31985618 37.37667694,-122.32210304 37.37580220,-122.32581446 37.37589532,-122.32401730 37.37331839,-122.32960417 37.37189020,-122.33465527 37.37331906,-122.33425328 37.37623680,-122.33620676 37.37726132,-122.33397986 37.37822382,-122.33358918 37.38036590,-122.33202637 37.37986918,-122.33147954 37.38101784,-122.33394080 37.38198017,-122.33545239 37.38587943,-122.33478058 37.38785697,-122.33386050 37.38723721,-122.33350041 37.38571137,-122.33122003 37.38548891,-122.33140008 37.38650606,-122.33366042 37.38817490,-122.33244019 37.39157602,-122.33298157 37.39419201,-122.33164013 37.39477028,-122.33202017 37.39518351,-122.33358038 37.39499282,-122.33376050 37.39597811,-122.33550067 37.39734478,-122.33556069 37.39481797,-122.33344040 37.39292676,-122.33638094 37.38892189,-122.34240644 37.38852719,-122.34906293 37.38726898,-122.35072321 37.39338769,-122.34910291 37.39445252,-122.34796272 37.39410291,-122.34449043 37.39640534,-122.34500223 37.39729709,-122.34936291 37.39670910,-122.35098322 37.39531066,-122.35364623 37.39554510,-122.35434369 37.39612111,-122.35798429 37.39600988,-122.35768430 37.39478621,-122.36334519 37.39206871,-122.36604726 37.39203267,-122.36778592 37.39335592,-122.36518870 37.40022011,-122.36554552 37.40247752,-122.36370519 37.40331974,-122.36270506 37.40530591,-122.36320512 37.40670418,-122.36149849 37.40851392,-122.36730580 37.41054938,-122.37263720 37.41378932,-122.37161871 37.42076600,-122.36566153 37.42006292,-122.36520547 37.42742106,-122.37165953 37.43661157,-122.35943972 37.44459022,-122.35356359 37.44600810,-122.33792254 37.45796329,-122.35228518 37.47478091,-122.35127080 37.48181199,-122.34867342 37.48487322,-122.34359717 37.48801082,-122.33388431 37.48677650,-122.33142321 37.48429747,-122.32929580 37.48473149,-122.32609609 37.48291144,-122.32344850 37.48228229,-122.31924364 37.48410234,-122.31677299 37.48114051,-122.31431751 37.47848973,-122.31259201 37.47682190,-122.31515972 37.47568196,-122.31691389 37.47360309,-122.31292494 37.46960081,-122.31130153 37.46937743,-122.30889894 37.47124987,-122.30612839 37.47011613,-122.30149630 37.46568378,-122.30064277 37.46363784,-122.29283821 37.45922376,-122.28630141 37.45415497,-122.28883099 37.44629920,-122.28316717 37.44197138,-122.27554148 37.42297597,-122.25597410 37.40553692,-122.25196579 37.40129593,-122.25012043 37.40049143,-122.24823207 37.39897758,-122.24754551 37.39740941,-122.24778582 37.39621607,-122.24934787 37.39599102,-122.25005170 37.39871849,-122.25222328 37.39863668,-122.25342491 37.39737529,-122.25520162 37.39667289,-122.25528737 37.39522726,-122.27747460 37.37809616,-122.27977493 37.37858717,-122.28157729 37.37920106,-122.28322534 37.37952846,-122.28416939 37.38092656,-122.28621223 37.37984219,-122.28638389 37.37613857,-122.28382607 37.37843722,-122.27930278 37.37718220,-122.28196361 37.37652740,-122.28295058 37.37568167,-122.28216101 37.37523148,-122.28114822 37.37543608,-122.27934569 37.37528613,-122.27996369 37.37448121,-122.28104521 37.37454944,-122.28185197 37.37422883,-122.28290767 37.37474038,-122.28376597 37.37467224,-122.28428104 37.37399012,-122.28402346 37.37338989,-122.28610922 37.37364914,-122.28651264 37.37327388,-122.28672722 37.37207343,-122.28628398 37.37205448,-122.28574460 37.37166682,-122.28479711 37.37200981,-122.28327731 37.37137228,-122.28285511 37.37100700,-122.28279409 37.37125669,-122.28315527 37.37173756,-122.28321872 37.37220569,-122.28187007 37.37231918,-122.28193109 37.37294908,-122.28139163 37.37319149))"; + //test_overlay("44", *iterator, ticket17, "POLYGON((-122.297 37.368, -122.297 37.413, -122.242 37.413, -122.242 37.368, -122.297 37.368))"); + //test_overlay("44b", *iterator, ticket17, "BOX(-122.297 37.368,-122.242 37.413)"); + test_overlay("ticket_17", *iterator, ticket17, "BOX(-122.280 37.377,-122.277 37.379)"); + iterator++; + +#endif + + // Boost.List case Brandon + BOOST_ASSERT(iterator != boost::end(expected)); + { + std::string p5 = "POLYGON((37.29449462890625 1.7902572154998779,37.000419616699219 1.664225697517395,37.140213012695313 1.3446992635726929,50.974888957147442 -30.277285722290763,57.297810222148939 -37.546793343968417,41.590042114257813 -7.2021245956420898,40.6978759765625 -5.4500408172607422,40.758884429931641 -5.418975830078125,42.577911376953125 -4.4901103973388672,42.577877044677734 -4.4900407791137695,42.699958801269531 -4.4278755187988281,46.523914387974358 -8.5152102535033496,47.585065917176543 -6.1314922196594779,45.389434814453125 -4.5143837928771973,46.296027072709599 -2.4984308554828116,37.43402099609375 1.470055103302002,37.29449462890625 1.7902572154998779))"; + std::string p6 = "POLYGON((42.399410247802734 1.4956772327423096,42.721500396728516 2.2342472076416016,42.721500396728516 3.6584999561309814,51.20102152843122 7.1738039562841562,51.370888500897557 7.4163459734570729,37.43402099609375 1.470055103302002,37.29449462890625 1.7902572154998779,37.000419616699219 1.664225697517395,37.140213012695313 1.3446992635726929,36.954700469970703 1.2597870826721191,26.472516656201325 -3.5380830513658776,27.069889344709196 -4.2926591211028242,30.501169204711914 -2.3718316555023193,32.708126068115234 -2.3611266613006592,32.708126068115234 -2.3611700534820557,32.708168029785156 -2.3611698150634766,32.718830108642578 -4.3281683921813965,29.135100397190627 -8.9262827849488211,29.619997024536133 -9.5368013381958008,30.339155197143555 -8.9838371276855469,30.670633316040039 -8.8180980682373047,30.896280288696289 -9.1206979751586914,30.207040612748258 -10.275926149505661,30.947774887084961 -11.208560943603516,31.669155120849609 -10.653837203979492,32.000633239746094 -10.488097190856934,32.226280212402344 -10.790698051452637,31.682494778186321 -12.133624901803865,32.274600982666016 -12.879127502441406,32.998821258544922 -12.323249816894531,33.339523315429688 -12.147735595703125,33.566280364990234 -12.450697898864746,33.164891643669634 -14.000060288415174,33.598796844482422 -14.546377182006836,34.328716278076172 -13.992490768432617,34.658355712890625 -13.81736946105957,34.886280059814453 -14.120697975158691,34.634240447128811 -15.85007183479255,34.931102752685547 -16.223842620849609,35.656356811523438 -15.66030216217041,35.963497161865234 -15.476018905639648,37.326129913330078 -17.190576553344727,38.823680877685547 -16.296066284179688,39.966808319091797 -17.625011444091797,40.800632476806641 -17.208097457885742,41.821544647216797 -19.211688995361328,41.988733475572282 -19.945838749437218,57.524304765518266 -37.807195733984784,41.590042114257813 -7.2021245956420898,40.6978759765625 -5.4500408172607422,40.758884429931641 -5.418975830078125,42.577911376953125 -4.4901103973388672,42.577877044677734 -4.4900407791137695,42.699958801269531 -4.4278755187988281,46.559533858616469 -8.435196445683264,47.604561877161387 -6.087697464505224,45.389434814453125 -4.5143837928771973,46.695858001708984 -1.6093428134918213,47.263670054709685 -1.784876824891044,47.830955505371094 -0.69758313894271851,48.43512638981781 -0.81299959072453376,49.071769542946825 0.61489892713413252,43.764598846435547 0.93951499462127686,43.644271850585938 0.96149998903274536,42.399410247802734 1.4956772327423096))"; + test_overlay("isovist", *iterator, p5, p6); + } + iterator++; + + + return; + + +#if ! defined(NO_LINESTRING_INTERSECTION) + BOOST_ASSERT(iterator != boost::end(expected)); + test_overlay("100", *iterator, + "LINESTRING(0 1,2 5,5 3)", + "LINESTRING(3 0,0 3,4 5)"); +#endif + + + +/* + + test_overlay(11, "box(1.5 1.5, 4.5 2.5)", + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))"); + test_overlay(21, "box(1.5 1.5, 4.5 2.5)", + "POLYGON((3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2))"); + test_overlay(12, "box(1.5 1.5, 4.5 2.5)", + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,5.3 2.5,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))"); + test_overlay(13, "box(1.5 1.5, 4.5 2.5)", + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 2.5,4.5 1.2,4.9 0.8,2.9 0.7,2 1.3))"); + test_overlay(23, "box(1.5 1.5, 4.5 2.5)", + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 2.5,4.5 2.3,5.0 2.3,5.0 2.1,4.5 2.1,4.5 1.9,4.0 1.9,4.5 1.2,4.9 0.8,2.9 0.7,2 1.3))"); + + test_overlay(14, "box(1.5 1.5, 4.5 2.5)", + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 1.2,2.9 0.7,2 1.3))"); + + test_overlay(15, "box(1.5 1.5, 4.5 2.5)", + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.0 3.0,5.0 2.0,2.9 0.7,2 1.3))"); + + test_overlay(16, "box(0 0, 3 3)", + "POLYGON((2 2, 1 4, 2 4, 3 3, 2 2))"); + + test_overlay(19, "box(115041.10 471900.10, 118334.60 474523.40)", + "POLYGON ((115483.40 474533.40, 116549.40 474059.20, 117199.90 473762.50, 117204.90 473659.50, 118339.40 472796.90, 118334.50 472757.90, 118315.10 472604.00, 118344.60 472520.90, 118277.90 472419.10, 118071.40 472536.80, 118071.40 472536.80, 117943.10 472287.70, 117744.90 472248.40, 117708.00 472034.50, 117481.90 472056.90, 117481.90 472056.90, 117272.30 471890.10, 117077.90 472161.20, 116146.60 473054.50, 115031.10 473603.30, 115483.40 474533.40))"); +*/ +} +#endif + +#endif // BOOST_GEOMETRY_TEST_OVERLAY_COMMON_HPP diff --git a/src/boost/libs/geometry/test/algorithms/overlay/relative_order.cpp b/src/boost/libs/geometry/test/algorithms/overlay/relative_order.cpp new file mode 100644 index 000000000..8d2a5b47a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/relative_order.cpp @@ -0,0 +1,220 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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 + +// 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) + + +#include + +#include + + +#include + +#include + +#include +#include +#include + +#include + +#if defined(TEST_WITH_SVG) +# include +#endif + +#include +#include + + +template +void test_with_point(std::string const& /*caseid*/, + T pi_x, T pi_y, T pj_x, T pj_y, + T ri_x, T ri_y, T rj_x, T rj_y, + T si_x, T si_y, T sj_x, T sj_y, + int expected_order) +{ + P pi = bg::make

(pi_x, pi_y); + P pj = bg::make

(pj_x, pj_y); + P ri = bg::make

(ri_x, ri_y); + P rj = bg::make

(rj_x, rj_y); + P si = bg::make

(si_x, si_y); + P sj = bg::make

(sj_x, sj_y); + + typedef typename bg::strategy::side::services::default_strategy + < + typename bg::cs_tag

::type + >::type strategy_type; + + int order = bg::detail::overlay::get_relative_order::apply(pi, pj, ri, rj, si, sj, strategy_type()); + + BOOST_CHECK_EQUAL(order, expected_order); + + + + + /* + std::cout << caseid + << (caseid.find("_") == std::string::npos ? " " : "") + << " " << method + << " " << detected + << " " << order + << std::endl; + */ + + + +/*#if defined(TEST_WITH_SVG) + { + std::ostringstream filename; + filename << "get_turn_info_" << caseid + << "_" << string_from_type::type>::name() + << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper

mapper(svg, 500, 500); + mapper.add(bg::make

(0, 0)); + mapper.add(bg::make

(10, 10)); + + bg::model::linestring

p; p.push_back(pi); p.push_back(pj); p.push_back(pk); + bg::model::linestring

q; q.push_back(qi); q.push_back(qj); q.push_back(qk); + mapper.map(p, "opacity:0.8;stroke:rgb(0,192,0);stroke-width:3"); + mapper.map(q, "opacity:0.8;stroke:rgb(0,0,255);stroke-width:3"); + + std::string style = ";font-family='Verdana';font-weight:bold"; + std::string align = ";text-anchor:end;text-align:end"; + int offset = 8; + + mapper.text(pi, "pi", "fill:rgb(0,192,0)" + style, offset, offset); + mapper.text(pj, "pj", "fill:rgb(0,192,0)" + style, offset, offset); + mapper.text(pk, "pk", "fill:rgb(0,192,0)" + style, offset, offset); + + mapper.text(qi, "qi", "fill:rgb(0,0,255)" + style + align, -offset, offset); + mapper.text(qj, "qj", "fill:rgb(0,0,255)" + style + align, -offset, offset); + mapper.text(qk, "qk", "fill:rgb(0,0,255)" + style + align, -offset, offset); + + + int factor = 1; // second info, if any, will go left by factor -1 + int ch = '1'; + for (typename tp_vector::const_iterator it = info.begin(); + it != info.end(); + ++it, factor *= -1, ch++) + { + bool at_j = it->method == bg::detail::overlay::method_crosses; + std::string op; + op += operation_char(it->operations[0].operation); + align = ";text-anchor:middle;text-align:center"; + mapper.text(at_j ? pj : pk, op, "fill:rgb(255,128,0)" + style + align, offset * factor, -offset); + + op.clear(); + op += operation_char(it->operations[1].operation); + mapper.text(at_j ? qj : qk, op, "fill:rgb(255,128,0)" + style + align, offset * factor, -offset); + + // Map intersection point + method + mapper.map(it->point, "opacity:0.8;fill:rgb(255,0,0);stroke:rgb(0,0,100);stroke-width:1"); + + op.clear(); + op += method_char(it->method); + if (info.size() != 1) + { + op += ch; + op += " p:"; op += operation_char(it->operations[0].operation); + op += " q:"; op += operation_char(it->operations[1].operation); + } + mapper.text(it->point, op, "fill:rgb(255,0,0)" + style, offset, -offset); + } + } +#endif +*/ +} + + + +template +void test_all() +{ + test_with_point("OLR1", + 5, 1, 5, 8, // p + 3, 5, 7, 5, // r + 3, 3, 7, 2, // s + 1); + test_with_point("OLR2", + 5, 1, 5, 8, // p + 3, 5, 7, 5, // r + 3, 7, 7, 6, // s + -1); + test_with_point("OLR3", + 5, 1, 5, 8, // p + 3, 5, 7, 5, // r + 4, 2, 9, 6, // s + 1); + test_with_point("OLR4", + 5, 1, 5, 8, // p + 3, 5, 7, 5, // r + 3, 8, 9, 4, // s + -1); + test_with_point("OLR5", + 5, 1, 5, 8, // p + 3, 5, 7, 5, // r + 4, 2, 8, 6, // s + 1); + test_with_point("OLR6", + 5, 1, 5, 8, // p + 3, 5, 7, 5, // r + 3, 7, 9, 4, // s + -1); + test_with_point("OLR7", + 5, 1, 5, 8, // p + 3, 5, 7, 5, // r + 1, 4, 7, 7, // s + -1); + test_with_point("OLR8", + 5, 1, 5, 8, // p + 3, 5, 7, 5, // r + 1, 6, 7, 3, // s + 1); + + + test_with_point("OD1", + 5, 1, 5, 8, // p + 3, 5, 7, 5, // r + 7, 2, 3, 3, // s + 1); + + test_with_point("OD9", + 5, 1, 5, 8, // p + 3, 5, 7, 5, // r + 7, 5, 3, 3, // s + 1); + test_with_point("OD10", + 5, 1, 5, 8, // p + 3, 5, 7, 5, // r + 7, 5, 3, 7, // s + -1); + test_with_point("OD11", + 5, 1, 5, 8, // p + 7, 5, 3, 5, // r + 3, 5, 7, 7, // s + -1); + test_with_point("OD12", + 5, 1, 5, 8, // p + 7, 5, 3, 5, // r + 3, 5, 7, 3, // s + 1); +} + + +int test_main(int, char* []) +{ + test_all >(); + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/select_rings.cpp b/src/boost/libs/geometry/test/algorithms/overlay/select_rings.cpp new file mode 100644 index 000000000..af43328f5 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/select_rings.cpp @@ -0,0 +1,118 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// +// 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 +// +// 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) + +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include + +#include + +#include + + +template +< + typename Geometry1, + typename Geometry2, + bg::overlay_type OverlayType, + typename RingIdVector +> +void test_geometry(std::string const& wkt1, std::string const& wkt2, + RingIdVector const& expected_ids) +{ + typedef bg::detail::overlay::ring_properties + < + typename bg::point_type::type, + double + > properties; + + Geometry1 geometry1; + Geometry2 geometry2; + + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); + + typedef std::map map_type; + map_type selected; + std::map empty; + + typedef typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy_type; + + bg::detail::overlay::select_rings(geometry1, geometry2, empty, selected, strategy_type()); + + BOOST_CHECK_EQUAL(selected.size(), expected_ids.size()); + + if (selected.size() <= expected_ids.size()) + { + BOOST_AUTO(eit, expected_ids.begin()); + for(typename map_type::const_iterator it = selected.begin(); it != selected.end(); ++it, ++eit) + { + bg::ring_identifier const ring_id = it->first; + BOOST_CHECK_EQUAL(ring_id.source_index, eit->source_index); + BOOST_CHECK_EQUAL(ring_id.multi_index, eit->multi_index); + BOOST_CHECK_EQUAL(ring_id.ring_index, eit->ring_index); + } + } +} + + + + +template +void test_all() +{ + // Point in correct clockwise ring -> should return true + typedef bg::ring_identifier rid; + + test_geometry, bg::model::polygon

, bg::overlay_union>( + winded[0], winded[1], + boost::assign::list_of + (rid(0,-1,-1)) + (rid(0,-1, 0)) + (rid(0,-1, 1)) + (rid(0,-1, 3)) + (rid(1,-1, 1)) + (rid(1,-1, 2))); + + test_geometry, bg::model::polygon

, bg::overlay_intersection>( + winded[0], winded[1], + boost::assign::list_of + (rid(0,-1, 2)) + (rid(1,-1,-1)) + (rid(1,-1, 0)) + (rid(1,-1, 3))); +} + + + + +int test_main( int , char* [] ) +{ + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/self_intersection_points.cpp b/src/boost/libs/geometry/test/algorithms/overlay/self_intersection_points.cpp new file mode 100644 index 000000000..2d7a42039 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/self_intersection_points.cpp @@ -0,0 +1,279 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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. + +// 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) + +#include +#include +#include + +#include + + +#include +#include +#include +//#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include + + +#if defined(TEST_WITH_SVG) +# include +#endif + +template +static void test_self_intersection_points(std::string const& case_id, + std::size_t expected_count, + Geometry const& geometry, + bool check_has_intersections, + double /*precision*/ = 0.001) +{ + typedef typename bg::point_type::type point_type; + //typedef typename bg::rescale_policy_type::type rescale_policy_type; + typedef typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy_type; + typedef bg::detail::no_rescale_policy rescale_policy_type; + typedef bg::detail::overlay::turn_info turn_info; + + std::vector turns; + + strategy_type strategy; + rescale_policy_type rescale_policy; + + bg::detail::self_get_turn_points::no_interrupt_policy policy; + bg::self_turns + < + bg::detail::overlay::assign_null_policy + >(geometry, strategy, rescale_policy, turns, policy); + + + typedef typename bg::coordinate_type::type ct; + ct zero = ct(); + ct x = zero, y = zero; + BOOST_FOREACH(turn_info const& turn, turns) + { + x += bg::get<0>(turn.point); + y += bg::get<1>(turn.point); + } + std::size_t n = boost::size(turns); + if (n > 0) + { + x /= n; + y /= n; + } + + BOOST_CHECK_EQUAL(expected_count, n); + + if (expected_count > 0) + { + BOOST_CHECK_EQUAL(bg::intersects(geometry), true); + + if (check_has_intersections) + { + try + { + boost::geometry::detail::overlay::has_self_intersections(geometry); + BOOST_CHECK_MESSAGE(false, "Case " << case_id << " there are no self-intersections detected!"); + } + catch(...) + { + } + } + } + else + { + if (check_has_intersections) + { + try + { + boost::geometry::detail::overlay::has_self_intersections(geometry); + } + catch(...) + { + BOOST_CHECK_MESSAGE(false, "Case " << case_id << " there are self-intersections detected!"); + } + } + } + + +#if defined(TEST_WITH_SVG) + { + std::ostringstream filename; + filename << "self_ip" << case_id << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper::type> mapper(svg, 500, 500); + mapper.add(geometry); + + mapper.map(geometry, "fill:rgb(255,255,128);stroke:rgb(0,0,0);stroke-width:1"); + + BOOST_FOREACH(turn_info const& turn, turns) + { + mapper.map(turn.point, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1"); + } + } +#endif +} + + +template +void test_self_overlay(std::string const& case_id, T const& expected, + std::string const& wkt, + bool check_has_intersections = true) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + bg::correct(geometry); + +#ifdef GEOMETRY_DEBUG_INTERSECTION + std::cout << std::endl << std::endl << "# " << case_id << std::endl; +#endif + test_self_intersection_points(case_id, expected, geometry, check_has_intersections); +} + + + +template +void test_self_poly() +{ + typedef bg::model::polygon

polygon; + + // Just a normal polygon + test_self_overlay("1", 0, + "POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))"); + + // TODO: clean-up and visualize testcases + + // Self intersecting + test_self_overlay("2", 2, + "POLYGON((1 2,1 1,2 1,2 2.25,3 2.25,3 0,0 0,0 3,3 3,2.75 2,1 2))"); + + // Self intersecting in last segment + test_self_overlay("3", 1, + "POLYGON((0 2,2 4,2 0,4 2,0 2))"); + + // Self tangent + test_self_overlay("4", 1, + "POLYGON((0 0,0 4,4 4,4 0,2 4,0 0))", false); + + // Self tangent in corner + test_self_overlay("5", 1, + "POLYGON((0 0,0 4,4 4,4 0,0 4,2 0,0 0))", false); + + // With spike + test_self_overlay("6", 1, + "POLYGON((0 0,0 4,4 4,4 2,6 2,4 2,4 0,0 0))"); + + // Non intersection, but with duplicate + test_self_overlay("d1", 0, + "POLYGON((0 0,0 4,4 0,4 0,0 0))"); + + // With many duplicates + test_self_overlay("d2", 0, + "POLYGON((0 0,0 1,0 1,0 1,0 2,0 2,0 3,0 3,0 3,0 3,0 4,2 4,2 4,4 4,4 0,4 0,3 0,3 0,3 0,3 0,3 0,0 0))"); + + // Hole: interior tangent to exterior + test_self_overlay("h1", 1, + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 2,2 4,3 2,1 2))", false); + + // Hole: interior intersecting exterior + test_self_overlay("h2", 2, + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 3,5 4,1 1))"); + + // Hole: two intersecting holes + test_self_overlay("h3", 2, + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 3,3 3,3 1,1 1),(2 2,2 3.5,3.5 3.5,3.5 2,2 2))"); + + // Hole: self-intersecting hole + test_self_overlay("h4", 2, + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,3 3,3 2.5,1 3.5,1.5 3.5,1 1))"); + + // Many loops (e.g. as result from buffering) + test_self_overlay("case_1", 6, + "POLYGON((1 3,0 9,9 5,1 7,9 8,2 5,10 10,9 2,1 3))"); + + test_self_overlay("buffer_poly_indentation8_d_r", 3, + "POLYGON((-0.8 5,-0.799036 5.03925,-0.796148 5.07841,-0.791341 5.11738,-0.784628 5.15607,-0.776025 5.19438,-0.765552 5.23223,-0.753235 5.26951,-0.739104 5.30615,-0.723191 5.34204,-0.705537 5.37712,-0.686183 5.41128,-0.665176 5.44446,-0.642566 5.47656,-0.618408 5.50751,-0.592761 5.53725,-0.537247 5.59276,-0.507515 5.61841,-0.476559 5.64257,-0.444456 5.66518,-0.411282 5.68618,-0.377117 5.70554,-0.342044 5.72319,-0.306147 5.7391,-0.269512 5.75324,-0.232228 5.76555,-0.194384 5.77603,-0.156072 5.78463,-0.117384 5.79134,-0.0784137 5.79615,-0.0392541 5.79904,0 5.8,4 5.8,4.03925 5.79904,4.07841 5.79615,4.11738 5.79134,4.15607 5.78463,4.19438 5.77603,4.23223 5.76555,4.26951 5.75324,4.30615 5.7391,4.34204 5.72319,4.37712 5.70554,4.41128 5.68618,4.44446 5.66518,4.47656 5.64257,4.50751 5.61841,4.53725 5.59276,4.59276 5.53725,4.61841 5.50751,4.64257 5.47656,4.66518 5.44446,4.68618 5.41128,4.70554 5.37712,4.72319 5.34204,4.7391 5.30615,4.75324 5.26951,4.76555 5.23223,4.77603 5.19438,4.78463 5.15607,4.79134 5.11738,4.79615 5.07841,4.79904 5.03925,4.8 5,4.8 4,4.79976 3.98037,4.79904 3.96075,4.79783 3.94115,4.79615 3.92159,4.79398 3.90207,4.79134 3.88262,4.78822 3.86323,4.78463 3.84393,4.78056 3.82472,4.77603 3.80562,4.77102 3.78663,4.76555 3.76777,4.75962 3.74905,4.75324 3.73049,4.74639 3.71208,4.73137 3.67581,4.72319 3.65796,4.71458 3.64031,4.70554 3.62288,4.69607 3.60568,4.68618 3.58872,4.67588 3.572,4.66518 3.55554,4.65407 3.53935,4.64257 3.52344,4.63068 3.50781,4.61841 3.49249,4.60577 3.47746,4.59276 3.46275,4.5794 3.44837,4.56569 3.43431,3.56569 2.43431,3.53725 2.40724,3.50751 2.38159,3.47656 2.35743,3.44446 2.33482,3.41128 2.31382,3.37712 2.29446,3.34204 2.27681,3.30615 2.2609,3.26951 2.24676,3.23223 2.23445,3.19438 2.22397,3.15607 2.21537,3.11738 2.20866,3.07841 2.20385,3.03925 2.20096,2.96075 2.20096,2.92159 2.20385,2.88262 2.20866,2.84393 2.21537,2.80562 2.22397,2.76777 2.23445,2.73049 2.24676,2.69385 2.2609,2.65796 2.27681,2.62288 2.29446,2.58872 2.31382,2.55554 2.33482,2.52344 2.35743,2.49249 2.38159,2.46275 2.40724,2.43431 2.43431,2.8 2.06863,2.8 2.93137,2.43431 2.56569,2.46275 2.59276,2.49249 2.61841,2.52344 2.64257,2.55554 2.66518,2.58872 2.68618,2.62288 2.70554,2.65796 2.72319,2.69385 2.7391,2.73049 2.75324,2.76777 2.76555,2.80562 2.77603,2.84393 2.78463,2.88262 2.79134,2.92159 2.79615,2.96075 2.79904,3.03925 2.79904,3.07841 2.79615,3.11738 2.79134,3.15607 2.78463,3.19438 2.77603,3.23223 2.76555,3.26951 2.75324,3.30615 2.7391,3.34204 2.72319,3.37712 2.70554,3.41128 2.68618,3.44446 2.66518,3.47656 2.64257,3.50751 2.61841,3.53725 2.59276,3.56569 2.56569,4.56569 1.56569,4.5794 1.55163,4.59276 1.53725,4.60577 1.52254,4.61841 1.50751,4.63068 1.49219,4.64257 1.47656,4.65407 1.46065,4.66518 1.44446,4.67588 1.428,4.68618 1.41128,4.69607 1.39432,4.70554 1.37712,4.71458 1.35969,4.72319 1.34204,4.73137 1.32419,4.74639 1.28792,4.75324 1.26951,4.75962 1.25095,4.76555 1.23223,4.77102 1.21337,4.77603 1.19438,4.78056 1.17528,4.78463 1.15607,4.78822 1.13677,4.79134 1.11738,4.79398 1.09793,4.79615 1.07841,4.79783 1.05885,4.79904 1.03925,4.79976 1.01963,4.8 1,4.8 0,4.79904 -0.0392541,4.79615 -0.0784137,4.79134 -0.117384,4.78463 -0.156072,4.77603 -0.194384,4.76555 -0.232228,4.75324 -0.269512,4.7391 -0.306147,4.72319 -0.342044,4.70554 -0.377117,4.68618 -0.411282,4.66518 -0.444456,4.64257 -0.476559,4.61841 -0.507515,4.59276 -0.537247,4.53725 -0.592761,4.50751 -0.618408,4.47656 -0.642566,4.44446 -0.665176,4.41128 -0.686183,4.37712 -0.705537,4.34204 -0.723191,4.30615 -0.739104,4.26951 -0.753235,4.23223 -0.765552,4.19438 -0.776025,4.15607 -0.784628,4.11738 -0.791341,4.07841 -0.796148,4.03925 -0.799036,4 -0.8,0 -0.8,-0.0392541 -0.799036,-0.0784137 -0.796148,-0.117384 -0.791341,-0.156072 -0.784628,-0.194384 -0.776025,-0.232228 -0.765552,-0.269512 -0.753235,-0.306147 -0.739104,-0.342044 -0.723191,-0.377117 -0.705537,-0.411282 -0.686183,-0.444456 -0.665176,-0.476559 -0.642566,-0.507515 -0.618408,-0.537247 -0.592761,-0.592761 -0.537247,-0.618408 -0.507515,-0.642566 -0.476559,-0.665176 -0.444456,-0.686183 -0.411282,-0.705537 -0.377117,-0.723191 -0.342044,-0.739104 -0.306147,-0.753235 -0.269512,-0.765552 -0.232228,-0.776025 -0.194384,-0.784628 -0.156072,-0.791341 -0.117384,-0.796148 -0.0784137,-0.799036 -0.0392541,-0.8 0,-0.8 5))"); + + test_self_overlay("toolkit_2", 12, + "POLYGON((170718 605997,170718 605997,170776 606016,170773 606015,170786 606020,170778 606016,170787 606021,170781 606017,170795 606028,170795 606028,170829 606055,170939 606140,170933 605968,170933 605968,170932 605908,170929 605834,170920 605866,170961 605803,170739 605684,170699 605749,170691 605766,170693 605762,170686 605775,170688 605771,170673 605794,170676 605790,170668 605800,170672 605796,170651 605818,170653 605816,170639 605829,170568 605899,170662 605943,170633 605875,170603 605961,170718 605997))"); + + // Real-life + + std::string const ticket17 = "POLYGON ((-122.28139163 37.37319149,-122.28100699 37.37273669,-122.28002186 37.37303123,-122.27979681 37.37290072,-122.28007349 37.37240493,-122.27977334 37.37220360,-122.27819720 37.37288580,-122.27714184 37.37275161,-122.27678628 37.37253167,-122.27766437 37.37180973,-122.27804382 37.37121453,-122.27687664 37.37101354,-122.27645829 37.37203386,-122.27604423 37.37249110,-122.27632234 37.37343339,-122.27760980 37.37391082,-122.27812478 37.37800320,-122.26117222 37.39121007,-122.25572289 37.39566631,-122.25547269 37.39564971,-122.25366304 37.39552993,-122.24919976 37.39580268,-122.24417933 37.39366907,-122.24051443 37.39094143,-122.23246277 37.38100418,-122.23606766 37.38141338,-122.24001587 37.37738940,-122.23666848 37.37609347,-122.23057450 37.37882170,-122.22679803 37.37807143,-122.22525727 37.37448817,-122.22523229 37.37443000,-122.23083199 37.37609347,-122.23033486 37.37777891,-122.23169030 37.37732117,-122.23229178 37.37709687,-122.23237761 37.37631249,-122.23297776 37.37438834,-122.23872850 37.37165986,-122.24044511 37.36934068,-122.24671067 37.36865847,-122.24825570 37.36981819,-122.25151719 37.36947713,-122.25357721 37.36756706,-122.26001451 37.36579354,-122.25615213 37.36545239,-122.25486458 37.36245083,-122.25357721 37.36108651,-122.25194642 37.36013139,-122.24885652 37.35958557,-122.24911401 37.35849399,-122.25357721 37.35808470,-122.25675286 37.35897159,-122.25855539 37.35753887,-122.26181687 37.35828939,-122.26713837 37.35897159,-122.26782510 37.36108651,-122.26662339 37.36456559,-122.27288911 37.36722601,-122.27366159 37.36531602,-122.27168740 37.36470213,-122.27391900 37.36374701,-122.27074326 37.36245083,-122.27134408 37.35951742,-122.27426240 37.36135926,-122.27709482 37.36115474,-122.27966974 37.36231438,-122.27958391 37.36463382,-122.27572152 37.36463382,-122.27563569 37.36524779,-122.27700899 37.36593000,-122.27709482 37.36763529,-122.27554978 37.36838573,-122.27667254 37.36931478,-122.27677932 37.36932073,-122.27769362 37.36853987,-122.27942490 37.36830803,-122.28178776 37.36677917,-122.28509559 37.36443500,-122.28845129 37.36413744,-122.29194403 37.36695946,-122.29382577 37.36726817,-122.29600414 37.36898512,-122.29733083 37.36995398,-122.29593239 37.37141436,-122.29416649 37.37075898,-122.29325026 37.37108436,-122.29652910 37.37311697,-122.29584237 37.37374461,-122.29537583 37.37573372,-122.29487677 37.37752502,-122.30923212 37.37593011,-122.31122484 37.38230086,-122.31467994 37.38092472,-122.31715663 37.38252181,-122.32307970 37.38166978,-122.31985618 37.37667694,-122.32210304 37.37580220,-122.32581446 37.37589532,-122.32401730 37.37331839,-122.32960417 37.37189020,-122.33465527 37.37331906,-122.33425328 37.37623680,-122.33620676 37.37726132,-122.33397986 37.37822382,-122.33358918 37.38036590,-122.33202637 37.37986918,-122.33147954 37.38101784,-122.33394080 37.38198017,-122.33545239 37.38587943,-122.33478058 37.38785697,-122.33386050 37.38723721,-122.33350041 37.38571137,-122.33122003 37.38548891,-122.33140008 37.38650606,-122.33366042 37.38817490,-122.33244019 37.39157602,-122.33298157 37.39419201,-122.33164013 37.39477028,-122.33202017 37.39518351,-122.33358038 37.39499282,-122.33376050 37.39597811,-122.33550067 37.39734478,-122.33556069 37.39481797,-122.33344040 37.39292676,-122.33638094 37.38892189,-122.34240644 37.38852719,-122.34906293 37.38726898,-122.35072321 37.39338769,-122.34910291 37.39445252,-122.34796272 37.39410291,-122.34449043 37.39640534,-122.34500223 37.39729709,-122.34936291 37.39670910,-122.35098322 37.39531066,-122.35364623 37.39554510,-122.35434369 37.39612111,-122.35798429 37.39600988,-122.35768430 37.39478621,-122.36334519 37.39206871,-122.36604726 37.39203267,-122.36778592 37.39335592,-122.36518870 37.40022011,-122.36554552 37.40247752,-122.36370519 37.40331974,-122.36270506 37.40530591,-122.36320512 37.40670418,-122.36149849 37.40851392,-122.36730580 37.41054938,-122.37263720 37.41378932,-122.37161871 37.42076600,-122.36566153 37.42006292,-122.36520547 37.42742106,-122.37165953 37.43661157,-122.35943972 37.44459022,-122.35356359 37.44600810,-122.33792254 37.45796329,-122.35228518 37.47478091,-122.35127080 37.48181199,-122.34867342 37.48487322,-122.34359717 37.48801082,-122.33388431 37.48677650,-122.33142321 37.48429747,-122.32929580 37.48473149,-122.32609609 37.48291144,-122.32344850 37.48228229,-122.31924364 37.48410234,-122.31677299 37.48114051,-122.31431751 37.47848973,-122.31259201 37.47682190,-122.31515972 37.47568196,-122.31691389 37.47360309,-122.31292494 37.46960081,-122.31130153 37.46937743,-122.30889894 37.47124987,-122.30612839 37.47011613,-122.30149630 37.46568378,-122.30064277 37.46363784,-122.29283821 37.45922376,-122.28630141 37.45415497,-122.28883099 37.44629920,-122.28316717 37.44197138,-122.27554148 37.42297597,-122.25597410 37.40553692,-122.25196579 37.40129593,-122.25012043 37.40049143,-122.24823207 37.39897758,-122.24754551 37.39740941,-122.24778582 37.39621607,-122.24934787 37.39599102,-122.25005170 37.39871849,-122.25222328 37.39863668,-122.25342491 37.39737529,-122.25520162 37.39667289,-122.25528737 37.39522726,-122.27747460 37.37809616,-122.27977493 37.37858717,-122.28157729 37.37920106,-122.28322534 37.37952846,-122.28416939 37.38092656,-122.28621223 37.37984219,-122.28638389 37.37613857,-122.28382607 37.37843722,-122.27930278 37.37718220,-122.28196361 37.37652740,-122.28295058 37.37568167,-122.28216101 37.37523148,-122.28114822 37.37543608,-122.27934569 37.37528613,-122.27996369 37.37448121,-122.28104521 37.37454944,-122.28185197 37.37422883,-122.28290767 37.37474038,-122.28376597 37.37467224,-122.28428104 37.37399012,-122.28402346 37.37338989,-122.28610922 37.37364914,-122.28651264 37.37327388,-122.28672722 37.37207343,-122.28628398 37.37205448,-122.28574460 37.37166682,-122.28479711 37.37200981,-122.28327731 37.37137228,-122.28285511 37.37100700,-122.28279409 37.37125669,-122.28315527 37.37173756,-122.28321872 37.37220569,-122.28187007 37.37231918,-122.28193109 37.37294908,-122.28139163 37.37319149))"; + test_self_overlay("ticket17", 2, ticket17); + + std::string const uscounty_ne = "POLYGON((-72.297814 44.183545,-72.30498 44.183149,-72.306552 44.183668,-72.321587 44.188629,-72.368353 44.204057,-72.362972 44.211115,-72.357354 44.218485,-72.336176 44.246264,-72.333283 44.25006,-72.329737 44.254806,-72.327061 44.258388,-72.316301 44.272583,-72.317394 44.293961,-72.317455 44.295412,-72.317621 44.298382,-72.31757 44.298423,-72.308843 44.30567,-72.308336 44.306161,-72.305947 44.30843,-72.295321 44.31908,-72.292014 44.321754,-72.289771 44.323567,-72.283878 44.32772,-72.282024 44.32927,-72.275139 44.335778,-72.271225 44.339322,-72.269779 44.340275,-72.269584 44.340461,-72.267563 44.343747,-72.255707 44.359532,-72.254273 44.361075,-72.249662 44.367162,-72.249549 44.367339,-72.24832 44.369514,-72.247963 44.369843,-72.245885 44.372717,-72.244210 44.375223,-72.240219 44.380321,-72.24014 44.380422,-72.229086 44.391162,-72.224592 44.39553,-72.224364 44.395751,-72.224549 44.395985,-72.226261 44.398726,-72.225478 44.399979,-72.223603 44.402875,-72.222984 44.403317,-72.222454 44.403753,-72.217109 44.411083,-72.218322 44.411745,-72.218833 44.412134,-72.218904 44.412313,-72.219023 44.412613,-72.219444 44.412803,-72.21963 44.412887,-72.220395 44.413162,-72.220619 44.413527,-72.22215 44.414167,-72.222276 44.414327,-72.222276 44.414784,-72.222565 44.415058,-72.22266 44.415469,-72.222565 44.415583,-72.22282 44.416063,-72.222757 44.416452,-72.222543 44.416596,-72.222247 44.416792,-72.221852 44.416792,-72.221439 44.416564,-72.22084 44.416647,-72.220708 44.416898,-72.221268 44.417736,-72.221378 44.418454,-72.220846 44.418454,-72.220492 44.418406,-72.220095 44.418422,-72.219850 44.418865,-72.220006 44.419292,-72.220514 44.419909,-72.220846 44.420637,-72.220581 44.421159,-72.220824 44.421665,-72.221732 44.42214,-72.222374 44.422757,-72.222971 44.422583,-72.223103 44.422282,-72.223259 44.421981,-72.223923 44.42195,-72.224874 44.421491,-72.22514 44.420827,-72.225557 44.420503,-72.226261 44.420157,-72.226305 44.419869,-72.226807 44.419643,-72.226863 44.419618,-72.227333 44.41927,-72.22776 44.41927,-72.228341 44.419488,-72.22864 44.419675,-72.229199 44.420381,-72.229136 44.421066,-72.228977 44.421181,-72.228945 44.421569,-72.228404 44.421958,-72.228297 44.421996,-72.228021 44.422096,-72.227097 44.422119,-72.226936 44.422302,-72.22649 44.422508,-72.225917 44.422645,-72.224831 44.423217,-72.224068 44.42324,-72.223654 44.423537,-72.223654 44.423717,-72.223654 44.423742,-72.223781 44.42381,-72.223908 44.424587,-72.223924 44.424667,-72.227403 44.426083,-72.228008 44.426329,-72.228662 44.426595,-72.229395 44.426894,-72.230747 44.427231,-72.230971 44.427489,-72.234293 44.428436,-72.236972 44.429199,-72.23719 44.430035,-72.238801 44.430515,-72.24147 44.43131,-72.249962 44.43504,-72.252411 44.436005,-72.255865 44.437305,-72.263358 44.440285,-72.268753 44.442368,-72.277045 44.445563,-72.282573 44.447693,-72.292033 44.451282,-72.299916 44.454331,-72.30082 44.45469,-72.321277 44.462572,-72.325974 44.464436,-72.337127 44.468707,-72.341171 44.470234,-72.348117 44.472931,-72.350859 44.473996,-72.358758 44.477037,-72.371940 44.482113,-72.37455 44.483117,-72.374648 44.483164,-72.374779 44.483225,-72.381115 44.485666,-72.381492 44.485688,-72.392298 44.489866,-72.403342 44.494088,-72.418579 44.499928,-72.418900 44.500046,-72.4255 44.502596,-72.426254 44.502888,-72.434315 44.506098,-72.429847 44.512045,-72.428773 44.513475,-72.421543 44.522929,-72.42088 44.523797,-72.419175 44.524889,-72.416181 44.528756,-72.415673 44.529497,-72.411684 44.534382,-72.403416 44.545482,-72.401901 44.547507,-72.398575 44.553005,-72.396373 44.555888,-72.394723 44.556887,-72.389997 44.563861,-72.38785 44.567083,-72.374786 44.584125,-72.374551 44.584042,-72.374141 44.583887,-72.364296 44.579947,-72.363627 44.579974,-72.362284 44.579484,-72.354192 44.576537,-72.351726 44.575587,-72.346763 44.573679,-72.326173 44.566333,-72.322536 44.56502,-72.312109 44.560996,-72.303198 44.557718,-72.30252 44.557467,-72.299574 44.556334,-72.28218 44.550137,-72.282083 44.550101,-72.280975 44.54965,-72.278823 44.548773,-72.268653 44.544573,-72.268148 44.544564,-72.267242 44.544547,-72.267178 44.544523,-72.266593 44.544303,-72.264975 44.543192,-72.263435 44.542639,-72.263284 44.542541,-72.262964 44.542336,-72.261344 44.544238,-72.259827 44.54559,-72.257865 44.548899,-72.254187 44.554001,-72.249372 44.560675,-72.241644 44.570815,-72.237928 44.576139,-72.237433 44.576818,-72.236396 44.578188,-72.226097 44.591711,-72.224712 44.59373,-72.21978 44.600803,-72.218155 44.602206,-72.210135 44.612594,-72.209324 44.613712,-72.208816 44.614535,-72.207016 44.617438,-72.202901 44.624073,-72.202293 44.625051,-72.199855 44.62841,-72.198157 44.630644,-72.194619 44.635355,-72.193153 44.637354,-72.19052 44.641163,-72.188343 44.644224,-72.184378 44.649871,-72.182172 44.652973,-72.176 44.661598,-72.173651 44.665011,-72.169648 44.67078,-72.165261 44.676857,-72.163971 44.678423,-72.162882 44.679959,-72.158868 44.685588,-72.156736 44.688747,-72.152374 44.694988,-72.150094 44.698355,-72.147612 44.7018,-72.147155 44.702567,-72.146873 44.703032,-72.146226 44.703325,-72.145589 44.702653,-72.141899 44.701438,-72.132779 44.698434,-72.128309 44.696934,-72.124544 44.695638,-72.110654 44.691192,-72.109358 44.690747,-72.088864 44.683714,-72.09305 44.694921,-72.094078 44.697511,-72.094433 44.698327,-72.09461 44.698776,-72.094955 44.699515,-72.095146 44.700011,-72.099952 44.712285,-72.100813 44.714476,-72.101332 44.715715,-72.101783 44.717146,-72.108368 44.733658,-72.114503 44.749624,-72.091369 44.738322,-72.083693 44.734606,-72.061312 44.723479,-72.039137 44.7125,-72.036351 44.711121,-72.02562 44.705812,-72.024818 44.705401,-72.012503 44.698821,-72.010696 44.699614,-72.007273 44.70299,-72.006749 44.703702,-72.005453 44.70441,-72.004999 44.704665,-72.002948 44.706065,-72.002574 44.706344,-71.998947 44.710903,-71.9954 44.715164,-71.995032 44.715247,-71.989775 44.720625,-71.988815 44.721224,-71.981344 44.728822,-71.98093 44.729224,-71.977211 44.732588,-71.976089 44.733763,-71.974770 44.735186,-71.974591 44.73538,-71.973434 44.736503,-71.97039 44.73946,-71.959927 44.749625,-71.958846 44.750086,-71.950606 44.758585,-71.950276 44.758952,-71.943595 44.765337,-71.939936 44.769032,-71.930968 44.765049,-71.928756 44.762738,-71.921857 44.759843,-71.902374 44.750318,-71.882733 44.740608,-71.882573 44.740269,-71.881573 44.739354,-71.876888 44.736935,-71.875148 44.736035,-71.874539 44.735721,-71.858381 44.72766,-71.837294 44.716637,-71.83775 44.716201,-71.852267 44.702366,-71.856071 44.69874,-71.856484 44.698345,-71.87445 44.681027,-71.881231 44.674373,-71.882862 44.67311,-71.883675 44.67175,-71.88436 44.671401,-71.885978 44.669571,-71.888314 44.667829,-71.890624 44.665594,-71.891007 44.664845,-71.898726 44.657917,-71.902653 44.654205,-71.910085 44.64718,-71.910282 44.647038,-71.907401 44.645283,-71.894791 44.638722,-71.89426 44.638626,-71.892962 44.637931,-71.874538 44.628066,-71.86852 44.625053,-71.848306 44.614173,-71.848221 44.614129,-71.842803 44.611203,-71.842732 44.611165,-71.843021 44.610884,-71.856079 44.597255,-71.856286 44.59707,-71.874003 44.580903,-71.874537 44.580409,-71.898111 44.557857,-71.89867 44.557286,-71.908656 44.54708,-71.884835 44.524403,-71.884487 44.524048,-71.874412 44.51323,-71.871838 44.510637,-71.871760 44.51054,-71.861209 44.500056,-71.856636 44.496178,-71.8567 44.496122,-71.874535 44.480282,-71.885627 44.470472,-71.891883 44.464859,-71.893164 44.46383,-71.903342 44.454655,-71.903549 44.454476,-71.912995 44.450245,-71.921348 44.446484,-71.922164 44.44623,-71.925058 44.444914,-71.926307 44.44418,-71.933287 44.441174,-71.91481 44.423081,-71.90842 44.416928,-71.905891 44.414322,-71.898406 44.407105,-71.897962 44.406696,-71.897325 44.406109,-71.886305 44.395364,-71.874506 44.383831,-71.867904 44.377301,-71.865579 44.374962,-71.858643 44.368062,-71.849854 44.359674,-71.847478 44.357361,-71.844776 44.354732,-71.841775 44.351811,-71.840508 44.350578,-71.837656 44.347801,-71.838072 44.347593,-71.83875 44.34721,-71.839767 44.346579,-71.840775 44.345795,-71.84159 44.3453,-71.842483 44.344757,-71.843283 44.34444,-71.844319 44.344204,-71.845288 44.343871,-71.845882 44.343666,-71.846346 44.343506,-71.848005 44.342766,-71.849099 44.342345,-71.849899 44.341978,-71.851118 44.341405,-71.85184 44.341143,-71.852628 44.340873,-71.85355 44.340717,-71.854404 44.340617,-71.855257 44.340589,-71.85619 44.340522,-71.857168 44.340463,-71.858155 44.340363,-71.859166 44.340369,-71.859940 44.340357,-71.860974 44.340282,-71.861941 44.340109,-71.86265 44.33992,-71.863291 44.339778,-71.863719 44.339644,-71.864485 44.339374,-71.865196 44.339071,-71.865895 44.338801,-71.866458 44.338514,-71.866753 44.338322,-71.867509 44.337964,-71.868253 44.337638,-71.869120 44.337288,-71.869616 44.337129,-71.869909 44.336962,-71.870573 44.336804,-71.871203 44.336686,-71.871488 44.336689,-71.871833 44.336641,-71.872472 44.336628,-71.873009 44.336736,-71.873713 44.336973,-71.874326 44.337195,-71.874535 44.337123,-71.874997 44.337226,-71.875514 44.337266,-71.875863 44.33737,-71.876122 44.337482,-71.8762 44.337539,-71.87629 44.337651,-71.876313 44.337732,-71.876324 44.337844,-71.876324 44.337925,-71.876358 44.338054,-71.876403 44.338167,-71.876448 44.338287,-71.876583 44.338424,-71.876685 44.338512,-71.876731 44.338548,-71.876973 44.338572,-71.877493 44.338615,-71.877628 44.338623,-71.877965 44.338719" + ",-71.878695 44.338964,-71.879896 44.339367,-71.880546 44.339559,-71.880962 44.33976,-71.881154 44.33988,-71.881895 44.340209,-71.883973 44.341228,-71.884917 44.341717,-71.885044 44.341794,-71.887531 44.3426,-71.888182 44.342807,-71.888483 44.342846,-71.888866 44.342916,-71.88893 44.342938,-71.888994 44.342945,-71.889404 44.343039,-71.889893 44.343174,-71.890324 44.343274,-71.890332 44.343272,-71.890380 44.343255,-71.890408 44.343246,-71.890456 44.343228,-71.890548 44.343209,-71.890644 44.343192,-71.890739 44.343177,-71.890844 44.343173,-71.890926 44.343201,-71.891373 44.343335,-71.892197 44.343693,-71.894326 44.344591,-71.895856 44.345209,-71.898726 44.346251,-71.900162 44.346722,-71.902332 44.347499,-71.903115 44.347694,-71.905036 44.348154,-71.906001 44.348239,-71.906909 44.348284,-71.917008 44.346714,-71.917434 44.346535,-71.918748 44.345555,-71.921314 44.343835,-71.921459 44.343739,-71.924607 44.342252,-71.925088 44.342024,-71.926666 44.340286,-71.928041 44.338516,-71.929109 44.337577,-71.932138 44.336541,-71.935395 44.33577,-71.936773 44.335684,-71.939049 44.335843,-71.942442 44.336805,-71.943365 44.337188,-71.944254 44.337643,-71.945162 44.337744,-71.952593 44.337689,-71.956516 44.337632,-71.958119 44.337544,-71.959965 44.337013,-71.961822 44.336634,-71.963133 44.336556,-71.972572 44.336781,-71.973300 44.336777,-71.977175 44.337518,-71.977971 44.33757,-71.979505 44.337354,-71.980559 44.337486,-71.98112 44.3375,-71.984281 44.336414,-71.984617 44.336243,-71.984729 44.335882,-71.986483 44.331218,-71.987862 44.330081,-71.988305 44.329768,-71.989058 44.329561,-71.992446 44.328548,-71.993662 44.327611,-71.999448 44.325595,-72.000793 44.325295,-72.001221 44.325234,-72.001792 44.325079,-72.002314 44.324871,-72.003547 44.324397,-72.00485 44.324054,-72.005532 44.323829,-72.00676 44.323357,-72.009976 44.321951,-72.012172 44.321408,-72.014543 44.321032,-72.015936 44.320849,-72.01913 44.320383,-72.019577 44.320498,-72.019801 44.32052,-72.019908 44.320683,-72.020149 44.320818,-72.021041 44.320887,-72.021994 44.321184,-72.025782 44.322054,-72.028201 44.322375,-72.029061 44.322398,-72.029698 44.32217,-72.031322 44.320936,-72.031959 44.320662,-72.033136 44.320365,-72.033137 44.319543,-72.033773 44.317989,-72.033806 44.317349,-72.033678 44.316823,-72.03317 44.31632,-72.032341 44.315752,-72.031937 44.315475,-72.031802 44.315383,-72.031739 44.314652,-72.031549 44.313966,-72.031708 44.313007,-72.032218 44.311955,-72.032505 44.310653,-72.032444 44.307134,-72.032316 44.306677,-72.032541 44.303752,-72.032955 44.302701,-72.033464 44.301878,-72.034324 44.300941,-72.03487 44.300512,-72.035660 44.29989,-72.03633 44.298634,-72.03703 44.297834,-72.039003 44.296463,-72.039836 44.296087,-72.040117 44.295962,-72.040543 44.295876,-72.041609 44.295665,-72.041856 44.29565,-72.043202 44.295579,-72.043775 44.295608,-72.044546 44.294969,-72.044926 44.294636,-72.045137 44.29391,-72.045265 44.293198,-72.045745 44.292448,-72.046302 44.291983,-72.047349 44.291581,-72.048216 44.291404,-72.049472 44.291186,-72.051541 44.290889,-72.053355 44.290501,-72.054046 44.289971,-72.055002 44.288945,-72.055964 44.288162,-72.056078 44.287893,-72.056409 44.287618,-72.057273 44.287163,-72.05888 44.28624,-72.059957 44.284767,-72.062298 44.281754,-72.065434 44.277235,-72.066464 44.275093,-72.067774 44.270976,-72.066464 44.268331,-72.065949 44.268666,-72.064544 44.267997,-72.062671 44.269336,-72.060846 44.269972,-72.05874 44.270005,-72.058646 44.269269,-72.059395 44.268365,-72.05888 44.266926,-72.059113 44.265787,-72.058553 44.265285,-72.059021 44.265018,-72.059581 44.264315,-72.059535 44.265687,-72.060378 44.264951,-72.061173 44.263377,-72.061033 44.26244,-72.060333 44.261643,-72.060398 44.261463,-72.060723 44.261313,-72.061173 44.261258,-72.061495 44.260726,-72.06156 44.260621,-72.061542 44.26047,-72.060878 44.260436,-72.060518 44.260284,-72.060307 44.259961,-72.060259 44.259789,-72.060163 44.259766,-72.060194 44.257778,-72.060099 44.257595,-72.059838 44.256295,-72.059782 44.256018,-72.059523 44.255798,-72.059432 44.255721,-72.059018 44.255013,-72.058161 44.253916,-72.058224 44.253823,-72.058033 44.253664,-72.05708 44.252064,-72.056889 44.251859,-72.055694 44.250061,-72.055641 44.249649,-72.055515 44.249615,-72.055483 44.24912,-72.055134 44.248435,-72.054276 44.247703,-72.05399 44.246926,-72.051002 44.244892,-72.050112 44.244046,-72.049604 44.243292,-72.048999 44.242058,-72.04846 44.241212,-72.04792 44.239498,-72.047889 44.238493,-72.048621 44.237145,-72.050209 44.235066,-72.050656 44.233581,-72.052118 44.229856,-72.052469 44.229239,-72.052532 44.228805,-72.053264 44.227114,-72.053581 44.22604,-72.053995 44.224028,-72.0539 44.222703,-72.053614 44.221081,-72.053518 44.221035,-72.053518 44.220852,-72.053423 44.220784,-72.053423 44.220601,-72.053328 44.220487,-72.053328 44.220327,-72.053043 44.219732,-72.052662 44.218841,-72.052966 44.217794,-72.053232 44.216876,-72.05495 44.213677,-72.055903 44.212694,-72.056952 44.212169,-72.058605 44.211803,-72.058954 44.211597,-72.059716 44.210752,-72.060067 44.209998,-72.060067 44.209816,-72.058987 44.208512,-72.058605 44.208215,-72.058542 44.208032,-72.05886 44.207667,-72.058987 44.207164,-72.058906 44.20701,-72.058796 44.206798,-72.058066 44.206067,-72.058194 44.204907,-72.058287 44.204056,-72.058987 44.202114,-72.059564 44.201223,-72.059614 44.201144,-72.059669 44.201061,-72.060067 44.200446,-72.060543 44.200012,-72.062035 44.199074,-72.063560 44.198457,-72.064005 44.198069,-72.064577 44.196949,-72.064608 44.196058,-72.064608 44.195692,-72.06499 44.194801,-72.065213 44.194115,-72.065403 44.192607,-72.066102 44.19039,-72.066166 44.189773,-72.065911 44.189293,-72.065085 44.188631,-72.064285 44.187888,-72.06299 44.186688,-72.061337 44.184951,-72.05956 44.182666,-72.059116 44.181912,-72.058956 44.18182,-72.057496 44.179444,-72.056987 44.178096,-72.056861 44.178027,-72.056862 44.177822,-72.056798 44.17773,-72.056798 44.177433,-72.056575 44.176679,-72.056480 44.176633,-72.05629 44.175742,-72.054734 44.173114,-72.054227 44.172108,-72.054005 44.170646,-72.05391 44.170577,-72.053783 44.169869,-72.053021 44.167903,-72.052196 44.166921,-72.051655 44.166463,-72.050575 44.165961,-72.049179 44.165138,-72.048925 44.164795,-72.048799 44.164498,-72.048672 44.164452,-72.048639 44.164201,-72.048418 44.163926,-72.048355 44.163058,-72.048101 44.162144,-72.047592 44.161801,-72.047022 44.161595,-72.046133 44.161549,-72.043244 44.161869,-72.042830 44.161754,-72.042386 44.161343,-72.042386 44.160817,-72.042672 44.160292,-72.043785 44.158852,-72.044102 44.158121,-72.044039 44.157435,-72.043785 44.157047,-72.0435 44.156841,-72.042801 44.156613,-72.042103 44.15659,-72.041119 44.156864,-72.040167 44.157023,-72.039594 44.156749,-72.039245 44.156703,-72.039150 44.156498,-72.03988 44.155932,-72.039976 44.155858,-72.040082 44.155749,-72.040737 44.155972,-72.041923 44.156312,-72.042043 44.156349,-72.042801 44.156613,-72.044676 44.157097,-72.044884 44.157151,-72.045078 44.157206,-72.045767 44.157401,-72.046234 44.157563,-72.047344 44.157836,-72.048554 44.158134,-72.058602 44.160893,-72.065528 44.162794,-72.066594 44.163099,-72.070984 44.164364,-72.083157 44.167671,-72.083344 44.167722,-72.083451 44.167775,-72.087279 44.168733,-72.091724 44.16998,-72.092625 44.170284,-72.097954 44.171765,-72.100237 44.172391,-72.100809 44.172548,-72.100996 44.172599,-72.101265 44.172673,-72.10189 44.172759,-72.102047 44.172803,-72.105729 44.173842,-72.109921 44.175046,-72.110927 44.175333,-72.116790 44.176949,-72.122705 44.178552,-72.124310 44.179174,-72.133395 44.181725,-72.138984 44.183365,-72.139194 44.183494,-72.139466 44.183503,-72.140796 44.183868,-72.151283 44.186773,-72.166147 44.190938,-72.16836 44.191508,-72.17026 44.192053,-72.171978 44.19207,-72.174381 44.192183,-72.175395 44.192186,-72.187153 44.191379,-72.190945 44.191111,-72.191322 44.191101,-72.192686 44.190957,-72.199012 44.190573,-72.204065 44.190303,-72.209594 44.190003,-72.210965 44.189741,-72.221076 44.189175,-72.229408 44.188625,-72.237321 44.188057,-72.238117 44.188023,-72.24954 44.187528,-72.271323 44.185807,-72.282972 44.184887,-72.297814 44.183545))"; + test_self_overlay("uscounty_ne", 1, uscounty_ne, false); + + // First two points are similar but not equal, causing a self-intersection (continuation) + // ----s-C------ + // C=closing point, s=similar point, lying a little south-west. This causes a c/c (continue) intersection point. + // Was caused by error in neighbouring (get_turns.cpp) + std::string const ticket_9081_20873 = + "POLYGON((0.5246796698528305436 0.56288112949742163948," + "0.52467966985283021053 0.56288112949742141744," + "0.51150490059304598578 0.55384245388529118603,0.51053725440836283944 0.56288079068493779289," + "0.55019180962335967333 0.60735187918348676472,0.5445123657939807682 0.58331435417450905323," + "0.5246796698528305436 0.56288112949742163948))"; + test_self_overlay("ticket_9081_20873", 0, ticket_9081_20873); + + // Was caused by error in neighbouring (get_turns.cpp) + std::string const ggl_list_2013_11_06_joan = "POLYGON((137.14632454923444 200.61927877947369,50 224, 323 497,255 169,137.14632454923444 200.61927877947369))"; + test_self_overlay("ggl_list_2013_11_06_joan", 0, ggl_list_2013_11_06_joan); + + test_self_overlay("ggl_list_20131119_james", 0, ggl_list_20131119_james[0]); +} + +template +void test_self_ls() +{ + //typedef bg::model::linestring

linestring; + + // Same case - but if this is a linestring. + // TODO: this does not compile yet, but it should return 1 intersection point at the "closing" point + // std::string const ggl_list_2013_11_06_joan_linestring = "LINESTRING(137.14632454923444 200.61927877947369,50 224, 323 497,255 169,137.14632454923444 200.61927877947369)"; + // test_self_overlay("ggl_list_2013_11_06_joan_linestring", 1, ggl_list_2013_11_06_joan_linestring); +} + +template +void test_self_all() +{ + test_self_poly

(); + test_self_ls

(); +} + +int test_main(int, char* []) +{ + test_self_all >(); + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/sort_by_side.cpp b/src/boost/libs/geometry/test/algorithms/overlay/sort_by_side.cpp new file mode 100644 index 000000000..1e0f42258 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/sort_by_side.cpp @@ -0,0 +1,268 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2016 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2017, 2019. +// Modifications copyright (c) 2017, 2019, 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) + +#include + +#include +#include +#include +#include +#include + +#include "multi_overlay_cases.hpp" + + +namespace +{ + +template +std::string as_string(std::vector const& v) +{ + std::stringstream out; + bool first = true; + BOOST_FOREACH(T const& value, v) + { + out << (first ? "[" : " , ") << value; + first = false; + } + out << (first ? "" : "]"); + return out.str(); +} + +} + +// Adapted copy of handle_colocations::gather_cluster_properties +template +< + bool Reverse1, bool Reverse2, + bg::overlay_type OverlayType, + typename Clusters, + typename Turns, + typename Geometry1, + typename Geometry2, + typename SideStrategy +> +std::vector gather_cluster_properties( + Clusters& clusters, Turns& turns, + bg::detail::overlay::operation_type for_operation, + Geometry1 const& geometry1, Geometry2 const& geometry2, + SideStrategy const& strategy) +{ + using namespace boost::geometry; + using namespace boost::geometry::detail::overlay; + + std::vector result; + + typedef typename boost::range_value::type turn_type; + typedef typename turn_type::point_type point_type; + typedef typename turn_type::turn_operation_type turn_operation_type; + + // Define sorter, sorting counter-clockwise such that polygons are on the + // right side + typedef sort_by_side::side_sorter + < + Reverse1, Reverse2, OverlayType, point_type, SideStrategy, std::less + > sbs_type; + + for (typename Clusters::iterator mit = clusters.begin(); + mit != clusters.end(); ++mit) + { + cluster_info& cinfo = mit->second; + std::set const& ids = cinfo.turn_indices; + if (ids.empty()) + { + return result; + } + + sbs_type sbs(strategy); + point_type turn_point; // should be all the same for all turns in cluster + + bool first = true; + for (typename std::set::const_iterator sit = ids.begin(); + sit != ids.end(); ++sit) + { + signed_size_type turn_index = *sit; + turn_type const& turn = turns[turn_index]; + if (first) + { + turn_point = turn.point; + } + for (int i = 0; i < 2; i++) + { + turn_operation_type const& op = turn.operations[i]; + sbs.add(op, turn_index, i, geometry1, geometry2, first); + first = false; + } + } + sbs.apply(turn_point); + + sbs.find_open(); + sbs.assign_zones(for_operation); + + cinfo.open_count = sbs.open_count(for_operation); + result.push_back(cinfo.open_count); + } + return result; +} + + +// Adapted copy of overlay::apply +template +< + bg::overlay_type OverlayType, + bool Reverse1, bool Reverse2, bool ReverseOut, + typename GeometryOut, + typename Geometry1, typename Geometry2, + typename RobustPolicy, typename Strategy +> +std::vector apply_overlay( + Geometry1 const& geometry1, Geometry2 const& geometry2, + RobustPolicy const& robust_policy, + Strategy const& strategy) +{ + using namespace boost::geometry; + + typedef typename bg::point_type::type point_type; + typedef bg::detail::overlay::traversal_turn_info + < + point_type, + typename bg::detail::segment_ratio_type::type + > turn_info; + typedef std::deque turn_container_type; + + // Define the clusters, mapping cluster_id -> turns + typedef std::map + < + signed_size_type, + bg::detail::overlay::cluster_info + > cluster_type; + + turn_container_type turns; + + detail::get_turns::no_interrupt_policy policy; + bg::get_turns + < + Reverse1, Reverse2, + detail::overlay::assign_null_policy + >(geometry1, geometry2, strategy, robust_policy, turns, policy); + + cluster_type clusters; + + bg::enrich_intersection_points(turns, + clusters, geometry1, geometry2, robust_policy, strategy); + + // Gather cluster properties, with test option + return ::gather_cluster_properties( + clusters, turns, bg::detail::overlay::operation_from_overlay::value, + geometry1, geometry2, strategy.get_side_strategy()); +} + + +template +void test_sort_by_side(std::string const& case_id, + std::string const& wkt1, std::string const& wkt2, + std::vector const& expected_open_count) +{ +// std::cout << case_id << std::endl; + + Geometry g1; + bg::read_wkt(wkt1, g1); + + Geometry g2; + bg::read_wkt(wkt2, g2); + + // Reverse if necessary + bg::correct(g1); + bg::correct(g2); + + typedef typename boost::range_value::type geometry_out; + + typedef typename bg::rescale_overlay_policy_type + < + Geometry, + Geometry + >::type rescale_policy_type; + + rescale_policy_type robust_policy + = bg::get_rescale_policy(g1, g2); + + typedef typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy_type; + + strategy_type strategy; + + std::vector result = ::apply_overlay + < + OverlayType, false, false, false, geometry_out + >(g1, g2, robust_policy, strategy); + + BOOST_CHECK_MESSAGE(result == expected_open_count, + " caseid=" << case_id + << " open count: expected=" << as_string(expected_open_count) + << " detected=" << as_string(result)); +} + + +// Define two small macro's to avoid repetitions of testcases/names etc +#define TEST_INT(caseid, exp) { (test_sort_by_side) \ + ( #caseid "_int", caseid[0], caseid[1], exp); } + +#define TEST_UNION(caseid, exp) { (test_sort_by_side) \ + ( #caseid "_union", caseid[0], caseid[1], exp); } + +using boost::assign::list_of; + +template +void test_all() +{ + typedef bg::model::point point_type; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + + // Selection of test cases having only one cluster + + TEST_INT(case_64_multi, list_of(1)); + TEST_INT(case_72_multi, list_of(3)); + TEST_INT(case_107_multi, list_of(2)); + TEST_INT(case_123_multi, list_of(3)); + TEST_INT(case_124_multi, list_of(3)); + TEST_INT(case_recursive_boxes_10, list_of(2)); + TEST_INT(case_recursive_boxes_20, list_of(2)); + TEST_INT(case_recursive_boxes_21, list_of(1)); + TEST_INT(case_recursive_boxes_22, list_of(0)); + + TEST_UNION(case_recursive_boxes_46, list_of(2)(1)(2)(1)(1)(2)(1)); + + TEST_UNION(case_62_multi, list_of(2)); + TEST_UNION(case_63_multi, list_of(2)); + TEST_UNION(case_64_multi, list_of(1)); + TEST_UNION(case_107_multi, list_of(1)); + TEST_UNION(case_123_multi, list_of(1)); + TEST_UNION(case_124_multi, list_of(1)); + TEST_UNION(case_recursive_boxes_10, list_of(1)); + TEST_UNION(case_recursive_boxes_18, list_of(3)); + TEST_UNION(case_recursive_boxes_19, list_of(3)); + TEST_UNION(case_recursive_boxes_20, list_of(2)); + TEST_UNION(case_recursive_boxes_21, list_of(1)); + TEST_UNION(case_recursive_boxes_22, list_of(1)); + TEST_UNION(case_recursive_boxes_23, list_of(3)); +} + +int test_main(int, char* []) +{ + test_all(); + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/sort_by_side_basic.cpp b/src/boost/libs/geometry/test/algorithms/overlay/sort_by_side_basic.cpp new file mode 100644 index 000000000..f37bd38c6 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/sort_by_side_basic.cpp @@ -0,0 +1,348 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2017 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// 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 + +// 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) + +#include + +#include + +#include // for equals/within +#include +#include +#include +#include +#include +#include + +#include +#include + +#if defined(TEST_WITH_SVG) +#include "debug_sort_by_side_svg.hpp" +#endif + +namespace +{ + + +template +std::string as_string(std::vector const& v) +{ + std::stringstream out; + bool first = true; + BOOST_FOREACH(T const& value, v) + { + out << (first ? "[" : " , ") << value; + first = false; + } + out << (first ? "" : "]"); + return out.str(); +} + +} + +template +< + typename Geometry, typename Point, + typename RobustPolicy, typename Strategy +> +std::vector apply_get_turns(std::string const& case_id, + Geometry const& geometry1, Geometry const& geometry2, + Point const& turn_point, Point const& origin_point, + RobustPolicy const& robust_policy, + Strategy const& strategy, + std::size_t expected_open_count, + std::size_t expected_max_rank, + std::vector const& expected_right_count) +{ + using namespace boost::geometry; + + std::vector result; + +//todo: maybe should be enriched to count left/right - but can also be counted from ranks + typedef typename bg::point_type::type point_type; + typedef bg::detail::overlay::turn_info + < + point_type, + typename bg::detail::segment_ratio_type::type + > turn_info; + typedef std::deque turn_container_type; + + turn_container_type turns; + + detail::get_turns::no_interrupt_policy policy; + bg::get_turns + < + false, false, + detail::overlay::assign_null_policy + >(geometry1, geometry2, strategy, robust_policy, turns, policy); + + + // Define sorter, sorting counter-clockwise such that polygons are on the + // right side + typedef typename Strategy::side_strategy_type side_strategy; + typedef bg::detail::overlay::sort_by_side::side_sorter + < + false, false, overlay_union, + point_type, side_strategy, std::less + > sbs_type; + + sbs_type sbs(strategy.get_side_strategy()); + + std::cout << "Case: " << case_id << std::endl; + + bool has_origin = false; + for (std::size_t turn_index = 0; turn_index < turns.size(); turn_index++) + { + turn_info const& turn = turns[turn_index]; + + if (bg::equals(turn.point, turn_point)) + { +// std::cout << "Found turn: " << turn_index << std::endl; + for (int i = 0; i < 2; i++) + { + Point point1, point2, point3; + bg::copy_segment_points(geometry1, geometry2, + turn.operations[i].seg_id, point1, point2, point3); + bool const is_origin = ! has_origin && bg::equals(point1, origin_point); + if (is_origin) + { + has_origin = true; + } + + sbs.add(turn.operations[i], turn_index, i, + geometry1, geometry2, is_origin); + + } + } + } + + BOOST_CHECK_MESSAGE(has_origin, + " caseid=" << case_id + << " origin not found"); + + if (!has_origin) + { + for (std::size_t turn_index = 0; turn_index < turns.size(); turn_index++) + { + turn_info const& turn = turns[turn_index]; + if (bg::equals(turn.point, turn_point)) + { + for (int i = 0; i < 2; i++) + { + Point point1, point2, point3; + bg::copy_segment_points(geometry1, geometry2, + turn.operations[i].seg_id, point1, point2, point3); +// std::cout << "Turn " << turn_index << " op " << i << " point1=" << bg::wkt(point1) << std::endl; + } + } + } + return result; + } + + + sbs.apply(turn_point); + + sbs.find_open(); + sbs.assign_zones(detail::overlay::operation_union); + + std::size_t const open_count = sbs.open_count(detail::overlay::operation_union); + std::size_t const max_rank = sbs.m_ranked_points.back().rank; + std::vector right_count(max_rank + 1, -1); + + int previous_rank = -1; + int previous_to_rank = -1; + for (std::size_t i = 0; i < sbs.m_ranked_points.size(); i++) + { + typename sbs_type::rp const& ranked_point = sbs.m_ranked_points[i]; + + int const rank = static_cast(ranked_point.rank); + bool const set_right = rank != previous_to_rank; + if (rank != previous_rank) + { + BOOST_CHECK_MESSAGE(rank == previous_rank + 1, + " caseid=" << case_id + << " ranks: conflict in ranks=" << ranked_point.rank + << " vs " << previous_rank + 1); + previous_rank = rank; + } + + if (ranked_point.direction != bg::detail::overlay::sort_by_side::dir_to) + { + continue; + } + + previous_to_rank = rank; + if (set_right) + { + right_count[rank] = ranked_point.count_right; + } + else + { + BOOST_CHECK_MESSAGE(right_count[rank] == int(ranked_point.count_right), + " caseid=" << case_id + << " ranks: conflict in right_count=" << ranked_point.count_right + << " vs " << right_count[rank]); + } + + } + BOOST_CHECK_MESSAGE(open_count == expected_open_count, + " caseid=" << case_id + << " open_count: expected=" << expected_open_count + << " detected=" << open_count); + + BOOST_CHECK_MESSAGE(max_rank == expected_max_rank, + " caseid=" << case_id + << " max_rank: expected=" << expected_max_rank + << " detected=" << max_rank); + + BOOST_CHECK_MESSAGE(right_count == expected_right_count, + " caseid=" << case_id + << " right count: expected=" << as_string(expected_right_count) + << " detected=" << as_string(right_count)); + +#if defined(TEST_WITH_SVG) + debug::sorted_side_map(case_id, sbs, turn_point, geometry1, geometry2); +#endif + + return result; +} + + +template +void test_basic(std::string const& case_id, + std::string const& wkt1, + std::string const& wkt2, + std::string const& wkt_turn_point, + std::string const& wkt_origin_point, + std::size_t expected_open_count, + std::size_t expected_max_rank, + std::vector const& expected_right_count) +{ + typedef bg::model::point point_type; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + + multi_polygon g1; + bg::read_wkt(wkt1, g1); + + multi_polygon g2; + bg::read_wkt(wkt2, g2); + + point_type turn_point, origin_point; + bg::read_wkt(wkt_turn_point, turn_point); + bg::read_wkt(wkt_origin_point, origin_point); + + // Reverse if necessary + bg::correct(g1); + bg::correct(g2); + + typedef typename bg::rescale_overlay_policy_type + < + multi_polygon, + multi_polygon + >::type rescale_policy_type; + + rescale_policy_type robust_policy + = bg::get_rescale_policy(g1, g2); + + typedef typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy_type; + + strategy_type strategy; + + apply_get_turns(case_id, g1, g2, turn_point, origin_point, + robust_policy, strategy, + expected_open_count, expected_max_rank, expected_right_count); +} + +using boost::assign::list_of; + +template +void test_all() +{ + test_basic("simplex", + "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)))", + "MULTIPOLYGON(((1 0,1 1,2 1,2 0,1, 0)))", + "POINT(1 1)", "POINT(1 0)", + 2, 3, list_of(-1)(1)(-1)(1)); + + test_basic("dup1", + "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)))", + "MULTIPOLYGON(((1 0,1 1,2 1,2 0,1, 0)),((0 2,1 2,1 1,0 1,0 2)))", + "POINT(1 1)", "POINT(1 0)", + 2, 3, list_of(-1)(1)(-1)(2)); + + test_basic("dup2", + "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)),((1 0,1 1,2 1,2 0,1, 0)))", + "MULTIPOLYGON(((1 0,1 1,2 1,2 0,1, 0)))", + "POINT(1 1)", "POINT(1 0)", + 2, 3, list_of(-1)(2)(-1)(1)); + + test_basic("dup3", + "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)),((1 0,1 1,2 1,2 0,1, 0)))", + "MULTIPOLYGON(((1 0,1 1,2 1,2 0,1, 0)),((0 2,1 2,1 1,0 1,0 2)))", + "POINT(1 1)", "POINT(1 0)", + 2, 3, list_of(-1)(2)(-1)(2)); + + test_basic("threequart1", + "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)),((1 0,1 1,2 1,2 0,1, 0)))", + "MULTIPOLYGON(((1 2,2 2,2 1,1 1,1 2)))", + "POINT(1 1)", "POINT(1 0)", + 1, 3, list_of(-1)(1)(1)(1)); + + test_basic("threequart2", + "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)),((1 0,1 1,2 1,2 0,1, 0)))", + "MULTIPOLYGON(((1 2,2 2,2 1,1 1,1 2)),((2 0,1 0,1 1,2 0)))", + "POINT(1 1)", "POINT(1 0)", + 1, 4, list_of(-1)(2)(1)(1)(1)); + + test_basic("threequart3", + "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)),((1 0,1 1,2 1,2 0,1, 0)))", + "MULTIPOLYGON(((1 2,2 2,2 1,1 1,1 2)),((2 0,1 0,1 1,2 0)),((0 1,0 2,1 1,0 1)))", + "POINT(1 1)", "POINT(1 0)", + 1, 5, list_of(-1)(2)(1)(1)(-1)(2)); + + test_basic("full1", + "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)),((1 0,1 1,2 1,2 0,1, 0)))", + "MULTIPOLYGON(((1 2,2 2,2 1,1 1,1 2)),((0 0,0 1,1 1,1 0,0 0)))", + "POINT(1 1)", "POINT(1 0)", + 0, 3, list_of(1)(1)(1)(1)); + + test_basic("hole1", + "MULTIPOLYGON(((0 0,0 3,2 3,2 2,3 2,3 0,0 0),(1 1,2 1,2 2,1 2,1 1)),((4 2,3 2,3 3,4 3,4 2)))", + "MULTIPOLYGON(((1 0,1 1,2 1,2 2,1 2,1 4,4 4,4 0,1, 0),(3 2,3 3,2 3,2 2,3 2)))", + "POINT(1 2)", "POINT(2 2)", + 1, 2, list_of(-1)(2)(1)); + + test_basic("hole2", + "MULTIPOLYGON(((0 0,0 3,2 3,2 2,3 2,3 0,0 0),(1 1,2 1,2 2,1 2,1 1)),((4 2,3 2,3 3,4 3,4 2)))", + "MULTIPOLYGON(((1 0,1 1,2 1,2 2,1 2,1 4,4 4,4 0,1, 0),(3 2,3 3,2 3,2 2,3 2)))", + "POINT(2 2)", "POINT(2 1)", + 2, 3, list_of(-1)(2)(-1)(2)); + + test_basic("hole3", + "MULTIPOLYGON(((0 0,0 3,2 3,2 2,3 2,3 0,0 0),(1 1,2 1,2 2,1 2,1 1)),((4 2,3 2,3 3,4 3,4 2)))", + "MULTIPOLYGON(((1 0,1 1,2 1,2 2,1 2,1 4,4 4,4 0,1, 0),(3 2,3 3,2 3,2 2,3 2)))", + "POINT(3 2)", "POINT(2 2)", + 1, 3, list_of(-1)(2)(-1)(2)); +} + + +int test_main(int, char* []) +{ + test_all(); + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/split_rings.cpp b/src/boost/libs/geometry/test/algorithms/overlay/split_rings.cpp new file mode 100644 index 000000000..00cf9f85b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/split_rings.cpp @@ -0,0 +1,155 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include +#include +#include + +#include + +#include +#include + +#include + +#include + +#include +#include + + +#if defined(TEST_WITH_SVG) +# include +#endif + + +struct test_split_rings +{ + template + static void apply(std::string const& id, + Geometry const& geometry, + int expected_ring_count, + double precision) + { + + typedef typename bg::ring_type::type ring_type; + std::vector rings; + bg::split_rings(geometry, rings); + + BOOST_CHECK_EQUAL(rings.size(), expected_ring_count); + + +#if defined(TEST_WITH_SVG) + { + std::ostringstream filename; + filename << "split_rings_" << id << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper::type> mapper(svg, 500, 500); + mapper.add(geometry); + + mapper.map(geometry, "fill:rgb(255,255,128);stroke:rgb(0,0,0);stroke-width:1"); + + BOOST_FOREACH(ring_type const& ring, rings) + { + std::string style = "opacity:0.6;fill:rgb"; + std::string color = bg::area(ring) > 0 ? "(255,0,0)" : "(0,0,255)"; + mapper.map(ring, style + color + ";stroke:rgb(128,128,128);stroke-width:3"); + } + } +#endif + } +}; + + +template +void test_geometry(std::string const& caseid, + std::string const& wkt, + int expected_ring_count, double precision = 0.001) +{ + if (wkt.empty()) + { + return; + } + + Geometry geometry; + bg::read_wkt(wkt, geometry); + + test_split_rings::apply(caseid, geometry, expected_ring_count, precision); +} + + +#if ! defined(GEOMETRY_TEST_MULTI) + +template +void test_self_all() +{ + typedef bg::model::polygon

polygon; + + // Simplex + + test_geometry("1", "POLYGON((0 0,0 10,10 10,5 2,5 8,10 0,0 0))", 2); + + + // // Many loops (e.g. as result from buffering) + test_geometry("many_loops", + "POLYGON((1 3,0 9,9 5,1 7,9 8,2 5,10 10,9 2,1 3))", 3); + + + // From "mill" (flower) + test_geometry("2", + "POLYGON((5 6.10557,3.64223 8.82111,4.28284 8.71716,2.28284 6.71716,2.17889 7.35777,4.89443 6,2.17889 4.64223,2.28284 5.28284,4.28284 3.28284,3.62547 3.14045,5 6.10557))", + 5); + + test_geometry("3", + "POLYGON((0.6 10.4,9.4 10.4,9.4 -0.4,7.59 -0.4,4.59 5.33667,4.25383 5.6797,2.67526 4.89042,4.28284 3.28284,3.62547 3.14045,5.15 7.20587,5.15 -0.4,0.6 -0.4,0.6 10.4))", + 4); + + test_geometry("4", + "POLYGON((0.6 10.4,9.4 10.4,9.4 -0.4,4.59 -0.4,4.59 5.5,4.70431 5.22003,3.93716 6.00284,5 7.06569,6.06284 6.00284,5.29569 5.22003,5.41 5.5,5.41 0.01,5.01 0.41,5.25 0.41,4.85 0.01,4.85 7.20587,6.37453 3.14045,5.71716 3.28284,7.71716 5.28284,7.82111 4.64223,5.10557 6,7.82111 7.35777,7.71716 6.71716,5.71716 8.71716,6.35777 8.82111,5 6.10557,3.64223 8.82111,4.28284 8.71716,2.28284 6.71716,2.17889 7.35777,4.89443 6,2.17889 4.64223,2.28284 5.28284,4.28284 3.28284,3.62547 3.14045,5.15 7.20587,5.15 -0.4,0.6 -0.4,0.6 10.4))", + 21); + + + // Split at end-point + test_geometry("end1", "POLYGON((0 -1,0 10,10 10,10 0,-1 0,0 -1))", 2); + test_geometry("end2", "POLYGON((0 -1,0 10,11 10,11 11,10 11,10 0,-1 0,0 -1))", 3); + test_geometry("end3", "POLYGON((0 -1,0 10,11 10,11 12,12 12,12 11,10 11,10 0,-1 0,0 -1))", 4); + + // Common boundaries + test_geometry("common1", "POLYGON((0 0,0 10,10 10,10 0,15 0,15 5,10 5,10 0,0 0))", 2); + + + /* + // From us counties + test_geometry("us_counties_1", + "POLYGON((-111.5261116995073 41.22069282150765,-111.5217628285303 41.22035416591237,-111.5169320292328 41.22267065617934,-111.5202664326763 41.22008222445458,-111.524706358225 41.21912313459525,-111.5275767689257 41.2191200646373,-111.5313115885788 41.21977799763464,-111.5361319416122 41.22230930953956,-111.5390149025386 41.22669307111289,-111.5389640868764 41.22665820699549,-111.5405314519348 41.226478917027,-111.5432483336679 41.22674131537675,-111.5420873870024 41.22669699246593,-111.5468899132279 41.22714783689431,-111.5460245791811 41.22698484329734,-111.549259355884 41.2274477430645,-111.5577408755315 41.22811342877968,-111.5617324131657 41.22965779857636,-111.5622074202574 41.22994756325099,-111.5670818828246 41.22909494401993,-111.5692718200805 41.22891062885189,-111.5728540853548 41.22873442382645,-111.5760492668632 41.22941962741943,-111.5791498048043 41.22837886418323,-111.5837423095737 41.22837646600842,-111.5873509885199 41.22912252997033,-111.5905502098084 41.23037015657303,-111.5905738976172 41.23038614536871,-111.5911014306057 41.23028197627109,-111.5941112302391 41.22824505355918,-111.595808135602 41.22727811489068,-111.5980905931322 41.22548836332129,-111.5989075933465 41.22473873279626,-111.6007963250705 41.22266022435337,-111.6036899443978 41.22086457915817,-111.6058137732627 41.22012887375856,-111.602749721482 41.22196865310281,-111.5997971061567 41.22806209012482,-111.6002070563618 41.23129419775559,-111.6028708561713 41.23528460733029,-111.5994206515041 41.23211047917744,-111.5970021250484 41.22731367405874,-111.5968553199938 41.2213333698604,-111.5978240860405 41.218735705151,-111.59872799008 41.21674091429518,-111.5990118775156 41.21586922673351,-111.5993569133788 41.21346252288525,-111.601620124863 41.20717717448136,-111.6036896381354 41.20413147570312,-111.6066477579892 41.20036520970371,-111.6170938638088 41.19792503997269,-111.6171211409054 41.197912672181,-111.6174792281175 41.19763333099935,-111.6154497071748 41.19990210883104,-111.6145469690724 41.20214793299209,-111.6143872042365 41.20466380077419,-111.6140900270553 41.2012073328748,-111.6150859490031 41.19660529794054,-111.6218436555485 41.19061554473284,-111.6263257242001 41.18915337689279,-111.6371251993805 41.18909914015737,-111.6373680096377 41.18885567474617,-111.6383949129559 41.18739026040299,-111.6411123401382 41.18431339866869,-111.6444453559743 41.18263938395823,-111.6475502757163 41.18131111472079,-111.6480824344513 41.18111660627603,-111.6487261483388 41.18018217910811,-111.6541286582274 41.17582409853807,-111.6607502293818 41.17606808683036,-111.6639928385305 41.17750001069842,-111.6627289991998 41.17881191178137,-111.6627289991998 41.16984763275211,-111.6723147297616 41.17250652017602,-111.6740201607502 41.17050691221176,-111.6809028142628 41.17126673355348,-111.6809650818884 41.17123939654464,-111.6853833520725 41.17029389383428,-111.6898658836949 41.17133338502266,-111.6902209084905 41.17152318556664,-111.6904607105552 41.17152361200778,-111.6937608878567 41.171379538936,-111.6956197940083 41.17208616938441,-111.6993728847585 41.17040839085778,-111.7047507179242 41.17328962730216,-111.705138917194 41.1733253907057,-111.7102826252236 41.17325145150028,-111.7134998796559 41.17582525522811,-111.713857740997 41.1760577731046,-111.7143713164526 41.17626863893947,-111.714718580845 41.17638849963699,-111.7161627293466 41.17641647553787,-111.7235652490785 41.17698889260424,-111.7252956636535 41.18063938630633,-111.7255467374265 41.18070780591805,-111.7276362413481 41.18341443465751,-111.7281195035541 41.18379477216856,-111.7289633137073 41.18400466618191,-111.7322463245943 41.18537474159142,-111.7350417499302 41.18787350954477,-111.7400241492817 41.18920498371762,-111.7403897806728 41.18992392192225,-111.7405871404544 41.18993880963902,-111.7419062185388 41.19156105303389,-111.7441017621743 41.19149230781282,-111.74633522639 41.19326425318707,-111.7521804511058 41.19568179191514,-111.7548256119847 41.2000988714596,-111.7562439764081 41.20369244649578,-111.756385520958 41.20741568356885,-111.7560620666084 41.21002180147129,-111.7557493627381 41.2115435666562,-111.7556682922401 41.21250032230501,-111.7549762228438 41.2083729918014,-111.753021260936 41.20652061558319,-111.7508964302413 41.20557195114677,-111.7490502562344 41.20743627992862,-111.7538043672131 41.20092160586289,-111.7599851908795 41.19974075159288,-111.7535482000425 41.20277936096064,-111.7771999505038 41.20664084862795,-111.7822946483749 41.20868575255317,-111.7890479847428 41.20857546302415,-111.7834053984034 41.21113545825469,-111.8070916837301 41.21164475084303,-111.7983239620671 41.20690941545636,-111.7989057748419 41.20685382060309,-111.7988970680348 41.20685567247974,-111.8003950034205 41.20645434489455,-111.8015510337817 41.20521459774467,-111.8040078302751 41.20352268624269,-111.8051400156104 41.20305119804074,-111.805500030827 41.2024512874073,-111.8087760206539 41.19898729003837,-111.8127632488366 41.19571430853862,-111.8168246456107 41.19449127428283,-111.8226375152909 41.19565019698728,-111.8231921576817 41.19623717584509,-111.8268842679184 41.19390830631116,-111.8294386474025 41.19326999358571,-111.8281081895357 41.1923520714658,-111.83461841217 41.19040911228597,-111.8363820197726 41.18976234820737,-111.8389082690123 41.18928774535946,-111.8407278566805 41.18914288072003,-111.8414848277101 41.18915262958935,-111.8446813084015 41.18866243446734,-111.845959886583 41.18861802620197,-111.8434859428467 41.18901816674433,-111.8524610560402 41.1882713958049,-111.8481595765179 41.18832631814151,-111.8496570501088 41.18779673144824,-111.8533671749084 41.18768855682465,-111.8555901658855 41.18738820608631,-111.8545856366929 41.18543601585669,-111.8575805827953 41.18393299249777,-111.8615394981653 41.18172167621498,-111.8609477242236 41.1754400940934,-111.8606336522941 41.17523901959252,-111.8627856637925 41.16997723323662,-111.8635235797656 41.16904436111794,-111.8633266432236 41.16866453458245,-111.8616523096336 41.16843313106372,-111.8616216864947 41.16843907484764,-111.8576102899319 41.16714259614227,-111.8547179142898 41.16646709783558,-111.849004376199 41.16243082584917,-111.8507419858166 41.16392775774389,-111.8449330541267 41.15938516033442,-111.8453252871628 41.14671969870953,-111.8475090520856 41.14347927334031,-111.8495994494861 41.14184555885641,-111.8555300241724 41.12935093455723,-111.8539570692924 41.12913464596177,-111.8600529353453 41.12732099986341,-111.8628893201463 41.12732099986341,-111.8661516016343 41.12766178921265,-111.8717554038871 41.12781992480323,-111.8727125056091 41.12781941462108,-111.8744250029675 41.12734726013537,-111.8884146775109 41.12740408919985,-111.8910337085167 41.12670722950872,-111.8905605241137 41.12684570910798,-111.9013989090858 41.12571131225988,-111.902772044475 41.12619651923274,-111.9129115072118 41.12403191483529,-111.9147507512154 41.12495153622086,-111.9201178874858 41.12566715447374,-111.9240696750495 41.12855499923182,-111.9276546757843 41.12501918886934,-111.9355598663484 41.12798289437448,-111.9479782385554 41.12689279975358,-111.9529681915247 41.12994221534668,-111.9568859680716 41.13081283226165,-111.9574421207222 41.13136898494051,-111.9640025656762 41.1310956332098,-111.9657332834527 41.1401588859141,-111.9717215703218 41.14239547503718,-111.9730675011477 41.14266466120236,-111.9787329018218 41.14336183402796,-111.9883596218439 41.14364222393152,-111.9931363926252 41.14354196764271,-111.9994051904948 41.14363978973041,-112.0021307818896 41.14345808374524,-112.019489139395 41.14254400074554,-112.0239643318703 41.14234399927284,-112.026875 41.142344,-112.027575 41.142344,-112.0287262996005 41.142444,-112.029675 41.142444,-112.0285706847393 41.14250516265326,-112.0334643259497 41.14254400007785,-112.037275 41.142544,-112.038460765726 41.14254315085275,-112.0431214055661 41.14232416334449,-112.045375 41.142443" + ",-112.045875 41.142443,-112.046183 41.142443,-112.046675 41.142443,-112.04701 41.142443,-112.047675 41.142443,-112.048675 41.142443,-112.050775 41.142443,-112.051675 41.142443,-112.0540827641383 41.14234300009903,-112.0612488438362 41.14234300000304,-112.0635234354713 41.14223960918194,-112.0770714181921 41.14244181784342,-112.083276 41.142343,-112.084776 41.142343,-112.0848417657806 41.14234299978541,-112.0924417865876 41.142443,-112.100276 41.142443,-112.103976 41.142443,-112.104114857411 41.14244299996745,-112.1076037688054 41.1425399140815,-112.112793190197 41.14242459354599,-112.1135036272676 41.14254300000501,-112.1226270227682 41.14254300006021,-112.1324270190691 41.142643,-112.1421638167791 41.142643,-112.1506273882427 41.14262237725859,-112.1576209575547 41.16131792925686,-112.152476 41.142743,-112.1733149590181 41.14274300002015,-112.1756526514941 41.14285431862275,-112.1721656863206 41.14330717334865,-112.1790628146085 41.14280884335523,-112.1808690864646 41.1427879609488,-112.1876051371955 41.1429370321104,-112.1984510116649 41.14057456440421,-112.1985386297479 41.14057190901539,-112.2482545857727 41.12928342466068,-112.2585216921568 41.1262568687031,-112.2815023152398 41.11964490348107,-112.3289786112679 41.10733319877986,-112.3533969705625 41.10142824273057,-112.5251560608342 41.05848586571712,-112.4535385157666 41.13192877978023,-112.3829356229766 41.20387761333999,-112.3628222295217 41.22454031797921,-112.3307981858544 41.25696262304565,-112.2578598211629 41.33099951523954,-112.2419961323004 41.34673900002596,-112.201955 41.34674,-112.198854 41.34674,-112.198567 41.34674,-112.197535 41.34674,-112.196755 41.34674,-112.183092 41.34674,-112.182661 41.34674,-112.174135 41.34674,-112.171521 41.34674,-112.164398 41.34674,-112.163765 41.34674,-112.162149 41.34674,-112.160616 41.34674,-112.152812 41.34674,-112.137305 41.34674,-112.133199 41.34674,-112.132112 41.34674,-112.1321083653075 41.34674,-112.1261408632321 41.34735552370944,-112.1210375425564 41.34723915345325,-112.0986867218297 41.34703960146247,-112.0991128873171 41.34703432373578,-112.096676 41.34703999999999,-112.0826884841567 41.34693962919125,-112.0727519042998 41.34683715821147,-112.0659830006501 41.34633201618576,-112.043791 41.346241,-112.038076 41.346241,-112.037476 41.346241,-112.033576 41.346241,-112.032963751752 41.346241,-112.0320859322845 41.34720047709238,-112.0293729847019 41.35158293065583,-112.0225987768525 41.35384099993897,-112.012945949278 41.35384099993896,-112.0051264048585 41.35982065155388,-111.9999931863867 41.35955048219633,-111.9985054002757 41.36093908247315,-111.9886378853145 41.36437975025613,-111.982438239708 41.36699931881362,-111.9768823000155 41.37105942855347,-111.9678461715639 41.3739866250941,-111.964824595067 41.37468391195694,-111.9684577169769 41.3568526391571,-111.9703144346862 41.35837247542384,-111.9717680562695 41.36002125916402,-111.9721806067458 41.36052336335063,-111.9722701353691 41.36056857086819,-111.9756933090284 41.36361139189865,-111.9764686134888 41.3653518489586,-111.9774815061067 41.36631107832983,-111.9784353725122 41.3673490439311,-111.9818608355456 41.36917725269873,-111.9855534354769 41.3760117250587,-111.9850442656137 41.37863404701749,-111.9854221363925 41.37887044147006,-111.977148428119 41.39494967066619,-111.9823464481754 41.39046084615109,-111.9775668170106 41.39635867866395,-111.9772955142989 41.39712343090701,-111.9777832268621 41.39396396792152,-111.9780769108747 41.39453595193084,-111.9779510967016 41.39732368111444,-111.9769673928205 41.40507237141038,-111.9776418373984 41.4063310929224,-111.979249745182 41.40756511192825,-111.9805546890196 41.41174800617959,-111.9821969091629 41.41376647554345,-111.9822412429523 41.41771857136868,-111.9841029081325 41.42395514822981,-111.9758267412905 41.42973332568962,-111.9744143892868 41.43003915215967,-111.974044426735 41.43044369722418,-111.9724487099302 41.43127793250221,-111.9714554951038 41.43218647543674,-111.9705674410934 41.4326839955389,-111.969173938818 41.43455463604666,-111.9691313074541 41.43514229114804,-111.9698532625346 41.44083524341373,-111.9563035057409 41.44387691758892,-111.9528519001313 41.4425035997071,-111.948862688548 41.43996812957263,-111.9436557129119 41.43464132813732,-111.944571811535 41.43108183151026,-111.9453783570838 41.43429662278894,-111.9453292374341 41.43423156460978,-111.9487047416977 41.4370350518674,-111.949293219852 41.43728152821434,-111.946617863753 41.43651233182759,-111.9427973525344 41.43430728368595,-111.9423776809036 41.43367777659645,-111.9419291943176 41.4334303851785,-111.9407777658475 41.43217660903539,-111.9381879763191 41.43031650193143,-111.9382493895579 41.43040002340472,-111.9372011434928 41.42981718018637,-111.934117584732 41.42860635849613,-111.9324487007684 41.4262717701259,-111.9302590931362 41.42612441754618,-111.925590477184 41.4240869309046,-111.9246983708718 41.42340851775217,-111.9216328785657 41.42175106235152,-111.9201304574531 41.41957427158692,-111.9218350345417 41.42105808569211,-111.9265579698133 41.4224674871054,-111.9269374253964 41.42243152261963,-111.92904005315 41.4216476704315,-111.9263529265228 41.42314117163985,-111.9215977648415 41.42317758175992,-111.9196428552148 41.42261319977101,-111.9169146898828 41.42287472206833,-111.9134215054519 41.42473907134696,-111.9126447259132 41.42469479648941,-111.9124490246428 41.42499795177306,-111.9092387641912 41.42755224569281,-111.9052380937632 41.42897848938426,-111.9002628533518 41.42946382895553,-111.8971561379816 41.42889450986716,-111.8960249780191 41.4283771327491,-111.8940193677521 41.42850175875044,-111.8960340763695 41.42767896956915,-111.9024176724123 41.42135665487622,-111.9015750043214 41.42528897612509,-111.8998000296643 41.4285722194028,-111.8966205495849 41.43183063874344,-111.8944406431162 41.43324514380939,-111.8926252959783 41.43414332950123,-111.8916804311569 41.43450204532494,-111.8813854987459 41.43984949127724,-111.880095916456 41.43458669143437,-111.8830979471463 41.43487808596424,-111.8730501071175 41.43221499037259,-111.8646587191902 41.42862291364479,-111.8681104012376 41.41281394982138,-111.8676066232081 41.41192879397556,-111.8662685472666 41.41047503332864,-111.8648360831269 41.40927056113344,-111.8617555367589 41.40987864206158,-111.8571815473483 41.40797796402953,-111.8529378794857 41.40290666028592,-111.8525219677778 41.40333283159944,-111.8527417149485 41.40333718389994,-111.8501119188309 41.40364548567232,-111.8450021686117 41.40306327006346,-111.843627880848 41.40234608708582,-111.8435199095021 41.40231074220579,-111.844881585803 41.40265278843807,-111.8349256853031 41.39920519979233,-111.832436319031 41.39890094762616,-111.8320872552582 41.39798934323525,-111.8361009415533 41.3978803505358,-111.8321021292179 41.40300459287702,-111.8241291143356 41.40167512219369,-111.8217725690825 41.40211299539512,-111.8212955423522 41.40200922486019,-111.8171546776915 41.40329458953078,-111.8125316083106 41.39846505320347,-111.8124294708664 41.39842288523761,-111.8124264284935 41.3984236578345,-111.8108857608745 41.39858652417184" + ",-111.809365213452 41.39987879371605,-111.8042760434507 41.4011908453571,-111.8020686543937 41.40053613590567,-111.8039046363505 41.40017458184678,-111.8042635478739 41.39999258459775,-111.7909954737669 41.40089644205416,-111.7929629310693 41.40139132981063,-111.7846743021944 41.40036870539331,-111.7827866126724 41.39571814524774,-111.7815214169703 41.39299863043483,-111.7828920971421 41.39327334027993,-111.7748509130635 41.38743730378992,-111.7752165761997 41.38718480775791,-111.7721697223399 41.38604483298051,-111.7750983614573 41.386555270279,-111.7639414583505 41.38192065911581,-111.761963781468 41.3800412809659,-111.7613108864837 41.37912231691754,-111.7612258742607 41.37910304832786,-111.7591299416527 41.37968085372221,-111.7577907259937 41.37944029328051,-111.7558579035919 41.38022277149841,-111.7512688505652 41.38095536128881,-111.7482174462501 41.37990334283357,-111.7486646160195 41.37996229584262,-111.7501551896196 41.37882469173843,-111.7454941763277 41.38178624311301,-111.7335398767194 41.38465825647904,-111.7344375425085 41.38458725363097,-111.7324914280349 41.38482975996588,-111.7308102203539 41.38492274099217,-111.730258 41.364938,-111.7400445096964 41.37466081033997,-111.7367972666407 41.37827413406988,-111.7369761626924 41.37865937323883,-111.7373499817572 41.38191202877975,-111.7362382343994 41.3896817282629,-111.7318062031051 41.39385726751244,-111.730934876677 41.39610325892399,-111.7281898573264 41.39852698503418,-111.7232992768295 41.40141614738422,-111.7216699706312 41.40155945218662,-111.7235231380814 41.40068052773415,-111.7265750913976 41.3963025736558,-111.7201029932023 41.40005616511778,-111.7177896512755 41.40746098221877,-111.7158070848994 41.41038399195119,-111.715655176932 41.41047706608663,-111.715983156649 41.40463400375688,-111.7204406800612 41.40810070196405,-111.7274933391879 41.41205246687121,-111.7285125917203 41.41467440623902,-111.728522980037 41.41344595317905,-111.7322942449122 41.41795959302958,-111.731896106543 41.42560633754115,-111.7320332087593 41.42926118743524,-111.729957646899 41.43302822141643,-111.7118843501114 41.43114694815002,-111.7140310900979 41.43355552193208,-111.7078739864605 41.43654866026967,-111.6998524797112 41.43271471504839,-111.6986652926243 41.42986102526688,-111.6975120881016 41.42897853603878,-111.6971210984819 41.4282934699863,-111.6961606079428 41.42773075204737,-111.6959864719628 41.42776692740181,-111.6933497690836 41.42989872972967,-111.6930019315523 41.42994586089555,-111.6917153721713 41.43152040923766,-111.6902295574764 41.4326187150197,-111.6857899530101 41.43448702217745,-111.6836120286734 41.43709471482509,-111.6771247652154 41.43723637943522,-111.6779983979918 41.43725697173675,-111.6749495172627 41.43734007411281,-111.6746735498744 41.43741591954125,-111.6720209667629 41.43783594325005,-111.6727109972352 41.43770166372526,-111.6553038799185 41.42796846134614,-111.6559813580971 41.42929086121254,-111.6584331526525 41.4317013458235,-111.6584370945208 41.43170379247909,-111.6526596626538 41.42834717102206,-111.6520987713805 41.42542774863863,-111.651155399945 41.42497098966823,-111.6485038542844 41.42069082966789,-111.6484473142877 41.42048207616851,-111.6481701857523 41.42030165647017,-111.6458111338422 41.41860283437335,-111.6435250708396 41.41556473317775,-111.6434325770253 41.41553749590582,-111.6387074295628 41.41091893071695,-111.6382542875749 41.40697282822121,-111.6430587268327 41.41423110967988,-111.6474946531616 41.41493287990986,-111.6519130312862 41.41196173789954,-111.6533453458041 41.4089750382549,-111.6534670630606 41.40818567942468,-111.6532180676668 41.41233729755218,-111.650141671316 41.41784707703802,-111.6506362105335 41.41721786169201,-111.6483458444573 41.42038505559527,-111.6399883913355 41.42456782419585,-111.6387619333563 41.42531302770971,-111.6372313167869 41.42610278062988,-111.6388772156545 41.42503724999391,-111.6241185051481 41.42565671005583,-111.6292989198989 41.42747881108829,-111.6330212257612 41.42632935426848,-111.6300888540781 41.42874135696512,-111.6258525865511 41.43045665694785,-111.6200937473438 41.43292197700307,-111.6163818162207 41.43227133372919,-111.6139121279047 41.43210192316946,-111.6127778034731 41.431778181874,-111.6100998879303 41.43186873969825,-111.6033371287108 41.42772766687219,-111.6022619251007 41.41977026042356,-111.6042208823911 41.42642276689722,-111.6042547368996 41.42641106290917,-111.608203778722 41.42866129535266,-111.6088030126456 41.42877501302603,-111.6100720883581 41.428785889551,-111.6085308515393 41.42932400636524,-111.606750545072 41.42926095100312,-111.6050156683234 41.42987323575301,-111.6032457428657 41.43066814395039,-111.5990673748855 41.43148472494484,-111.5935002234159 41.43042488220517,-111.5930272861467 41.42998515359408,-111.5930267097009 41.42998503477877,-111.5926383972181 41.42952847560235,-111.5893656740488 41.42939120933852,-111.5879879513229 41.42897465490946,-111.5877655061638 41.42920784693975,-111.5872128087414 41.42998364520915,-111.583805331358 41.43402279679681,-111.5850015607415 41.43257430449172,-111.5682595644039 41.43689127289402,-111.5655580307463 41.43431733658391,-111.5648140723382 41.43437789786282,-111.5588494686844 41.43147389314375,-111.5627733442355 41.43390475163831,-111.5467595603931 41.43097085352397,-111.5435231017314 41.4216909235525,-111.5442217676426 41.42410058028637,-111.5429581915997 41.4198629141784,-111.5415905096045 41.41916883276773,-111.5377466703981 41.42118674271469,-111.4999002636551 41.40754598864975,-111.49992321854 41.41992376877793,-111.5043942337116 41.42316548043323,-111.5074667581468 41.42367669767896,-111.5018577201973 41.42339139933106,-111.498492694593 41.42223736811422,-111.4908347022589 41.41568090530068,-111.4908130094445 41.41544015588016,-111.4899750552739 41.41493216608176,-111.4892746770538 41.41472074332899,-111.4877789754887 41.41479252991904,-111.4780235955907 41.41446855024663,-111.4758343817126 41.4101305233553,-111.4667945916543 41.408008495426,-111.4649303818979 41.39743051733797,-111.4670499026164 41.38880238826368,-111.4675403497742 41.39238946277144,-111.4682693256192 41.3896798556904,-111.468223034458 41.38866896494368,-111.4679524737185 41.3873696044556,-111.467909790308 41.38511421668602,-111.4689252899892 41.3893194192861,-111.4719613794916 41.39260783946975,-111.4773850453548 41.3939272250177,-111.4755047817366 41.39401042247292,-111.4730700536672 41.3936966334367,-111.4707125540257 41.39313997077441,-111.4681148394472 41.39206078401419,-111.4673020106218 41.39150164420799,-111.4650634653196 41.39118921312598,-111.4624398349077 41.3906400254072,-111.4605400175199 41.38972232484358,-111.4570460693707 41.38909801417777,-111.4548503602481 41.38578941112745,-111.4481916270633 41.37903507093495,-111.4538905371506 41.37167946112217,-111.4523110338275 41.37562482145626,-111.453122061191 41.38030214182341,-111.4559274593289 41.38258137778414,-111.4578400905912 41.38326186498487,-111.4580092624499 41.38328010181085,-111.4545500072416 41.38310423553524,-111.453828693243 41.38286176547096,-111.4513917306495 41.38316888047494,-111.4490880680225 41.38286920566615,-111.4458883535083 41.38283562865421,-111.4410455091279 41.38056286130516,-111.4296540092564 41.37759174629597,-111.4330684620716 41.37199485958408,-111.4325288499295 41.37170115977816,-111.433423614824 41.37148481989143,-111.4327514468304 41.37229760229101,-111.4292876194388 41.37329041914894,-111.4279628046368 41.37382224950171,-111.4310504194527 41.37201570165918,-111.4220511206116 41.37680632625185,-111.4132007135549 41.36916475528064,-111.4132556937664 41.36821137521456,-111.410599947015 41.3655167694235,-111.4095467780071 41.35588239586497,-111.4153923235931 41.35080670253447,-111.4157574283901 41.3503345776012,-111.4141595503214 41.35370156318688,-111.4141624489772 41.35339760480722,-111.4115288588478 41.35121628241728" + ",-111.4156461230987 41.34027082280225,-111.4156347336163 41.34011622708512,-111.4219171529141 41.33399691991721,-111.4230512496498 41.33351877639811,-111.4246536800136 41.33255158448824,-111.4278802645644 41.3316442458971,-111.4321841269485 41.3326384089827,-111.4310435307007 41.3328305819942,-111.4298921041398 41.33381070679388,-111.4325816436783 41.34640754412428,-111.4305938656625 41.34507358150004,-111.4288086603161 41.342542060306,-111.431481679049 41.34513109369425,-111.4287994278175 41.33815667720043,-111.4278232779227 41.33641772801344,-111.4265560012482 41.33289501968777,-111.4265560012482 41.32617628698502,-111.4272107382647 41.32560778902531,-111.4272178782421 41.32554523388917,-111.4261980734283 41.32225817088516,-111.4304919167739 41.31367048419434,-111.4363369977304 41.31257559725096,-111.4394237666417 41.31270635296883,-111.4394344156974 41.31270409565712,-111.441519161219 41.31236426658026,-111.4381960052264 41.31363247642526,-111.4343497992445 41.31844116068382,-111.4351634377084 41.3136073258965,-111.4398662896243 41.30910418220708,-111.4422468135143 41.30752683142005,-111.44538081134 41.30634785128562,-111.4477252742131 41.30622230681761,-111.4450982072919 41.30679223598104,-111.4415499070308 41.30926911751111,-111.440343520513 41.31155182354399,-111.4451062874178 41.31989072583871,-111.4414187617719 41.31986572481608,-111.4386063431991 41.31574156424257,-111.4372288340086 41.31425825843935,-111.4357467129998 41.3119401785306,-111.4339202494052 41.30822377235391,-111.4336625137004 41.30069611228576,-111.436193501451 41.29832538323529,-111.4342850140522 41.29308194363609,-111.4328391389641 41.29555271021763,-111.4325216530159 41.29665639935071,-111.4347508608123 41.30443260100356,-111.4360586780902 41.30564636670918,-111.4346792471093 41.30464063662748,-111.4254390049755 41.29528237788455,-111.4291302686912 41.29068338555521,-111.4261573074688 41.28463104839097,-111.4370267030589 41.27981638195083,-111.4375558321362 41.27935123578043,-111.4354383430839 41.27995632635503,-111.4416162807751 41.2758529929185,-111.4384076084416 41.27957295063146,-111.4377212864738 41.2850520602332,-111.4381740345049 41.28651100478594,-111.4384610963577 41.28700771059263,-111.4443864706288 41.29120163044556,-111.4392995187362 41.28993258176533,-111.437506253794 41.28634485567613,-111.4356263875061 41.28302577228677,-111.4349277183834 41.27937332380423,-111.4350242056712 41.26951553923891,-111.4419729572562 41.26823923756828,-111.443851402553 41.26628117225569,-111.4466503255125 41.26617791598309,-111.4466539930302 41.26617467737448,-111.4520015669708 41.26396940238351,-111.4535032224145 41.26442883740561,-111.4575335757568 41.26357415147228,-111.4483713214452 41.27007784433943,-111.4479650010794 41.2717768437342,-111.4480273600067 41.27313463677613,-111.4493445602483 41.27659822195652,-111.4478190730863 41.27422750187978,-111.4464117327744 41.26893674882813,-111.4496732569538 41.26159468063268,-111.4543300686382 41.25793771380997,-111.4571410161368 41.2577942766178,-111.4584177002777 41.25730159262817,-111.4553050787541 41.25932963474278,-111.4530081358515 41.26959930131982,-111.4508994156196 41.26371450013092,-111.4541957910179 41.25962837787136,-111.4533513082429 41.25606707336917,-111.4584511900491 41.24989054984832,-111.4611419330649 41.24901272751228,-111.4642296892219 41.2471079915566,-111.466302267792 41.24724208780359,-111.4612041454673 41.25525650795958,-111.4613628730978 41.25711686602586,-111.460012566547 41.25068020785515,-111.4631190491229 41.24557484651866,-111.4668960494423 41.24198842878425,-111.4691669157075 41.2417000374843,-111.4697812813245 41.24112614793989,-111.4746504843807 41.23477980181183,-111.4803977314971 41.23547461817721,-111.4807668379497 41.23549157614718,-111.4821598518453 41.235181287545,-111.4835147362251 41.23397825845257,-111.4913294700869 41.23144137067924,-111.4937928098947 41.23127714842143,-111.4853525806721 41.23734674935701,-111.4851730213113 41.24391252958296,-111.4868064098187 41.24667054274708,-111.4899998360328 41.24898263383229,-111.4827890866642 41.24415984037166,-111.4821185211798 41.23272415759732,-111.4852056387818 41.22855546079995,-111.4871367392634 41.22636620973306,-111.4877302368984 41.22602162842327,-111.4866371991571 41.22728810367443,-111.4862618064053 41.21244302667023,-111.5038439093175 41.21886594606829,-111.5086526752272 41.22023174933462,-111.5093913926803 41.21966687966173,-111.5156021372448 41.21908063181036,-111.5179945315531 41.21978213857661,-111.5200627063573 41.21974916010367,-111.5242768213902 41.22009310457656,-111.5261116995073 41.22069282150765))", + 22); + */ + +} +#endif + + + +#if ! defined(GEOMETRY_TEST_MULTI) +int test_main(int, char* []) +{ + test_self_all >(); + return 0; +} +#endif diff --git a/src/boost/libs/geometry/test/algorithms/overlay/test_get_turns.hpp b/src/boost/libs/geometry/test/algorithms/overlay/test_get_turns.hpp new file mode 100644 index 000000000..f761a996d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/test_get_turns.hpp @@ -0,0 +1,328 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014, 2016, 2017, 2018. +// Modifications copyright (c) 2014-2018 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. + +// 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) + +#ifndef BOOST_GEOMETRY_TEST_ALGORITHMS_OVERLAY_TEST_GET_TURNS_HPP +#define BOOST_GEOMETRY_TEST_ALGORITHMS_OVERLAY_TEST_GET_TURNS_HPP + +#include +#include + +#include + +#include + +#include + +#include + +#include +#include + +struct expected_pusher + : std::vector +{ + expected_pusher & operator()(std::string const& ex) + { + std::vector::push_back(ex); + return *this; + } +}; + +inline expected_pusher expected(std::string const& ex) +{ + expected_pusher res; + return res(ex); +} + +struct equal_turn +{ + equal_turn(std::string const& s) : turn_ptr(&s) {} + + template + bool operator()(T const& t) const + { + std::string const& s = (*turn_ptr); + std::string::size_type const count = s.size(); + + return (count > 0 + ? bg::method_char(t.method) == s[0] + : true) + && (count > 1 + ? bg::operation_char(t.operations[0].operation) == s[1] + : true) + && (count > 2 + ? bg::operation_char(t.operations[1].operation) == s[2] + : true) + && equal_operations_ex(t.operations[0], t.operations[1], s); + } + + template + static bool equal_operations_ex(bg::detail::overlay::turn_operation const& /*op0*/, + bg::detail::overlay::turn_operation const& /*op1*/, + std::string const& /*s*/) + { + return true; + } + + template + static bool equal_operations_ex(bg::detail::overlay::turn_operation_linear const& op0, + bg::detail::overlay::turn_operation_linear const& op1, + std::string const& s) + { + std::string::size_type const count = s.size(); + + return (count > 3 + ? is_colinear_char(op0.is_collinear) == s[3] + : true) + && (count > 4 + ? is_colinear_char(op1.is_collinear) == s[4] + : true); + } + + static char is_colinear_char(bool is_collinear) + { + return is_collinear ? '=' : '+'; + } + + const std::string * turn_ptr; +}; + +template +struct turns_printer +{ + turns_printer(Turns const& t) : turns(t) {} + + friend std::ostream & operator<<(std::ostream & os, turns_printer const& tp) + { + std::vector vec(tp.turns.size()); + std::transform(tp.turns.begin(), tp.turns.end(), vec.begin(), to_string()); + std::sort(vec.begin(), vec.end()); + std::copy(vec.begin(), vec.end(), std::ostream_iterator(os, " ")); + return os; + } + + struct to_string + { + template + std::string operator()(bg::detail::overlay::turn_info > const& t) const + { + std::string res(3, ' '); + res[0] = bg::method_char(t.method); + res[1] = bg::operation_char(t.operations[0].operation); + res[2] = bg::operation_char(t.operations[1].operation); + return res; + } + + template + std::string operator()(bg::detail::overlay::turn_info > const& t) const + { + std::string res(5, ' '); + res[0] = bg::method_char(t.method); + res[1] = bg::operation_char(t.operations[0].operation); + res[2] = bg::operation_char(t.operations[1].operation); + res[3] = equal_turn::is_colinear_char(t.operations[0].is_collinear); + res[4] = equal_turn::is_colinear_char(t.operations[1].is_collinear); + return res; + } + }; + + Turns const& turns; +}; + +template <> +struct turns_printer +{ + turns_printer(expected_pusher const& t) : turns(t) {} + + friend std::ostream & operator<<(std::ostream & os, turns_printer const& tp) + { + std::vector vec(tp.turns.size()); + std::copy(tp.turns.begin(), tp.turns.end(), vec.begin()); + std::sort(vec.begin(), vec.end()); + std::copy(vec.begin(), vec.end(), std::ostream_iterator(os, " ")); + return os; + } + + expected_pusher const& turns; +}; + +template +void check_geometry_range(Geometry1 const& g1, + Geometry2 const& g2, + std::string const& wkt1, + std::string const& wkt2, + Expected const& expected, + Strategy const& strategy) +{ + typedef bg::detail::no_rescale_policy robust_policy_type; + typedef typename bg::point_type::type point_type; + + typedef typename bg::detail::segment_ratio_type + < + point_type, robust_policy_type + >::type segment_ratio_type; + + typedef bg::detail::overlay::turn_info + < + typename bg::point_type::type, + segment_ratio_type, + typename bg::detail::get_turns::turn_operation_type + < + Geometry1, + Geometry2, + segment_ratio_type + >::type + > turn_info; + typedef bg::detail::overlay::assign_null_policy assign_policy_t; + typedef bg::detail::get_turns::no_interrupt_policy interrupt_policy_t; + + std::vector detected; + interrupt_policy_t interrupt_policy; + robust_policy_type robust_policy; + + // Don't switch the geometries + typedef bg::detail::get_turns::get_turn_info_type + < + Geometry1, Geometry2, assign_policy_t + > turn_policy_t; + + bg::dispatch::get_turns + < + typename bg::tag::type, typename bg::tag::type, + Geometry1, Geometry2, false, false, + turn_policy_t + >::apply(0, g1, 1, g2, strategy, robust_policy, detected, interrupt_policy); + + bool ok = boost::size(expected) == detected.size(); + + BOOST_CHECK_MESSAGE(ok, + "get_turns: " << wkt1 << " and " << wkt2 + << " -> Expected turns #: " << boost::size(expected) << " detected turns #: " << detected.size()); + + if (ok) + { + std::vector turns = detected; + + for ( typename boost::range_iterator::type sit = boost::begin(expected) ; + sit != boost::end(expected) ; ++sit) + { + typename std::vector::iterator + it = std::find_if(turns.begin(), turns.end(), equal_turn(*sit)); + + if ( it != turns.end() ) + { + turns.erase(it); + } + else + { + ok = false; + break; + } + } + } + + if ( !ok ) + { + BOOST_CHECK_MESSAGE(false, + "get_turns: " << wkt1 << " and " << wkt2 + << " -> Expected turns: " << turns_printer(expected) + << "Detected turns: " << turns_printer >(detected)); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Coordinates: " + << typeid(typename bg::coordinate_type::type).name() + << ", " + << typeid(typename bg::coordinate_type::type).name() + << std::endl; +#endif + } +} + +template +void check_geometry_range(Geometry1 const& g1, + Geometry2 const& g2, + std::string const& wkt1, + std::string const& wkt2, + Expected const& expected) +{ + typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy; + + check_geometry_range(g1, g2, wkt1, wkt2, expected, strategy); +} + +template +void test_geometry_range(std::string const& wkt1, std::string const& wkt2, + Expected const& expected, Strategy const& strategy) +{ + Geometry1 geometry1; + Geometry2 geometry2; + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); + check_geometry_range(geometry1, geometry2, wkt1, wkt2, expected, strategy); +} + +template +void test_geometry_range(std::string const& wkt1, std::string const& wkt2, + Expected const& expected) +{ + Geometry1 geometry1; + Geometry2 geometry2; + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); + check_geometry_range(geometry1, geometry2, wkt1, wkt2, expected); +} + +template +void test_geometry(std::string const& wkt1, std::string const& wkt2, + std::string const& ex0) +{ + test_geometry_range(wkt1, wkt2, expected(ex0)); +} + +template +void test_geometry(std::string const& wkt1, std::string const& wkt2, + std::string const& ex0, std::string const& ex1) +{ + test_geometry_range(wkt1, wkt2, expected(ex0)(ex1)); +} + +template +void test_geometry(std::string const& wkt1, std::string const& wkt2, + std::string const& ex0, std::string const& ex1, std::string const& ex2) +{ + test_geometry_range(wkt1, wkt2, expected(ex0)(ex1)(ex2)); +} + +template +void test_geometry(std::string const& wkt1, std::string const& wkt2, + expected_pusher const& expected) +{ + test_geometry_range(wkt1, wkt2, expected); +} + +template +void test_geometry(std::string const& wkt1, std::string const& wkt2, + expected_pusher const& expected, + Strategy const& strategy) +{ + test_geometry_range(wkt1, wkt2, expected, strategy); +} + +#endif // BOOST_GEOMETRY_TEST_ALGORITHMS_OVERLAY_TEST_GET_TURNS_HPP diff --git a/src/boost/libs/geometry/test/algorithms/overlay/traverse.cpp b/src/boost/libs/geometry/test/algorithms/overlay/traverse.cpp new file mode 100644 index 000000000..8f5225091 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/traverse.cpp @@ -0,0 +1,1040 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#define BOOST_GEOMETRY_DEFINE_STREAM_OPERATOR_SEGMENT_RATIO +//#define BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE +//#define BOOST_GEOMETRY_OVERLAY_NO_THROW +//#define HAVE_TTMATH + +#include +#include +#include +#include +#include + +#include + +#ifdef HAVE_TTMATH +# include +#endif + +#include + + +// #define BOOST_GEOMETRY_DEBUG_ENRICH +//#define BOOST_GEOMETRY_DEBUG_RELATIVE_ORDER + +// #define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR +// #define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER + + +#define BOOST_GEOMETRY_TEST_OVERLAY_NOT_EXCHANGED + +#ifdef BOOST_GEOMETRY_DEBUG_ENRICH +# define BOOST_GEOMETRY_DEBUG_IDENTIFIER +#endif + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + +#include + +#include + + +#if defined(TEST_WITH_SVG) +# include +#endif + +#include + +#include + +template +static inline std::string operation() +{ + switch(Op) + { + case bg::overlay_union : return "union"; + case bg::overlay_intersection : return "intersection"; + case bg::overlay_difference : return "difference"; + } + return "unknown"; +} + + +namespace detail +{ + +template +< + typename G1, typename G2, + bg::overlay_type OverlayType, + bool Reverse1, bool Reverse2 +> +struct test_traverse +{ + + static void apply(std::string const& id, + std::size_t expected_count, double expected_area, + G1 const& g1, G2 const& g2, + double precision) + { + // DEBUG ONE or FEW CASE(S) ONLY + //if (! boost::contains(id, "36") || Direction != 1) return; + //if (! boost::contains(id, "iet_") || boost::contains(id, "st")) return; + //if (! boost::contains(id, "66") || Direction != 1) return; + //if (! boost::contains(id, "92") && ! boost::contains(id, "96") ) return; + //if (! (boost::contains(id, "58_st") || boost::contains(id, "59_st") || boost::contains(id, "60_st") || boost::contains(id, "83")) ) return; + //if (! (boost::contains(id, "81") || boost::contains(id, "82") || boost::contains(id, "84") || boost::contains(id, "85") || boost::contains(id, "68")) ) return; + //if (! (boost::contains(id, "81") || boost::contains(id, "86") || boost::contains(id, "88")) ) return; + //if (! boost::contains(id, "58_") || Direction != 1) return; + //if (! boost::contains(id, "55") || Direction != 1) return; + //if (! boost::contains(id, "55_iet_iet") || Direction != 1) return; + //if (! boost::contains(id, "55_st_iet") || Direction != 1) return; + //if (! boost::contains(id, "55_iet_st") || Direction != 1) return; + //if (! boost::contains(id, "54_st_st") || Direction != 1) return; + //if (! boost::contains(id, "54_iet_st") || Direction != 1) return; + //if (! (boost::contains(id, "54_") || boost::contains(id, "55_")) || Direction != 1) return; + //if (Direction != 1) return; + // END DEBUG ONE ... + + + /*** FOR REVERSING ONLY + { + // If one or both are invalid (e.g. ccw), + // they can be corrected by uncommenting this section + G1 cg1 = g1; + G2 cg2 = g2; + bg::correct(cg1); + bg::correct(cg2); + std::cout << std::setprecision(12) + << bg::wkt(cg1) << std::endl + << bg::wkt(cg2) << std::endl; + } + ***/ + +#if defined(BOOST_GEOMETRY_DEBUG_OVERLAY) || defined(BOOST_GEOMETRY_DEBUG_ENRICH) + bool const ccw = + bg::point_order::value == bg::counterclockwise + || bg::point_order::value == bg::counterclockwise; + + std::cout << std::endl + << "TRAVERSE" + << " " << id + << (ccw ? "_ccw" : "") + << " " << string_from_type::type>::name() + << "(" << OverlayType << ")" << std::endl; + + //std::cout << bg::area(g1) << " " << bg::area(g2) << std::endl; +#endif + + typedef typename bg::strategy::side::services::default_strategy + < + typename bg::cs_tag::type + >::type side_strategy_type; + + typedef typename bg::point_type::type point_type; + typedef typename bg::rescale_policy_type::type + rescale_policy_type; + + rescale_policy_type rescale_policy + = bg::get_rescale_policy(g1, g2); + + typedef bg::detail::overlay::traversal_turn_info + < + point_type, + typename bg::detail::segment_ratio_type::type + > turn_info; + std::vector turns; + + bg::detail::overlay::operation_type const op = + OverlayType == bg::overlay_union + ? bg::detail::overlay::operation_union + : bg::detail::overlay::operation_intersection; + + bg::detail::get_turns::no_interrupt_policy policy; + bg::get_turns(g1, g2, rescale_policy, turns, policy); + bg::enrich_intersection_points(turns, op, + g1, g2, rescale_policy, side_strategy_type()); + + typedef bg::model::ring::type> ring_type; + typedef std::vector out_vector; + out_vector v; + + bg::detail::overlay::overlay_null_visitor visitor; + + bg::detail::overlay::traverse + < + Reverse1, Reverse2, + G1, G2 + >::apply(g1, g2, op, rescale_policy, turns, v, visitor); + + // Check number of resulting rings + BOOST_CHECK_MESSAGE(expected_count == boost::size(v), + "traverse: " << id + << " (" << operation() << ")" + << " #shapes expected: " << expected_count + << " detected: " << boost::size(v) + << " type: " << string_from_type + ::type>::name() + ); + + // Check total area of resulting rings + typename bg::default_area_result::type total_area = 0; + BOOST_FOREACH(ring_type const& ring, v) + { + total_area += bg::area(ring); + //std::cout << bg::wkt(ring) << std::endl; + } + + BOOST_CHECK_CLOSE(expected_area, total_area, precision); + +#if defined(TEST_WITH_SVG) + { + std::ostringstream filename; + filename << "traverse_" << operation() + << "_" << id + << "_" << string_from_type::type>::name() + << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper::type> mapper(svg, 500, 500); + mapper.add(g1); + mapper.add(g2); + + // Input shapes in green (src=0) / blue (src=1) + mapper.map(g1, "fill-opacity:0.5;fill:rgb(153,204,0);" + "stroke:rgb(153,204,0);stroke-width:3"); + mapper.map(g2, "fill-opacity:0.3;fill:rgb(51,51,153);" + "stroke:rgb(51,51,153);stroke-width:3"); + + // Traversal rings in magenta outline/red fill -> over blue/green this gives brown + BOOST_FOREACH(ring_type const& ring, v) + { + mapper.map(ring, "fill-opacity:0.2;stroke-opacity:0.4;fill:rgb(255,0,0);" + "stroke:rgb(255,0,255);stroke-width:8"); + } + + // turn points in orange, + enrichment/traversal info + typedef typename bg::coordinate_type::type coordinate_type; + + // Simple map to avoid two texts at same place (note that can still overlap!) + std::map, int> offsets; + int index = 0; + int const margin = 5; + + BOOST_FOREACH(turn_info const& turn, turns) + { + int lineheight = 8; + mapper.map(turn.point, "fill:rgb(255,128,0);" + "stroke:rgb(0,0,0);stroke-width:1", 3); + + { + coordinate_type half = 0.5; + coordinate_type ten = 10; + // Map characteristics + // Create a rounded off point + std::pair p + = std::make_pair( + boost::numeric_cast(half + + ten * bg::get<0>(turn.point)), + boost::numeric_cast(half + + ten * bg::get<1>(turn.point)) + ); + std::string style = "fill:rgb(0,0,0);font-family:Arial;font-size:8px"; + + if (turn.colocated) + { + style = "fill:rgb(255,0,0);font-family:Arial;font-size:8px"; + } + else if (turn.discarded) + { + style = "fill:rgb(92,92,92);font-family:Arial;font-size:6px"; + lineheight = 6; + } + + //if (! turn.is_discarded() && ! turn.blocked() && ! turn.both(bg::detail::overlay::operation_union)) + //if (! turn.discarded) + { + std::ostringstream out; + out << index + << ": " << bg::method_char(turn.method) + << std::endl + << "op: " << bg::operation_char(turn.operations[0].operation) + << " / " << bg::operation_char(turn.operations[1].operation) + //<< (turn.is_discarded() ? " (discarded) " : turn.blocked() ? " (blocked)" : "") + << std::endl; + + out << "r: " << turn.operations[0].fraction + << " ; " << turn.operations[1].fraction + << std::endl; + if (turn.operations[0].enriched.next_ip_index != -1) + { + out << "ip: " << turn.operations[0].enriched.next_ip_index; + } + else + { + out << "vx: " << turn.operations[0].enriched.travels_to_vertex_index + << " -> ip: " << turn.operations[0].enriched.travels_to_ip_index; + } + out << " / "; + if (turn.operations[1].enriched.next_ip_index != -1) + { + out << "ip: " << turn.operations[1].enriched.next_ip_index; + } + else + { + out << "vx: " << turn.operations[1].enriched.travels_to_vertex_index + << " -> ip: " << turn.operations[1].enriched.travels_to_ip_index; + } + + out << std::endl; + + /*out + + << std::setprecision(3) + << "dist: " << boost::numeric_cast(turn.operations[0].enriched.distance) + << " / " << boost::numeric_cast(turn.operations[1].enriched.distance) + << std::endl + << "vis: " << bg::visited_char(turn.operations[0].visited) + << " / " << bg::visited_char(turn.operations[1].visited); + */ + + /* + out << index + << ": " << bg::operation_char(turn.operations[0].operation) + << " " << bg::operation_char(turn.operations[1].operation) + << " (" << bg::method_char(turn.method) << ")" + << (turn.ignore() ? " (ignore) " : " ") + << std::endl + + << "ip: " << turn.operations[0].enriched.travels_to_ip_index + << "/" << turn.operations[1].enriched.travels_to_ip_index; + + if (turn.operations[0].enriched.next_ip_index != -1 + || turn.operations[1].enriched.next_ip_index != -1) + { + out << " [" << turn.operations[0].enriched.next_ip_index + << "/" << turn.operations[1].enriched.next_ip_index + << "]" + ; + } + out << std::endl; + + + out + << "vx:" << turn.operations[0].enriched.travels_to_vertex_index + << "/" << turn.operations[1].enriched.travels_to_vertex_index + << std::endl + + << std::setprecision(3) + << "dist: " << turn.operations[0].fraction + << " / " << turn.operations[1].fraction + << std::endl; + */ + + + + offsets[p] += lineheight; + int offset = offsets[p]; + offsets[p] += lineheight * 3; + mapper.text(turn.point, out.str(), style, margin, offset, lineheight); + } + index++; + } + } + } +#endif + } +}; +} + +template +< + typename G1, typename G2, + bg::overlay_type OverlayType, + bool Reverse1 = false, + bool Reverse2 = false +> +struct test_traverse +{ + typedef detail::test_traverse + < + G1, G2, OverlayType, Reverse1, Reverse2 + > detail_test_traverse; + + inline static void apply(std::string const& id, std::size_t expected_count, double expected_area, + std::string const& wkt1, std::string const& wkt2, + double precision = 0.001) + { + if (wkt1.empty() || wkt2.empty()) + { + return; + } + + G1 g1; + bg::read_wkt(wkt1, g1); + + G2 g2; + bg::read_wkt(wkt2, g2); + + bg::correct(g1); + bg::correct(g2); + + //std::cout << bg::wkt(g1) << std::endl; + //std::cout << bg::wkt(g2) << std::endl; + + // Try the overlay-function in both ways + std::string caseid = id; + //goto case_reversed; + +#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION + std::cout << std::endl << std::endl << "# " << caseid << std::endl; +#endif + detail_test_traverse::apply(caseid, expected_count, expected_area, g1, g2, precision); + +#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION + return; +#endif + + //case_reversed: +#if ! defined(BOOST_GEOMETRY_TEST_OVERLAY_NOT_EXCHANGED) + caseid = id + "_rev"; +#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION + std::cout << std::endl << std::endl << "# " << caseid << std::endl; +#endif + + detail_test_traverse::apply(caseid, expected_count, expected_area, g2, g1, precision); +#endif + } +}; + +#if ! defined(BOOST_GEOMETRY_TEST_MULTI) +template +void test_all(bool test_self_tangencies = true, bool test_mixed = false) +{ + typedef bg::model::point P; + typedef bg::model::polygon

polygon; + //typedef bg::model::box

box; + + typedef test_traverse + < + polygon, polygon, bg::overlay_intersection + > test_traverse_intersection; + typedef test_traverse + < + polygon, polygon, bg::overlay_union + > test_traverse_union; + + // 1-6 + test_traverse_intersection::apply("1", 1, 5.4736, case_1[0], case_1[1]); + test_traverse_intersection::apply("2", 1, 12.0545, case_2[0], case_2[1]); + test_traverse_intersection::apply("3", 1, 5, case_3[0], case_3[1]); + test_traverse_intersection::apply("4", 1, 10.2212, case_4[0], case_4[1]); + test_traverse_intersection::apply("5", 2, 12.8155, case_5[0], case_5[1]); + test_traverse_intersection::apply("6", 1, 4.5, case_6[0], case_6[1]); + + // 7-12 + test_traverse_intersection::apply("7", 0, 0, case_7[0], case_7[1]); + test_traverse_intersection::apply("8", 0, 0, case_8[0], case_8[1]); + test_traverse_intersection::apply("9", 0, 0, case_9[0], case_9[1]); + test_traverse_intersection::apply("10", 0, 0, case_10[0], case_10[1]); + test_traverse_intersection::apply("11", 1, 1, case_11[0], case_11[1]); + test_traverse_intersection::apply("12", 2, 0.63333, case_12[0], case_12[1]); + + // 13-18 + test_traverse_intersection::apply("13", 0, 0, case_13[0], case_13[1]); + test_traverse_intersection::apply("14", 0, 0, case_14[0], case_14[1]); + test_traverse_intersection::apply("15", 0, 0, case_15[0], case_15[1]); + test_traverse_intersection::apply("16", 0, 0, case_16[0], case_16[1]); + test_traverse_intersection::apply("17", 1, 2, case_17[0], case_17[1]); + test_traverse_intersection::apply("18", 1, 2, case_18[0], case_18[1]); + + // 19-24 + test_traverse_intersection::apply("19", 0, 0, case_19[0], case_19[1]); + test_traverse_intersection::apply("20", 1, 5.5, case_20[0], case_20[1]); + test_traverse_intersection::apply("21", 0, 0, case_21[0], case_21[1]); + test_traverse_intersection::apply("22", 0, 0, case_22[0], case_22[1]); + test_traverse_intersection::apply("23", 1, 1.4, case_23[0], case_23[1]); + test_traverse_intersection::apply("24", 1, 1.0, case_24[0], case_24[1]); + + // 25-30 + test_traverse_intersection::apply("25", 0, 0, case_25[0], case_25[1]); + test_traverse_intersection::apply("26", 0, 0, case_26[0], case_26[1]); + test_traverse_intersection::apply("27", 1, 0.9545454, case_27[0], case_27[1]); + test_traverse_intersection::apply("28", 1, 0.9545454, case_28[0], case_28[1]); + test_traverse_intersection::apply("29", 1, 1.4, case_29[0], case_29[1]); + test_traverse_intersection::apply("30", 1, 0.5, case_30[0], case_30[1]); + + // 31-36 + test_traverse_intersection::apply("31", 0, 0, case_31[0], case_31[1]); + test_traverse_intersection::apply("32", 0, 0, case_32[0], case_32[1]); + test_traverse_intersection::apply("33", 0, 0, case_33[0], case_33[1]); + test_traverse_intersection::apply("34", 1, 0.5, case_34[0], case_34[1]); + test_traverse_intersection::apply("35", 1, 1.0, case_35[0], case_35[1]); + test_traverse_intersection::apply("36", 1, 1.625, case_36[0], case_36[1]); + + // 37-42 + test_traverse_intersection::apply("37", 2, 0.666666, case_37[0], case_37[1]); + test_traverse_intersection::apply("38", 2, 0.971429, case_38[0], case_38[1]); + test_traverse_intersection::apply("39", 1, 24, case_39[0], case_39[1]); + test_traverse_intersection::apply("40", 0, 0, case_40[0], case_40[1]); + test_traverse_intersection::apply("41", 1, 5, case_41[0], case_41[1]); + test_traverse_intersection::apply("42", 1, 5, case_42[0], case_42[1]); + + // 43-48 - invalid polygons + //test_traverse_intersection::apply("43", 2, 0.75, case_43[0], case_43[1]); + //test_traverse_intersection::apply("44", 1, 44, case_44[0], case_44[1]); + //test_traverse_intersection::apply("45", 1, 45, case_45[0], case_45[1]); + //test_traverse_intersection::apply("46", 1, 46, case_46[0], case_46[1]); + //test_traverse_intersection::apply("47", 1, 47, case_47[0], case_47[1]); + + // 49-54 + + test_traverse_intersection::apply("50", 0, 0, case_50[0], case_50[1]); + test_traverse_intersection::apply("51", 0, 0, case_51[0], case_51[1]); + test_traverse_intersection::apply("52", 1, 10.5, case_52[0], case_52[1]); + if (test_self_tangencies) + { + test_traverse_intersection::apply("53_st", 0, 0, case_53[0], case_53[1]); + } + test_traverse_intersection::apply("53_iet", 0, 0, case_53[0], case_53[2]); + + test_traverse_intersection::apply("54_iet_iet", 1, 2, case_54[1], case_54[3]); + if (test_self_tangencies) + { + test_traverse_intersection::apply("54_st_iet", 1, 2, case_54[0], case_54[3]); + test_traverse_intersection::apply("54_iet_st", 1, 2, case_54[1], case_54[2]); + test_traverse_intersection::apply("54_st_st", 1, 2, case_54[0], case_54[2]); + } + + if (test_self_tangencies) + { + // 55-60 + test_traverse_intersection::apply("55_st_st", 1, 2, case_55[0], case_55[2]); + } + + test_traverse_intersection::apply("55_st_iet", 1, 2, case_55[0], case_55[3]); + test_traverse_intersection::apply("55_iet_st", 1, 2, case_55[1], case_55[2]); + if (test_self_tangencies) + { + test_traverse_intersection::apply("56", 2, 4.5, case_56[0], case_56[1]); + } + test_traverse_intersection::apply("55_iet_iet", 1, 2, case_55[1], case_55[3]); + test_traverse_intersection::apply("57", 2, 5.9705882, case_57[0], case_57[1]); + + if (test_self_tangencies) + { + test_traverse_intersection::apply("58_st", + 2, 0.333333, case_58[0], case_58[1]); + test_traverse_intersection::apply("59_st", + 2, 1.5416667, case_59[0], case_59[1]); + test_traverse_intersection::apply("60_st", + 3, 2, case_60[0], case_60[1]); + } + test_traverse_intersection::apply("58_iet", + 2, 0.333333, case_58[0], case_58[2]); + test_traverse_intersection::apply("59_iet", + 2, 1.5416667, case_59[0], case_59[2]); + test_traverse_intersection::apply("60_iet", + 3, 2, case_60[0], case_60[2]); + test_traverse_intersection::apply("61_st", + 0, 0, case_61[0], case_61[1]); + + test_traverse_intersection::apply("70", + 2, 4, case_70[0], case_70[1]); + test_traverse_intersection::apply("71", + 2, 2, case_71[0], case_71[1]); + test_traverse_intersection::apply("72", + 3, 2.85, case_72[0], case_72[1]); + test_traverse_intersection::apply("79", + 2, 20, case_79[0], case_79[1]); + + // Should be 3 shapes + test_traverse_intersection::apply("82a", + 2, 2.0, case_82[0], case_82[1]); + // Should be 3 shapes + test_traverse_intersection::apply("82b", + 2, 2.0, case_82[0], case_82[2]); + // other + +#ifdef BOOST_GEOMETRY_TEST_FAILURES + // simplified version of 82, area should be different + // missing IP at (1.5 3.5) from (1 4,1.5 3.5,2 4)x(2 4,1 3) + test_traverse_intersection::apply("83", + 1, 0.0, case_83[0], case_83[1]); +#endif + + // pies (went wrong when not all cases where implemented, especially some collinear (opposite) cases + test_traverse_intersection::apply("pie_16_4_12", + 1, 491866.5, pie_16_4_12[0], pie_16_4_12[1]); + test_traverse_intersection::apply("pie_23_21_12_500", + 2, 2363199.3313, pie_23_21_12_500[0], pie_23_21_12_500[1]); + test_traverse_intersection::apply("pie_23_23_3_2000", + 2, 1867779.9349, pie_23_23_3_2000[0], pie_23_23_3_2000[1]); + test_traverse_intersection::apply("pie_23_16_16", + 2, 2128893.9555, pie_23_16_16[0], pie_23_16_16[1]); + test_traverse_intersection::apply("pie_16_2_15_0", + 0, 0, pie_16_2_15_0[0], pie_16_2_15_0[1]); + test_traverse_intersection::apply("pie_4_13_15", + 1, 490887.06678, pie_4_13_15[0], pie_4_13_15[1]); + test_traverse_intersection::apply("pie_20_20_7_100", + 2, 2183372.2718, pie_20_20_7_100[0], pie_20_20_7_100[1]); + + + + // 1-6 + test_traverse_union::apply("1", 1, 11.5264, case_1[0], case_1[1]); + test_traverse_union::apply("2", 1, 17.9455, case_2[0], case_2[1]); + test_traverse_union::apply("3", 1, 9, case_3[0], case_3[1]); + test_traverse_union::apply("4", 3, 17.7788, case_4[0], case_4[1]); + test_traverse_union::apply("5", 2, 18.4345, case_5[0], case_5[1]); + test_traverse_union::apply("6", 1, 9, case_6[0], case_6[1]); + + // 7-12 + test_traverse_union::apply("7", 1, 9, case_7[0], case_7[1]); + test_traverse_union::apply("8", 1, 12, case_8[0], case_8[1]); + test_traverse_union::apply("9", 0, 0 /*UU 2, 11*/, case_9[0], case_9[1]); + test_traverse_union::apply("10", 1, 9, case_10[0], case_10[1]); + test_traverse_union::apply("11", 1, 8, case_11[0], case_11[1]); + test_traverse_union::apply("12", 2, 8.36667, case_12[0], case_12[1]); + + // 13-18 + test_traverse_union::apply("13", 1, 4, case_13[0], case_13[1]); + test_traverse_union::apply("14", 1, 12, case_14[0], case_14[1]); + test_traverse_union::apply("15", 1, 12, case_15[0], case_15[1]); + test_traverse_union::apply("16", 1, 9, case_16[0], case_16[1]); + test_traverse_union::apply("17", 1, 8, case_17[0], case_17[1]); + test_traverse_union::apply("18", 1, 8, case_18[0], case_18[1]); + + // 19-24 + test_traverse_union::apply("19", 1, 10, case_19[0], case_19[1]); + test_traverse_union::apply("20", 1, 5.5, case_20[0], case_20[1]); + test_traverse_union::apply("21", 0, 0, case_21[0], case_21[1]); + test_traverse_union::apply("22", 0, 0 /*UU 2, 9.5*/, case_22[0], case_22[1]); + test_traverse_union::apply("23", 1, 6.1, case_23[0], case_23[1]); + test_traverse_union::apply("24", 1, 5.5, case_24[0], case_24[1]); + + // 25-30 + test_traverse_union::apply("25", 0, 0 /*UU 2, 7*/, case_25[0], case_25[1]); + test_traverse_union::apply("26", 0, 0 /*UU 2, 7.5 */, case_26[0], case_26[1]); + test_traverse_union::apply("27", 1, 8.04545, case_27[0], case_27[1]); + test_traverse_union::apply("28", 1, 10.04545, case_28[0], case_28[1]); + test_traverse_union::apply("29", 1, 8.1, case_29[0], case_29[1]); + test_traverse_union::apply("30", 1, 6.5, case_30[0], case_30[1]); + + // 31-36 + test_traverse_union::apply("31", 0, 0 /*UU 2, 4.5 */, case_31[0], case_31[1]); + test_traverse_union::apply("32", 0, 0 /*UU 2, 4.5 */, case_32[0], case_32[1]); + test_traverse_union::apply("33", 0, 0 /*UU 2, 4.5 */, case_33[0], case_33[1]); + test_traverse_union::apply("34", 1, 6.0, case_34[0], case_34[1]); + test_traverse_union::apply("35", 1, 10.5, case_35[0], case_35[1]); + test_traverse_union::apply("36", 1 /*UU 2*/, 14.375, case_36[0], case_36[1]); + + // 37-42 + test_traverse_union::apply("37", 1, 7.33333, case_37[0], case_37[1]); + test_traverse_union::apply("38", 1, 9.52857, case_38[0], case_38[1]); + test_traverse_union::apply("39", 1, 40.0, case_39[0], case_39[1]); + test_traverse_union::apply("40", 0, 0 /*UU 2, 11 */, case_40[0], case_40[1]); + test_traverse_union::apply("41", 1, 5, case_41[0], case_41[1]); + test_traverse_union::apply("42", 1, 5, case_42[0], case_42[1]); + + // 43-48 + //test_traverse_union::apply("43", 3, 8.1875, case_43[0], case_43[1]); + //test_traverse_union::apply("44", 1, 44, case_44[0], case_44[1]); + //test_traverse_union::apply("45", 1, 45, case_45[0], case_45[1]); + //test_traverse_union::apply("46", 1, 46, case_46[0], case_46[1]); + //test_traverse_union::apply("47", 1, 47, case_47[0], case_47[1]); + + // 49-54 + + test_traverse_union::apply("50", 1, 25, case_50[0], case_50[1]); + test_traverse_union::apply("51", 0, 0, case_51[0], case_51[1]); + test_traverse_union::apply("52", 1, 15.5, case_52[0], case_52[1]); + if (test_self_tangencies) + { + test_traverse_union::apply("53_st", 2, 16, case_53[0], case_53[1]); + } + test_traverse_union::apply("53_iet", + 2, 16, case_53[0], case_53[2]); + if (test_self_tangencies) + { + test_traverse_union::apply("54_st_st", 2, 20, case_54[0], case_54[2]); + test_traverse_union::apply("54_st_iet", 2, 20, case_54[0], case_54[3]); + test_traverse_union::apply("54_iet_st", 2, 20, case_54[1], case_54[2]); + } + test_traverse_union::apply("54_iet_iet", 2, 20, case_54[1], case_54[3]); + + if (test_mixed) + { + test_traverse_union::apply("55_st_iet", 2, 18, case_55[0], case_55[3]); + test_traverse_union::apply("55_iet_st", 2, 18, case_55[1], case_55[2]); + // moved to mixed + test_traverse_union::apply("55_iet_iet", 3, 18, case_55[1], case_55[3]); + } + + // 55-60 + if (test_self_tangencies) + { + // 55 with both input polygons having self tangencies (st_st) generates 1 correct shape + test_traverse_union::apply("55_st_st", 1, 18, case_55[0], case_55[2]); + // 55 with one of them self-tangency, other int/ext ring tangency generate 2 correct shapes + + test_traverse_union::apply("56", 2, 14, case_56[0], case_56[1]); + } + test_traverse_union::apply("57", 1, 14.029412, case_57[0], case_57[1]); + + if (test_self_tangencies) + { + test_traverse_union::apply("58_st", + 4, 12.16666, case_58[0], case_58[1]); + test_traverse_union::apply("59_st", + 2, 17.208333, case_59[0], case_59[1]); + test_traverse_union::apply("60_st", + 3, 19, case_60[0], case_60[1]); + } + test_traverse_union::apply("58_iet", + 4, 12.16666, case_58[0], case_58[2]); + test_traverse_union::apply("59_iet", + 1, -3.791666, // 2, 17.208333), outer ring (ii/ix) is done by ASSEMBLE + case_59[0], case_59[2]); + test_traverse_union::apply("60_iet", + 3, 19, case_60[0], case_60[2]); + test_traverse_union::apply("61_st", + 1, 4, case_61[0], case_61[1]); + + test_traverse_union::apply("70", + 1, 9, case_70[0], case_70[1]); + test_traverse_union::apply("71", + 2, 9, case_71[0], case_71[1]); + test_traverse_union::apply("72", + 1, 10.65, case_72[0], case_72[1]); + + // other + test_traverse_union::apply("box_poly5", + 2, 4.7191, + "POLYGON((1.5 1.5, 1.5 2.5, 4.5 2.5, 4.5 1.5, 1.5 1.5))", + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 2.5,4.5 2.3,5.0 2.3,5.0 2.1,4.5 2.1,4.5 1.9,4.0 1.9,4.5 1.2,4.9 0.8,2.9 0.7,2 1.3))"); + + test_traverse_intersection::apply("collinear_overlaps", + 1, 24, + collinear_overlaps[0], collinear_overlaps[1]); + test_traverse_union::apply("collinear_overlaps", + 1, 50, + collinear_overlaps[0], collinear_overlaps[1]); + + test_traverse_intersection::apply("many_situations", 1, 184, case_many_situations[0], case_many_situations[1]); + test_traverse_union::apply("many_situations", + 1, 207, case_many_situations[0], case_many_situations[1]); + + + // From "intersection piets", robustness test. + // This all went wrong in the past + // (when not all cases (get_turns) where implemented, + // especially important are some collinear (opposite) cases) + test_traverse_union::apply("pie_16_4_12", + 1, 3669665.5, pie_16_4_12[0], pie_16_4_12[1]); + test_traverse_union::apply("pie_23_21_12_500", + 1, 6295516.7185, pie_23_21_12_500[0], pie_23_21_12_500[1]); + test_traverse_union::apply("pie_23_23_3_2000", + 1, 7118735.0530, pie_23_23_3_2000[0], pie_23_23_3_2000[1]); + test_traverse_union::apply("pie_23_16_16", + 1, 5710474.5406, pie_23_16_16[0], pie_23_16_16[1]); + test_traverse_union::apply("pie_16_2_15_0", + 1, 3833641.5, pie_16_2_15_0[0], pie_16_2_15_0[1]); + test_traverse_union::apply("pie_4_13_15", + 1, 2208122.43322, pie_4_13_15[0], pie_4_13_15[1]); + test_traverse_union::apply("pie_20_20_7_100", + 1, 5577158.72823, pie_20_20_7_100[0], pie_20_20_7_100[1]); + + /* + if (test_not_valid) + { + test_traverse_union::apply("pie_5_12_12_0_7s", + 1, 3271710.48516, pie_5_12_12_0_7s[0], pie_5_12_12_0_7s[1]); + } + */ + + static const bool is_float + = boost::is_same::value; + + static const double float_might_deviate_more = is_float ? 0.1 : 0.001; // In some cases up to 1 promille permitted + + // GCC: does not everywhere handle float correctly (in our algorithms) + static bool const is_float_on_non_msvc = +#if defined(_MSC_VER) + false; +#else + is_float; +#endif + + + + // From "Random Ellipse Stars", robustness test. + // This all went wrong in the past + // when using Determinant/ra/rb and comparing with 0/1 + // Solved now by avoiding determinant / using sides + // ("hv" means "high volume") + { + double deviation = is_float ? 0.01 : 0.001; + test_traverse_union::apply("hv1", 1, 1624.508688461573, hv_1[0], hv_1[1], deviation); + test_traverse_intersection::apply("hv1", 1, 1622.7200125123809, hv_1[0], hv_1[1], deviation); + + test_traverse_union::apply("hv2", 1, 1622.9193392726836, hv_2[0], hv_2[1], deviation); + test_traverse_intersection::apply("hv2", 1, 1622.1733591429329, hv_2[0], hv_2[1], deviation); + + test_traverse_union::apply("hv3", 1, 1624.22079205664, hv_3[0], hv_3[1], deviation); + test_traverse_intersection::apply("hv3", 1, 1623.8265057282042, hv_3[0], hv_3[1], deviation); + + + if ( BOOST_GEOMETRY_CONDITION(! is_float) ) + { + test_traverse_union::apply("hv4", 1, 1626.5146964146334, hv_4[0], hv_4[1], deviation); + test_traverse_intersection::apply("hv4", 1, 1626.2580370864305, hv_4[0], hv_4[1], deviation); + test_traverse_union::apply("hv5", 1, 1624.2158307261871, hv_5[0], hv_5[1], deviation); + test_traverse_intersection::apply("hv5", 1, 1623.4506071521519, hv_5[0], hv_5[1], deviation); + + // Case 2009-12-07 + test_traverse_intersection::apply("hv6", 1, 1604.6318757402121, hv_6[0], hv_6[1], deviation); + test_traverse_union::apply("hv6", 1, 1790.091872401327, hv_6[0], hv_6[1], deviation); + + // Case 2009-12-08, needing sorting on side in enrich_intersection_points + test_traverse_union::apply("hv7", 1, 1624.5779453641017, hv_7[0], hv_7[1], deviation); + test_traverse_intersection::apply("hv7", 1, 1623.6936420295772, hv_7[0], hv_7[1], deviation); + } + } + + // From "Random Ellipse Stars", robustness test. + // This all went wrong in the past when distances (see below) were zero (dz) + // "Distance zero", dz, means: the distance between two intersection points + // on a same segment is 0, therefore it can't be sorted normally, therefore + // the chance is 50% that the segments are not sorted correctly and the wrong + // decision is taken. + // Solved now (by sorting on sides in those cases) + if ( BOOST_GEOMETRY_CONDITION(! is_float_on_non_msvc) ) + { + test_traverse_intersection::apply("dz_1", + 2, 16.887537949472005, dz_1[0], dz_1[1]); + test_traverse_union::apply("dz_1", + 3, 1444.2621305732864, dz_1[0], dz_1[1]); + + test_traverse_intersection::apply("dz_2", + 2, 68.678921274288541, dz_2[0], dz_2[1]); + test_traverse_union::apply("dz_2", + 1, 1505.4202304878663, dz_2[0], dz_2[1]); + + test_traverse_intersection::apply("dz_3", + 5, 192.49316937645651, dz_3[0], dz_3[1]); + test_traverse_union::apply("dz_3", + 5, 1446.496005965641, dz_3[0], dz_3[1]); + + test_traverse_intersection::apply("dz_4", + 1, 473.59423868207693, dz_4[0], dz_4[1]); + test_traverse_union::apply("dz_4", + 1, 1871.6125138873476, dz_4[0], dz_4[1]); + } + + // Real-life problems + + // SNL (Subsidiestelsel Natuur & Landschap - verAANnen) + + test_traverse_intersection::apply("snl-1", + 2, 286.996062095888, + snl_1[0], snl_1[1], + float_might_deviate_more); + + test_traverse_union::apply("snl-1", + 2, 51997.5408506132, + snl_1[0], snl_1[1], + float_might_deviate_more); + + { + test_traverse_intersection::apply("isov", + 1, 88.1920, isovist[0], isovist[1], + float_might_deviate_more); + test_traverse_union::apply("isov", + 1, 313.3604, isovist[0], isovist[1], + float_might_deviate_more); + } + + if ( BOOST_GEOMETRY_CONDITION(! is_float) ) + { + +/* TODO check this BSG 2013-09-24 +#if defined(_MSC_VER) + double const expected = if_typed_tt(3.63794e-17, 0.0); + int expected_count = if_typed_tt(1, 0); +#else + double const expected = if_typed(2.77555756156289135106e-17, 0.0); + int expected_count = if_typed(1, 0); +#endif + + // Calculate intersection/union of two triangles. Robustness case. + // ttmath can form a very small intersection triangle + // (which is even not accomplished by SQL Server/PostGIS) + std::string const caseid = "ggl_list_20110820_christophe"; + test_traverse_intersection::apply(caseid, + expected_count, expected, + ggl_list_20110820_christophe[0], ggl_list_20110820_christophe[1]); + test_traverse_union::apply(caseid, + 1, 67.3550722317627, + ggl_list_20110820_christophe[0], ggl_list_20110820_christophe[1]); +*/ + } + + test_traverse_union::apply("buffer_rt_f", + 1, 4.60853, + buffer_rt_f[0], buffer_rt_f[1]); + test_traverse_intersection::apply("buffer_rt_f", + 1, 0.0002943725152286, + buffer_rt_f[0], buffer_rt_f[1], 0.01); + + test_traverse_union::apply("buffer_rt_g", + 1, 16.571, + buffer_rt_g[0], buffer_rt_g[1]); + + test_traverse_union::apply("buffer_rt_g_boxes1", + 1, 20, + buffer_rt_g_boxes[0], buffer_rt_g_boxes[1]); + test_traverse_union::apply("buffer_rt_g_boxes2", + 1, 24, + buffer_rt_g_boxes[0], buffer_rt_g_boxes[2]); + test_traverse_union::apply("buffer_rt_g_boxes3", + 1, 28, + buffer_rt_g_boxes[0], buffer_rt_g_boxes[3]); + + test_traverse_union::apply("buffer_rt_g_boxes43", + 1, 30, + buffer_rt_g_boxes[4], buffer_rt_g_boxes[3]); + + test_traverse_union::apply("buffer_rt_l", + 1, 19.3995, buffer_rt_l[0], buffer_rt_l[1]); + + test_traverse_union::apply("buffer_mp2", + 1, 36.7535642, buffer_mp2[0], buffer_mp2[1], 0.01); + test_traverse_union::apply("collinear_opposite_rr", + 1, 6.41, collinear_opposite_right[0], collinear_opposite_right[1]); + test_traverse_union::apply("collinear_opposite_ll", + 1, 11.75, collinear_opposite_left[0], collinear_opposite_left[1]); + test_traverse_union::apply("collinear_opposite_ss", + 1, 6, collinear_opposite_straight[0], collinear_opposite_straight[1]); + test_traverse_union::apply("collinear_opposite_lr", + 1, 8.66, collinear_opposite_left[0], collinear_opposite_right[1]); + test_traverse_union::apply("collinear_opposite_rl", + 1, 9, collinear_opposite_right[0], collinear_opposite_left[1]); + + test_traverse_intersection::apply("ticket_7462", 1, 0.220582, ticket_7462[0], ticket_7462[1]); + + test_traverse_intersection::apply + ("ticket_9081_15", 1, 0.006889578, + ticket_9081_15[0], ticket_9081_15[1]); + +#ifdef BOOST_GEOMETRY_OVERLAY_NO_THROW + { + // NOTE: currently throws (normally) + std::string caseid = "ggl_list_20120229_volker"; + test_traverse_union::apply(caseid, + 1, 99, + ggl_list_20120229_volker[0], ggl_list_20120229_volker[1]); + test_traverse_intersection::apply(caseid, + 1, 99, + ggl_list_20120229_volker[0], ggl_list_20120229_volker[1]); + caseid = "ggl_list_20120229_volker_2"; + test_traverse_union::apply(caseid, + 1, 99, + ggl_list_20120229_volker[2], ggl_list_20120229_volker[1]); + test_traverse_intersection::apply(caseid, + 1, 99, + ggl_list_20120229_volker[2], ggl_list_20120229_volker[1]); + } +#endif +} + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) +template +void test_open() +{ + typedef bg::model::polygon + < + bg::model::point, + true, false + > polygon; + + typedef test_traverse + < + polygon, polygon, bg::overlay_intersection + > test_traverse_intersection; + typedef test_traverse + < + polygon, polygon, bg::overlay_union + > test_traverse_union; + + test_traverse_intersection::apply("open_1", 1, 5.4736, + open_case_1[0], open_case_1[1]); + test_traverse_union::apply("open_1", 1, 11.5264, + open_case_1[0], open_case_1[1]); +} + + +template +void test_ccw() +{ + typedef bg::model::polygon + < + bg::model::point, + false, true + > polygon; + + test_traverse::apply("ccw_1", 1, 5.4736, + ccw_case_1[0], ccw_case_1[1]); + test_traverse::apply("ccw_1", 1, 11.5264, + ccw_case_1[0], ccw_case_1[1]); +} +#endif + + +int test_main(int, char* []) +{ +#if defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_all(); +#else + test_all(); + test_all(); + test_open(); + test_ccw(); + +#if ! defined(_MSC_VER) + test_all(); +#endif + +#ifdef HAVE_TTMATH + test_all(); +#endif +#endif + + return 0; + } + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/overlay/traverse_ccw.cpp b/src/boost/libs/geometry/test/algorithms/overlay/traverse_ccw.cpp new file mode 100644 index 000000000..f93980860 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/traverse_ccw.cpp @@ -0,0 +1,365 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#define BOOST_GEOMETRY_DEFINE_STREAM_OPERATOR_SEGMENT_RATIO + +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include + +#if defined(TEST_WITH_SVG) +# include +#endif + +#include +#include + +#include + +template +struct rev : boost::mpl::if_c::value == bg::counterclockwise, boost::true_type, boost::false_type>::type +{}; + +template +inline typename bg::coordinate_type::type +intersect(Geometry1 const& g1, Geometry2 const& g2, std::string const& name, + bg::detail::overlay::operation_type op) +{ + boost::ignore_unused(name); + + typedef typename bg::strategy::side::services::default_strategy + < + typename bg::cs_tag::type + >::type side_strategy_type; + + + typedef typename bg::point_type::type point_type; + + typedef typename bg::rescale_policy_type::type + rescale_policy_type; + + rescale_policy_type rescale_policy + = bg::get_rescale_policy(g1, g2); + + typedef bg::detail::overlay::traversal_turn_info + < + point_type, + typename bg::detail::segment_ratio_type::type + > turn_info; + std::vector turns; + + bg::detail::get_turns::no_interrupt_policy policy; + bg::get_turns + < + rev::value, + rev::value, + bg::detail::overlay::assign_null_policy + >(g1, g2, rescale_policy, turns, policy); + + bg::enrich_intersection_points + < + rev::value, rev::value, + bg::overlay_intersection + >(turns, bg::detail::overlay::operation_intersection, + g1, g2, rescale_policy, side_strategy_type()); + + typedef bg::model::ring::type> ring_type; + typedef std::deque out_vector; + out_vector v; + + bg::detail::overlay::traverse + < + rev::value, rev::value, + Geometry1, Geometry2 + >::apply(g1, g2, op, rescale_policy, turns, v); + + typename bg::coordinate_type::type result = 0.0; + BOOST_FOREACH(ring_type& ring, v) + { + result += bg::area(ring); + } + +#if defined(TEST_WITH_SVG) + { + std::ostringstream filename; + filename + << name << "_" + << (op == bg::detail::overlay::operation_intersection ? "i" : "u") + << "_" << (rev::value ? "ccw" : "cw") + << "_" << (rev::value ? "ccw" : "cw") + << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper::type> mapper(svg, 500, 500); + mapper.add(g1); + mapper.add(g2); + + // Input shapes in green/blue + mapper.map(g1, "fill-opacity:0.5;fill:rgb(153,204,0);" + "stroke:rgb(153,204,0);stroke-width:3"); + mapper.map(g2, "fill-opacity:0.3;fill:rgb(51,51,153);" + "stroke:rgb(51,51,153);stroke-width:3"); + + // Traversal rings in magenta/light yellow fill + BOOST_FOREACH(ring_type const& ring, v) + { + mapper.map(ring, "fill-opacity:0.3;stroke-opacity:0.4;fill:rgb(255,255,0);" + "stroke:rgb(255,0,255);stroke-width:8"); + } + + + // turn points in orange, + enrichment/traversal info + + // Simple map to avoid two texts at same place (note that can still overlap!) + std::map, int> offsets; + int index = 0; + int const lineheight = 10; + int const margin = 5; + + BOOST_FOREACH(turn_info const& turn, turns) + { + mapper.map(turn.point, "fill:rgb(255,128,0);" + "stroke:rgb(0,0,0);stroke-width:1", 3); + + { + // Map characteristics + // Create a rounded off point + std::pair p + = std::make_pair( + boost::numeric_cast(0.5 + 10 * bg::get<0>(turn.point)), + boost::numeric_cast(0.5 + 10 * bg::get<1>(turn.point)) + ); + std::string style = "fill:rgb(0,0,0);font-family:Arial;font-size:10px"; + + std::ostringstream out; + out << index + << ": " << bg::method_char(turn.method) + << std::endl + << "op: " << bg::operation_char(turn.operations[0].operation) + << " / " << bg::operation_char(turn.operations[1].operation) + << (turn.is_discarded() ? " (discarded) " : turn.blocked() ? " (blocked)" : "") + << std::endl; + + if (turn.operations[0].enriched.next_ip_index != -1) + { + out << "ip: " << turn.operations[0].enriched.next_ip_index; + } + else + { + out << "vx: " << turn.operations[0].enriched.travels_to_vertex_index; + } + out << " "; + if (turn.operations[1].enriched.next_ip_index != -1) + { + out << "ip: " << turn.operations[1].enriched.next_ip_index; + } + else + { + out << "vx: " << turn.operations[1].enriched.travels_to_vertex_index; + } + + out << std::endl; + + out + + << std::setprecision(3) + << "dist: " << turn.operations[0].fraction + << " / " << turn.operations[1].fraction + << std::endl; + + offsets[p] += lineheight; + int offset = offsets[p]; + offsets[p] += lineheight * 5; + mapper.text(turn.point, out.str(), style, margin, offset, lineheight); + } + index++; + } + } +#endif + + return result; +} + +template +inline typename bg::coordinate_type::type intersect(std::string const& wkt1, std::string const& wkt2, std::string const& name, + bg::detail::overlay::operation_type op) +{ + Geometry1 geometry1; + Geometry2 geometry2; + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); + + // Reverse if necessary: adapt to cw/ccw + bg::correct(geometry1); + bg::correct(geometry2); + + return intersect(geometry1, geometry2, name, op); +} + +template +inline void test_polygon(std::string const& wkt1, std::string const& wkt2, std::string const& name) +{ + typedef bg::model::d2::point_xy point; + typedef bg::model::polygon clock; + typedef bg::model::polygon counter; + + namespace ov = bg::detail::overlay; + T area1 = intersect(wkt1, wkt2, name, ov::operation_intersection); + T area2 = intersect(wkt1, wkt2, name, ov::operation_intersection); + T area3 = intersect(wkt1, wkt2, name, ov::operation_intersection); + T area4 = intersect(wkt1, wkt2, name, ov::operation_intersection); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area3, area4, 0.001); + BOOST_CHECK_CLOSE(area1, area3, 0.001); + BOOST_CHECK_CLOSE(area2, area4, 0.001); + + area1 = intersect(wkt1, wkt2, name, ov::operation_union); + area2 = intersect(wkt1, wkt2, name, ov::operation_union); + area3 = intersect(wkt1, wkt2, name, ov::operation_union); + area4 = intersect(wkt1, wkt2, name, ov::operation_union); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area3, area4, 0.001); + BOOST_CHECK_CLOSE(area1, area3, 0.001); + BOOST_CHECK_CLOSE(area2, area4, 0.001); +} + +template +inline void test_box_polygon(std::string const& wkt1, std::string const& wkt2, std::string const& name) +{ + typedef bg::model::d2::point_xy point; + typedef bg::model::box box; + typedef bg::model::polygon clock; + typedef bg::model::polygon counter; + + namespace ov = bg::detail::overlay; + T area1 = intersect(wkt1, wkt2, name + "_bp", ov::operation_intersection); + T area2 = intersect(wkt1, wkt2, name + "_bp", ov::operation_intersection); + T area3 = intersect(wkt2, wkt1, name + "_pb", ov::operation_intersection); + T area4 = intersect(wkt2, wkt1, name + "_pb", ov::operation_intersection); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area3, area4, 0.001); + BOOST_CHECK_CLOSE(area1, area3, 0.001); + BOOST_CHECK_CLOSE(area2, area4, 0.001); + + area1 = intersect(wkt1, wkt2, name + "_bp", ov::operation_union); + area2 = intersect(wkt1, wkt2, name + "_bp", ov::operation_union); + area3 = intersect(wkt2, wkt1, name + "_pb", ov::operation_union); + area4 = intersect(wkt2, wkt1, name + "_pb", ov::operation_union); + BOOST_CHECK_CLOSE(area1, area2, 0.001); + BOOST_CHECK_CLOSE(area3, area4, 0.001); + BOOST_CHECK_CLOSE(area1, area3, 0.001); + BOOST_CHECK_CLOSE(area2, area4, 0.001); +} + +int test_main(int, char* []) +{ + //bool const ig = true; + test_polygon(case_1[0], case_1[1], "c1"); + test_polygon(case_2[0], case_2[1], "c2"); + test_polygon(case_3[0], case_3[1], "c3"); + test_polygon(case_4[0], case_4[1], "c4"); + test_polygon(case_5[0], case_5[1], "c5"); + test_polygon(case_6[0], case_6[1], "c6"); + test_polygon(case_7[0], case_7[1], "c7"); + test_polygon(case_8[0], case_8[1], "c8"); + test_polygon(case_9[0], case_9[1], "c9" /*, ig */); + + + test_polygon(case_10[0], case_10[1], "c10"); + test_polygon(case_11[0], case_11[1], "c11"); + test_polygon(case_12[0], case_12[1], "c12"); + test_polygon(case_13[0], case_13[1], "c13"); + test_polygon(case_14[0], case_14[1], "c14"); + test_polygon(case_15[0], case_15[1], "c15"); + test_polygon(case_16[0], case_16[1], "c16"); + test_polygon(case_17[0], case_17[1], "c17"); + test_polygon(case_18[0], case_18[1], "c18"); + test_polygon(case_19[0], case_19[1], "c19"); + test_polygon(case_20[0], case_20[1], "c20"); + test_polygon(case_21[0], case_21[1], "c21"); + test_polygon(case_22[0], case_22[1], "c22" /*, ig */); + test_polygon(case_23[0], case_23[1], "c23"); + test_polygon(case_24[0], case_24[1], "c24"); + test_polygon(case_25[0], case_25[1], "c25" /*, ig */); + test_polygon(case_26[0], case_26[1], "c26" /*, ig */); + test_polygon(case_27[0], case_27[1], "c27"); + test_polygon(case_28[0], case_28[1], "c28"); + test_polygon(case_29[0], case_29[1], "c29"); + test_polygon(case_30[0], case_30[1], "c30"); + test_polygon(case_31[0], case_31[1], "c31" /*, ig */); + test_polygon(case_32[0], case_32[1], "c32" /*, ig */); + test_polygon(case_33[0], case_33[1], "c33" /*, ig */); + test_polygon(case_34[0], case_34[1], "c34"); + test_polygon(case_35[0], case_35[1], "c35"); + test_polygon(case_36[0], case_36[1], "c36" /*, ig */); + test_polygon(case_37[0], case_37[1], "c37" /*, ig */); + test_polygon(case_38[0], case_38[1], "c38" /*, ig */); + test_polygon(case_39[0], case_39[1], "c39"); + test_polygon(case_40[0], case_40[1], "c40" /*, ig */); + test_polygon(case_41[0], case_41[1], "c41"); + test_polygon(case_42[0], case_42[1], "c42"); + //test_polygon(case_43[0], case_43[1], "c43", inv); + test_polygon(case_44[0], case_44[1], "c44"); + test_polygon(case_45[0], case_45[1], "c45"); + //test_polygon(case_46[0], case_46[1], "c46", inv); + //test_polygon(case_47[0], case_47[1], "c47" /*, ig */); + //test_polygon(case_48[0], case_48[1], "c48"); + test_polygon(case_49[0], case_49[1], "c49"); + test_polygon(case_50[0], case_50[1], "c50"); + test_polygon(case_51[0], case_51[1], "c51"); + test_polygon(case_52[0], case_52[1], "c52" /*, ig */); + test_polygon(case_53[0], case_53[1], "c53"); + // Invalid ones / overlaying intersection points / self tangencies + //test_polygon(case_54[0], case_54[1], "c54"); + //test_polygon(case_55[0], case_55[1], "c55"); + //test_polygon(case_56[0], case_56[1], "c56"); + //test_polygon(case_57[0], case_57[1], "c57" /*, ig */); + //test_polygon(case_58[0], case_58[1], "c58"); + //test_polygon(case_59[0], case_59[1], "c59"); + + test_polygon(pie_16_4_12[0], pie_16_4_12[1], "pie_16_4_12"); + test_polygon(pie_23_21_12_500[0], pie_23_21_12_500[1], "pie_23_21_12_500"); + test_polygon(pie_23_23_3_2000[0], pie_23_23_3_2000[1], "pie_23_23_3_2000"); + test_polygon(pie_23_16_16[0], pie_23_16_16[1], "pie_23_16_16"); + test_polygon(pie_16_2_15_0[0], pie_16_2_15_0[1], "pie_16_2_15_0"); + test_polygon(pie_4_13_15[0], pie_4_13_15[1], "pie_4_13_15"); + test_polygon(pie_20_20_7_100[0], pie_20_20_7_100[1], "pie_20_20_7_100"); + + test_polygon(hv_1[0], hv_1[1], "hv1"); + test_polygon(hv_2[0], hv_2[1], "hv2"); + test_polygon(hv_3[0], hv_3[1], "hv3"); + test_polygon(hv_4[0], hv_4[1], "hv4"); + test_polygon(hv_5[0], hv_5[1], "hv5"); + test_polygon(hv_6[0], hv_6[1], "hv6"); + test_polygon(hv_7[0], hv_7[1], "hv7"); + test_polygon(dz_1[0], dz_1[1], "dz_1"); + test_polygon(dz_2[0], dz_2[1], "dz_2"); + test_polygon(dz_3[0], dz_3[1], "dz_3"); + + test_box_polygon("POLYGON((1 1,4 4))", case_1[0], "bp1"); + + { + static std::string example_box = "POLYGON((1.5 1.5, 4.5 2.5))"; + static std::string example_ring = + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))"; + test_box_polygon(example_box, example_ring, "bp2"); + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp b/src/boost/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp new file mode 100644 index 000000000..335e8ce34 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp @@ -0,0 +1,208 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#error This unit test is not updated for several years + + +#if defined(_MSC_VER) +#pragma warning( disable : 4244 ) +#pragma warning( disable : 4267 ) +#endif + +//#define GEOMETRY_DEBUG_INTERSECTION + + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + + + +#include + +#if defined(TEST_WITH_SVG) +# include +#endif + + + +template +void test_traverse(std::string const& caseid, G1 const& g1, G2 const& g2) +{ + typedef bg::detail::intersection::intersection_point + ::type> ip; + typedef typename boost::range_const_iterator >::type iterator; + typedef std::vector ip_vector; + ip_vector ips; + + typedef typename bg::strategy::side::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy_type; + + + typedef bg::detail::overlay::traversal_turn_info + < + typename bg::point_type::type + > turn_info; + typedef typename boost::range_iterator >::type iterator; + std::vector ips; + + bg::get_turns(g1, g2, ips); + bg::enrich_intersection_points(ips, g1, g2, strategy_type()); + + typedef bg::model::ring::type> ring_type; + typedef std::vector out_vector; + out_vector v; + + + + bg::traverse + < + strategy_type, + ring_type + > + ( + g1, g2, -1, ips, std::back_inserter(v) + ); + + + +#if defined(TEST_WITH_SVG) + { + std::ostringstream filename; + filename << "intersection_" << caseid << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + // Trick to have this always LongDouble + //typedef bg::model::d2::point_xy P; + typedef typename bg::point_type::type P; + //typename bg::replace_point_type::type rg1; + //typename bg::replace_point_type::type rg2; + + bg::svg_mapper

mapper(svg, 1000, 800); + + mapper.add(g1); + mapper.add(g2); + + // Input shapes in green/blue + mapper.map(g1, "opacity:0.8;fill:rgb(0,255,0);" + "stroke:rgb(0,0,0);stroke-width:1"); + mapper.map(g2, "opacity:0.8;fill:rgb(0,0,255);" + "stroke:rgb(0,0,0);stroke-width:1"); + + // Traversal rings in red + for (typename out_vector::const_iterator it = boost::begin(v); + it != boost::end(v); + ++it) + { + mapper.map(*it, "fill-opacity:0.1;stroke-opacity:0.9;" + "fill:rgb(255,0,0);stroke:rgb(255,0,0);stroke-width:5"); + + std::cout << bg::wkt(*it) << std::endl; + std::cout << bg::area(*it) << std::endl; + } + + // IP's in orange + for (iterator it = boost::begin(ips); it != boost::end(ips); ++it) + { + mapper.map(it->point, "fill:rgb(255,128,0);" + "stroke:rgb(0,0,100);stroke-width:1"); + } + } +#endif +} + +template +void test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2) +{ + G1 g1; + bg::read_wkt(wkt1, g1); + + G2 g2; + bg::read_wkt(wkt2, g2); + + bg::correct(g1); + bg::correct(g2); + std::cout << "area1 " << bg::area(g1) << " " << " area2: " << bg::area(g2) << std::endl; + + test_traverse(caseid, g1, g2); +} + + +#if ! defined(GEOMETRY_TEST_MULTI) + +template +void test_traverse_gmp(std::string const& caseid) +{ + typedef bg::model::polygon

polygon; + std::cout << typeid(typename bg::coordinate_type

::type).name() << std::endl; + std::cout << std::setprecision(30) << std::numeric_limits::epsilon() << std::endl; + std::cout << std::setprecision(30) << std::numeric_limits::epsilon() << std::endl; + std::cout << std::setprecision(30) << std::numeric_limits::epsilon() << std::endl; + + static std::string brandon[3] = + { + //37.43402099609375 1.470055103302002, + "POLYGON((37.29449462890625 1.7902572154998779,37.000419616699219 1.664225697517395,37.140213012695313 1.3446992635726929,50.974888957147442 -30.277285722290763,57.297810222148939 -37.546793343968417,41.590042114257813 -7.2021245956420898,40.6978759765625 -5.4500408172607422,40.758884429931641 -5.418975830078125,42.577911376953125 -4.4901103973388672,42.577877044677734 -4.4900407791137695,42.699958801269531 -4.4278755187988281,46.523914387974358 -8.5152102535033496,47.585065917176543 -6.1314922196594779,45.389434814453125 -4.5143837928771973,46.296027072709599 -2.4984308554828116,37.29449462890625 1.7902572154998779))", + "POLYGON((42.399410247802734 1.4956772327423096,42.721500396728516 2.2342472076416016,42.721500396728516 3.6584999561309814,51.20102152843122 7.1738039562841562,51.370888500897557 7.4163459734570729,37.43402099609375 1.470055103302002,37.29449462890625 1.7902572154998779,37.000419616699219 1.664225697517395,37.140213012695313 1.3446992635726929,36.954700469970703 1.2597870826721191,26.472516656201325 -3.5380830513658776,27.069889344709196 -4.2926591211028242,30.501169204711914 -2.3718316555023193,32.708126068115234 -2.3611266613006592,32.708126068115234 -2.3611700534820557,32.708168029785156 -2.3611698150634766,32.718830108642578 -4.3281683921813965,29.135100397190627 -8.9262827849488211,29.619997024536133 -9.5368013381958008,30.339155197143555 -8.9838371276855469,30.670633316040039 -8.8180980682373047,30.896280288696289 -9.1206979751586914,30.207040612748258 -10.275926149505661,30.947774887084961 -11.208560943603516,31.669155120849609 -10.653837203979492,32.000633239746094 -10.488097190856934,32.226280212402344 -10.790698051452637,31.682494778186321 -12.133624901803865,32.274600982666016 -12.879127502441406,32.998821258544922 -12.323249816894531,33.339523315429688 -12.147735595703125,33.566280364990234 -12.450697898864746,33.164891643669634 -14.000060288415174,33.598796844482422 -14.546377182006836,34.328716278076172 -13.992490768432617,34.658355712890625 -13.81736946105957,34.886280059814453 -14.120697975158691,34.634240447128811 -15.85007183479255,34.931102752685547 -16.223842620849609,35.656356811523438 -15.66030216217041,35.963497161865234 -15.476018905639648,37.326129913330078 -17.190576553344727,38.823680877685547 -16.296066284179688,39.966808319091797 -17.625011444091797,40.800632476806641 -17.208097457885742,41.821544647216797 -19.211688995361328,41.988733475572282 -19.945838749437218,57.524304765518266 -37.807195733984784,41.590042114257813 -7.2021245956420898,40.6978759765625 -5.4500408172607422,40.758884429931641 -5.418975830078125,42.577911376953125 -4.4901103973388672,42.577877044677734 -4.4900407791137695,42.699958801269531 -4.4278755187988281,46.559533858616469 -8.435196445683264,47.604561877161387 -6.087697464505224,45.389434814453125 -4.5143837928771973,46.695858001708984 -1.6093428134918213,47.263670054709685 -1.784876824891044,47.830955505371094 -0.69758313894271851,48.43512638981781 -0.81299959072453376,49.071769542946825 0.61489892713413252,43.764598846435547 0.93951499462127686,43.644271850585938 0.96149998903274536,42.399410247802734 1.4956772327423096))", + "POLYGON((43.644271850585938 0.96149998903274536,43.764598846435547 0.93951499462127686,49.071769542946825 0.61489892713413252,48.43512638981781 -0.81299959072453376,47.830955505371094 -0.69758313894271851,47.263670054709685 -1.784876824891044,46.695858001708984 -1.6093428134918213,45.389434814453125 -4.5143837928771973,47.604561877161387 -6.087697464505224,46.559533858616469 -8.435196445683264,42.699958801269531 -4.4278755187988281,42.577877044677734 -4.4900407791137695,42.577911376953125 -4.4901103973388672,40.758884429931641 -5.418975830078125,40.6978759765625 -5.4500408172607422,41.590042114257813 -7.2021245956420898,57.524304765518266 -37.807195733984784,41.988733475572282 -19.945838749437218,41.821544647216797 -19.211688995361328,40.800632476806641 -17.208097457885742,39.966808319091797 -17.625011444091797,38.823680877685547 -16.296066284179688,37.326129913330078 -17.190576553344727,35.963497161865234 -15.476018905639648,35.656356811523438 -15.66030216217041,34.931102752685547 -16.223842620849609,34.634240447128811 -15.85007183479255,34.886280059814453 -14.120697975158691,34.658355712890625 -13.81736946105957,34.328716278076172 -13.992490768432617,33.598796844482422 -14.546377182006836,33.164891643669634 -14.000060288415174,33.566280364990234 -12.450697898864746,33.339523315429688 -12.147735595703125,32.998821258544922 -12.323249816894531,32.274600982666016 -12.879127502441406,31.682494778186321 -12.133624901803865,32.226280212402344 -10.790698051452637,32.000633239746094 -10.488097190856934,31.669155120849609 -10.653837203979492,30.947774887084961 -11.208560943603516,30.207040612748258 -10.275926149505661,30.896280288696289 -9.1206979751586914,30.670633316040039 -8.8180980682373047,30.339155197143555 -8.9838371276855469,29.619997024536133 -9.5368013381958008,29.135100397190627 -8.9262827849488211,32.718830108642578 -4.3281683921813965,32.708168029785156 -2.3611698150634766,32.708126068115234 -2.3611700534820557,32.708126068115234 -2.3611266613006592,30.501169204711914 -2.3718316555023193,27.069889344709196 -4.2926591211028242,26.472516656201325 -3.5380830513658776,36.954700469970703 1.2597870826721191,37.140213012695313 1.3446992635726929,37.000419616699219 1.664225697517395,37.29449462890625 1.7902572154998779,37.43402099609375 1.470055103302002,51.370888500897557 7.4163459734570729,51.20102152843122 7.1738039562841562,42.721500396728516 3.6584999561309814,42.721500396728516 2.2342472076416016,42.399410247802734 1.4956772327423096,43.644271850585938 0.96149998903274536))" + }; + + + // Test the FORWARD case + test_one(caseid, brandon[0], brandon[1]); +} +#endif + + + +int main(int argc, char** argv) +{ + int mode = (argc > 1) ? atol(argv[1]) : 1; + switch(mode) + { + case 1 : + test_traverse_gmp >("float"); + break; + case 2 : + test_traverse_gmp >("double"); + break; + case 3 : + test_traverse_gmp >("long double"); + break; + case 4 : + #if defined(HAVE_TTMATH) + test_traverse_gmp >("ttmath_big"); + #endif + break; + } + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/overlay/traverse_multi.cpp b/src/boost/libs/geometry/test/algorithms/overlay/traverse_multi.cpp new file mode 100644 index 000000000..dd20f9567 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/overlay/traverse_multi.cpp @@ -0,0 +1,462 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +//#define BOOST_GEOMETRY_DEBUG_ENRICH +//#define BOOST_GEOMETRY_DEBUG_RELATIVE_ORDER + +// Include the single-geometry version +#define BOOST_GEOMETRY_TEST_MULTI +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + + +#include "multi_overlay_cases.hpp" + + + +template +void test_geometries() +{ + typedef test_traverse + < + MultiPolygon, MultiPolygon, + bg::overlay_intersection, Reverse, Reverse + > test_traverse_intersection; + typedef test_traverse + < + MultiPolygon, MultiPolygon, + bg::overlay_union, Reverse, Reverse + > test_traverse_union; + + // Intersections: + test_traverse_intersection::apply + ( + "simplex", 2, 6.42, + case_multi_simplex[0], case_multi_simplex[1] + ); + + test_traverse_intersection::apply + ( + "case_58_multi_b4", 1, 12.666666667, + case_58_multi[4], case_58_multi[2] + ); + +#ifdef BOOST_GEOMETRY_TEST_FAILURES + test_traverse_intersection::apply + ( + "case_58_multi_b5", 1, 1, + case_58_multi[5], case_58_multi[2] + ); +#endif + test_traverse_intersection::apply + ( + "case_58_multi_b6", 1, 13.25, + case_58_multi[6], case_58_multi[2] + ); + + test_traverse_intersection::apply + ( + "case_65_multi", 1, 1, + case_65_multi[0], case_65_multi[1] + ); + test_traverse_intersection::apply + ( + "case_66_multi", 1, 1, + case_66_multi[0], case_66_multi[1] + ); + + test_traverse_intersection::apply + ( + "case_67_multi", 1, 1, + case_67_multi[0], case_67_multi[1] + ); + test_traverse_intersection::apply + ( + "case_69_multi", 1, 1, + case_69_multi[0], case_69_multi[1] + ); + + test_traverse_intersection::apply + ( + "case_71_multi", 2, 2, + case_71_multi[0], case_71_multi[1] + ); + + // #72, note that it intersects into 2 shapes, + // the third one is done by assemble (see intersection #72) + test_traverse_intersection::apply + ( + "case_72_multi", 2, 1.35, + case_72_multi[0], case_72_multi[1] + ); + + test_traverse_intersection::apply + ( + "case_73_multi", 2, 2, + case_73_multi[0], case_73_multi[1] + ); + test_traverse_intersection::apply + ( + "case_74_multi", 2, 3, + case_74_multi[0], case_74_multi[1] + ); + test_traverse_intersection::apply + ( + "case_75_multi", 1, 1, + case_75_multi[0], case_75_multi[1] + ); + test_traverse_intersection::apply + ( + "case_77_multi", 5, 9, + case_77_multi[0], case_77_multi[1] + ); + test_traverse_intersection::apply + ( + "case_78_multi", 2, 22, // Went from 3 to 2 by get_turns / partition + case_78_multi[0], case_78_multi[1] + ); + + test_traverse_intersection::apply + ( + "case_80_multi", 1, 0.5, + case_80_multi[0], case_80_multi[1] + ); + test_traverse_intersection::apply + ( + "case_81_multi", 1, 0.25, + case_81_multi[0], case_81_multi[1] + ); + test_traverse_intersection::apply + ( + "case_83_multi", 3, 1.25, + case_83_multi[0], case_83_multi[1] + ); + + test_traverse_intersection::apply + ( + "case_91_multi", 2, 1.0, + case_91_multi[0], case_91_multi[1] + ); + test_traverse_intersection::apply + ( + "case_92_multi", 3, 1.5, + case_92_multi[0], case_92_multi[1] + ); + test_traverse_intersection::apply + ( + "case_93_multi", 2, 1.25, + case_93_multi[0], case_93_multi[1] + ); + test_traverse_intersection::apply + ( + "case_96_multi", 1, 0.5, + case_96_multi[0], case_96_multi[1] + ); + test_traverse_intersection::apply + ( + "case_98_multi", 4, 3.0, + case_98_multi[0], case_98_multi[1] + ); + + test_traverse_intersection::apply + ( + "case_99_multi", 3, 1.75, + case_99_multi[0], case_99_multi[1] + ); + test_traverse_intersection::apply + ( + "case_100_multi", 2, 1.5, + case_100_multi[0], case_100_multi[1] + ); + + test_traverse_intersection::apply + ( + "case_108_multi", 7, 7.5, + case_108_multi[0], case_108_multi[1] + ); + + test_traverse_intersection::apply + ( + "case_recursive_boxes_2", 1, 91, + case_recursive_boxes_2[0], case_recursive_boxes_2[1] + ); + test_traverse_intersection::apply + ( + "case_107_multi", 2, 1.5, + case_107_multi[0], case_107_multi[1] + ); + test_traverse_intersection::apply + ( + "case_recursive_boxes_3", 19, 12.5, + case_recursive_boxes_3[0], case_recursive_boxes_3[1] + ); + + // Unions + + + test_traverse_union::apply + ( + "simplex", 1, 14.58, + case_multi_simplex[0], case_multi_simplex[1] + ); + + test_traverse_union::apply + ( + "case_61_multi", 1, 4, + case_61_multi[0], case_61_multi[1] + ); + test_traverse_union::apply + ( + "case_62_multi", 1, 1 /*UU 2, 2 */, + case_62_multi[0], case_62_multi[1] + ); + test_traverse_union::apply + ( + "case_63_multi", 1, 1 /*UU 2, 2 */, + case_63_multi[0], case_63_multi[1] + ); + test_traverse_union::apply + ( + "case_64_multi", 1, 3, + case_64_multi[0], case_64_multi[1] + ); + + test_traverse_union::apply + ( + "case_66_multi", 1, 4 /*UU 3, 7 */, + case_66_multi[0], case_66_multi[1] + ); + test_traverse_union::apply + ( + "case_68_multi", 1, 4 /*UU 2, 5 */, + case_68_multi[0], case_68_multi[1] + ); + // 71: single-polygon generates 2 shapes, multi-polygon + // generates 1 shape, both are self-tangent and OK + test_traverse_union::apply + ( + "case_71_multi", 1, 9, + case_71_multi[0], case_71_multi[1] + ); + + test_traverse_union::apply + ( + "case_72_multi", 1, 10.65, + case_72_multi[0], case_72_multi[1] + ); + + test_traverse_union::apply + ( + "case_73_multi", 1, 3, + case_73_multi[0], case_73_multi[1] + ); + test_traverse_union::apply + ( + "case_74_multi", 2, 17, + case_74_multi[0], case_74_multi[1] + ); + test_traverse_union::apply + ( + "case_75_multi", 1, 1 /*UU 5, 5 */, + case_75_multi[0], case_75_multi[1] + ); + test_traverse_union::apply + ( + "case_76_multi", 2, 5 /*UU 6, 6 */, + case_76_multi[0], case_76_multi[1] + ); + + test_traverse_union::apply + ( + "case_80_multi", 1, 9.25, + case_80_multi[0], case_80_multi[1] + ); + test_traverse_union::apply + ( + "case_81_multi", 1, 3.25, + case_81_multi[0], case_81_multi[1] + ); + test_traverse_union::apply + ( + "case_82_multi", 3, 4, + case_82_multi[0], case_82_multi[1] + ); + test_traverse_union::apply + ( + "case_84_multi", 1, 4, + case_84_multi[0], case_84_multi[1] + ); + test_traverse_union::apply + ( + "case_85_multi", 1, 3.5, + case_85_multi[0], case_85_multi[1] + ); + test_traverse_union::apply + ( + "case_86_multi", 1, 4, + case_86_multi[0], case_86_multi[1] + ); + test_traverse_union::apply + ( + "case_87_multi", 1, 6, + case_87_multi[0], case_87_multi[1] + ); + test_traverse_union::apply + ( + "case_88_multi", 2, 4, + case_88_multi[0], case_88_multi[1] + ); + test_traverse_union::apply + ( + "case_89_multi", 1, 6, + case_89_multi[0], case_89_multi[1] + ); + test_traverse_union::apply + ( + "case_90_multi", 1, 7.5, + case_90_multi[0], case_90_multi[1] + ); + test_traverse_union::apply + ( + "case_92_multi", 2, 6.25, + case_92_multi[0], case_92_multi[1] + ); + test_traverse_union::apply + ( + "case_94_multi", 1, 10.0, + case_94_multi[0], case_94_multi[1] + ); + test_traverse_union::apply + ( + "case_95_multi", 2, 6.5, + case_95_multi[0], case_95_multi[1] + ); + test_traverse_union::apply + ( + "case_96_multi", 1, 3.5, + case_96_multi[0], case_96_multi[1] + ); + test_traverse_union::apply + ( + "case_97_multi", 1, 3.75, + case_97_multi[0], case_97_multi[1] + ); + test_traverse_union::apply + ( + "case_101_multi", 1, 22.25, + case_101_multi[0], case_101_multi[1] + ); + test_traverse_union::apply + ( + "case_102_multi", 3, 24.25, + case_102_multi[0], case_102_multi[1] + ); + test_traverse_union::apply + ( + "case_103_multi", 1, 25, + case_103_multi[0], case_103_multi[1] + ); + test_traverse_union::apply + ( + "case_104_multi", 1, 25, + case_104_multi[0], case_104_multi[1] + ); + test_traverse_union::apply + ( + "case_105_multi", 1, 25, + case_105_multi[0], case_105_multi[1] + ); + test_traverse_union::apply + ( + "case_106_multi", 1, 25, + case_106_multi[0], case_106_multi[1] + ); + + + test_traverse_union::apply + ( + "case_recursive_boxes_1", 2, 97, + case_recursive_boxes_1[0], case_recursive_boxes_1[1] + ); + + test_traverse_union::apply + ( + "case_recursive_boxes_3", 7, 49.5, + case_recursive_boxes_3[0], case_recursive_boxes_3[1] + ); + + test_traverse_intersection::apply + ( + "pie_21_7_21_0_3", 2, 818824.56678, + pie_21_7_21_0_3[0], pie_21_7_21_0_3[1] + ); + + test_traverse_intersection::apply + ( + "pie_23_19_5_0_2", 2, 2948602.3911823, + pie_23_19_5_0_2[0], pie_23_19_5_0_2[1] + ); + test_traverse_intersection::apply + ( + "pie_7_14_5_0_7", 2, 490804.56678, + pie_7_14_5_0_7[0], pie_7_14_5_0_7[1] + ); + test_traverse_intersection::apply + ( + "pie_16_16_9_0_2", 2, 1146795, + pie_16_16_9_0_2[0], pie_16_16_9_0_2[1] + ); + test_traverse_intersection::apply + ( + "pie_7_2_1_0_15", 2, 490585.5, + pie_7_2_1_0_15[0], pie_7_2_1_0_15[1] + ); + +} + +template +void test_all() +{ + typedef bg::model::point point_type; + + typedef bg::model::multi_polygon + < + bg::model::polygon + > multi_polygon; + + typedef bg::model::multi_polygon + < + bg::model::polygon + > multi_polygon_ccw; + + test_geometries(); + test_geometries(); +} + + +int test_main(int, char* []) +{ + test_all(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/perimeter.cpp b/src/boost/libs/geometry/test/algorithms/perimeter.cpp new file mode 100644 index 000000000..54fcd3c57 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/perimeter.cpp @@ -0,0 +1,63 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#include +#include + +#include + + +template +void test_all() +{ + // 3-4-5 triangle + //test_geometry >("LINESTRING(0 0,3 4)", 5); + + test_geometry >( + "POLYGON((0 0,0 1,1 1,1 0,0 0))", 4); + test_geometry >( + "POLYGON((0 0,0 1,1 0,0 0))", 1.0 + 1.0 + sqrt(2.0)); + test_geometry >( + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,2 1,2 2,1 2,1 1))", 20); +} + +template +void test_open() +{ + typedef bg::model::polygon open_polygon; + test_geometry("POLYGON((0 0,0 1,1 1,1 0))", 4); +} + +template +void test_empty_input() +{ + bg::model::polygon

poly_empty; + bg::model::ring

ring_empty; + + test_empty_input(poly_empty); + test_empty_input(ring_empty); +} + +int test_main(int, char* []) +{ + //test_all >(); + test_all >(); + test_all >(); + + test_open >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + // test_empty_input >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/perimeter/Jamfile b/src/boost/libs/geometry/test/algorithms/perimeter/Jamfile new file mode 100644 index 000000000..79fea5d4f --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/perimeter/Jamfile @@ -0,0 +1,16 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2016 Oracle and/or its affiliates. +# +# Contributed and/or modified by Vissarion Fisikopoulos, 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) + +test-suite boost-geometry-algorithms-perimeter + : + [ run perimeter.cpp : : : : algorithms_perimeter ] + [ run perimeter_geo.cpp : : : : algorithms_perimeter_geo ] + [ run perimeter_sph.cpp : : : : algorithms_perimeter_sph ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/perimeter/perimeter.cpp b/src/boost/libs/geometry/test/algorithms/perimeter/perimeter.cpp new file mode 100644 index 000000000..c30389fde --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/perimeter/perimeter.cpp @@ -0,0 +1,66 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2016 Oracle and/or its affiliates. +// Contributed and/or modified by Vissarion Fisikopoulos, 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) + +#include + +#include +#include + +template +void test_all() +{ + // Simple + test_geometry >("POLYGON((0 0,3 4,4 3,0 0))", + 5 + sqrt(2.0) + 5); + // Non-simple + test_geometry >("POLYGON((0 0,3 4,4 3,0 3,0 0))", + 5 + sqrt(2.0) + 4 + 3); + // With holes + test_geometry >("POLYGON((0 0,3 4,4 3,0 0),\ + (2 2,3 4,3 3,2 2))", + 5 + sqrt(2.0) + 5 + + sqrt(5.0) + 1 + sqrt(2.0)); + // Repeated points + test_geometry >("POLYGON((0 0,3 4,3 4,3 4,4 3,4 3,\ + 4 3,4 3,4 3,4 3,0 3,0 0))", + 5 + sqrt(2.0) + 4 + 3); + // Multipolygon + test_geometry > > + ( + "MULTIPOLYGON(((0 0,3 4,4 3,0 0)), ((0 0,3 4,4 3,0 3,0 0)))", + 5 + sqrt(2.0) + 5 + 5 + sqrt(2.0) + 4 + 3 + ); + + // Geometries with perimeter zero + test_geometry

("POINT(0 0)", 0); + test_geometry >("LINESTRING(0 0,3 4,4 3)", 0); +} + +template +void test_empty_input() +{ + test_empty_input(bg::model::polygon

()); + test_empty_input(bg::model::multi_polygon >()); +} + +int test_main(int, char* []) +{ + test_all >(); + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + // test_empty_input >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/perimeter/perimeter_geo.cpp b/src/boost/libs/geometry/test/algorithms/perimeter/perimeter_geo.cpp new file mode 100644 index 000000000..403f87b0b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/perimeter/perimeter_geo.cpp @@ -0,0 +1,124 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2016-2017 Oracle and/or its affiliates. +// Contributed and/or modified by Vissarion Fisikopoulos, 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) + +#include +#include + +#include +#include + +template +struct geo_strategies +{ + // Set radius type, but for integer coordinates we want to have floating + // point radius type + typedef typename bg::promote_floating_point + < + typename bg::coordinate_type

::type + >::type rtype; + + typedef bg::srs::spheroid stype; + typedef bg::strategy::distance::andoyer andoyer_type; + typedef bg::strategy::distance::thomas thomas_type; + typedef bg::strategy::distance::vincenty vincenty_type; +}; + +template +void test_default() //this should use andoyer strategy +{ + for (std::size_t i = 0; i <= 2; ++i) + { + test_geometry >(poly_data_geo[i], + 1116814.237 + 1116152.605); + } + + //since the geodesic distance is the shortest path it should go over the pole + //in this case; thus the correct perimeter is the meridian length (below) + //and not 40075160 which is the legth of the equator + test_geometry >(poly_data_geo[3], + 40007834.7139); + + //force to use equator path + test_geometry >(poly_data_geo[4], + 40075016.6856); + + // Multipolygon + test_geometry > > + (multipoly_data[0], 60011752.0709); + + // Geometries with length zero + test_geometry

("POINT(0 0)", 0); + test_geometry >("LINESTRING(0 0,0 1,1 1,1 0,0 0)", + 0); +} + +template +void test_with_strategy(N exp_length, Strategy strategy) +{ + for (std::size_t i = 0; i <= 2; ++i) + { + test_geometry >(poly_data_geo[i], + exp_length, + strategy); + } + // Geometries with length zero + test_geometry

("POINT(0 0)", 0, strategy); + test_geometry >("LINESTRING(0 0,0 1,1 1,1 0,0 0)", + 0, + strategy); +} + +template +void test_andoyer() +{ + typename geo_strategies

::andoyer_type andoyer; + test_with_strategy

(1116814.237 + 1116152.605, andoyer); +} + +template +void test_thomas() +{ + typename geo_strategies

::thomas_type thomas; + test_with_strategy

(1116825.795 + 1116158.7417, thomas); +} + +template +void test_vincenty() +{ + typename geo_strategies

::vincenty_type vincenty; + test_with_strategy

(1116825.857 + 1116159.144, vincenty); +} + +template +void test_all() +{ + test_default

(); + test_andoyer

(); + test_thomas

(); + test_vincenty

(); +} + +int test_main(int, char* []) +{ + // Works only for double(?!) + //test_all > >(); + //test_all > >(); + test_all > >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} + diff --git a/src/boost/libs/geometry/test/algorithms/perimeter/perimeter_polygon_cases.hpp b/src/boost/libs/geometry/test/algorithms/perimeter/perimeter_polygon_cases.hpp new file mode 100644 index 000000000..837829f5f --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/perimeter/perimeter_polygon_cases.hpp @@ -0,0 +1,37 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2016 Oracle and/or its affiliates. +// Contributed and/or modified by Vissarion Fisikopoulos, 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) + +#ifndef PERIMETER_POLYGON_CASES_HPP +#define PERIMETER_POLYGON_CASES_HPP + +#include + +static std::string poly_data_geo[] = { + "POLYGON((0 90,1 80,1 70))", + "POLYGON((0 90,1 80,1 80,1 80,1 70,1 70))", + "POLYGON((0 90,1 80,1 79,1 78,1 77,1 76,1 75,1 74,\ + 1 73,1 72,1 71,1 70))",\ + "POLYGON((0 0,180 0,0 0))", + "POLYGON((0 0,90 0,180 0,90 0,0 0))" +}; + +static std::string poly_data_sph[] = { + "POLYGON((0 0,180 0,0 0))", + "POLYGON((0 0,180 0,180 0,180 0,180 180,0 0))", + "POLYGON((0 0,180 0,180 10,180 20,180 30,180 40,180 50,180 60,\ + 180 70,180 80,180 90,180 100,180 110,180 120,180 130,\ + 180 140,180 150,180 160,180 170,180 180,0 0))" +}; + +static std::string multipoly_data[] = { + "MULTIPOLYGON(((0 0,180 0,0 0)), ((0 0, 0 90, 90 90, 0 0)))" +}; + +#endif // PERIMETER_POLYGON_CASES_HPP diff --git a/src/boost/libs/geometry/test/algorithms/perimeter/perimeter_sph.cpp b/src/boost/libs/geometry/test/algorithms/perimeter/perimeter_sph.cpp new file mode 100644 index 000000000..73cf91800 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/perimeter/perimeter_sph.cpp @@ -0,0 +1,88 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2016 Oracle and/or its affiliates. +// Contributed and/or modified by Vissarion Fisikopoulos, 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) + +#include +#include + +#include +#include + +template +void test_all_default() //test the default strategy +{ + double const pi = boost::math::constants::pi(); + + for (std::size_t i = 0; i <= 2; ++i) + { + test_geometry >(poly_data_sph[i], 2 * pi); + } + + // Multipolygon + test_geometry > > + (multipoly_data[0], 3 * pi); + + // Geometries with length zero + test_geometry

("POINT(0 0)", 0); + test_geometry >("LINESTRING(0 0,3 4,4 3)", 0); +} + + +template +void test_all_haversine(double const mean_radius) +{ + double const pi = boost::math::constants::pi(); + bg::strategy::distance::haversine haversine_strategy(mean_radius); + + for (std::size_t i = 0; i <= 2; ++i) + { + test_geometry >(poly_data_sph[i], + 2 * pi * mean_radius, + haversine_strategy); + } + + // Multipolygon + test_geometry > > + (multipoly_data[0], + 3 * pi * mean_radius, + haversine_strategy); + + // Geometries with length zero + test_geometry

("POINT(0 0)", 0, haversine_strategy); + test_geometry >("LINESTRING(0 0,3 4,4 3)", + 0, + haversine_strategy); +} + +int test_main(int, char* []) +{ + //Earth radius estimation in Km + //(see https://en.wikipedia.org/wiki/Earth_radius) + double const mean_radius = 6371.0; + + test_all_default > >(); + test_all_default > >(); + test_all_default > >(); + + test_all_haversine > >(mean_radius); + test_all_haversine > >(mean_radius); + test_all_haversine > >(mean_radius); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/perimeter_multi.cpp b/src/boost/libs/geometry/test/algorithms/perimeter_multi.cpp new file mode 100644 index 000000000..3ddd8395c --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/perimeter_multi.cpp @@ -0,0 +1,37 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#include + +#include + +#include + +#include +#include +#include + +#include + + +template +void test_all() +{ + test_geometry > >( + "MULTIPOLYGON(((0 0,0 1,1 0,0 0)))", 1.0 + 1.0 + sqrt(2.0)); +} + +int test_main( int , char* [] ) +{ + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/point_on_surface.cpp b/src/boost/libs/geometry/test/algorithms/point_on_surface.cpp new file mode 100644 index 000000000..7ee5eb880 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/point_on_surface.cpp @@ -0,0 +1,365 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +// Copyright (c) 2013-2017 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 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. + +// 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) + +// Instead of having a separate (and nearly similar) unit test to test multipolygons, +// we now include them here and compile them by default. Only undefining the next line +// will avoid testing multi-geometries +#define BOOST_GEOMETRY_UNIT_TEST_MULTI + +#include + +// The include to test +#include + +// Helper includes +#include +#include +#include +#include + +#include +#include + +// Include from unit tests +#include +#include +#include + +#if defined(BOOST_GEOMETRY_UNIT_TEST_MULTI) +# include +#endif + + +#if defined(TEST_WITH_SVG) +# include +#endif + +template +void test_geometry(std::string const& case_id, Geometry const& geometry, double /*expected_x*/ = 0, double /*expected_y*/ = 0) +{ +//std::cout << case_id << std::endl; + typedef typename bg::point_type::type point_type; + + point_type point; + bg::point_on_surface(geometry, point); + + BOOST_CHECK_MESSAGE(bg::within(point, geometry), + case_id << " generated point_on_surface (dim 1) is not within geometry"); + +#ifdef BOOST_GEOMETRY_POINT_ON_SURFACE_COMPLETE + // For the algorithm we also check generation in the other dimension + point_type right_point; + bg::detail::point_on_surface::calculate_point_on_surface<0>(geometry, right_point); + + BOOST_CHECK_MESSAGE(bg::within(right_point, geometry), + case_id << " generated point_on_surface (dim 0) is not within geometry"); + + point_type returned_point = bg::return_point_on_surface(geometry); +#endif + +#if defined(TEST_WITH_SVG) + { + std::ostringstream filename; + filename << "point_on_surface_" << case_id << "_" + << string_from_type::type>::name() + << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + // To map the intermediate products: + bg::model::linestring top_points; + typedef bg::model::linestring intruder_type; + std::vector top_intruders; + bg::extreme_points<1>(geometry, top_points, top_intruders); + +#ifdef BOOST_GEOMETRY_POINT_ON_SURFACE_COMPLETE + bg::model::linestring right_points; + std::vector > right_intruders; + bg::extreme_points<0>(geometry, right_points, right_intruders); +#endif + + bg::svg_mapper mapper(svg, 500, 500); + mapper.add(geometry); + mapper.map(geometry, "fill-opacity:0.5;fill:rgb(153,204,0);stroke:rgb(153,204,0);stroke-width:1"); + + // Top (red/magenta) + mapper.map(top_points, "stroke:rgb(255,0,0);stroke-width:2"); + BOOST_FOREACH(intruder_type const& intruder, top_intruders) + { + mapper.map(intruder, "stroke:rgb(255,0,255);stroke-width:2"); + } + mapper.map(point, "opacity:0.8;fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1", 3); + +#ifdef BOOST_GEOMETRY_POINT_ON_SURFACE_COMPLETE + //// Right (blue/cyan) + // (mostly commented, makes the picture less clear) + //mapper.map(right_points, "stroke:rgb(0,0,255);stroke-width:2"); + //BOOST_FOREACH(intruder_type const& intruder, right_intruders) + //{ + // mapper.map(intruder, "stroke:rgb(0,255,255);stroke-width:2"); + //} + mapper.map(right_point, "opacity:0.8;fill:rgb(0,128,255);stroke:rgb(0,0,100);stroke-width:1", 3); +#endif + } +#endif + +} + +template +void test_geometry(std::string const& case_id, std::string const& wkt, double expected_x = 0, double expected_y = 0) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + bg::correct(geometry); + test_geometry(case_id, geometry, expected_x, expected_y); +} + +template +void test_point_order_and_type() +{ + typedef bg::model::polygon ccw_open_polygon; + typedef bg::model::polygon cw_open_polygon; + typedef bg::model::polygon ccw_closed_polygon; + typedef bg::model::polygon cw_closed_polygon; + + test_geometry("with_hole_ccw_open", "POLYGON((0 0,9 0,9 9,0 9),(2 2,2 7,7 7,7 2))", 0, 0); + test_geometry("with_hole_cw_open", "POLYGON((0 0,0 9,9 9,9 0),(2 2,7 2,7 7,2 7))", 0, 0); + test_geometry("with_hole_ccw_closed", "POLYGON((0 0,9 0,9 9,0 9,0 0),(2 2,2 7,7 7,7 2,2 2))", 0, 0); + test_geometry("with_hole_cw_closed", "POLYGON((0 0,0 9,9 9,9 0,0 0),(2 2,7 2,7 7,2 7,2 2))", 0, 0); + + test_geometry("t1", "POLYGON((0 0,0 10,10 0,0 0))", 0, 0); + test_geometry("t2", "POLYGON((0 0,10 0,0 -10,0 0))", 0, 0); + test_geometry("t3", "POLYGON((0 0,0 -10,-10 0,0 0))", 0, 0); + test_geometry("t4", "POLYGON((0 0,-10 0,0 10,0 0))", 0, 0); +} + +template +void test_all() +{ + typedef bg::model::polygon polygon; + + // Specific test-cases for point-on-surface: + test_geometry("ice", "polygon((5 0,0 5,1 6,2 5,4 8,6 5,7 6,8 5,9 6,10 5,5 0))", 0, 0); + test_geometry("intruding", "polygon((5 0,0 5,1 6,2 5,4 8,6 5,7 6,8 5,9 6,10 5,7 2,4 7,6 1,5 0))", 0, 0); + test_geometry("intruding2", "polygon((5 0,3 2,4 6,2 3,0 5,1 6,2 5,4 8,6 5,7 6,8 5,9 6,10 5,7 2,4 7,6 1,5 0))", 0, 0); + test_geometry("intruding3", "polygon((5 0,3 2,3 6,2 3,0 5,1 6,3 7,2 5,4 8,6 5,5 7,7 6,8 5,9 6,10 5,7 2,5 6,6 1,5 0))", 0, 0); + test_geometry("intruding4", "polygon((5 0,3 2,3 6,2 3,0 5,1 6,3 7,2 5,4 8,6 5,5 8,7 6,8 5,9 6,10 5,7 2,5 6,6 1,5 0))", 0, 0); + test_geometry("intruding5", "polygon((5 0,3 2,3 6,2 3,0 5,1 6,3 8,2 5,4 8,6 5,5 8,7 6,8 5,9 6,10 5,7 2,5 6,6 1,5 0))", 0, 0); + test_geometry("ice_int", "polygon((5 0,0 5,1 6,2 5,4 8,6 5,7 6,8 5,9 6,10 5,5 0),(3 4,4 3,5 4,4 7,3 4))", 0, 0); + test_geometry("ice_int2", "polygon((5 0,0 5,1 6,2 5,4 8,6 5,7 6,8 5,9 6,10 5,5 0),(4 7,3 4,4 3,5 4,4 7))", 0, 0); + test_geometry("ice_in3", "polygon((5 0,0 5,1 6,2 5,4 8,6 5,7 6,8 5,9 6,10 5,5 0),(3 4,5 4,5 6,3 6,3 4))", 0, 0); + test_geometry("simplex_normal", simplex_normal[0], 0, 0); + test_geometry("sqr", "polygon((0 0,0 5,0 10,5 10,10 10,10 5,10 0,5 0,0 0))", 0, 0); + test_geometry("self_tangent", "polygon((0 0,5 10,10 0,9 0,7 4,8 0,7 0,5 10,3 0,2 0,3 4,1 0,0 0))", 0, 0); + test_geometry("self_tangent2", "polygon((5 0,2 3,4 8,1.5 3.5,0 5,1 6,2 5,4 8,6 5,7 6,8 5,9 6,10 5,5 0))", 0, 0); + test_geometry("self_tangent_int", "polygon((5 0,0 5,1 6,2 5,4 8,6 5,7 6,8 5,9 6,10 5,5 0),(3 4,4 3,5 4,4 8,3 4))", 0, 0); + test_geometry("self_tangent_int2", "polygon((5 0,2 3,3.5 7,1.5 3.5,0 5,1 6,2 5,4 8,6 5,7 6,8 5,9 6,10 5,5 0),(3 4,4 3,5 4,4 8,3 4))", 0, 0); + test_geometry("self_tangent_int3", "polygon((5 0,2 3,4 8,1.5 3.5,0 5,1 6,2 5,4 8,6 5,7 6,8 5,9 6,10 5,5 0),(3 4,4 3,5 4,4 8,3 4))", 0, 0); + + test_geometry("self_tangent_int3", "polygon((5 0,2 3,4 8,1.5 3.5,0 5,1 6,2 5,4 8,6 5,7 6,8 5,9 6,10 5,5 0),(3 4,4 3,5 4,4 8,3 4))", 0, 0); + test_geometry("disjoint_simplex0", disjoint_simplex[0], 0, 0); + test_geometry("disjoint_simplex1", disjoint_simplex[1], 0, 0); + + test_geometry("ticket_10643", "POLYGON((1074699.93 703064.65, 1074703.90 703064.58, 1074704.53 703061.40, 1074702.10 703054.62, 1074699.93 703064.65))"); + test_geometry("ticket_10643_2", "POLYGON((699.93 64.65, 703.90 64.58, 704.53 61.40, 702.10 54.62, 699.93 64.65))"); + +#if defined(BOOST_GEOMETRY_UNIT_TEST_MULTI) + { + typedef bg::model::multi_polygon multi_polygon; + test_geometry("mp_simplex", "multipolygon(((0 0,0 5,5 0, 0 0)),((7 1,7 6,10 1,7 1)))", 0, 0); + // Wrapped polygon in two orders + test_geometry("mp_wrapped1", + "multipolygon(" + "((4 10,9 11,10 16,11 11,16 10,11 9,10 4,9 9,4 10))" + "," + "((0 10,10 20,20 10,10 0,0 10),(10 2,18 10,10 18,2 10,10 2))" + ")", + 0, 0); + test_geometry("mp_wrapped2", + "multipolygon(" + "((0 10,10 20,20 10,10 0,0 10),(10 2,18 10,10 18,2 10,10 2))" + "," + "((4 10,9 11,10 16,11 11,16 10,11 9,10 4,9 9,4 10))" + ")", + 0, 0); + } +#endif + + + // Overlay testcases + test_geometry("buffer_mp1", buffer_mp1[0], 0, 0); + test_geometry("buffer_mp2", buffer_mp2[0], 0, 0); + test_geometry("buffer_rt_a", buffer_rt_a[0], 0, 0); + test_geometry("buffer_rt_f", buffer_rt_f[0], 0, 0); + test_geometry("buffer_rt_g", buffer_rt_g[0], 0, 0); + test_geometry("buffer_rt_i", buffer_rt_i[0], 0, 0); + test_geometry("buffer_rt_j", buffer_rt_j[0], 0, 0); + test_geometry("buffer_rt_l", buffer_rt_l[0], 0, 0); + test_geometry("buffer_rt_m1", buffer_rt_m1[0], 0, 0); + test_geometry("buffer_rt_m2", buffer_rt_m2[0], 0, 0); + test_geometry("buffer_rt_n", buffer_rt_n[0], 0, 0); + test_geometry("buffer_rt_q", buffer_rt_q[0], 0, 0); + test_geometry("buffer_rt_r", buffer_rt_r[0], 0, 0); + test_geometry("buffer_rt_t", buffer_rt_t[0], 0, 0); + test_geometry("case_10", case_10[0], 0, 0); + test_geometry("case_11", case_11[0], 0, 0); + test_geometry("case_12", case_12[0], 0, 0); + test_geometry("case_13", case_13[0], 0, 0); + test_geometry("case_14", case_14[0], 0, 0); + test_geometry("case_15", case_15[0], 0, 0); + test_geometry("case_16", case_16[0], 0, 0); + test_geometry("case_17", case_17[0], 0, 0); + test_geometry("case_18", case_18[0], 0, 0); + test_geometry("case_19", case_19[0], 0, 0); + test_geometry("case_1", case_1[0], 0, 0); + test_geometry("case_20", case_20[0], 0, 0); + test_geometry("case_21", case_21[0], 0, 0); + test_geometry("case_22", case_22[0], 0, 0); + test_geometry("case_23", case_23[0], 0, 0); + test_geometry("case_24", case_24[0], 0, 0); + test_geometry("case_25", case_25[0], 0, 0); + test_geometry("case_26", case_26[0], 0, 0); + test_geometry("case_27", case_27[0], 0, 0); + test_geometry("case_28", case_28[0], 0, 0); + test_geometry("case_29", case_29[0], 0, 0); + test_geometry("case_2", case_2[0], 0, 0); + test_geometry("case_30", case_30[0], 0, 0); + test_geometry("case_31", case_31[0], 0, 0); + test_geometry("case_32", case_32[0], 0, 0); + test_geometry("case_33", case_33[0], 0, 0); + test_geometry("case_34", case_34[0], 0, 0); + test_geometry("case_35", case_35[0], 0, 0); + test_geometry("case_36", case_36[0], 0, 0); + test_geometry("case_37", case_37[0], 0, 0); + test_geometry("case_38", case_38[0], 0, 0); + test_geometry("case_39", case_39[0], 0, 0); + test_geometry("case_3", case_3[0], 0, 0); + test_geometry("case_40", case_40[0], 0, 0); + test_geometry("case_41", case_41[0], 0, 0); + test_geometry("case_42", case_42[0], 0, 0); + test_geometry("case_43", case_43[0], 0, 0); + test_geometry("case_44", case_44[0], 0, 0); + test_geometry("case_45", case_45[0], 0, 0); + test_geometry("case_46", case_46[0], 0, 0); + test_geometry("case_47", case_47[0], 0, 0); + test_geometry("case_49", case_49[0], 0, 0); + test_geometry("case_4", case_4[0], 0, 0); + test_geometry("case_50", case_50[0], 0, 0); + test_geometry("case_51", case_51[0], 0, 0); + test_geometry("case_52", case_52[0], 0, 0); + test_geometry("case_53", case_53[0], 0, 0); + test_geometry("case_54", case_54[0], 0, 0); + test_geometry("case_55", case_55[0], 0, 0); + test_geometry("case_56", case_56[0], 0, 0); + test_geometry("case_57", case_57[0], 0, 0); + test_geometry("case_58", case_58[0], 0, 0); + test_geometry("case_59", case_59[0], 0, 0); + test_geometry("case_5", case_5[0], 0, 0); + test_geometry("case_60", case_60[0], 0, 0); + test_geometry("case_61", case_61[0], 0, 0); + test_geometry("case_6", case_6[0], 0, 0); + test_geometry("case_70", case_70[0], 0, 0); + test_geometry("case_71", case_71[0], 0, 0); + test_geometry("case_72", case_72[0], 0, 0); + test_geometry("case_79", case_79[0], 0, 0); + test_geometry("case_7", case_7[0], 0, 0); + test_geometry("case_8", case_8[0], 0, 0); + test_geometry("case_9", case_9[0], 0, 0); + test_geometry("case_many_situations", case_many_situations[0], 0, 0); + test_geometry("ccw_case_1", ccw_case_1[0], 0, 0); + test_geometry("ccw_case_9", ccw_case_9[0], 0, 0); + test_geometry("collinear_opposite_left", collinear_opposite_left[0], 0, 0); + test_geometry("collinear_opposite_right", collinear_opposite_right[0], 0, 0); + test_geometry("collinear_opposite_straight", collinear_opposite_straight[0], 0, 0); + test_geometry("collinear_overlaps", collinear_overlaps[0], 0, 0); + test_geometry("dz_1", dz_1[0], 0, 0); + test_geometry("dz_2", dz_2[0], 0, 0); + test_geometry("dz_3", dz_3[0], 0, 0); + test_geometry("dz_4", dz_4[0], 0, 0); + test_geometry("geos_1", geos_1[0], 0, 0); + test_geometry("geos_2", geos_2[0], 0, 0); + test_geometry("geos_3", geos_3[0], 0, 0); + test_geometry("geos_4", geos_4[0], 0, 0); + test_geometry("ggl_list_20110306_javier", ggl_list_20110306_javier[0], 0, 0); + test_geometry("ggl_list_20110307_javier", ggl_list_20110307_javier[0], 0, 0); + test_geometry("ggl_list_20110627_phillip", ggl_list_20110627_phillip[0], 0, 0); + test_geometry("ggl_list_20110716_enrico", ggl_list_20110716_enrico[0], 0, 0); + test_geometry("ggl_list_20110820_christophe ", ggl_list_20110820_christophe [0], 0, 0); + test_geometry("ggl_list_20120717_volker", ggl_list_20120717_volker[0], 0, 0); + test_geometry("hv_1", hv_1[0], 0, 0); + test_geometry("hv_2", hv_2[0], 0, 0); + test_geometry("hv_3", hv_3[0], 0, 0); + test_geometry("hv_4", hv_4[0], 0, 0); + test_geometry("hv_5", hv_5[0], 0, 0); + test_geometry("hv_6", hv_6[0], 0, 0); + test_geometry("hv_7", hv_7[0], 0, 0); + test_geometry("isovist", isovist[0], 0, 0); + test_geometry("open_case_1", open_case_1[0], 0, 0); + test_geometry("open_case_9", open_case_9[0], 0, 0); + test_geometry("pie_16_2_15_0", pie_16_2_15_0[0], 0, 0); + test_geometry("pie_16_4_12", pie_16_4_12[0], 0, 0); + test_geometry("pie_20_20_7_100", pie_20_20_7_100[0], 0, 0); + test_geometry("pie_23_16_16", pie_23_16_16[0], 0, 0); + test_geometry("pie_23_21_12_500", pie_23_21_12_500[0], 0, 0); + test_geometry("pie_23_23_3_2000", pie_23_23_3_2000[0], 0, 0); + test_geometry("pie_4_13_15", pie_4_13_15[0], 0, 0); + test_geometry("pie_5_12_12_0_7s", pie_5_12_12_0_7s[0], 0, 0); + test_geometry("snl_1", snl_1[0], 0, 0); + test_geometry("ticket_17", ticket_17[0], 0, 0); + test_geometry("ticket_5103", ticket_5103[0], 0, 0); + test_geometry("ticket_7462", ticket_7462[0], 0, 0); + test_geometry("ticket_8310a", ticket_8310a[0], 0, 0); + test_geometry("ticket_8310b", ticket_8310b[0], 0, 0); + test_geometry("ticket_8310c", ticket_8310c[0], 0, 0); + test_geometry("ticket_8254", ticket_8254[0], 0, 0); +} + +template +void test_dense(std::string const& case_id, double size) +{ + typedef bg::model::polygon polygon; + polygon poly; + + bg::append(poly, Point(-size, 0)); + + double thres = 3.14158 / 8; + for ( double a = thres ; a > -thres ; a -= 0.01 ) + { + bg::append(poly, Point(size * ::cos(a), size * ::sin(a))); + } + + bg::append(poly, Point(-size, 0)); + + test_geometry(case_id, poly); +} + + +int test_main(int, char* []) +{ + test_all >(); + test_point_order_and_type >(); + test_point_order_and_type >(); + + test_dense >("dense1", 100); + test_dense >("dense2", 1000000); + + return 0; +} + diff --git a/src/boost/libs/geometry/test/algorithms/predef_relop.hpp b/src/boost/libs/geometry/test/algorithms/predef_relop.hpp new file mode 100644 index 000000000..eda98ac01 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/predef_relop.hpp @@ -0,0 +1,33 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef BOOST_GEOMETRY_PREDEF_RELOP_HPP +#define BOOST_GEOMETRY_PREDEF_RELOP_HPP + +#include + + +static std::string disjoint_simplex[2] = + {"POLYGON((0 0,0 2,2 2,0 0))", + "POLYGON((1 0,3 2,3 0,1 0))"}; + +static std::string touch_simplex[2] = + {"POLYGON((0 0,0 2,2 2,0 0))", + "POLYGON((2 2,3 2,3 0,2 2))"}; + +static std::string overlaps_box[2] = + {"POLYGON((0 0,0 2,2 2,0 0))", + "POLYGON((1 1,3 2,3 0,1 1))"}; + +static std::string within_simplex[2] = + {"POLYGON((0 0,1 4,4 1,0 0))", + "POLYGON((1 1,1 3,3 1,1 1))"}; + + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/pretty_print_geometry.hpp b/src/boost/libs/geometry/test/algorithms/pretty_print_geometry.hpp new file mode 100644 index 000000000..2f3275cba --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/pretty_print_geometry.hpp @@ -0,0 +1,69 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Tests + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_TEST_PRETTY_PRINT_GEOMETRY_HPP +#define BOOST_GEOMETRY_TEST_PRETTY_PRINT_GEOMETRY_HPP + +#include + +#include +#include + +#include +#include + + +template +< + typename Geometry, + typename Tag = typename boost::geometry::tag::type +> +struct pretty_print_geometry +{ + static inline std::ostream& + apply(std::ostream& os, Geometry const& geometry) + { + os << boost::geometry::wkt(geometry); + return os; + } +}; + +template +struct pretty_print_geometry +{ + static inline std::ostream& + apply(std::ostream& os, Box const& box) + { + return os << "BOX" << boost::geometry::dsv(box); + } +}; + +template +struct pretty_print_geometry +{ + static inline std::ostream& + apply(std::ostream& os, Segment const& segment) + { + return os << "SEGMENT" << boost::geometry::dsv(segment); + } +}; + +template +struct pretty_print_geometry +{ + static inline std::ostream& + apply(std::ostream& os, Ring const& ring) + { + return os << "RING" << boost::geometry::dsv(ring); + } +}; + + +#endif // BOOST_GEOMETRY_TEST_PRETTY_PRINT_GEOMETRY_HPP diff --git a/src/boost/libs/geometry/test/algorithms/relate/Jamfile b/src/boost/libs/geometry/test/algorithms/relate/Jamfile new file mode 100644 index 000000000..bcc306dac --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/relate/Jamfile @@ -0,0 +1,26 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2016. +# Modifications copyright (c) 2014-2016, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-relate + : + [ run relate_areal_areal.cpp : : : : algorithms_relate_areal_areal ] + [ run relate_areal_areal_sph.cpp : : : : algorithms_relate_areal_areal_sph ] + [ run relate_linear_areal.cpp : : : : algorithms_relate_linear_areal ] + [ run relate_linear_areal_sph.cpp : : : : algorithms_relate_linear_areal_sph ] + [ run relate_linear_linear.cpp : : : : algorithms_relate_linear_linear ] + [ run relate_linear_linear_sph.cpp : : : : algorithms_relate_linear_linear_sph ] + [ run relate_pointlike_geometry.cpp : : : : algorithms_relate_pointlike_geometry ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/relate/nan_cases.hpp b/src/boost/libs/geometry/test/algorithms/relate/nan_cases.hpp new file mode 100644 index 000000000..24306202d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/relate/nan_cases.hpp @@ -0,0 +1,130 @@ +// Boost.Geometry + +// Copyright (c) 2015 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) + +#include + +#include +#include + +#include +#include + +template +struct pusher + : public Container +{ + typedef typename Container::value_type value_type; + pusher(value_type const& val) + { + this->push_back(val); + } + + pusher & operator()(value_type const& val) + { + this->push_back(val); + return *this; + } +}; + +template ::type, + typename Coord = typename bg::coordinate_type::type> +struct nan_case_generator +{ + static void apply(Geometry & , std::string & ) + {} +}; + +template +struct nan_case_generator +{ + static void apply(Geometry & geometry, std::string & wkt) + { + typedef typename boost::range_value::type ls; + typedef typename bg::point_type::type P; + typedef typename bg::coordinate_type::type coord_t; + coord_t nan = std::numeric_limits::quiet_NaN(); + + wkt = "MULTILINESTRING((3.1e+307 1,-nan -nan),(3.1e+307 1,-nan -nan),(3.1e+307 1,5.1e+307 6e+307,nan nan),(-nan -nan,nan nan),(-nan -nan,-1 -3.97843,-1 3.28571,-1 47.6364),(3 78.5455,3 2),(nan nan,3 12.9689),(3 -2,-nan -nan),(3 2,3 12.9689,3 78.5455),(-1 4.29497e+09,-1 7,-nan -nan),(9 5,-nan -nan),(-nan -nan,9 60.8755,9 124.909),(nan nan,1 6.87195e+10,-nan -nan),(nan nan,4 86.2727,4 20.9533),(4 -5,-nan -nan),(4 -5,-nan -nan),(4 -5,-nan -nan),(4 -5,1.1e+308 2.1e+307,nan nan),(-nan -nan,-1 -8),(-nan -nan,-9 -4))"; + + typedef pusher ml; + typedef pusher l; + geometry = ml(l(P(3.1e+307, 1))(P(-nan, -nan))) + (l(P(3.1e+307, 1))(P(-nan, -nan))) + (l(P(3.1e+307, 1))(P(5.1e+307, 6e+307))(P(nan, nan))) + (l(P(-nan, -nan))(P(nan, nan))) + (l(P(-nan, -nan))(P(-1, -3.97843))(P(-1, 3.28571))(P(-1, 47.6364))) + (l(P(3, 78.5455))(P(3, 2))) + (l(P(nan, nan))(P(3, 12.9689))) + (l(P(3, -2))(P(-nan, -nan))) + (l(P(3, 2))(P(3, 12.9689))(P(3, 78.5455))) + (l(P(-1, 4.29497e+09))(P(-1, 7))(P(-nan, -nan))) + (l(P(9, 5))(P(-nan, -nan))) + (l(P(-nan, -nan))(P(9, 60.8755))(P(9, 124.909))) + (l(P(nan, nan))(P(1, 6.87195e+10))(P(-nan, -nan))) + (l(P(nan, nan))(P(4, 86.2727))(P(4, 20.9533))) + (l(P(4, -5))(P(-nan, -nan))) + (l(P(4, -5))(P(-nan, -nan))) + (l(P(4, -5))(P(-nan, -nan))) + (l(P(4, -5))(P(1.1e+308, 2.1e+307))(P(nan, nan))) + (l(P(-nan, -nan))(P(-1, -8))) + (l(P(-nan, -nan))(P(-9, -4))); + } +}; + +template +struct nan_case_generator +{ + static void apply(Geometry & geometry, std::string & wkt) + { + typedef typename bg::point_type::type P; + typedef typename bg::coordinate_type::type coord_t; + coord_t nan = std::numeric_limits::quiet_NaN(); + + wkt = "MULTIPOINT((3.1e+307 1),(-nan -nan),(3.1e+307 1),(-nan -nan),(3.1e+307 1),(5.1e+307 6e+307),(nan nan),(-nan -nan),(nan nan),(-nan -nan),(-1 -3.97843),(-1 3.28571),(-1 47.6364),(3 78.5455),(3 2),(nan nan),(3 12.9689),(3 -2),(-nan -nan),(3 2),(3 12.9689),(3 78.5455),(-1 4.29497e+09),(-1 7),(-nan -nan),(9 5),(-nan -nan),(-nan -nan),(9 60.8755),(9 124.909),(nan nan),(1 6.87195e+10),(-nan -nan),(nan nan),(4 86.2727),(4 20.9533),(4 -5),(-nan -nan),(4 -5),(-nan -nan),(4 -5),(-nan -nan),(4 -5),(1.1e+308 2.1e+307),(nan nan),(-nan -nan),(-1 -8),(-nan -nan),(-9 -4))"; + + typedef pusher mp; + geometry = mp(P(3.1e+307, 1))(P(-nan, -nan)) + (P(3.1e+307, 1))(P(-nan, -nan)) + (P(3.1e+307, 1))(P(5.1e+307, 6e+307))(P(nan, nan)) + (P(-nan, -nan))(P(nan, nan)) + (P(-nan, -nan))(P(-1, -3.97843))(P(-1, 3.28571))(P(-1, 47.6364)) + (P(3, 78.5455))(P(3, 2)) + (P(nan, nan))(P(3, 12.9689)) + (P(3, -2))(P(-nan, -nan)) + (P(3, 2))(P(3, 12.9689))(P(3, 78.5455)) + (P(-1, 4.29497e+09))(P(-1, 7))(P(-nan, -nan)) + (P(9, 5))(P(-nan, -nan)) + (P(-nan, -nan))(P(9, 60.8755))(P(9, 124.909)) + (P(nan, nan))(P(1, 6.87195e+10))(P(-nan, -nan)) + (P(nan, nan))(P(4, 86.2727))(P(4, 20.9533)) + (P(4, -5))(P(-nan, -nan)) + (P(4, -5))(P(-nan, -nan)) + (P(4, -5))(P(-nan, -nan)) + (P(4, -5))(P(1.1e+308, 2.1e+307))(P(nan, nan)) + (P(-nan, -nan))(P(-1, -8)) + (P(-nan, -nan))(P(-9, -4)); + } +}; + +template +void nan_case(Geometry & geometry, std::string & wkt) +{ + nan_case_generator::apply(geometry, wkt); +} + +template +struct is_nan_case_supported +{ + typedef typename bg::coordinate_type::type coord_t; + + static const bool value = boost::is_same::value + && std::numeric_limits::has_quiet_NaN; +}; diff --git a/src/boost/libs/geometry/test/algorithms/relate/relate_areal_areal.cpp b/src/boost/libs/geometry/test/algorithms/relate/relate_areal_areal.cpp new file mode 100644 index 000000000..81ced941e --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/relate/relate_areal_areal.cpp @@ -0,0 +1,434 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2013, 2014, 2015. +// Modifications copyright (c) 2013-2015 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) + + +#include "test_relate.hpp" + +//#include + +template +void test_polygon_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + + // touching + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((10 0,10 10,20 10,20 0,10 0))", + "FF2F11212"); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((0 -10,0 0,10 0,10 -10,0 -10))", + "FF2F11212"); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((10 0,15 10,20 10,20 0,10 0))", + "FF2F01212"); + + // containing + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((5 5,5 10,6 10,6 5,5 5))", + "212F11FF2"); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((5 5,5 10,6 5,5 5))", + "212F01FF2"); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((5 5,5 6,6 6,6 5,5 5))", + "212FF1FF2"); + + // fully containing + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((5 5,5 9,6 9,6 5,5 5))", + "212FF1FF2"); + // fully containing, with a hole + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(3 3,7 3,7 7,3 7,3 3))", + "POLYGON((1 1,1 9,9 9,9 1,1 1))", + "2121F12F2"); + // fully containing, both with holes + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(3 3,7 3,7 7,3 7,3 3))", + "POLYGON((1 1,1 9,9 9,9 1,1 1),(2 2,8 2,8 8,2 8,2 2))", + "212FF1FF2"); + // fully containing, both with holes + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(3 3,7 3,7 7,3 7,3 3))", + "POLYGON((1 1,1 9,9 9,9 1,1 1),(4 4,6 4,6 6,4 6,4 4))", + "2121F1212"); + + // overlapping + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((5 0,5 10,20 10,20 0,5 0))", + "212111212"); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((5 0,5 10,20 10,20 0,5 0))", + "212111212"); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((5 0,5 10,20 10,20 0,5 0))", + "212111212"); + test_geometry("POLYGON((0 0,0 10,10 10,15 5,10 0,0 0))", + "POLYGON((10 0,5 5,10 10,20 10,20 0,10 0))", + "212101212"); + + // equal + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((10 10,10 5,10 0,5 0,0 0,0 10,5 10,10 10))", + "2FFF1FFF2"); + // hole-sized + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(5 5,6 5,6 6,5 6,5 5))", + "POLYGON((5 5,5 6,6 6,6 5,5 5))", + "FF2F112F2"); + + // disjoint + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((0 20,0 30,10 30,10 20,0 20))", + "FF2FF1212"); + // disjoint + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(3 3,7 3,7 7,3 7,3 3))", + "POLYGON((0 20,0 30,10 30,10 20,0 20))", + "FF2FF1212"); + + // equal non-simple / non-simple hole + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(5 5,10 5,5 6,5 5))", + "POLYGON((0 0,0 10,10 10,10 5,5 6,5 5,10 5,10 0,0 0))", + "2FFF1FFF2"); + + // within non-simple / simple + test_geometry("POLYGON((0 0,0 10,10 10,10 5,5 6,5 5,10 5,10 0,0 0))", + "POLYGON((0 0,5 5,10 5,10 0,0 0))", + "212F11FF2"); + // within non-simple hole / simple + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(5 5,10 5,5 6,5 5))", + "POLYGON((0 0,5 5,10 5,10 0,0 0))", + "212F11FF2"); + + + // not within non-simple / simple + test_geometry("POLYGON((0 0,0 10,10 10,10 5,5 6,5 5,10 5,10 0,0 0))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "2FF11F2F2"); + // not within non-simple hole / simple + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(5 5,10 5,5 6,5 5))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "2FF11F2F2"); + // not within simple hole / simple + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(5 5,9 5,5 6,5 5))", + "POLYGON((0 0,0 10,10 10,9 5,10 0,0 0))", + "2121112F2"); + + // within non-simple fake hole / simple + test_geometry("POLYGON((0 0,0 10,10 10,10 5,4 7,4 3,10 5,10 0,0 0))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "2FF11F2F2"); + // within non-simple fake hole / non-simple fake hole + test_geometry("POLYGON((0 0,0 10,10 10,10 5,4 7,4 3,10 5,10 0,0 0))", + "POLYGON((0 0,0 10,10 10,10 5,5 6,5 4,10 5,10 0,0 0))", + "2FF11F212"); + // within non-simple fake hole / non-simple hole + test_geometry("POLYGON((0 0,0 10,10 10,10 5,4 7,4 3,10 5,10 0,0 0))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,5 6,5 4,10 5))", + "2FF11F212"); + // containing non-simple fake hole / non-simple hole + test_geometry("POLYGON((0 0,0 10,10 10,10 5,4 7,4 3,10 5,10 0,0 0))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,3 8,3 2,10 5))", + "212F11FF2"); + + // within non-simple hole / simple + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,4 7,4 3,10 5))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "2FF11F2F2"); + // within non-simple hole / non-simple fake hole + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,4 7,4 3,10 5))", + "POLYGON((0 0,0 10,10 10,10 5,5 6,5 4,10 5,10 0,0 0))", + "2FF11F212"); + // containing non-simple hole / non-simple fake hole + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,4 7,4 3,10 5))", + "POLYGON((0 0,0 10,10 10,10 5,3 8,3 2,10 5,10 0,0 0))", + "212F11FF2"); + // equal non-simple hole / non-simple fake hole + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,4 7,4 3,10 5))", + "POLYGON((0 0,0 10,10 10,10 5,4 7,4 3,10 5,10 0,0 0))", + "2FFF1FFF2"); + // within non-simple hole / non-simple hole + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,4 7,4 3,10 5))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,5 6,5 4,10 5))", + "2FF11F212"); + // containing non-simple hole / non-simple hole + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,4 7,4 3,10 5))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,3 8,3 2,10 5))", + "212F11FF2"); + // equal non-simple hole / non-simple hole + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,4 7,4 3,10 5))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,4 7,4 3,10 5))", + "2FFF1FFF2"); + + // intersecting non-simple hole / non-simple hole - touching holes + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(5 5,10 5,5 6,5 5))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(0 5,5 4,5 5,0 5))", + "21211F2F2"); + // intersecting non-simple fake hole / non-simple hole - touching holes + test_geometry("POLYGON((0 0,0 10,10 10,10 5,5 6,5 5,10 5,10 0,0 0))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(0 5,5 4,5 5,0 5))", + "21211F2F2"); + // intersecting non-simple fake hole / non-simple fake hole - touching holes + test_geometry("POLYGON((0 0,0 10,10 10,10 5,5 6,5 5,10 5,10 0,0 0))", + "POLYGON((0 0,0 5,5 4,5 5,0 5,0 10,10 10,10 0,0 0))", + "21211F2F2"); + + // intersecting simple - i/i + test_geometry("POLYGON((0 0,0 10,4 10,6 8,5 5,6 2,4 0,0 0))", + "POLYGON((5 5,4 8,6 10,10 10,10 0,6 0,4 2,5 5))", + "212101212"); + // intersecting non-simple hole / non-simple hole - i/i + test_geometry("POLYGON((0 0,0 10,4 10,6 8,5 5,6 2,4 0,0 0),(5 5,2 6,2 4,5 5))", + "POLYGON((5 5,4 8,6 10,10 10,10 0,6 0,4 2,5 5),(5 5,8 4,8 6,5 5))", + "212101212"); + // intersecting non-simple hole / simple - i/i + test_geometry("POLYGON((0 0,0 10,4 10,6 8,5 5,6 2,4 0,0 0),(5 5,2 6,2 4,5 5))", + "POLYGON((5 5,4 8,6 10,10 10,10 0,6 0,4 2,5 5))", + "212101212"); + + // no turns - disjoint inside a hole + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(1 1,9 1,9 9,1 9,1 1))", + "POLYGON((3 3,3 7,7 7,7 3,3 3))", + "FF2FF1212"); + // no turns - within + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(1 1,9 1,9 9,1 9,1 1))", + "POLYGON((-1 -1,-1 11,11 11,11 -1,-1 -1))", + "2FF1FF212"); + // no-turns - intersects + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,8 2,8 8,2 8,2 2))", + "POLYGON((1 1,1 9,9 9,9 1,1 1))", + "2121F12F2"); + // no-turns - intersects, hole in a hole + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,8 2,8 8,2 8,2 2))", + "POLYGON((1 1,1 9,9 9,9 1,1 1),(3 3,7 3,7 7,3 7,3 3))", + "2121F1212"); + + // no-turns ring - for exteriors + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,8 2,8 8,2 8,2 2))", + "POLYGON((1 1,1 9,9 9,9 1,1 1),(2 2,8 2,8 8,2 8,2 2))", + "212F11FF2"); + // no-turns ring - for interiors + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(3 3,7 3,7 7,3 7,3 3))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,8 2,8 8,2 8,2 2))", + "212F11FF2"); + + { + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((5 5,5 10,6 10,6 5,5 5))", + "212F11FF2"); + + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((10 0,10 10,20 10,20 0,10 0))", + "FF2F11212"); + + namespace bgdr = bg::detail::relate; + poly p1, p2, p3; + bg::read_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0))", p1); + bg::read_wkt("POLYGON((10 0,10 10,20 10,20 0,10 0))", p2); + bg::read_wkt("POLYGON((5 5,5 10,6 10,6 5,5 5))", p3); + BOOST_CHECK(bg::relate(p1, p2, bg::de9im::mask("FT*******") + || bg::de9im::mask("F**T*****") + || bg::de9im::mask("F***T****"))); // touches() + BOOST_CHECK(bg::relate(p1, p3, bg::de9im::mask("T*****FF*"))); // contains() + BOOST_CHECK(bg::relate(p2, p3, bg::de9im::mask("FF*FF****"))); // disjoint() + + BOOST_CHECK(bg::relate(p1, p2, bg::de9im::static_mask<'F','T'>() + || bg::de9im::static_mask<'F','*','*','T'>() + || bg::de9im::static_mask<'F','*','*','*','T'>())); + } + + // CCW + { + typedef bg::model::polygon poly; + // within non-simple hole / simple + test_geometry("POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,5 6,10 5,5 5))", + "POLYGON((0 0,10 0,10 5,5 5,0 0))", + "212F11FF2"); + } + // OPEN + { + typedef bg::model::polygon poly; + // within non-simple hole / simple + test_geometry("POLYGON((0 0,0 10,10 10,10 0),(5 5,10 5,5 6))", + "POLYGON((0 0,5 5,10 5,10 0))", + "212F11FF2"); + } + // CCW, OPEN + { + typedef bg::model::polygon poly; + // within non-simple hole / simple + test_geometry("POLYGON((0 0,10 0,10 10,0 10),(5 5,5 6,10 5))", + "POLYGON((0 0,10 0,10 5,5 5))", + "212F11FF2"); + } + + // https://svn.boost.org/trac/boost/ticket/10912 + { + // external rings touches and G2's hole is inside G1 + test_geometry("POLYGON((0 0,0 5,5 5,5 0,0 0))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2),(6 6,8 6,8 8,6 8,6 6))", + "21211F212"); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2))", + "212F1FFF2"); + // extended + // external rings touches and G1's hole is inside G2 + test_geometry("POLYGON((0 0,0 9,9 9,9 0,0 0),(2 2,7 2,7 7,2 7,2 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "2FF11F212"); + // external rings touches, holes doesn't + test_geometry("POLYGON((0 0,0 9,9 9,9 0,0 0),(2 2,7 2,7 7,2 7,2 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(1 1,8 1,8 8,1 8,1 1))", + "212111212"); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,7 2,7 7,2 7,2 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(1 1,8 1,8 8,1 8,1 1))", + "212F11FF2"); + // holes touches, external rings doesn't + test_geometry("POLYGON((1 1,1 9,9 9,9 1,1 1),(2 2,8 2,8 8,2 8,2 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,7 2,7 7,2 7,2 2))", + "2FF11F212"); + test_geometry("POLYGON((1 1,1 9,9 9,9 1,1 1),(2 2,7 2,7 7,2 7,2 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,8 2,8 8,2 8,2 2))", + "212111212"); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,8 2,8 8,2 8,2 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,7 2,7 7,2 7,2 2))", + "2FF11F212"); + + test_geometry("POLYGON((3 3,3 9,9 9,9 3,3 3))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2))", + "212101212"); + } + + if ( BOOST_GEOMETRY_CONDITION(( + boost::is_same::type, double>::value )) ) + { + // original - assertion for CCW + //"POLYGON((-0.593220338983050821113352 -8.05084745762711939676137,1.14285714285714279370154 -4,1.50731707317073171381594 1.10243902439024443751237,1.73758865248226967992196 1.37588652482269591104114,1.21739130434782616418943 -3.82608695652173924628414,2 -2,2 1.68750000000000044408921,2.35384615384615436539661 2.10769230769230775379697,2 2.16666666666666651863693,2 4,1.81967213114754100544701 2.1967213114754100544701,1.5882352941176469673934 2.2352941176470588757752,1.8148148148148146585612 5.4074074074074074403029,-0.538461538461538546940233 4.23076923076923083755219,-1.76510067114094004736558 2.89261744966443012927471,-1.64864864864864868465588 2.7567567567567570208098,-1.83962264150943455298659 2.81132075471698161805989,-1.84337349397590433142113 2.80722891566265086993326,-2.14285714285714279370154 2.85714285714285720629846,-2.11111111111111116045436 2.88888888888888883954564,-2.87234042553191448732264 3.10638297872340407579372,-2.91803278688524558859285 3.4262295081967208965068,-3.1733333333333324510761 3.26666666666666660745477,-2.99999999999999822364316 3.14285714285714234961233,-3.25490196078431326398572 3.21568627450980359938626,-3.47368421052631504153396 3.07894736842105265495206,-7.32000000000000028421709 3.72000000000000019539925,-7.54716981132075481752963 3.62264150943396234794136,-7.75 3.79166666666666651863693,-7.79999999999999982236432 3.79999999999999982236432,-7.59999999999999964472863 3.60000000000000008881784,-8.8556701030927822415606 3.06185567010309300783888,-8.82945736434108674473009 2.8914728682170549589614,-7.73333333333333339254523 2.193939393939393855959,-8 2,-5.94736842105263185942476 -1.42105263157894645686952,-5.32558139534883689947264 -0.488372093023255016142059,-5.85714285714285765038767 1.00000000000000066613381,-4.78723404255319184841255 0.319148936170212838003835,-5.32558139534883689947264 -0.488372093023255016142059,-4.74019607843137258385013 -2.12745098039215774221589,-3.17647058823529437887601 -0.705882352941176627325603,-2.93103448275862055183438 -0.862068965517241436735674,-3 -1,-4.57894736842105309904127 -2.57894736842105265495206,-4.47887323943661996850096 -2.85915492957746497637572,-7.58620689655172419918472 -5.18965517241379359347775,-7.52525252525252508206677 -5.5858585858585865224768,-4.18644067796610119813749 -3.67796610169491522412955,-3.44041450777202051369841 -5.76683937823834202873741,-3.73611111111111116045436 -6.56944444444444464181743,-2.8823529411764705621124 -7.7647058823529411242248,-2.88235294117647100620161 -7.7647058823529411242248,-0.593220338983050821113352 -8.05084745762711939676137),(1.66666666666666696272614 1.59999999999999875655021,1.43749999999999911182158 1.8750000000000002220446,0.0869565217391310429917439 2.26086956521739113057379,0.466666666666667118157363 2.60606060606060552231611,1.04878048780487764801705 2.34146341463414664474385,1.43749999999999911182158 1.8750000000000002220446,1.56756756756756754356275 1.83783783783783771781373,1.66666666666666696272614 1.59999999999999875655021))" + //"POLYGON((-2.33333333333333303727386 -8.66666666666666607454772,-2.26315789473684203514381 -8.63157894736842123961651,-2.88235294117647100620161 -7.7647058823529411242248,-2.8823529411764705621124 -7.7647058823529411242248,-4.11949685534591125701809 -7.61006289308176064878353,-4.32530120481927671249878 -8.16867469879518104391991,-2.33333333333333303727386 -8.66666666666666607454772))" + + // assertion failure in 1.57 + test_geometry("POLYGON((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))", + "POLYGON((-2.333333333333333 -8.6666666666666661,-4.3253012048192767 -8.168674698795181,-4.1194968553459113 -7.6100628930817606,-2.8823529411764706 -7.7647058823529411,-2.882352941176471 -7.7647058823529411,-2.263157894736842 -8.6315789473684212,-2.333333333333333 -8.6666666666666661))", + "*********"); + // simpler case + test_geometry("POLYGON((0 0, -0.59322033898305082 -8.0508474576271194, -2.8823529411764710 -7.7647058823529411, -3.7361111111111112 -6.5694444444444446, 0 0))", + "POLYGON((-10 -10, -4.1194968553459113 -7.6100628930817606, -2.8823529411764706 -7.7647058823529411, -2.2631578947368420 -8.6315789473684212, -10 -10))", + "FF2F01212"); + // sanity check + test_geometry("POLYGON((0 0, -0.59322033898305082 -8.0508474576271194, -2.8823529411764710 -7.7647058823529411, -3.7361111111111112 -6.5694444444444446, 0 0))", + "POLYGON((-10 -10, -4.1194968553459113 -7.6100628930817606, -2.8823529411764710 -7.7647058823529411, -2.2631578947368420 -8.6315789473684212, -10 -10))", + "FF2F01212"); + + // compatibility check + /*test_geometry("POLYGON((0 0,0 1,1 1,1 0,0 0))", + "POLYGON((1 1,1 2,2 2,2 1,1 1))", + "****0****"); + test_geometry("POINT(0.9999999999999998 0.9999999999999998)", + "POINT(1 1)", + "0********"); + test_geometry("POINT(0.9999999999999995 0.9999999999999995)", + "POINT(1 1)", + "F********"); + test_geometry("POLYGON((0 0,0 1,0.9999999999999998 0.9999999999999998,1 0,0 0))", + "POLYGON((1 1,1 2,2 2,2 1,1 1))", + "****0****"); + test_geometry("POLYGON((0 0,0 1,0.9999999999999995 0.9999999999999995,1 0,0 0))", + "POLYGON((1 1,1 2,2 2,2 1,1 1))", + "****F****");*/ + } + + // mysql 21872795 (overlaps) + test_geometry("POLYGON((2 2,2 8,8 8,8 2,2 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(8 8,4 6,4 4,8 8))", + "21210F212"); + test_geometry("POLYGON((2 2,2 8,8 8,8 2,2 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 4,4 6,2 2))", + "21210F212"); + // mysql 21873343 (touches) + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0), (0 8, 8 5, 8 8, 0 8))", + "POLYGON((0 8,-8 5,-8 8,0 8))", + "FF2F01212"); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0), (0 6, 6 3, 6 6, 0 6))", + "POLYGON((0 6,-6 3,-6 6,0 6))", + "FF2F01212"); + // similar but touching from the inside of the hole + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0), (0 8, 8 5, 8 8, 0 8))", + "POLYGON((0 8,7 7, 7 6,0 8))", + "FF2F01212"); +} + +template +void test_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_polygon mpoly; + + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "MULTIPOLYGON(((5 5,5 10,6 10,6 5,5 5)),((0 20,0 30,10 30,10 20,0 20)))", + "212F11212"); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "MULTIPOLYGON(((5 5,5 10,6 10,6 5,5 5)),((0 20,0 30,10 30,10 20,0 20)))", + "212F11212"); + + test_geometry("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "POLYGON((0 0,0 5,5 5,5 0,0 0))", + "212F11FF2"); + test_geometry("POLYGON((0 0,0 5,5 5,5 0,0 0))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "2FF11F212"); + test_geometry("POLYGON((0 0,0 5,5 5,5 0,0 0))", + "MULTIPOLYGON(((0 0,0 -10,-10 -10,-10 0,0 0)),((0 0,0 10,10 10,10 0,0 0)))", + "2FF11F212"); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "2FFF1F212"); +} + +template +void test_multi_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + "MULTIPOLYGON(((5 5,5 10,6 10,6 5,5 5)),((0 20,0 30,10 30,10 20,0 20)))", + "212F11212"); + test_geometry("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 20,0 30,10 30,10 20,0 20)))", + "MULTIPOLYGON(((5 5,5 10,6 10,6 5,5 5)))", + "212F11FF2"); + + test_geometry("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + "MULTIPOLYGON(((5 5,5 6,6 6,6 5,5 5)),((0 20,0 30,10 30,10 20,0 20)))", + "212FF1212"); + test_geometry("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 20,0 30,10 30,10 20,0 20)))", + "MULTIPOLYGON(((5 5,5 6,6 6,6 5,5 5)))", + "212FF1FF2"); +} + +template +void test_all() +{ + test_polygon_polygon

(); + test_polygon_multi_polygon

(); + test_multi_polygon_multi_polygon

(); +} + +int test_main( int , char* [] ) +{ + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/relate/relate_areal_areal_sph.cpp b/src/boost/libs/geometry/test/algorithms/relate/relate_areal_areal_sph.cpp new file mode 100644 index 000000000..5475a8fe7 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/relate/relate_areal_areal_sph.cpp @@ -0,0 +1,115 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016, 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) + + +#include "test_relate.hpp" + +#include +#include + + +template +void test_polygon_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + + test_geometry(case_1[0], case_1[1], + "212101212"); + test_geometry(case_1[0], case_1[1], + "212101212"); + + test_geometry(case_1[0], case_1[1], + "212101212"); + test_geometry(case_2[0], case_2[1], + "212101212"); + test_geometry(case_3_sph[0], case_3_sph[1], + "2FF10F212"); + test_geometry(case_3_2_sph[0], case_3_2_sph[1], + "2FFF1FFF2"); + test_geometry(case_4[0], case_4[1], + "212101212"); + test_geometry(case_5[0], case_5[1], + "212101212"); + test_geometry(case_6_sph[0], case_6_sph[1], + "212F11FF2"); + + test_geometry(case_7[0], case_7[1], + "FF2F11212"); + test_geometry(case_8_sph[0], case_8_sph[1], + "FF2F11212"); + test_geometry(case_9_sph[0], case_9_sph[1], + "FF2F01212"); + test_geometry(case_10_sph[0], case_10_sph[1], + "FF2F11212"); + test_geometry(case_11_sph[0], case_11_sph[1], + "212F01FF2"); + test_geometry(case_12[0], case_12[1], + "212101212"); + + test_geometry(case_13_sph[0], case_13_sph[1], + "FF2F11212"); + test_geometry(case_14_sph[0], case_14_sph[1], + "FF2F11212"); + test_geometry(case_15_sph[0], case_15_sph[1], + "FF2F11212"); + test_geometry(case_16_sph[0], case_16_sph[1], + "FF2F11212"); + test_geometry(case_17_sph[0], case_17_sph[1], + "212F11FF2"); + test_geometry(case_18_sph[0], case_18_sph[1], + "212F11FF2"); +} + +template +void test_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_1[0], case_multi_2[0], + "212101212"); + test_geometry(case_2[0], case_multi_2[0], + "212101212"); +} + +template +void test_multi_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_multi_2[0], case_multi_2[1], + "212101212"); +} + + +template +void test_all() +{ + test_polygon_polygon

(); + test_polygon_multi_polygon

(); + test_multi_polygon_multi_polygon

(); +} + +int test_main( int , char* [] ) +{ + typedef bg::cs::spherical_equatorial cs_t; + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/relate/relate_linear_areal.cpp b/src/boost/libs/geometry/test/algorithms/relate/relate_linear_areal.cpp new file mode 100644 index 000000000..56017f6de --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/relate/relate_linear_areal.cpp @@ -0,0 +1,536 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2018 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2013, 2014, 2015. +// Modifications copyright (c) 2013-2015 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) + +#include "test_relate.hpp" +#include "nan_cases.hpp" + +//TEST +//#include + +template +void test_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + + // LS disjoint + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "FF1FF0212"); + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "FF1FF0212"); + + // II BB + test_geometry("LINESTRING(0 0,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1FFF0F212"); + test_geometry("LINESTRING(5 0,5 5,10 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1FFF0F212"); + test_geometry("LINESTRING(5 1,5 5,9 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1FF0FF212"); + + // IE + test_geometry("LINESTRING(11 1,11 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "FF1FF0212"); + // IE IB0 + test_geometry("LINESTRING(11 1,10 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "FF1F00212"); + // IE IB1 + test_geometry("LINESTRING(11 1,10 5,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F00212"); + test_geometry("LINESTRING(11 1,10 10,0 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F00212"); + test_geometry("LINESTRING(11 1,10 0,0 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F00212"); + test_geometry("LINESTRING(0 -1,1 0,2 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F00212"); + // IE IB0 II + test_geometry("LINESTRING(11 1,10 5,5 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1010F0212"); + // IE IB0 lring + test_geometry("LINESTRING(11 1,10 5,11 5,11 1)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F01FFF212"); + // IE IB1 lring + test_geometry("LINESTRING(11 1,10 5,10 10,11 5,11 1)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11FFF212"); + + // IB1 II + test_geometry("LINESTRING(0 0,5 0,5 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "11F00F212"); + // BI0 II IB1 + test_geometry("LINESTRING(5 0,5 5,10 5,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "11FF0F212"); + + // IB1 II IB1 + test_geometry("LINESTRING(1 0,2 0,3 1,4 0,5 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "11FF0F212"); + // IB1 IE IB1 + test_geometry("LINESTRING(1 0,2 0,3 -1,4 0,5 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F0F212"); + + // II IB1 + test_geometry("LINESTRING(5 5,10 5,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "11F00F212"); + // IB1 II + test_geometry("LINESTRING(10 10,10 5,5 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "11F00F212"); + // IE IB1 + test_geometry("LINESTRING(15 5,10 5,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F00212"); + // IB1 IE + test_geometry("LINESTRING(10 10,10 5,15 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F00212"); + + // duplicated points + { + // II IB0 IE + test_geometry("LINESTRING(5 5,10 5,15 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1010F0212"); + test_geometry("LINESTRING(5 5,5 5,5 5,10 5,10 5,10 5,15 10,15 10,15 10)", + "POLYGON((0 0,0 0,0 0,0 10,0 10,0 10,10 10,10 10,10 10,10 0,10 0,10 0,0 0,0 0,0 0))", + "1010F0212"); + test_geometry("LINESTRING(5 5,5 5,5 5,10 0,10 0,10 0,15 10,15 10,15 10)", + "POLYGON((0 0,0 0,0 0,0 10,0 10,0 10,10 10,10 10,10 10,10 0,10 0,10 0,0 0,0 0,0 0))", + "1010F0212"); + // IE IB0 II + test_geometry("LINESTRING(15 10,15 10,15 10,10 5,10 5,10 5,5 5,5 5,5 5)", + "POLYGON((0 0,0 0,0 0,0 10,0 10,0 10,10 10,10 10,10 10,10 0,10 0,10 0,0 0,0 0,0 0))", + "1010F0212"); + test_geometry("LINESTRING(15 10,15 10,15 10,10 0,10 0,10 0,5 5,5 5,5 5)", + "POLYGON((0 0,0 0,0 0,0 10,0 10,0 10,10 10,10 10,10 10,10 0,10 0,10 0,0 0,0 0,0 0))", + "1010F0212"); + + // TEST + //test_geometry("LINESTRING(5 5,5 5,5 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1010F0212"); + test_geometry("LINESTRING(5 5,5 5,5 5,15 5,15 5,15 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1010F0212"); + } + + // non-simple polygon with hole + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "10F0FF212"); + test_geometry("LINESTRING(10 1,10 5,10 9)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "F1FF0F212"); + test_geometry("LINESTRING(2 8,10 5,2 2)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,2 2)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,2 8)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "F1FF0F212"); + + // non-simple polygon with hole, linear ring + test_geometry("LINESTRING(9 1,10 5,9 9,1 9,1 1,9 1)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "10FFFF212"); + test_geometry("LINESTRING(10 5,10 9,11 5,10 1,10 5)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "F11FFF212"); + test_geometry("LINESTRING(11 5,10 1,10 5,10 9,11 5)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "F11FFF212"); + + // non-simple polygon with self-touching holes + test_geometry("LINESTRING(7 1,8 5,7 9)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(8 1,9 1,9 9,8 9,8 1),(2 2,8 5,2 8,2 2))", + "10F0FF212"); + test_geometry("LINESTRING(8 2,8 5,8 8)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(8 1,9 1,9 9,8 9,8 1),(2 2,8 5,2 8,2 2))", + "F1FF0F212"); + test_geometry("LINESTRING(2 8,8 5,2 2)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(8 1,9 1,9 9,8 9,8 1),(2 2,8 5,2 8,2 2))", + "F1FF0F212"); + + // non-simple polygon self-touching + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + "10F0FF212"); + test_geometry("LINESTRING(10 1,10 5,10 9)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + "F1FF0F212"); + test_geometry("LINESTRING(2 8,10 5,2 2)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + "F1FF0F212"); + + // non-simple polygon self-touching, linear ring + test_geometry("LINESTRING(9 1,10 5,9 9,1 9,1 1,9 1)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + "10FFFF212"); + test_geometry("LINESTRING(10 5,10 9,11 5,10 1,10 5)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + "F11FFF212"); + test_geometry("LINESTRING(11 5,10 1,10 5,10 9,11 5)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + "F11FFF212"); + + // polygons with some ring equal to the linestring + test_geometry("LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "F1FFFF2F2"); + test_geometry("LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,5 5,2 8,2 2))", + "F1FFFF212"); + test_geometry("LINESTRING(2 2,5 5,2 8,2 2)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,5 5,2 8,2 2))", + "F1FFFF212"); + + // self-IP going on the boundary then into the exterior and to the boundary again + test_geometry("LINESTRING(2 10,5 10,5 15,6 15,5 10,8 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "F11F0F212"); + // self-IP going on the boundary then into the interior and to the boundary again + test_geometry("LINESTRING(2 10,5 10,5 5,6 5,5 10,8 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "11FF0F212"); + + // self-IP with a hole -> B to I to B to E + test_geometry("LINESTRING(0 0,3 3)", "POLYGON((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 9,1 9,0 0))", + "FF1F00212"); + + // ccw + { + typedef bg::model::polygon ccwpoly; + + // IE IB0 II + test_geometry("LINESTRING(11 1,10 5,5 5)", "POLYGON((0 0,10 0,10 10,0 10,0 0))", "1010F0212"); + // IE IB1 II + test_geometry("LINESTRING(11 1,10 1,10 5,5 5)", "POLYGON((0 0,10 0,10 10,0 10,0 0))", "1110F0212"); + test_geometry("LINESTRING(11 1,10 5,10 1,5 5)", "POLYGON((0 0,10 0,10 10,0 10,0 0))", "1110F0212"); + // II IB0 IE + test_geometry("LINESTRING(5 1,10 5,11 1)", "POLYGON((0 0,10 0,10 10,0 10,0 0))", "1010F0212"); + // IE IB1 II + test_geometry("LINESTRING(5 5,10 1,10 5,11 5)", "POLYGON((0 0,10 0,10 10,0 10,0 0))", "1110F0212"); + test_geometry("LINESTRING(5 5,10 5,10 1,11 5)", "POLYGON((0 0,10 0,10 10,0 10,0 0))", "1110F0212"); + + } + + { + // SPIKES + + test_geometry("LINESTRING(0 0,2 2,3 3,1 1)", "POLYGON((0 0,3 3,3 0,0 0))", "F1FF0F212"); + test_geometry("LINESTRING(0 0,3 3,1 1)", "POLYGON((0 0,3 3,3 0,0 0))", "F1FF0F212"); + test_geometry("LINESTRING(0 0,2 2,1 1)", "POLYGON((0 0,3 3,3 0,0 0))", "F1FF0F212"); + test_geometry("LINESTRING(1 1,3 3,2 2)", "POLYGON((0 0,3 3,3 0,0 0))", "F1FF0F212"); + test_geometry("LINESTRING(1 1,2 2,1 1)", "POLYGON((0 0,3 3,3 0,0 0))", "F1FFFF212"); + + test_geometry("LINESTRING(3 3,1 1,0 0,2 2)", "POLYGON((0 0,3 3,3 0,0 0))", "F1FF0F212"); + test_geometry("LINESTRING(3 3,0 0,2 2)", "POLYGON((0 0,3 3,3 0,0 0))", "F1FF0F212"); + test_geometry("LINESTRING(2 2,0 0,1 1)", "POLYGON((0 0,3 3,3 0,0 0))", "F1FF0F212"); + test_geometry("LINESTRING(3 3,1 1,2 2)", "POLYGON((0 0,3 3,3 0,0 0))", "F1FF0F212"); + test_geometry("LINESTRING(2 2,1 1,2 2)", "POLYGON((0 0,3 3,3 0,0 0))", "F1FFFF212"); + + test_geometry("LINESTRING(0 0,2 2,4 4,1 1)", "POLYGON((0 0,3 3,3 0,0 0))", "F11F0F212"); + + test_geometry("LINESTRING(0 1,1 1,0 1)", "POLYGON((0 0,3 3,3 0,0 0))", "F01FFF212"); + test_geometry("LINESTRING(0 1,3 3,0 1)", "POLYGON((0 0,3 3,3 0,0 0))", "F01FFF212"); + test_geometry("LINESTRING(0 1,0 0,0 1)", "POLYGON((0 0,3 3,3 0,0 0))", "F01FFF212"); + + test_geometry("LINESTRING(0 1,1 1,-1 1)", "POLYGON((0 0,3 3,3 0,0 0))", "F01FF0212"); + } + + { + // POLYGON SPIKES + // note that those are invalid Polygons and in general the result is undefined + + // MySQL bug 15.12.2014 (assertion for invalid polygon) + test_geometry("LINESTRING(6 3,9 0)", + "POLYGON((0 0,5 8,6 1,6 3,8 1,5 4,9 6,2 5,7 4,1 7,0 0))", + "F11F00212"); + test_geometry("LINESTRING(9 0,2 7)", + "POLYGON((4 1,3 2,5 9,8 4,4 5,3 6,8 1,6 2,2 4,6 0,4 1))", + "F11FF0212"); + + test_geometry("LINESTRING(6 3,9 0)", + "POLYGON((6 1,6 3,8 1,5 4,6 1))", + "F11F00212"); + test_geometry("LINESTRING(6 3,8 1,9 0)", + "POLYGON((6 1,6 3,8 1,5 4,6 1))", + "F11F00212"); + + // entry-point spikes are not handled + test_geometry("LINESTRING(9 0,6 3)", + "POLYGON((6 1,6 3,8 1,5 4,6 1))", + "**1*00212"); + test_geometry("LINESTRING(9 0,8 1,6 3)", + "POLYGON((6 1,6 3,8 1,5 4,6 1))", + "F11F00212"); + + // Ls going out-in on 2 collinear spikes touching each other + // this works partially, other invalid effect is noticeable here, + // the bottom of a spike shouldn't be there so the algorithm + // thinks the linestring is going into the interior + test_geometry("LINESTRING(2 2,6 6)", + "POLYGON((0 0,0 2,2 2,4 4,3 3,5 3,5 5,4 4,7 7,7 0,0 0))", + "*1FF0F212"); + // Ls going out-in on 2 collinear spikes NOT touching each other + // This is not supported, plus the same as above + test_geometry("LINESTRING(2 2,6 6)", + "POLYGON((0 0,0 2,2 2,3 3,2 2,5 3,5 5,4 4,7 7,7 0,0 0))", + "*1*F0*212"); + } + + // 21.01.2015 + test_geometry("LINESTRING(3 7, 9 1)", + "POLYGON((0 0,0 10,10 10,10 0,5 5,0 0))", + "11F00F212"); + + // inspired by the bug for mls/poly + test_geometry("LINESTRING(0 0, 7 7)", + "POLYGON((5 5,5 15,15 15,15 5,5 5))", + "1010F0212"); + + // 25.01.2015 + test_geometry("LINESTRING(4 5, 0 6, 5 6)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4))", + "11FF0F212"); + test_geometry("LINESTRING(2 3, 4 5, 0 6, 5 6)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4))", + "11F00F212"); + test_geometry("LINESTRING(2 9, 1 1, 10 1, 10 10, 1 10, 0 6, 5 6)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))", + "11F00F212"); +} + +template +void test_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("LINESTRING(10 1,10 5,10 9)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,10 9)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0)))", + "F1FF0F212"); + + test_geometry("LINESTRING(10 1,10 5,2 2)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,2 2)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0)))", + "11F00F212"); + + test_geometry("LINESTRING(10 1,10 5,2 2)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)),((10 5,3 3,3 7,10 5)))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,2 8)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)),((10 5,3 3,3 7,10 5)))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,3 3)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)),((10 5,3 3,3 7,10 5)))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,3 7)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)),((10 5,3 3,3 7,10 5)))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,5 5)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)),((10 5,3 3,3 7,10 5)))", + "11F00F212"); + + test_geometry("LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((20 0,20 10,30 20,20 0)))", + "F1FFFF212"); + + // degenerated points + test_geometry("LINESTRING(5 5,10 10,10 10,10 10,15 15)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((10 10,10 20,20 20,20 10,10 10)))", + "10F0FF212"); + + // self-IP polygon with a hole and second polygon with a hole -> B to I to B to B to I to B to E + test_geometry("LINESTRING(0 0,3 3)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 9,1 9,0 0)),((0 0,2 8,8 8,8 2,0 0),(0 0,7 3,7 7,3 7,0 0)))", + "FF1F00212"); + // self-IP polygon with a hole and second polygon -> B to I to B to B to I + test_geometry("LINESTRING(0 0,3 3)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 9,1 9,0 0)),((0 0,2 8,8 8,8 2,0 0)))", + "1FF00F212"); + test_geometry("LINESTRING(0 0,3 3)", + "MULTIPOLYGON(((0 0,2 8,8 8,8 2,0 0)),((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 9,1 9,0 0)))", + "1FF00F212"); + + // MySQL report 18.12.2014 (https://svn.boost.org/trac/boost/ticket/10887) + test_geometry("LINESTRING(5 -2,5 2)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "10F0FF212"); + test_geometry("LINESTRING(5 -2,5 5)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "10F00F212"); + test_geometry("LINESTRING(5 -2,5 0)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "1FF00F212"); + // MySQL report 18.12.2014 - extended + test_geometry("LINESTRING(5 -2,5 0)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)),((5 0,7 1,7 -1,5 0)))", + "1FF00F212"); + test_geometry("LINESTRING(0 0,5 0)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)),((5 0,7 1,7 -1,5 0)))", + "FF1F00212"); + + // 22.01.2015 + test_geometry("LINESTRING(5 5,0 0,10 0)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "11F00F212"); + test_geometry("LINESTRING(5 5,0 0,0 10)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "11F00F212"); + // extended + test_geometry("LINESTRING(5 5,0 0,2 1)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "10F0FF212"); + test_geometry("LINESTRING(5 5,0 0,5 -5)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "1010F0212"); + test_geometry("LINESTRING(5 5,0 0,5 -5,5 1)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "1010FF212"); + test_geometry("LINESTRING(-5 5,0 0,5 -5)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "F01FF0212"); +} + +template +void test_multi_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + typedef bg::model::polygon

poly; + typedef typename bg::coordinate_type

::type coord_t; + + test_geometry("MULTILINESTRING((11 11, 20 20),(5 7, 4 1))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2))", + "1F10F0212"); + test_geometry("MULTILINESTRING((10 0, 18 12),(2 2,2 1))", + "POLYGON((5 0,0 -5,-5 0,0 5,5 0))", + "1F10F0212"); + + if ( BOOST_GEOMETRY_CONDITION(( + boost::is_same::value )) ) + { + // assertion failure in 1.57 + test_geometry("MULTILINESTRING((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))", + "POLYGON((-2.333333333333333 -8.6666666666666661,-4.3253012048192767 -8.168674698795181,-4.1194968553459113 -7.6100628930817606,-2.8823529411764706 -7.7647058823529411,-2.882352941176471 -7.7647058823529411,-2.263157894736842 -8.6315789473684212,-2.333333333333333 -8.6666666666666661))", + "*********"); + test_geometry("MULTILINESTRING((-2.333333333333333 -8.6666666666666661,-4.3253012048192767 -8.168674698795181,-4.1194968553459113 -7.6100628930817606,-2.8823529411764706 -7.7647058823529411,-2.882352941176471 -7.7647058823529411,-2.263157894736842 -8.6315789473684212,-2.333333333333333 -8.6666666666666661))", + "POLYGON((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))", + "*********"); + } + + // 21.01.2015 + test_geometry("MULTILINESTRING((6 6,15 15),(0 0, 7 7))", + "POLYGON((5 5,5 15,15 15,15 5,5 5))", + "101000212"); + test_geometry("MULTILINESTRING((15 15,6 6),(0 0, 7 7))", + "POLYGON((5 5,5 15,15 15,15 5,5 5))", + "101000212"); + // extended + test_geometry("MULTILINESTRING((15 15,6 6),(4 14,6 16))", + "POLYGON((5 5,5 15,15 15,15 5,5 5))", + "101000212"); + + // 23.01.2015 + test_geometry("MULTILINESTRING((4 10, 3 10, 10 6),(5 0, 7 5, 9 10))", + "POLYGON((0 0,0 10,10 10,10 0,5 5,0 0))", + "111F00212"); + + // 23.01.2015 + test_geometry("MULTILINESTRING((3 10, 1 5, 1 10, 3 4, 7 8, 6 10, 10 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "10FF0F212"); + + // mysql bug + // assertion failure in relate->boundary_checker->std::equal_range with msvc + if (BOOST_GEOMETRY_CONDITION(is_nan_case_supported::value)) + { + mls g1; + std::string wkt1; + nan_case(g1, wkt1); + + std::string wkt2 = "POLYGON((1.1e+308 1.2e+308,-1 -9,1 1e+12,1.1e+308 7.8e+307,1.1e+308 1.2e+308),(3 2,1 1,8e+307 1e+308,3 2),(258 2049,1 -3,1 1,-6 9,258 2049))"; + poly g2; + bg::read_wkt(wkt2, g2); + + check_geometry(g1, g2, wkt1, wkt2, "*********"); + } +} + +template +void test_multi_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_linestring mls; + typedef bg::model::multi_polygon mpoly; + + // polygons with some ring equal to the linestrings + test_geometry("MULTILINESTRING((0 0,10 0,10 10,0 10,0 0),(20 20,50 50,20 80,20 20))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + "F11FFF2F2"); + + test_geometry("MULTILINESTRING((0 0,10 0,10 10,0 10,0 0),(2 2,5 5,2 8,2 2))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(2 2,5 5,2 8,2 2)))", + "F1FFFF2F2"); + + + test_geometry("MULTILINESTRING((0 0,10 0,10 10),(10 10,0 10,0 0))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + "F1FFFF2F2"); + test_geometry("MULTILINESTRING((0 0,10 0,10 10),(10 10,0 10,0 0),(20 20,50 50,20 80,20 20))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + "F11FFF2F2"); + + // disjoint + test_geometry("MULTILINESTRING((20 20,30 30),(30 30,40 40))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + "FF1FF0212"); + + test_geometry("MULTILINESTRING((5 5,0 5),(5 5,5 0),(10 10,10 5,5 5,5 10,10 10))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)),((5 5,10 1,10 0,5 5)))", + "F1FF0F212"); + test_geometry("MULTILINESTRING((5 5,0 5),(5 5,5 0),(0 5,0 0,5 0),(10 10,10 5,5 5,5 10,10 10))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)),((5 5,10 1,10 0,5 5)))", + "F1FFFF212"); + test_geometry("MULTILINESTRING((5 5,0 0),(5 5,5 0),(10 10,10 5,5 5,5 10,10 10))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)),((5 5,10 1,10 0,5 5)))", + "11FF0F212"); + + // MySQL report 18.12.2014 - extended + test_geometry("MULTILINESTRING((5 -2,4 -2,5 0),(5 -2,6 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "10FFFF212"); + test_geometry("MULTILINESTRING((0 0,0 1,5 0),(0 0,0 -1,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "F01FFF212"); + test_geometry("MULTILINESTRING((5 -2,4 -2,5 0),(6 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "10F0FF212"); + test_geometry("MULTILINESTRING((0 0,0 1,5 0),(0 -1,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "F01FF0212"); + test_geometry("MULTILINESTRING((0 0,5 0),(5 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "1010F0212"); + test_geometry("MULTILINESTRING((5 -2,5 0),(0 0,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "1010F0212"); + + // 22.01.2015 - extended + test_geometry("MULTILINESTRING((10 10,0 10),(5 5,0 0,10 0))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "11F00F212"); + test_geometry("MULTILINESTRING((5 5,0 0,5 -5),(0 0,9 1))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "101000212"); + test_geometry("MULTILINESTRING((5 -5,0 0,5 5),(0 0,5 -1))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "101000212"); +} + +template +void test_all() +{ + test_linestring_polygon

(); + test_linestring_multi_polygon

(); + test_multi_linestring_polygon

(); + test_multi_linestring_multi_polygon

(); +} + +int test_main( int , char* [] ) +{ + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/relate/relate_linear_areal_sph.cpp b/src/boost/libs/geometry/test/algorithms/relate/relate_linear_areal_sph.cpp new file mode 100644 index 000000000..ec7b41734 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/relate/relate_linear_areal_sph.cpp @@ -0,0 +1,419 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016, 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) + + +#include "test_relate.hpp" + + +template +void test_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + + // LS disjoint + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "FF1FF0212"); + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "FF1FF0212"); + + // II BB + test_geometry("LINESTRING(0 0,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1FFF0F212"); + test_geometry("LINESTRING(5 0,5 5,10 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1FFF0F212"); + test_geometry("LINESTRING(5 1,5 5,9 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1FF0FF212"); + + // IE + test_geometry("LINESTRING(11 1,11 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "FF1FF0212"); + // IE IB0 + test_geometry("LINESTRING(11 1,10 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "FF1F00212"); + // IE IB1 + test_geometry("LINESTRING(11 1,10 5,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F00212"); + test_geometry("LINESTRING(11 1,10 10,0 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F00212"); + test_geometry("LINESTRING(11 1,10 0,0 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F00212"); + test_geometry("LINESTRING(0 -1,1 0,2 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F00212"); + // IE IB0 II + test_geometry("LINESTRING(11 1,10 5,5 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1010F0212"); + // IE IB0 lring + test_geometry("LINESTRING(11 1,10 5,11 5,11 1)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F01FFF212"); + // IE IB1 lring + test_geometry("LINESTRING(11 1,10 5,10 10,11 5,11 1)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11FFF212"); + + // IB1 II + test_geometry("LINESTRING(0 0,5 0,5 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "11F00F212"); + // BI0 II IB1 + test_geometry("LINESTRING(5 0,5 5,10 5,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "11FF0F212"); + + // IB1 II IB1 + test_geometry("LINESTRING(1 0,2 0,3 1,4 0,5 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "11FF0F212"); + // IB1 IE IB1 + test_geometry("LINESTRING(1 0,2 0,3 -1,4 0,5 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F0F212"); + + // II IB1 + test_geometry("LINESTRING(5 5,10 5,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "11F00F212"); + // IB1 II + test_geometry("LINESTRING(10 10,10 5,5 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "11F00F212"); + // IE IB1 + test_geometry("LINESTRING(15 5,10 5,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F00212"); + // IB1 IE + test_geometry("LINESTRING(10 10,10 5,15 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "F11F00212"); + + // duplicated points + { + // II IB0 IE + test_geometry("LINESTRING(5 5,10 5,15 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1010F0212"); + test_geometry("LINESTRING(5 5,5 5,5 5,10 5,10 5,10 5,15 10,15 10,15 10)", + "POLYGON((0 0,0 0,0 0,0 10,0 10,0 10,10 10,10 10,10 10,10 0,10 0,10 0,0 0,0 0,0 0))", + "1010F0212"); + test_geometry("LINESTRING(5 5,5 5,5 5,10 0,10 0,10 0,15 10,15 10,15 10)", + "POLYGON((0 0,0 0,0 0,0 10,0 10,0 10,10 10,10 10,10 10,10 0,10 0,10 0,0 0,0 0,0 0))", + "1010F0212"); + // IE IB0 II + test_geometry("LINESTRING(15 10,15 10,15 10,10 5,10 5,10 5,5 5,5 5,5 5)", + "POLYGON((0 0,0 0,0 0,0 10,0 10,0 10,10 10,10 10,10 10,10 0,10 0,10 0,0 0,0 0,0 0))", + "1010F0212"); + test_geometry("LINESTRING(15 10,15 10,15 10,10 0,10 0,10 0,5 5,5 5,5 5)", + "POLYGON((0 0,0 0,0 0,0 10,0 10,0 10,10 10,10 10,10 10,10 0,10 0,10 0,0 0,0 0,0 0))", + "1010F0212"); + + // TEST + //test_geometry("LINESTRING(5 5,5 5,5 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1010F0212"); + test_geometry("LINESTRING(5 5,5 5,5 5,15 5,15 5,15 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", "1010F0212"); + } + + // non-simple polygon with hole + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "10F0FF212"); + test_geometry("LINESTRING(10 1,10 5,10 9)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "F1FF0F212"); + test_geometry("LINESTRING(2 8,10 5,2 2)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,2 2)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,2 8)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "F1FF0F212"); + + // non-simple polygon with hole, linear ring + test_geometry("LINESTRING(9 1,10 5,9 9,1 9,1 1,9 1)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "10FFFF212"); + test_geometry("LINESTRING(10 5,10 9,11 5,10 1,10 5)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "F11FFF212"); + test_geometry("LINESTRING(11 5,10 1,10 5,10 9,11 5)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + "F11FFF212"); + + // non-simple polygon with self-touching holes + test_geometry("LINESTRING(7 1,8 5,7 9)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(8 1,9 1,9 9,8 9,8 1),(2 2,8 5,2 8,2 2))", + "10F0FF212"); + test_geometry("LINESTRING(8 2,8 5,8 8)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(8 1,9 1,9 9,8 9,8 1),(2 2,8 5,2 8,2 2))", + "F1FF0F212"); + test_geometry("LINESTRING(2 8,8 5,2 2)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(8 1,9 1,9 9,8 9,8 1),(2 2,8 5,2 8,2 2))", + "F1FF0F212"); + + // non-simple polygon self-touching + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + "10F0FF212"); + test_geometry("LINESTRING(10 1,10 5,10 9)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + "F1FF0F212"); + test_geometry("LINESTRING(2 8,10 5,2 2)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + "F1FF0F212"); + + // non-simple polygon self-touching, linear ring + test_geometry("LINESTRING(9 1,10 5,9 9,1 9,1 1,9 1)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + "10FFFF212"); + test_geometry("LINESTRING(10 5,10 9,11 5,10 1,10 5)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + "F11FFF212"); + test_geometry("LINESTRING(11 5,10 1,10 5,10 9,11 5)", + "POLYGON((0 0,0 10,10 10,10 5,2 8,2 2,10 5,10 0,0 0))", + "F11FFF212"); + + // polygons with some ring equal to the linestring + test_geometry("LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "F1FFFF2F2"); + test_geometry("LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,5 5,2 8,2 2))", + "F1FFFF212"); + test_geometry("LINESTRING(2 2,5 5,2 8,2 2)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,5 5,2 8,2 2))", + "F1FFFF212"); + + // self-IP going on the boundary then into the exterior and to the boundary again + test_geometry("LINESTRING(2 10.023946271183535,5 10.037423045910710,5 15,6 15,5 10.037423045910710,8 10.023946271183535)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "F11F0F212"); + // self-IP going on the boundary then into the interior and to the boundary again + test_geometry("LINESTRING(2 10.023946271183535,5 10.037423045910710,5 5,6 5,5 10.037423045910710,8 10.023946271183535)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "11FF0F212"); + + // self-IP with a hole -> B to I to B to E + test_geometry("LINESTRING(0 0,3 3)", "POLYGON((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 9,1 9,0 0))", + "FF1F00212"); +} + +template +void test_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("LINESTRING(10 1,10 5,10 9)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,10 9)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0)))", + "F1FF0F212"); + + test_geometry("LINESTRING(10 1,10 5,2 2)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,2 2)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0)))", + "11F00F212"); + + test_geometry("LINESTRING(10 1,10 5,2 2)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)),((10 5,3 3,3 7,10 5)))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,2 8)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)),((10 5,3 3,3 7,10 5)))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,3 3)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)),((10 5,3 3,3 7,10 5)))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,3 7)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)),((10 5,3 3,3 7,10 5)))", + "F1FF0F212"); + test_geometry("LINESTRING(10 1,10 5,5 5)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)),((10 5,3 3,3 7,10 5)))", + "11F00F212"); + + test_geometry("LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((20 0,20 10,30 20,20 0)))", + "F1FFFF212"); + + // degenerated points + test_geometry("LINESTRING(5 5,10 10,10 10,10 10,15 15)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((10 10,10 20,20 20,20 10,10 10)))", + "10F0FF212"); + + // self-IP polygon with a hole and second polygon with a hole -> B to I to B to B to I to B to E + test_geometry("LINESTRING(0 0,3 3)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 9,1 9,0 0)),((0 0,2 8,8 8,8 2,0 0),(0 0,7 3,7 7,3 7,0 0)))", + "FF1F00212"); + // self-IP polygon with a hole and second polygon -> B to I to B to B to I + test_geometry("LINESTRING(0 0,3 3)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 9,1 9,0 0)),((0 0,2 8,8 8,8 2,0 0)))", + "1FF00F212"); + test_geometry("LINESTRING(0 0,3 3)", + "MULTIPOLYGON(((0 0,2 8,8 8,8 2,0 0)),((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 9,1 9,0 0)))", + "1FF00F212"); + + // MySQL report 18.12.2014 (https://svn.boost.org/trac/boost/ticket/10887) + test_geometry("LINESTRING(5 -2,5 2)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "10F0FF212"); + test_geometry("LINESTRING(5 -2,5 5.0190018174896416)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "10F00F212"); + test_geometry("LINESTRING(5 -2,5 0)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "1FF00F212"); + // MySQL report 18.12.2014 - extended + test_geometry("LINESTRING(5 -2,5 0)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)),((5 0,7 1,7 -1,5 0)))", + "1FF00F212"); + test_geometry("LINESTRING(0 0,5 0)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)),((5 0,7 1,7 -1,5 0)))", + "FF1F00212"); + + // 22.01.2015 + test_geometry("LINESTRING(5 5,0 0,10 0)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "11F00F212"); + test_geometry("LINESTRING(5 5,0 0,0 10)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "11F00F212"); + // extended + test_geometry("LINESTRING(5 5,0 0,2 1)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "10F0FF212"); + test_geometry("LINESTRING(5 5,0 0,5 -5)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "1010F0212"); + test_geometry("LINESTRING(5 5,0 0,5 -5,5 1)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "1010FF212"); + test_geometry("LINESTRING(-5 5,0 0,5 -5)", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "F01FF0212"); +} + +template +void test_multi_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef typename bg::coordinate_type

::type coord_t; + + test_geometry("MULTILINESTRING((11 11, 20 20),(5 7, 4 1))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2))", + "1F10F0212"); + test_geometry("MULTILINESTRING((10 0, 18 12),(2 2,2 1))", + "POLYGON((5 0,0 -5,-5 0,0 5,5 0))", + "1F10F0212"); + + if ( BOOST_GEOMETRY_CONDITION(( + boost::is_same::value )) ) + { + // assertion failure in 1.57 + test_geometry("MULTILINESTRING((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))", + "POLYGON((-2.333333333333333 -8.6666666666666661,-4.3253012048192767 -8.168674698795181,-4.1194968553459113 -7.6100628930817606,-2.8823529411764706 -7.7647058823529411,-2.882352941176471 -7.7647058823529411,-2.263157894736842 -8.6315789473684212,-2.333333333333333 -8.6666666666666661))", + "*********"); + test_geometry("MULTILINESTRING((-2.333333333333333 -8.6666666666666661,-4.3253012048192767 -8.168674698795181,-4.1194968553459113 -7.6100628930817606,-2.8823529411764706 -7.7647058823529411,-2.882352941176471 -7.7647058823529411,-2.263157894736842 -8.6315789473684212,-2.333333333333333 -8.6666666666666661))", + "POLYGON((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))", + "*********"); + } + + // 21.01.2015 + test_geometry("MULTILINESTRING((6 6,15 15),(0 0, 7 7))", + "POLYGON((5 5,5 15,15 15,15 5,5 5))", + "101000212"); + test_geometry("MULTILINESTRING((15 15,6 6),(0 0, 7 7))", + "POLYGON((5 5,5 15,15 15,15 5,5 5))", + "101000212"); + + // extended + test_geometry("MULTILINESTRING((15 15,6 6),(4 14,6 15.986412732589057))", + "POLYGON((5 5,5 15,15 15,15 5,5 5))", + "101000212"); + + // 23.01.2015 + test_geometry("MULTILINESTRING((4 10.035925377760330, 3 10.031432746397092, 10 6),(5 0, 7 5, 9 10.013467818052765))", + "POLYGON((0 0,0 10,10 10,10 0,5 5,0 0))", + "111F00212"); + + // 23.01.2015 + test_geometry("MULTILINESTRING((3 10.031432746397092, 1 5, 1 10.013467818052765, 3 4, 7 8, 6 10.035925377760330, 10 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "10FF0F212"); +} + +template +void test_multi_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_linestring mls; + typedef bg::model::multi_polygon mpoly; + + // polygons with some ring equal to the linestrings + test_geometry("MULTILINESTRING((0 0,10 0,10 10,0 10,0 0),(20 20,50 50,20 80,20 20))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + "F11FFF2F2"); + + test_geometry("MULTILINESTRING((0 0,10 0,10 10,0 10,0 0),(2 2,5 5,2 8,2 2))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(2 2,5 5,2 8,2 2)))", + "F1FFFF2F2"); + + + test_geometry("MULTILINESTRING((0 0,10 0,10 10),(10 10,0 10,0 0))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + "F1FFFF2F2"); + test_geometry("MULTILINESTRING((0 0,10 0,10 10),(10 10,0 10,0 0),(20 20,50 50,20 80,20 20))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + "F11FFF2F2"); + + // disjoint + test_geometry("MULTILINESTRING((20 20,30 30),(30 30,40 40))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + "FF1FF0212"); + + test_geometry("MULTILINESTRING((5 5,0 5),(5 5,5 0),(10 10,10 5,5 5,5 10,10 10))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)),((5 5,10 1,10 0,5 5)))", + "F1FF0F212"); + test_geometry("MULTILINESTRING((5 5,0 5),(5 5,5 0),(0 5,0 0,5 0),(10 10,10 5,5 5,5 10,10 10))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)),((5 5,10 1,10 0,5 5)))", + "F1FFFF212"); + test_geometry("MULTILINESTRING((5 5,0 0),(5 5,5 0),(10 10,10 5,5 5,5 10,10 10))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)),((5 5,10 1,10 0,5 5)))", + "11FF0F212"); + + // MySQL report 18.12.2014 - extended + test_geometry("MULTILINESTRING((5 -2,4 -2,5 0),(5 -2,6 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "10FFFF212"); + test_geometry("MULTILINESTRING((0 0,0 1,5 0),(0 0,0 -1,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "F01FFF212"); + test_geometry("MULTILINESTRING((5 -2,4 -2,5 0),(6 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "10F0FF212"); + test_geometry("MULTILINESTRING((0 0,0 1,5 0),(0 -1,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "F01FF0212"); + test_geometry("MULTILINESTRING((0 0,5 0),(5 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "1010F0212"); + test_geometry("MULTILINESTRING((5 -2,5 0),(0 0,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + "1010F0212"); + + // 22.01.2015 - extended + test_geometry("MULTILINESTRING((10 10,0 10),(5 5,0 0,10 0))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "11F00F212"); + test_geometry("MULTILINESTRING((5 5,0 0,5 -5),(0 0,9 1))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "101000212"); + test_geometry("MULTILINESTRING((5 -5,0 0,5 5),(0 0,5 -1))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + "101000212"); +} + +template +void test_all() +{ + test_linestring_polygon

(); + test_linestring_multi_polygon

(); + test_multi_linestring_polygon

(); + test_multi_linestring_multi_polygon

(); +} + +int test_main( int , char* [] ) +{ + typedef bg::cs::spherical_equatorial cs_t; + + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/relate/relate_linear_linear.cpp b/src/boost/libs/geometry/test/algorithms/relate/relate_linear_linear.cpp new file mode 100644 index 000000000..d2073a876 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/relate/relate_linear_linear.cpp @@ -0,0 +1,446 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2013, 2014, 2015. +// Modifications copyright (c) 2013-2015 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) + +#include "test_relate.hpp" + +//TEST +//#include + +template +void test_linestring_linestring() +{ + typedef bg::model::linestring

ls; + + test_geometry("LINESTRING(0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", "1FFF0FFF2"); + test_geometry("LINESTRING(0 0,3 2)", "LINESTRING(0 0, 2 2, 3 2)", "FF1F0F1F2"); + test_geometry("LINESTRING(1 0,2 2,2 3)", "LINESTRING(0 0, 2 2, 3 2)", "0F1FF0102"); + + test_geometry("LINESTRING(0 0,5 0)", "LINESTRING(0 0,1 1,2 0,2 -1)", "0F1F00102"); + + test_geometry("LINESTRING(0 0, 1 1, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", "1FFF0FFF2"); + test_geometry("LINESTRING(3 2, 2 2, 1 1, 0 0)", "LINESTRING(0 0, 2 2, 3 2)", "1FFF0FFF2"); + test_geometry("LINESTRING(0 0, 1 1, 2 2, 3 2)", "LINESTRING(3 2, 2 2, 0 0)", "1FFF0FFF2"); + test_geometry("LINESTRING(3 2, 2 2, 1 1, 0 0)", "LINESTRING(3 2, 2 2, 0 0)", "1FFF0FFF2"); + + test_geometry("LINESTRING(3 1, 2 2, 1 1, 0 0)", "LINESTRING(0 0, 2 2, 3 2)", "1F1F00102"); + test_geometry("LINESTRING(3 3, 2 2, 1 1, 0 0)", "LINESTRING(0 0, 2 2, 3 2)", "1F1F00102"); + + test_geometry("LINESTRING(0 0, 1 1, 2 2, 2 3)", "LINESTRING(0 0, 2 2, 2 3)", "1FFF0FFF2"); + test_geometry("LINESTRING(2 3, 2 2, 1 1, 0 0)", "LINESTRING(0 0, 2 2, 2 3)", "1FFF0FFF2"); + test_geometry("LINESTRING(0 0, 1 1, 2 2, 2 3)", "LINESTRING(2 3, 2 2, 0 0)", "1FFF0FFF2"); + test_geometry("LINESTRING(2 3, 2 2, 1 1, 0 0)", "LINESTRING(2 3, 2 2, 0 0)", "1FFF0FFF2"); + + test_geometry("LINESTRING(1 1, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", "1FF0FF102"); + + test_geometry("LINESTRING(3 2, 2 2, 1 1)", "LINESTRING(0 0, 2 2, 4 2)", "1FF0FF102"); + test_geometry("LINESTRING(1 1, 2 2, 3 2)", "LINESTRING(4 2, 2 2, 0 0)", "1FF0FF102"); + test_geometry("LINESTRING(3 2, 2 2, 1 1)", "LINESTRING(4 2, 2 2, 0 0)", "1FF0FF102"); + +// test_geometry("LINESTRING(1 1, 2 2, 2 2)", "LINESTRING(0 0, 2 2, 4 2)", true); + +// test_geometry("LINESTRING(1 1, 2 2, 3 3)", "LINESTRING(0 0, 2 2, 4 2)", false); +// test_geometry("LINESTRING(1 1, 2 2, 3 2, 3 3)", "LINESTRING(0 0, 2 2, 4 2)", false); +// test_geometry("LINESTRING(1 1, 2 2, 3 1)", "LINESTRING(0 0, 2 2, 4 2)", false); +// test_geometry("LINESTRING(1 1, 2 2, 3 2, 3 1)", "LINESTRING(0 0, 2 2, 4 2)", false); + +// test_geometry("LINESTRING(0 1, 1 1, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", false); +// test_geometry("LINESTRING(0 1, 0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", false); +// test_geometry("LINESTRING(1 0, 1 1, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", false); +// test_geometry("LINESTRING(1 0, 0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", false); + +// test_geometry("LINESTRING(0 0)", "LINESTRING(0 0)", false); +// test_geometry("LINESTRING(1 1)", "LINESTRING(0 0, 2 2)", true); +// test_geometry("LINESTRING(0 0)", "LINESTRING(0 0, 2 2)", false); +// test_geometry("LINESTRING(0 0, 1 1)", "LINESTRING(0 0)", false); + +// test_geometry("LINESTRING(0 0,5 0,3 0,6 0)", "LINESTRING(0 0,6 0)", true); +// test_geometry("LINESTRING(0 0,2 2,3 3,1 1)", "LINESTRING(0 0,3 3,6 3)", true); + + // SPIKES! + test_geometry("LINESTRING(0 0,2 2,3 3,1 1,5 3)", "LINESTRING(0 0,3 3,6 3)", "1F100F102"); + test_geometry("LINESTRING(5 3,1 1,3 3,2 2,0 0)", "LINESTRING(0 0,3 3,6 3)", "1F100F102"); + test_geometry("LINESTRING(0 0,2 2,3 3,1 1,5 3)", "LINESTRING(6 3,3 3,0 0)", "1F100F102"); + test_geometry("LINESTRING(5 3,1 1,3 3,2 2,0 0)", "LINESTRING(6 3,3 3,0 0)", "1F100F102"); + + test_geometry("LINESTRING(6 3,3 3,0 0)", "LINESTRING(0 0,2 2,3 3,1 1,5 3)", "101F001F2"); + + test_geometry("LINESTRING(0 0,10 0)", "LINESTRING(1 0,9 0,2 0)", "101FF0FF2"); + test_geometry("LINESTRING(0 0,2 2,3 3,1 1)", "LINESTRING(0 0,3 3,6 3)", "1FF00F102"); + // TODO: REWRITE MATRICES + // BEGIN + /*test_geometry("LINESTRING(0 0,2 2,3 3,1 1)", "LINESTRING(0 0,4 4,6 3)", "1FF00F102"); + + test_geometry("LINESTRING(0 0,2 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102"); + test_geometry("LINESTRING(2 0,0 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102"); + + test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(3 0,3 3,3 1)", "0F1FF0102"); + test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(2 0,2 3,2 1)", "0F1FF0102"); + test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(2 0,2 2,2 1)", "0F1FF0102"); + + test_geometry("LINESTRING(0 0,2 2,3 3,4 4)", "LINESTRING(0 0,1 1,4 4)", "1FFF0FFF2");*/ + // END + + test_geometry("LINESTRING(0 0,2 2,3 3,4 4)", "LINESTRING(0 0,1 1,4 4)", "1FFF0FFF2"); + + // loop i/i i/i u/u u/u + test_geometry("LINESTRING(0 0,10 0)", + "LINESTRING(1 1,1 0,6 0,6 1,4 1,4 0,9 0,9 1)", "1F1FF0102"); + + // self-intersecting and self-touching equal + test_geometry("LINESTRING(0 5,5 5,10 5,10 10,5 10,5 5,5 0)", + "LINESTRING(0 5,5 5,5 10,10 10,10 5,5 5,5 0)", "1FFF0FFF2"); + // self-intersecting loop and self-touching equal + test_geometry("LINESTRING(0 5,5 5,10 5,10 10,5 10,5 5,10 5,10 10,5 10,5 5,5 0)", + "LINESTRING(0 5,5 5,5 10,10 10,10 5,5 5,5 0)", "1FFF0FFF2"); + + test_geometry("LINESTRING(0 0,1 1)", "LINESTRING(0 1,1 0)", "0F1FF0102"); + test_geometry("LINESTRING(0 0,1 1)", "LINESTRING(1 1,2 0)", "FF1F00102"); + test_geometry("LINESTRING(0 0,1 1)", "LINESTRING(2 0,1 1)", "FF1F00102"); + + test_geometry("LINESTRING(0 0,1 0,2 1,3 5,4 0)", "LINESTRING(1 0,2 1,3 5)", "101FF0FF2"); + test_geometry("LINESTRING(0 0,1 0,2 1,3 5,4 0)", "LINESTRING(3 5,2 1,1 0)", "101FF0FF2"); + test_geometry("LINESTRING(1 0,2 1,3 5)", "LINESTRING(4 0,3 5,2 1,1 0,0 0)", "1FF0FF102"); + test_geometry("LINESTRING(3 5,2 1,1 0)", "LINESTRING(4 0,3 5,2 1,1 0,0 0)", "1FF0FF102"); + + test_geometry("LINESTRING(0 0,10 0)", "LINESTRING(-1 -1,1 0,10 0,20 -1)", "1F10F0102"); + test_geometry("LINESTRING(0 0,10 0)", "LINESTRING(20 -1,10 0,1 0,-1 -1)", "1F10F0102"); + + test_geometry("LINESTRING(-1 1,0 0,1 0,5 0,5 5,10 5,15 0,31 0)", + "LINESTRING(-1 -1,0 0,1 0,2 0,3 1,4 0,30 0)", + "101FF0102"); + test_geometry("LINESTRING(-1 1,0 0,1 0,5 0,5 5,10 5,15 0,31 0)", + "LINESTRING(30 0,4 0,3 1,2 0,1 0,0 0,-1 -1)", + "101FF0102"); + test_geometry("LINESTRING(31 0,15 0,10 5,5 5,5 0,1 0,0 0,-1 1)", + "LINESTRING(-1 -1,0 0,1 0,2 0,3 1,4 0,30 0)", + "101FF0102"); + test_geometry("LINESTRING(31 0,15 0,10 5,5 5,5 0,1 0,0 0,-1 1)", + "LINESTRING(30 0,4 0,3 1,2 0,1 0,0 0,-1 -1)", + "101FF0102"); + + // self-IP + test_geometry("LINESTRING(1 0,9 0)", + "LINESTRING(0 0,10 0,10 10,5 0,0 10)", + "1FF0FF102"); + test_geometry("LINESTRING(1 0,5 0,9 0)", + "LINESTRING(0 0,10 0,10 10,5 0,0 10)", + "1FF0FF102"); + test_geometry("LINESTRING(1 0,9 0)", + "LINESTRING(0 0,10 0,10 10,5 10,5 -1)", + "1FF0FF102"); + test_geometry("LINESTRING(1 0,9 0)", + "LINESTRING(0 0,10 0,5 0,5 5)", + "1FF0FF102"); + test_geometry("LINESTRING(1 0,7 0)", "LINESTRING(0 0,10 0,10 10,4 -1)", + "1FF0FF102"); + test_geometry("LINESTRING(1 0,5 0,7 0)", "LINESTRING(0 0,10 0,10 10,4 -1)", + "1FF0FF102"); + test_geometry("LINESTRING(1 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,4 -1)", + "1F10F0102"); + test_geometry("LINESTRING(1 0,5 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,4 -1)", + "1F10F0102"); + + // self-IP going out and in on the same point + test_geometry("LINESTRING(2 0,5 0,5 5,6 5,5 0,8 0)", "LINESTRING(1 0,9 0)", + "1F10FF102"); + + // duplicated points + test_geometry("LINESTRING(1 1, 2 2, 2 2)", "LINESTRING(0 0, 2 2, 4 2)", "1FF0FF102"); + test_geometry("LINESTRING(1 1, 1 1, 2 2)", "LINESTRING(0 0, 2 2, 4 2)", "1FF0FF102"); + + // linear ring + test_geometry("LINESTRING(0 0,10 0)", "LINESTRING(5 0,9 0,5 5,1 0,5 0)", "1F1FF01F2"); + test_geometry("LINESTRING(0 0,5 0,10 0)", "LINESTRING(5 0,9 0,5 5,1 0,5 0)", "1F1FF01F2"); + test_geometry("LINESTRING(0 0,5 0,10 0)", "LINESTRING(5 0,10 0,5 5,1 0,5 0)", "1F10F01F2"); + + test_geometry("LINESTRING(0 0,5 0)", "LINESTRING(5 0,10 0,5 5,0 0,5 0)", "1FF0FF1F2"); + test_geometry("LINESTRING(0 0,5 0)", "LINESTRING(5 0,10 0,5 5,5 0)", "FF10F01F2"); + + test_geometry("LINESTRING(1 0,1 6)", "LINESTRING(0 0,5 0,5 5,0 5)", "0F10F0102"); + + // point-size Linestring + test_geometry("LINESTRING(1 0,1 0)", "LINESTRING(0 0,5 0)", "0FFFFF102"); + test_geometry("LINESTRING(1 0,1 0)", "LINESTRING(1 0,5 0)", "F0FFFF102"); + test_geometry("LINESTRING(1 0,1 0)", "LINESTRING(0 0,1 0)", "F0FFFF102"); + test_geometry("LINESTRING(1 0,1 0)", "LINESTRING(1 0,1 0)", "0FFFFFFF2"); + test_geometry("LINESTRING(1 0,1 0)", "LINESTRING(0 0,0 0)", "FF0FFF0F2"); + + //to_svg("LINESTRING(0 0,5 0)", "LINESTRING(5 0,10 0,5 5,5 0)", "test_relate_00.svg"); + + // INVALID LINESTRINGS + // 1-point LS (a Point) NOT disjoint + //test_geometry("LINESTRING(1 0)", "LINESTRING(0 0,5 0)", "0FFFFF102"); + //test_geometry("LINESTRING(0 0,5 0)", "LINESTRING(1 0)", "0F1FF0FF2"); + //test_geometry("LINESTRING(0 0,5 0)", "LINESTRING(1 0,1 0,1 0)", "0F1FF0FF2"); + // Point/Point + //test_geometry("LINESTRING(0 0)", "LINESTRING(0 0)", "0FFFFFFF2"); + + if ( BOOST_GEOMETRY_CONDITION( + boost::is_floating_point::type>::value ) ) + { + // https://svn.boost.org/trac/boost/ticket/10904 + // very small segments + test_geometry("LINESTRING(5.6956521739130430148634331999347 -0.60869565217391330413931882503675,5.5 -0.50000000000000066613381477509392)", + "LINESTRING(5.5 -0.50000000000000066613381477509392,5.5 -0.5)", + "FF1F00102"); + test_geometry("LINESTRING(-3.2333333333333333925452279800083 5.5999999999999978683717927196994,-3.2333333333333333925452279800083 5.5999999999999996447286321199499)", + "LINESTRING(-3.2333333333333325043668082798831 5.5999999999999996447286321199499,-3.2333333333333333925452279800083 5.5999999999999996447286321199499)", + "FF1F00102", "F0FFFF102"); // on some platforms the first Linestring may be detected as degenerated to Point + } + + if ( BOOST_GEOMETRY_CONDITION(( + boost::is_same::type, double>::value )) ) + { + // detected as collinear + test_geometry("LINESTRING(1 -10, 3.069359e+307 3.069359e+307)", + "LINESTRING(1 6, 1 0)", + "*********"); // TODO: be more specific with the result + } + + // OTHER MASKS + { + namespace bgdr = bg::detail::relate; + ls ls1, ls2, ls3, ls4; + bg::read_wkt("LINESTRING(0 0,2 0)", ls1); + bg::read_wkt("LINESTRING(2 0,4 0)", ls2); + bg::read_wkt("LINESTRING(1 0,1 1)", ls3); + bg::read_wkt("LINESTRING(1 0,4 0)", ls4); + BOOST_CHECK(bg::relate(ls1, ls2, bg::de9im::mask("FT*******") + || bg::de9im::mask("F**T*****") + || bg::de9im::mask("F***T****"))); + BOOST_CHECK(bg::relate(ls1, ls3, bg::de9im::mask("FT*******") + || bg::de9im::mask("F**T*****") + || bg::de9im::mask("F***T****"))); + BOOST_CHECK(bg::relate(ls3, ls1, bg::de9im::mask("FT*******") + || bg::de9im::mask("F**T*****") + || bg::de9im::mask("F***T****"))); + BOOST_CHECK(bg::relate(ls2, ls4, bg::de9im::mask("T*F**F***"))); // within + + BOOST_CHECK(bg::relate(ls1, ls2, bg::de9im::static_mask<'F','T'>() + || bg::de9im::static_mask<'F','*','*','T'>() + || bg::de9im::static_mask<'F','*','*','*','T'>())); + BOOST_CHECK(bg::relate(ls1, ls2, bg::de9im::mask("FT") + || bg::de9im::mask("F**T") + || bg::de9im::mask("F***T**************"))); + + BOOST_CHECK_THROW(bg::relate(ls1, ls2, bg::de9im::mask("A")), bg::invalid_input_exception); + } + + // spike - boundary and interior on the same point + test_geometry("LINESTRING(3 7, 8 8, 2 6)", "LINESTRING(5 7, 10 7, 0 7)", "0010F0102"); + + // 22.01.2015 + test_geometry("LINESTRING(5 5,10 10)", "LINESTRING(6 6,3 3)", "1010F0102"); + test_geometry("LINESTRING(5 5,2 8)", "LINESTRING(4 6,7 3)", "1010F0102"); +} + +template +void test_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + // LS disjoint + test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1,2 1))", "101FF0102"); + // linear ring disjoint + test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1,2 1,2 2,1 1))", "101FF01F2"); + // 2xLS forming non-simple linear ring disjoint + test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1,2 1,2 2),(1 1,2 2))", "101FF01F2"); + + test_geometry("LINESTRING(0 0,10 0)", + "MULTILINESTRING((1 0,9 0),(9 0,2 0))", + "101FF0FF2"); + + // rings + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,0 5,0 0),(0 0,5 0,5 5))", + "1FFFFFFF2"); + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,5 0,0 0),(0 0,0 5,5 5))", + "1FFFFFFF2"); + // overlapping rings + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,0 5,0 0),(0 0,5 0,5 5,0 5))", + "10FFFFFF2"); + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,5 0,0 0),(0 0,0 5,5 5,5 0))", + "10FFFFFF2"); + + // INVALID LINESTRINGS + // 1-point LS (a Point) disjoint + //test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1))", "101FF00F2"); + //test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1,1 1))", "101FF00F2"); + //test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1,1 1,1 1))", "101FF00F2"); + // 1-point LS (a Point) NOT disjoint + //test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,9 0),(2 0))", "101FF0FF2"); + //test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,9 0),(2 0,2 0))", "101FF0FF2"); + //test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,9 0),(2 0,2 0,2 0))", "101FF0FF2"); + + // point-like + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 1 0),(2 0, 2 0))", // |------| * + "101F00FF2"); + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 1 0),(1 0, 1 0))", // |------* + "101F00FF2"); + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((5 0, 1 0),(1 0, 1 0))", // *-------| + "101F00FF2"); + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 1 0),(5 0, 5 0))", // |------| * + "10100FFF2"); + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 1 0),(0 0, 0 0))", // *------| + "101000FF2"); + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((4 0, 5 0),(5 0, 5 0))", // |------* + "101000FF2"); + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((1 0, 2 0),(0 0, 0 0))", // * |------| + "1010F0FF2"); + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((2 0, 2 0),(2 0, 2 2))", // * + "001FF0102"); // | + + // for consistency + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(0 0, 2 0))", // |--------------| + "10F00FFF2"); // |------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(3 0, 5 0))", // |--------------| + "10F00FFF2"); // |------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(0 0, 6 0))", // |--------------| + "1FF00F102"); // |----------------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(-1 0, 5 0))", // |--------------| + "1FF00F102"); // |----------------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(-1 0, 6 0))", // |--------------| + "1FF00F102"); // |------------------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(-1 0, 2 0))", // |--------------| + "10F00F102"); // |-------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(2 0, 6 0))", // |--------------| + "10F00F102"); // |-------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(2 0, 2 2))", // |--------------| + "10FF0F102"); // | + // | + + if ( BOOST_GEOMETRY_CONDITION(boost::is_floating_point::type>::value) ) + { + // related to https://svn.boost.org/trac/boost/ticket/10904 + test_geometry("LINESTRING(-2305843009213693956 4611686018427387906, -33 -92, 78 83)", + "MULTILINESTRING((20 100, 31 -97, -46 57, -20 -4),(-71 -4))", + "*********"); // TODO: be more specific with the result + } + + // 22.01.2015 + // inspired by L/A and A/A + test_geometry("LINESTRING(1 1,2 2)", "MULTILINESTRING((0 0,1 1),(1 1,3 3))", "1FF0FF102"); + + // 25.01.2015 + test_geometry("LINESTRING(1 1, 5 5, 4 4)", + "MULTILINESTRING((2 5, 7 5, 8 3, 6 3, 4 0),(0 0,10 10))", + "1FF0FF102"); + test_geometry("LINESTRING(4 1, 4 5, 4 4)", + "MULTILINESTRING((2 5, 7 5, 8 3, 6 3, 4 0),(4 0, 4 8, 0 4))", + "1FF0FF102"); + test_geometry("LINESTRING(1 1,5 5,4 4)", + "MULTILINESTRING((5 0,5 5,5 10),(0 0,10 10))", + "1FF0FF102"); + test_geometry("LINESTRING(1 1,5 5,1 0)", + "MULTILINESTRING((5 0,5 5,5 10),(0 0,5 5,1 0))", + "1FF00F102"); + test_geometry("LINESTRING(5 5,4 4)", + "MULTILINESTRING((5 0,5 5,5 10),(0 0,10 10))", + "1FF0FF102"); + test_geometry("LINESTRING(6 6,5 5,4 4)", + "MULTILINESTRING((5 0,5 5,5 10),(0 0,10 10))", + "1FF0FF102"); + test_geometry("LINESTRING(5 5,4 4)", + "MULTILINESTRING((5 0,5 5,5 10))", + "FF10F0102"); +} + +template +void test_multi_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0))", + "1F1F00102"); + test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", + //"MULTILINESTRING((0 10,5 0,20 0,20 0,30 0),(1 10,1 10,1 0,1 0,1 -10),(2 0,2 0),(3 0,3 0,3 0),(0 0,0 0,0 10,0 10),(30 0,30 0,31 0,31 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0),(1 10,1 10,1 0,1 0,1 -10),(0 0,0 0,0 10,0 10),(30 0,30 0,31 0,31 0))", + "1F100F102"); + test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0),(0 0,0 0,0 10,0 10))", + "1F1F0F1F2"); + + // point-like + test_geometry("MULTILINESTRING((0 0, 0 0),(1 1, 1 1))", + "MULTILINESTRING((0 0, 0 0))", + "0F0FFFFF2"); + test_geometry("MULTILINESTRING((0 0, 0 0),(1 1, 1 1))", + "MULTILINESTRING((0 0, 0 0),(1 1, 1 1))", + "0FFFFFFF2"); + test_geometry("MULTILINESTRING((0 0, 0 0),(1 1, 1 1))", + "MULTILINESTRING((2 2, 2 2),(3 3, 3 3))", + "FF0FFF0F2"); + + test_geometry("MULTILINESTRING((0 5,10 5,10 10,5 10),(5 10,5 0,5 2),(5 2,5 5,0 5))", + "MULTILINESTRING((5 5,0 5),(5 5,5 0),(10 10,10 5,5 5,5 10,10 10))", + "10FFFFFF2"); + + if ( BOOST_GEOMETRY_CONDITION(( + boost::is_same::type, double>::value )) ) + { + // assertion failure in 1.57 + test_geometry("MULTILINESTRING((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))", + "MULTILINESTRING((-2.333333333333333 -8.6666666666666661,-4.3253012048192767 -8.168674698795181,-4.1194968553459113 -7.6100628930817606,-2.8823529411764706 -7.7647058823529411,-2.882352941176471 -7.7647058823529411,-2.263157894736842 -8.6315789473684212,-2.333333333333333 -8.6666666666666661))", + "*********"); + } +} + +template +void test_all() +{ + test_linestring_linestring

(); + test_linestring_multi_linestring

(); + test_multi_linestring_multi_linestring

(); +} + +int test_main( int , char* [] ) +{ + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/relate/relate_linear_linear_sph.cpp b/src/boost/libs/geometry/test/algorithms/relate/relate_linear_linear_sph.cpp new file mode 100644 index 000000000..dce75f8bf --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/relate/relate_linear_linear_sph.cpp @@ -0,0 +1,451 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016, 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) + + +#include "test_relate.hpp" + + +template +void test_linestring_linestring() +{ + typedef bg::model::linestring

ls; + + test_geometry("LINESTRING(0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", "1FFF0FFF2"); + test_geometry("LINESTRING(0 0,3 2)", "LINESTRING(0 0, 2 2, 3 2)", "FF1F0F1F2"); + test_geometry("LINESTRING(1 0,2 2,2 3)", "LINESTRING(0 0, 2 2, 3 2)", "0F1FF0102"); + + test_geometry("LINESTRING(0 0,5 0)", "LINESTRING(0 0,1 1,2 0,2 -1)", "0F1F00102"); + + test_geometry("LINESTRING(0 0, 1 1.0004570537241206, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", "1FFF0FFF2"); + test_geometry("LINESTRING(3 2, 2 2, 1 1.0004570537241206, 0 0)", "LINESTRING(0 0, 2 2, 3 2)", "1FFF0FFF2"); + test_geometry("LINESTRING(0 0, 1 1.0004570537241206, 2 2, 3 2)", "LINESTRING(3 2, 2 2, 0 0)", "1FFF0FFF2"); + test_geometry("LINESTRING(3 2, 2 2, 1 1.0004570537241206, 0 0)", "LINESTRING(3 2, 2 2, 0 0)", "1FFF0FFF2"); + + test_geometry("LINESTRING(3 1, 2 2, 1 1.0004570537241206, 0 0)", "LINESTRING(0 0, 2 2, 3 2)", "1F1F00102"); + test_geometry("LINESTRING(3 3, 2 2.0015234344160047, 1 1.0012195839797347, 0 0)", "LINESTRING(0 0, 2 2.0015234344160047, 3 2)", "1F1F00102"); + + test_geometry("LINESTRING(0 0, 1 1.0004570537241206, 2 2, 2 3)", "LINESTRING(0 0, 2 2, 2 3)", "1FFF0FFF2"); + test_geometry("LINESTRING(2 3, 2 2, 1 1.0004570537241206, 0 0)", "LINESTRING(0 0, 2 2, 2 3)", "1FFF0FFF2"); + test_geometry("LINESTRING(0 0, 1 1.0004570537241206, 2 2, 2 3)", "LINESTRING(2 3, 2 2, 0 0)", "1FFF0FFF2"); + test_geometry("LINESTRING(2 3, 2 2, 1 1.0004570537241206, 0 0)", "LINESTRING(2 3, 2 2, 0 0)", "1FFF0FFF2"); + + test_geometry("LINESTRING(1 1.0004570537241206, 2 2, 3 2.0003044086155000)", "LINESTRING(0 0, 2 2, 4 2)", "1FF0FF102"); + + test_geometry("LINESTRING(3 2.0003044086155000, 2 2, 1 1.0004570537241206)", "LINESTRING(0 0, 2 2, 4 2)", "1FF0FF102"); + test_geometry("LINESTRING(1 1.0004570537241206, 2 2, 3 2.0003044086155000)", "LINESTRING(4 2, 2 2, 0 0)", "1FF0FF102"); + test_geometry("LINESTRING(3 2.0003044086155000, 2 2, 1 1.0004570537241206)", "LINESTRING(4 2, 2 2, 0 0)", "1FF0FF102"); + +// test_geometry("LINESTRING(1 1, 2 2, 2 2)", "LINESTRING(0 0, 2 2, 4 2)", true); + +// test_geometry("LINESTRING(1 1, 2 2, 3 3)", "LINESTRING(0 0, 2 2, 4 2)", false); +// test_geometry("LINESTRING(1 1, 2 2, 3 2, 3 3)", "LINESTRING(0 0, 2 2, 4 2)", false); +// test_geometry("LINESTRING(1 1, 2 2, 3 1)", "LINESTRING(0 0, 2 2, 4 2)", false); +// test_geometry("LINESTRING(1 1, 2 2, 3 2, 3 1)", "LINESTRING(0 0, 2 2, 4 2)", false); + +// test_geometry("LINESTRING(0 1, 1 1, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", false); +// test_geometry("LINESTRING(0 1, 0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", false); +// test_geometry("LINESTRING(1 0, 1 1, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", false); +// test_geometry("LINESTRING(1 0, 0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", false); + +// test_geometry("LINESTRING(0 0)", "LINESTRING(0 0)", false); +// test_geometry("LINESTRING(1 1)", "LINESTRING(0 0, 2 2)", true); +// test_geometry("LINESTRING(0 0)", "LINESTRING(0 0, 2 2)", false); +// test_geometry("LINESTRING(0 0, 1 1)", "LINESTRING(0 0)", false); + +// test_geometry("LINESTRING(0 0,5 0,3 0,6 0)", "LINESTRING(0 0,6 0)", true); +// test_geometry("LINESTRING(0 0,2 2,3 3,1 1)", "LINESTRING(0 0,3 3,6 3)", true); + + // SPIKES! + test_geometry("LINESTRING(0 0,2 2.0015234344160047,3 3,1 1.0012195839797347,5 3.0009124369434743)", "LINESTRING(0 0,3 3,6 3)", "1F100F102"); + test_geometry("LINESTRING(5 3.0009124369434743,1 1.0012195839797347,3 3,2 2.0015234344160047,0 0)", "LINESTRING(0 0,3 3,6 3)", "1F100F102"); + test_geometry("LINESTRING(0 0,2 2.0015234344160047,3 3,1 1.0012195839797347,5 3.0009124369434743)", "LINESTRING(6 3,3 3,0 0)", "1F100F102"); + test_geometry("LINESTRING(5 3.0009124369434743,1 1.0012195839797347,3 3,2 2.0015234344160047,0 0)", "LINESTRING(6 3,3 3,0 0)", "1F100F102"); + + test_geometry("LINESTRING(6 3,3 3,0 0)", "LINESTRING(0 0,2 2.0015234344160047,3 3,1 1.0012195839797347,5 3.0009124369434743)", "101F001F2"); + + test_geometry("LINESTRING(0 0,10 0)", "LINESTRING(1 0,9 0,2 0)", "101FF0FF2"); + test_geometry("LINESTRING(0 0,2 2.0015234344160047,3 3,1 1.0012195839797347)", "LINESTRING(0 0,3 3,6 3)", "1FF00F102"); + // TODO: REWRITE MATRICES + // BEGIN + /*test_geometry("LINESTRING(0 0,2 2,3 3,1 1)", "LINESTRING(0 0,4 4,6 3)", "1FF00F102"); + + test_geometry("LINESTRING(0 0,2 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102"); + test_geometry("LINESTRING(2 0,0 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102"); + + test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(3 0,3 3,3 1)", "0F1FF0102"); + test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(2 0,2 3,2 1)", "0F1FF0102"); + test_geometry("LINESTRING(0 0,3 3,1 1)", "LINESTRING(2 0,2 2,2 1)", "0F1FF0102"); + + test_geometry("LINESTRING(0 0,2 2,3 3,4 4)", "LINESTRING(0 0,1 1,4 4)", "1FFF0FFF2");*/ + // END + + test_geometry("LINESTRING(0 0,2 2.0036594926050868,3 3.0031983963093536,4 4)", "LINESTRING(0 0,1 1.0022887548647632,4 4)", "1FFF0FFF2"); + + // loop i/i i/i u/u u/u + test_geometry("LINESTRING(0 0,10 0)", + "LINESTRING(1 1,1 0,6 0,6 1,4 1,4 0,9 0,9 1)", "1F1FF0102"); + + // self-intersecting and self-touching equal + test_geometry("LINESTRING(0 5,5 5,10 5,10 10,5 10,5 5,5 0)", + "LINESTRING(0 5,5 5,5 10,10 10,10 5,5 5,5 0)", "1FFF0FFF2"); + // self-intersecting loop and self-touching equal + test_geometry("LINESTRING(0 5,5 5,10 5,10 10,5 10,5 5,10 5,10 10,5 10,5 5,5 0)", + "LINESTRING(0 5,5 5,5 10,10 10,10 5,5 5,5 0)", "1FFF0FFF2"); + + test_geometry("LINESTRING(0 0,1 1)", "LINESTRING(0 1,1 0)", "0F1FF0102"); + test_geometry("LINESTRING(0 0,1 1)", "LINESTRING(1 1,2 0)", "FF1F00102"); + test_geometry("LINESTRING(0 0,1 1)", "LINESTRING(2 0,1 1)", "FF1F00102"); + + test_geometry("LINESTRING(0 0,1 0,2 1,3 5,4 0)", "LINESTRING(1 0,2 1,3 5)", "101FF0FF2"); + test_geometry("LINESTRING(0 0,1 0,2 1,3 5,4 0)", "LINESTRING(3 5,2 1,1 0)", "101FF0FF2"); + test_geometry("LINESTRING(1 0,2 1,3 5)", "LINESTRING(4 0,3 5,2 1,1 0,0 0)", "1FF0FF102"); + test_geometry("LINESTRING(3 5,2 1,1 0)", "LINESTRING(4 0,3 5,2 1,1 0,0 0)", "1FF0FF102"); + + test_geometry("LINESTRING(0 0,10 0)", "LINESTRING(-1 -1,1 0,10 0,20 -1)", "1F10F0102"); + test_geometry("LINESTRING(0 0,10 0)", "LINESTRING(20 -1,10 0,1 0,-1 -1)", "1F10F0102"); + + test_geometry("LINESTRING(-1 1,0 0,1 0,5 0,5 5,10 5,15 0,31 0)", + "LINESTRING(-1 -1,0 0,1 0,2 0,3 1,4 0,30 0)", + "101FF0102"); + test_geometry("LINESTRING(-1 1,0 0,1 0,5 0,5 5,10 5,15 0,31 0)", + "LINESTRING(30 0,4 0,3 1,2 0,1 0,0 0,-1 -1)", + "101FF0102"); + test_geometry("LINESTRING(31 0,15 0,10 5,5 5,5 0,1 0,0 0,-1 1)", + "LINESTRING(-1 -1,0 0,1 0,2 0,3 1,4 0,30 0)", + "101FF0102"); + test_geometry("LINESTRING(31 0,15 0,10 5,5 5,5 0,1 0,0 0,-1 1)", + "LINESTRING(30 0,4 0,3 1,2 0,1 0,0 0,-1 -1)", + "101FF0102"); + + // self-IP + test_geometry("LINESTRING(1 0,9 0)", + "LINESTRING(0 0,10 0,10 10,5 0,0 10)", + "1FF0FF102"); + test_geometry("LINESTRING(1 0,5 0,9 0)", + "LINESTRING(0 0,10 0,10 10,5 0,0 10)", + "1FF0FF102"); + test_geometry("LINESTRING(1 0,9 0)", + "LINESTRING(0 0,10 0,10 10,5 10,5 -1)", + "1FF0FF102"); + test_geometry("LINESTRING(1 0,9 0)", + "LINESTRING(0 0,10 0,5 0,5 5)", + "1FF0FF102"); + test_geometry("LINESTRING(1 0,7 0)", "LINESTRING(0 0,10 0,10 10,4 -1)", + "1FF0FF102"); + test_geometry("LINESTRING(1 0,5 0,7 0)", "LINESTRING(0 0,10 0,10 10,4 -1)", + "1FF0FF102"); + test_geometry("LINESTRING(1 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,4 -1)", + "1F10F0102"); + test_geometry("LINESTRING(1 0,5 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,4 -1)", + "1F10F0102"); + + // self-IP going out and in on the same point + test_geometry("LINESTRING(2 0,5 0,5 5,6 5,5 0,8 0)", "LINESTRING(1 0,9 0)", + "1F10FF102"); + + // duplicated points + test_geometry("LINESTRING(1 1.0004570537241206, 2 2, 2 2)", "LINESTRING(0 0, 2 2, 4 2)", "1FF0FF102"); + test_geometry("LINESTRING(1 1.0004570537241206, 1 1.0004570537241206, 2 2)", "LINESTRING(0 0, 2 2, 4 2)", "1FF0FF102"); + + // linear ring + test_geometry("LINESTRING(0 0,10 0)", "LINESTRING(5 0,9 0,5 5,1 0,5 0)", "1F1FF01F2"); + test_geometry("LINESTRING(0 0,5 0,10 0)", "LINESTRING(5 0,9 0,5 5,1 0,5 0)", "1F1FF01F2"); + test_geometry("LINESTRING(0 0,5 0,10 0)", "LINESTRING(5 0,10 0,5 5,1 0,5 0)", "1F10F01F2"); + + test_geometry("LINESTRING(0 0,5 0)", "LINESTRING(5 0,10 0,5 5,0 0,5 0)", "1FF0FF1F2"); + test_geometry("LINESTRING(0 0,5 0)", "LINESTRING(5 0,10 0,5 5,5 0)", "FF10F01F2"); + + test_geometry("LINESTRING(1 0,1 6)", "LINESTRING(0 0,5 0,5 5,0 5)", "0F10F0102"); + + // point-size Linestring + test_geometry("LINESTRING(1 0,1 0)", "LINESTRING(0 0,5 0)", "0FFFFF102"); + test_geometry("LINESTRING(1 0,1 0)", "LINESTRING(1 0,5 0)", "F0FFFF102"); + test_geometry("LINESTRING(1 0,1 0)", "LINESTRING(0 0,1 0)", "F0FFFF102"); + test_geometry("LINESTRING(1 0,1 0)", "LINESTRING(1 0,1 0)", "0FFFFFFF2"); + test_geometry("LINESTRING(1 0,1 0)", "LINESTRING(0 0,0 0)", "FF0FFF0F2"); + + //to_svg("LINESTRING(0 0,5 0)", "LINESTRING(5 0,10 0,5 5,5 0)", "test_relate_00.svg"); + + // INVALID LINESTRINGS + // 1-point LS (a Point) NOT disjoint + //test_geometry("LINESTRING(1 0)", "LINESTRING(0 0,5 0)", "0FFFFF102"); + //test_geometry("LINESTRING(0 0,5 0)", "LINESTRING(1 0)", "0F1FF0FF2"); + //test_geometry("LINESTRING(0 0,5 0)", "LINESTRING(1 0,1 0,1 0)", "0F1FF0FF2"); + // Point/Point + //test_geometry("LINESTRING(0 0)", "LINESTRING(0 0)", "0FFFFFFF2"); + + if ( BOOST_GEOMETRY_CONDITION( + boost::is_floating_point::type>::value ) ) + { + // https://svn.boost.org/trac/boost/ticket/10904 + // very small segments + test_geometry("LINESTRING(5.6956521739130430148634331999347 -0.60869565217391330413931882503675,5.5 -0.50000000000000066613381477509392)", + "LINESTRING(5.5 -0.50000000000000066613381477509392,5.5 -0.5)", + "*********"); // TODO: be more specific with the result + test_geometry("LINESTRING(-3.2333333333333333925452279800083 5.5999999999999978683717927196994,-3.2333333333333333925452279800083 5.5999999999999996447286321199499)", + "LINESTRING(-3.2333333333333325043668082798831 5.5999999999999996447286321199499,-3.2333333333333333925452279800083 5.5999999999999996447286321199499)", + "*********"); // TODO: be more specific with the result + } + + if ( BOOST_GEOMETRY_CONDITION(( + boost::is_same::type, double>::value )) ) + { + // detected as collinear + test_geometry("LINESTRING(1 -10, 3.069359e+307 3.069359e+307)", + "LINESTRING(1 6, 1 0)", + "*********"); // TODO: be more specific with the result + } + + // OTHER MASKS + { + namespace bgdr = bg::detail::relate; + ls ls1, ls2, ls3, ls4; + bg::read_wkt("LINESTRING(0 0,2 0)", ls1); + bg::read_wkt("LINESTRING(2 0,4 0)", ls2); + bg::read_wkt("LINESTRING(1 0,1 1)", ls3); + bg::read_wkt("LINESTRING(1 0,4 0)", ls4); + BOOST_CHECK(bg::relate(ls1, ls2, bg::de9im::mask("FT*******") + || bg::de9im::mask("F**T*****") + || bg::de9im::mask("F***T****"))); + BOOST_CHECK(bg::relate(ls1, ls3, bg::de9im::mask("FT*******") + || bg::de9im::mask("F**T*****") + || bg::de9im::mask("F***T****"))); + BOOST_CHECK(bg::relate(ls3, ls1, bg::de9im::mask("FT*******") + || bg::de9im::mask("F**T*****") + || bg::de9im::mask("F***T****"))); + BOOST_CHECK(bg::relate(ls2, ls4, bg::de9im::mask("T*F**F***"))); // within + + BOOST_CHECK(bg::relate(ls1, ls2, bg::de9im::static_mask<'F','T'>() + || bg::de9im::static_mask<'F','*','*','T'>() + || bg::de9im::static_mask<'F','*','*','*','T'>())); + BOOST_CHECK(bg::relate(ls1, ls2, bg::de9im::mask("FT") + || bg::de9im::mask("F**T") + || bg::de9im::mask("F***T**************"))); + + BOOST_CHECK_THROW(bg::relate(ls1, ls2, bg::de9im::mask("A")), bg::invalid_input_exception); + } + + // spike - boundary and interior on the same point + test_geometry("LINESTRING(3 7.0222344894505291, 8 8, 2 6.0297078652914440)", "LINESTRING(5 7.0264720782244758, 10 7, 0 7)", "0010F0102"); + + // 22.01.2015 + test_geometry("LINESTRING(5 5.0276084891434261,10 10)", "LINESTRING(6 6.0348911579043349,3 3)", "1010F0102"); + test_geometry("LINESTRING(5 5.0146631750126396,2 8)", "LINESTRING(4 6.0155438000959975,7 3)", "1010F0102"); +} + +template +void test_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + // LS disjoint + test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1,2 1))", "101FF0102"); + // linear ring disjoint + test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1,2 1,2 2,1 1))", "101FF01F2"); + // 2xLS forming non-simple linear ring disjoint + test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1,2 1,2 2),(1 1,2 2))", "101FF01F2"); + + test_geometry("LINESTRING(0 0,10 0)", + "MULTILINESTRING((1 0,9 0),(9 0,2 0))", + "101FF0FF2"); + + // rings + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,0 5,0 0),(0 0,5 0,5 5))", + "1FFFFFFF2"); + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,5 0,0 0),(0 0,0 5,5 5))", + "1FFFFFFF2"); + // overlapping rings + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,0 5,0 0),(0 0,5 0,5 5,0 5))", + "10FFFFFF2"); + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,5 0,0 0),(0 0,0 5,5 5,5 0))", + "10FFFFFF2"); + + // INVALID LINESTRINGS + // 1-point LS (a Point) disjoint + //test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1))", "101FF00F2"); + //test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1,1 1))", "101FF00F2"); + //test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1,1 1,1 1))", "101FF00F2"); + // 1-point LS (a Point) NOT disjoint + //test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,9 0),(2 0))", "101FF0FF2"); + //test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,9 0),(2 0,2 0))", "101FF0FF2"); + //test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,9 0),(2 0,2 0,2 0))", "101FF0FF2"); + + // point-like + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 1 0),(2 0, 2 0))", // |------| * + "101F00FF2"); + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 1 0),(1 0, 1 0))", // |------* + "101F00FF2"); + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((5 0, 1 0),(1 0, 1 0))", // *-------| + "101F00FF2"); + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 1 0),(5 0, 5 0))", // |------| * + "10100FFF2"); + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 1 0),(0 0, 0 0))", // *------| + "101000FF2"); + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((4 0, 5 0),(5 0, 5 0))", // |------* + "101000FF2"); + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((1 0, 2 0),(0 0, 0 0))", // * |------| + "1010F0FF2"); + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((2 0, 2 0),(2 0, 2 2))", // * + "001FF0102"); // | + + // for consistency + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(0 0, 2 0))", // |--------------| + "10F00FFF2"); // |------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(3 0, 5 0))", // |--------------| + "10F00FFF2"); // |------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(0 0, 6 0))", // |--------------| + "1FF00F102"); // |----------------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(-1 0, 5 0))", // |--------------| + "1FF00F102"); // |----------------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(-1 0, 6 0))", // |--------------| + "1FF00F102"); // |------------------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(-1 0, 2 0))", // |--------------| + "10F00F102"); // |-------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(2 0, 6 0))", // |--------------| + "10F00F102"); // |-------| + + test_geometry("LINESTRING(0 0, 5 0)", // |--------------| + "MULTILINESTRING((0 0, 5 0),(2 0, 2 2))", // |--------------| + "10FF0F102"); // | + // | + + if ( BOOST_GEOMETRY_CONDITION(boost::is_floating_point::type>::value) ) + { + // related to https://svn.boost.org/trac/boost/ticket/10904 + test_geometry("LINESTRING(-2305843009213693956 4611686018427387906, -33 -92, 78 83)", + "MULTILINESTRING((20 100, 31 -97, -46 57, -20 -4),(-71 -4))", + "*********"); // TODO: be more specific with the result + } + + // 22.01.2015 + // inspired by L/A and A/A + test_geometry("LINESTRING(1 1.0012195839797347,2 2.0015234344160047)", + "MULTILINESTRING((0 0,1 1.0012195839797347),(1 1.0012195839797347,3 3))", + "1FF0FF102"); + // for floats this is considered as collinear due to a special check in spherical intersection strategy + test_geometry("LINESTRING(1 1,2 2)", + "MULTILINESTRING((0 0,1 1),(1 1,3 3))", + "FF10F0102", "1FF0FF102"); + + // 25.01.2015 + test_geometry("LINESTRING(1 1.0152687848942923, 5 5.0575148968282102, 4 4.0516408785782314)", + "MULTILINESTRING((2 5.1322576184978592, 7 5, 8 3, 6 3, 4 0),(0 0,10 10))", + "1FF0FF102"); + test_geometry("LINESTRING(4 1, 4 5, 4 4)", + "MULTILINESTRING((2 5.1322576184978592, 7 5, 8 3, 6 3, 4 0),(4 0, 4 8, 0 4))", + "1FF0FF102"); + test_geometry("LINESTRING(1 1.0152687848942923,5 5.0575148968282102,4 4.0516408785782314)", + "MULTILINESTRING((5 0,5 5.0575148968282102,5 10),(0 0,10 10))", + "1FF0FF102"); + test_geometry("LINESTRING(1 1.0036662021874625,5 5,1 0)", + "MULTILINESTRING((5 0,5 5,5 10),(0 0,5 5,1 0))", + "1FF00F102"); + test_geometry("LINESTRING(5 5.0575148968282102,4 4.0516408785782314)", + "MULTILINESTRING((5 0,5 5.0575148968282102,5 10),(0 0,10 10))", + "1FF0FF102"); + test_geometry("LINESTRING(6 6.0587459045645184,5 5.0575148968282102,4 4.0516408785782314)", + "MULTILINESTRING((5 0,5 5.0575148968282102,5 10),(0 0,10 10))", + "1FF0FF102"); + test_geometry("LINESTRING(5 5,4 4)", + "MULTILINESTRING((5 0,5 5,5 10))", + "FF10F0102"); +} + +template +void test_multi_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0))", + "1F1F00102"); + test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", + //"MULTILINESTRING((0 10,5 0,20 0,20 0,30 0),(1 10,1 10,1 0,1 0,1 -10),(2 0,2 0),(3 0,3 0,3 0),(0 0,0 0,0 10,0 10),(30 0,30 0,31 0,31 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0),(1 10,1 10,1 0,1 0,1 -10),(0 0,0 0,0 10,0 10),(30 0,30 0,31 0,31 0))", + "1F100F102"); + test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0),(0 0,0 0,0 10,0 10))", + "1F1F0F1F2"); + + // point-like + test_geometry("MULTILINESTRING((0 0, 0 0),(1 1, 1 1))", + "MULTILINESTRING((0 0, 0 0))", + "0F0FFFFF2"); + test_geometry("MULTILINESTRING((0 0, 0 0),(1 1, 1 1))", + "MULTILINESTRING((0 0, 0 0),(1 1, 1 1))", + "0FFFFFFF2"); + test_geometry("MULTILINESTRING((0 0, 0 0),(1 1, 1 1))", + "MULTILINESTRING((2 2, 2 2),(3 3, 3 3))", + "FF0FFF0F2"); + + test_geometry("MULTILINESTRING((0 5,10 5,10 10,5 10),(5 10,5 0,5 2),(5 2,5 5.0190018174896416,0 5))", + "MULTILINESTRING((5 5.0190018174896416,0 5),(5 5.0190018174896416,5 0),(10 10,10 5,5 5.0190018174896416,5 10,10 10))", + "10FFFFFF2"); + + if ( BOOST_GEOMETRY_CONDITION(( + boost::is_same::type, double>::value )) ) + { + // assertion failure in 1.57 + test_geometry("MULTILINESTRING((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))", + "MULTILINESTRING((-2.333333333333333 -8.6666666666666661,-4.3253012048192767 -8.168674698795181,-4.1194968553459113 -7.6100628930817606,-2.8823529411764706 -7.7647058823529411,-2.882352941176471 -7.7647058823529411,-2.263157894736842 -8.6315789473684212,-2.333333333333333 -8.6666666666666661))", + "*********"); + } +} + +template +void test_all() +{ + test_linestring_linestring

(); + test_linestring_multi_linestring

(); + test_multi_linestring_multi_linestring

(); +} + +int test_main( int , char* [] ) +{ + typedef bg::cs::spherical_equatorial cs_t; + + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/relate/relate_pointlike_geometry.cpp b/src/boost/libs/geometry/test/algorithms/relate/relate_pointlike_geometry.cpp new file mode 100644 index 000000000..8894b6850 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/relate/relate_pointlike_geometry.cpp @@ -0,0 +1,254 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2018 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2013, 2014, 2015, 2017. +// Modifications copyright (c) 2013-2017 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) + +#include "test_relate.hpp" +#include "nan_cases.hpp" + +//TEST +//#include + +template +void test_point_point() +{ + test_geometry("POINT(0 0)", "POINT(0 0)", "0FFFFFFF2"); + test_geometry("POINT(1 0)", "POINT(0 0)", "FF0FFF0F2"); +} + +template +void test_point_multipoint() +{ + typedef bg::model::multi_point

mpt; + + test_geometry("POINT(0 0)", "MULTIPOINT(0 0)", "0FFFFFFF2"); + test_geometry("POINT(1 0)", "MULTIPOINT(0 0)", "FF0FFF0F2"); + test_geometry("POINT(0 0)", "MULTIPOINT(0 0, 1 0)", "0FFFFF0F2"); +} + +template +void test_multipoint_multipoint() +{ + typedef bg::model::multi_point

mpt; + + test_geometry("MULTIPOINT(0 0)", "MULTIPOINT(0 0)", "0FFFFFFF2"); + test_geometry("MULTIPOINT(1 0)", "MULTIPOINT(0 0)", "FF0FFF0F2"); + test_geometry("MULTIPOINT(0 0)", "MULTIPOINT(0 0, 1 0)", "0FFFFF0F2"); + test_geometry("MULTIPOINT(0 0, 1 0)", "MULTIPOINT(0 0)", "0F0FFFFF2"); + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTIPOINT(0 0, 1 0)", "0F0FFF0F2"); + + //typedef bg::model::d2::point_xy ptf; + //typedef bg::model::multi_point mptf; + //test_geometry("MULTIPOINT(0 0)", "MULTIPOINT(0 0)", "0FFFFFFF2"); + + // assertion failure in relate->boundary_checker->std::equal_range with msvc + if (BOOST_GEOMETRY_CONDITION(is_nan_case_supported::value)) + { + mpt g; + std::string wkt; + nan_case(g, wkt); + + check_geometry(g, g, wkt, wkt, "*********"); + } +} + +template +void test_point_linestring() +{ + typedef bg::model::linestring

ls; + + // degenerated + //test_geometry("POINT(0 0)", "LINESTRING(0 0)", "0FFFFFFF2"); + + test_geometry("POINT(0 0)", "LINESTRING(0 0, 2 2, 3 2)", "F0FFFF102"); + test_geometry("POINT(1 1)", "LINESTRING(0 0, 2 2, 3 2)", "0FFFFF102"); + test_geometry("POINT(3 2)", "LINESTRING(0 0, 2 2, 3 2)", "F0FFFF102"); + test_geometry("POINT(1 0)", "LINESTRING(0 0, 2 2, 3 2)", "FF0FFF102"); + + test_geometry("POINT(0 0)", "LINESTRING(0 0, 2 2, 3 2, 0 0)", "0FFFFF1F2"); + test_geometry("POINT(1 1)", "LINESTRING(0 0, 2 2, 3 2, 0 0)", "0FFFFF1F2"); + test_geometry("POINT(3 2)", "LINESTRING(0 0, 2 2, 3 2, 0 0)", "0FFFFF1F2"); + test_geometry("POINT(1 0)", "LINESTRING(0 0, 2 2, 3 2, 0 0)", "FF0FFF1F2"); +} + +template +void test_point_multilinestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("POINT(0 0)", "MULTILINESTRING((0 0, 2 0, 2 2),(0 0, 0 2))", "0FFFFF102"); + test_geometry("POINT(0 0)", "MULTILINESTRING((0 0, 2 0, 2 2),(0 0, 0 2, 2 2))", "0FFFFF1F2"); + test_geometry("POINT(0 0)", "MULTILINESTRING((0 0, 2 0, 2 2),(0 0, 0 2, 2 2),(0 0, 1 1))", "F0FFFF102"); + + test_geometry("POINT(0 0)", "MULTILINESTRING((0 0,5 0),(0 0,0 5,5 0),(0 0,-5 0),(0 0,0 -5,-5 0))", "0FFFFF1F2"); + test_geometry("POINT(5 0)", "MULTILINESTRING((0 0,5 0),(0 0,0 5,5 0),(0 0,-5 0),(0 0,0 -5,-5 0))", "0FFFFF1F2"); + test_geometry("POINT(1 0)", "MULTILINESTRING((0 0,5 0),(0 0,0 5,5 0),(0 0,-5 0),(0 0,0 -5,-5 0))", "0FFFFF1F2"); + + // assertion failure in relate->boundary_checker->std::equal_range with msvc + if (BOOST_GEOMETRY_CONDITION(is_nan_case_supported::value)) + { + // on the boundary + std::string wkt0 = "POINT(3.1e+307 1)"; + P g0; + bg::read_wkt(wkt0, g0); + + // disjoint + std::string wkt1 = "POINT(1.1e+308 1.2e+308)"; + P g1; + bg::read_wkt(wkt1, g1); + + mls g2; + std::string wkt2; + nan_case(g2, wkt2); + + check_geometry(g0, g2, wkt0, wkt2, "*********"); + check_geometry(g1, g2, wkt1, wkt2, "*********"); + } +} + +template +void test_multipoint_linestring() +{ + typedef bg::model::multi_point

mpt; + typedef bg::model::linestring

ls; + + // degenerated + //test_geometry("MULTIPOINT(0 0)", "LINESTRING(0 0)", "0FFFFFFF2"); + + test_geometry("MULTIPOINT(0 0)", "LINESTRING(0 0, 2 2, 3 2)", "F0FFFF102"); + test_geometry("MULTIPOINT(0 0, 1 1)", "LINESTRING(0 0, 2 2, 3 2)", "00FFFF102"); + test_geometry("MULTIPOINT(0 0, 1 1, 3 3)", "LINESTRING(0 0, 2 2, 3 2)", "000FFF102"); + test_geometry("MULTIPOINT(0 0, 3 3)", "LINESTRING(0 0, 2 2, 3 2)", "F00FFF102"); + test_geometry("MULTIPOINT(1 1, 3 3)", "LINESTRING(0 0, 2 2, 3 2)", "0F0FFF102"); + + test_geometry("MULTIPOINT(0 0, 1 1)", "LINESTRING(0 0, 2 2, 3 2, 0 0)", "0FFFFF1F2"); + test_geometry("MULTIPOINT(0 0, 3 3)", "LINESTRING(0 0, 2 2, 3 2, 0 0)", "0F0FFF1F2"); + + test_geometry("MULTIPOINT(0 0)", "LINESTRING(0 0, 2 2)", "F0FFFF102"); + test_geometry("MULTIPOINT(2 2)", "LINESTRING(0 0, 2 2)", "F0FFFF102"); + test_geometry("MULTIPOINT(0 0, 2 2)", "LINESTRING(0 0, 2 2)", "F0FFFF1F2"); + test_geometry("MULTIPOINT(0 0, 1 1, 0 1, 2 2)", "LINESTRING(0 0, 2 2)", "000FFF1F2"); +} + +template +void test_multipoint_multilinestring() +{ + typedef bg::model::multi_point

mpt; + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTIPOINT(0 0)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2))", "F0FFFF102"); + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2))", "00FFFF102"); + test_geometry("MULTIPOINT(0 0, 1 1, 3 3)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2))", "000FFF102"); + test_geometry("MULTIPOINT(0 0, 3 3)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2))", "F00FFF102"); + test_geometry("MULTIPOINT(1 1, 3 3)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2))", "0F0FFF102"); + + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2, 0 0))", "0FFFFF1F2"); + test_geometry("MULTIPOINT(0 0, 3 3)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2, 0 0))", "0F0FFF1F2"); + + test_geometry("MULTIPOINT(0 0,1 1)", "MULTILINESTRING((0 0,0 1,1 1),(1 1,1 0,0 0))", "0FFFFF1F2"); + + test_geometry("MULTIPOINT(0 0)", "MULTILINESTRING((0 0,1 1),(1 1,2 2))", "F0FFFF102"); + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTILINESTRING((0 0,1 1),(1 1,2 2))", "00FFFF102"); + test_geometry("MULTIPOINT(0 0, 1 1, 2 2)", "MULTILINESTRING((0 0,1 1),(1 1,2 2))", "00FFFF1F2"); + test_geometry("MULTIPOINT(0 0, 2 2)", "MULTILINESTRING((0 0,1 1),(1 1,2 2))", "F0FFFF1F2"); +} + +template +void test_point_ring_polygon() +{ + typedef bg::model::ring

ring; + typedef bg::model::polygon

poly; + + test_geometry("POINT(0 0)", "POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))", "F0FFFF212"); + + test_geometry("POINT(1 1)", "POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))", "0FFFFF212"); + test_geometry("POINT(1 3)", "POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))", "FF0FFF212"); +} + +template +void test_point_multipolygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("POINT(0 0)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "F0FFFF212"); + test_geometry("POINT(1 1)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "0FFFFF212"); + test_geometry("POINT(5 5)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "F0FFFF212"); + test_geometry("POINT(6 6)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "0FFFFF212"); + test_geometry("POINT(1 6)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "FF0FFF212"); +} + +template +void test_multipoint_ring_polygon() +{ + typedef bg::model::multi_point

mpt; + typedef bg::model::ring

ring; + typedef bg::model::polygon

poly; + + test_geometry("MULTIPOINT(0 0)", "POLYGON((0 0, 0 3, 3 3, 3 0, 0 0))", "F0FFFF212"); + test_geometry("MULTIPOINT(0 0, 1 1)", "POLYGON((0 0, 0 3, 3 3, 3 0, 0 0))", "00FFFF212"); + test_geometry("MULTIPOINT(0 0, 1 1, 4 4)", "POLYGON((0 0, 0 3, 3 3, 3 0, 0 0))", "000FFF212"); + test_geometry("MULTIPOINT(1 1, 4 4)", "POLYGON((0 0, 0 3, 3 3, 3 0, 0 0))", "0F0FFF212"); + + test_geometry("MULTIPOINT(2 2)", "POLYGON((0 0, 0 4, 4 4, 4 0, 0 0),(1 1, 3 1, 3 3, 1 3, 1 1))", "FF0FFF212"); + test_geometry("MULTIPOINT(0 0, 1 1)", "POLYGON((0 0, 0 4, 4 4, 4 0, 0 0),(1 1, 3 1, 3 3, 1 3, 1 1))", "F0FFFF212"); + test_geometry("MULTIPOINT(0 0, 1 1, 2 2)", "POLYGON((0 0, 0 4, 4 4, 4 0, 0 0),(1 1, 3 1, 3 3, 1 3, 1 1))", "F00FFF212"); + test_geometry("MULTIPOINT(2 2, 4 4)", "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(1 1, 3 1, 3 3, 1 3, 1 1))", "0F0FFF212"); +} + +template +void test_multipoint_multipolygon() +{ + typedef bg::model::multi_point

mpt; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("MULTIPOINT(0 0)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "F0FFFF212"); + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "00FFFF212"); + test_geometry("MULTIPOINT(1 1, 5 5)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "00FFFF212"); + test_geometry("MULTIPOINT(1 6, 6 6)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "0F0FFF212"); + test_geometry("MULTIPOINT(0 0, 1 6)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "F00FFF212"); +} + +template +void test_all() +{ + test_point_point

(); + test_point_multipoint

(); + test_multipoint_multipoint

(); + + test_point_linestring

(); + test_point_multilinestring

(); + test_multipoint_linestring

(); + test_multipoint_multilinestring

(); + + test_point_ring_polygon

(); + test_point_multipolygon

(); + test_multipoint_ring_polygon

(); + test_multipoint_multipolygon

(); +} + +int test_main( int , char* [] ) +{ + check_mask(); + + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/relate/test_relate.hpp b/src/boost/libs/geometry/test/algorithms/relate/test_relate.hpp new file mode 100644 index 000000000..859d29ade --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/relate/test_relate.hpp @@ -0,0 +1,232 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2013, 2014, 2015, 2017. +// Modifications copyright (c) 2013-2017 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) + +#ifndef BOOST_GEOMETRY_TEST_RELATE_HPP +#define BOOST_GEOMETRY_TEST_RELATE_HPP + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +namespace bgdr = bg::detail::relate; + +std::string transposed(std::string matrix) +{ + if ( !matrix.empty() ) + { + std::swap(matrix[1], matrix[3]); + std::swap(matrix[2], matrix[6]); + std::swap(matrix[5], matrix[7]); + } + return matrix; +} + +bool matrix_compare(std::string const& m1, std::string const& m2) +{ + BOOST_ASSERT(m1.size() == 9 && m2.size() == 9); + for ( size_t i = 0 ; i < 9 ; ++i ) + { + if ( m1[i] == '*' || m2[i] == '*' ) + continue; + + if ( m1[i] != m2[i] ) + return false; + } + return true; +} + +bool matrix_compare(std::string const& m, std::string const& res1, std::string const& res2) +{ + return matrix_compare(m, res1) + || ( !res2.empty() ? matrix_compare(m, res2) : false ); +} + +std::string matrix_format(std::string const& matrix1, std::string const& matrix2) +{ + return matrix1 + + ( !matrix2.empty() ? " || " : "" ) + matrix2; +} + +template +char get_ii(M const& m) +{ + using bg::detail::relate::interior; + return m.template get(); +} + +template +char get_ee(M const& m) +{ + using bg::detail::relate::exterior; + return m.template get(); +} + +void check_mask() +{ + bg::de9im::mask m1(""); + bg::de9im::mask m2("TTT"); + bg::de9im::mask m3("000111222"); + bg::de9im::mask m4("000111222FFFF"); + bg::de9im::mask m5(std::string("")); + bg::de9im::mask m6(std::string("TTT")); + bg::de9im::mask m7(std::string("000111222")); + bg::de9im::mask m8(std::string("000111222FFFF")); + + using bg::detail::relate::interior; + using bg::detail::relate::exterior; + + BOOST_CHECK(get_ii(m1) == '*' && get_ee(m1) == '*'); + BOOST_CHECK(get_ii(m2) == 'T' && get_ee(m2) == '*'); + BOOST_CHECK(get_ii(m3) == '0' && get_ee(m3) == '2'); + BOOST_CHECK(get_ii(m4) == '0' && get_ee(m4) == '2'); + BOOST_CHECK(get_ii(m5) == '*' && get_ee(m5) == '*'); + BOOST_CHECK(get_ii(m6) == 'T' && get_ee(m6) == '*'); + BOOST_CHECK(get_ii(m7) == '0' && get_ee(m7) == '2'); + BOOST_CHECK(get_ii(m8) == '0' && get_ee(m8) == '2'); +} + +template +void check_geometry(Geometry1 const& geometry1, + Geometry2 const& geometry2, + std::string const& wkt1, + std::string const& wkt2, + std::string const& expected1, + std::string const& expected2 = std::string()) +{ + boost::variant variant1 = geometry1; + boost::variant variant2 = geometry2; + + { + std::string res_str = bg::relation(geometry1, geometry2).str(); + bool ok = matrix_compare(res_str, expected1, expected2); + BOOST_CHECK_MESSAGE(ok, + "relate: " << wkt1 + << " and " << wkt2 + << " -> Expected: " << matrix_format(expected1, expected2) + << " detected: " << res_str); + + typedef typename bg::strategy::relate::services::default_strategy + < + Geometry1, Geometry2 + >::type strategy_type; + std::string res_str0 = bg::relation(geometry1, geometry2, strategy_type()).str(); + BOOST_CHECK(res_str == res_str0); + + // test variants + boost::variant v1 = geometry1; + boost::variant v2 = geometry2; + std::string res_str1 = bg::relation(geometry1, variant2).str(); + std::string res_str2 = bg::relation(variant1, geometry2).str(); + std::string res_str3 = bg::relation(variant1, variant2).str(); + BOOST_CHECK(res_str == res_str1); + BOOST_CHECK(res_str == res_str2); + BOOST_CHECK(res_str == res_str3); + } + + // changed sequence of geometries - transposed result + { + std::string res_str = bg::relation(geometry2, geometry1).str(); + std::string expected1_tr = transposed(expected1); + std::string expected2_tr = transposed(expected2); + bool ok = matrix_compare(res_str, expected1_tr, expected2_tr); + BOOST_CHECK_MESSAGE(ok, + "relate: " << wkt2 + << " and " << wkt1 + << " -> Expected: " << matrix_format(expected1_tr, expected2_tr) + << " detected: " << res_str); + } + + if ( expected2.empty() ) + { + { + bool result = bg::relate(geometry1, geometry2, bg::de9im::mask(expected1)); + // TODO: SHOULD BE !interrupted - CHECK THIS! + BOOST_CHECK_MESSAGE(result, + "relate: " << wkt1 + << " and " << wkt2 + << " -> Expected: " << expected1); + + typedef typename bg::strategy::relate::services::default_strategy + < + Geometry1, Geometry2 + >::type strategy_type; + bool result0 = bg::relate(geometry1, geometry2, bg::de9im::mask(expected1), strategy_type()); + BOOST_CHECK(result == result0); + + // test variants + bool result1 = bg::relate(geometry1, variant2, bg::de9im::mask(expected1)); + bool result2 = bg::relate(variant1, geometry2, bg::de9im::mask(expected1)); + bool result3 = bg::relate(variant1, variant2, bg::de9im::mask(expected1)); + BOOST_CHECK(result == result1); + BOOST_CHECK(result == result2); + BOOST_CHECK(result == result3); + } + + if ( BOOST_GEOMETRY_CONDITION(( + bg::detail::relate::interruption_enabled::value )) ) + { + // brake the expected output + std::string expected_interrupt = expected1; + bool changed = false; + BOOST_FOREACH(char & c, expected_interrupt) + { + if ( c >= '0' && c <= '9' ) + { + if ( c == '0' ) + c = 'F'; + else + --c; + + changed = true; + } + } + + if ( changed ) + { + bool result = bg::relate(geometry1, geometry2, bg::de9im::mask(expected_interrupt)); + // TODO: SHOULD BE interrupted - CHECK THIS! + BOOST_CHECK_MESSAGE(!result, + "relate: " << wkt1 + << " and " << wkt2 + << " -> Expected interrupt for:" << expected_interrupt); + } + } + } +} + +template +void test_geometry(std::string const& wkt1, + std::string const& wkt2, + std::string const& expected1, + std::string const& expected2 = std::string()) +{ + Geometry1 geometry1; + Geometry2 geometry2; + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); + check_geometry(geometry1, geometry2, wkt1, wkt2, expected1, expected2); +} + +#endif // BOOST_GEOMETRY_TEST_RELATE_HPP diff --git a/src/boost/libs/geometry/test/algorithms/remove_spikes.cpp b/src/boost/libs/geometry/test/algorithms/remove_spikes.cpp new file mode 100644 index 000000000..f4e252103 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/remove_spikes.cpp @@ -0,0 +1,186 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +// Copyright (c) 2013-2015 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 +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +// Instead of having a separate (and nearly similar) unit test to test multipolygons, +// we now include them here and compile them by default. Only undefining the next line +// will avoid testing multi-geometries +#define BOOST_GEOMETRY_UNIT_TEST_MULTI + +#include + +#include + +// The include to test +#include + +// Helper includes +#include +#include +#include +#include +#include +#include +#include + +#if defined(BOOST_GEOMETRY_UNIT_TEST_MULTI) +# include +#endif + + +#if defined(TEST_WITH_SVG) +# include +#endif + + +template +inline void test_remove_spikes(std::string const& /*id*/, + Geometry& geometry, + double expected_area, double expected_perimeter) +{ + bg::remove_spikes(geometry); + + double detected_area = bg::area(geometry); + double detected_perimeter = bg::perimeter(geometry); + + BOOST_CHECK_CLOSE(detected_area, expected_area, 0.01); + BOOST_CHECK_CLOSE(detected_perimeter, expected_perimeter, 0.01); +} + +template +void test_geometry(std::string const& id, std::string const& wkt, + double expected_area, double expected_perimeter) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + bg::correct(geometry); + boost::variant v(geometry); + +#if defined(TEST_WITH_SVG) + std::ostringstream filename; + filename << "remove_spikes_" << id; + if (! bg::closure::value) + { + filename << "_open"; + } + filename << ".svg"; + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper::type> mapper(svg, 500, 500); + mapper.add(geometry); + mapper.map(geometry, "fill-opacity:0.3;opacity:0.6;fill:rgb(51,51,153);stroke:rgb(0,0,255);stroke-width:2"); +#endif + + test_remove_spikes(id, geometry, expected_area, expected_perimeter); + test_remove_spikes(id, v, expected_area, expected_perimeter); + +#if defined(TEST_WITH_SVG) + mapper.map(geometry, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:3"); +#endif +} + +template +void test_polygons() +{ + typedef bg::model::ring ring; + typedef bg::model::polygon polygon; + + test_geometry("box", + "POLYGON((0 0,0 4,4 4,4 0,0 0))", + 16, 16); + test_geometry("box", + "POLYGON((0 0,0 4,4 4,4 0,0 0))", + 16, 16); + test_geometry("box2", + "POLYGON((0 0,0 2,0 4,2 4,4 4,4 2,4 0,2 0,0 0))", + 16, 16); + test_geometry("spike_right", + "POLYGON((0 0,0 4,4 4,4 2,6 2,4 2,4 0,0 0))", + 16, 16); + test_geometry("spike_at_corner", + "POLYGON((0 0,0 4,6 4,4 4,4 0,0 0))", + 16, 16); + test_geometry("spike_at_first", + "POLYGON((0 0,-1 3,0 0,0 4,4 4,4 0,0 0))", + 16, 16); + test_geometry("spike_at_last", + "POLYGON((0 0,0 4,4 4,4 0,6 0,0 0))", + 16, 16); + test_geometry("spike_at_closing", + "POLYGON((-1 0,0 0,0 4,4 4,4 0,0 0,-1 0))", + 16, 16); + test_geometry("double_spike", + "POLYGON((0 0,0 4,4 4,4 2,6 2,5 2,4 2,4 0,0 0))", + 16, 16); + test_geometry("three_double_spike", + "POLYGON((0 0,0 4,4 4,4 2,6 2,5 2,4.5 2,4 2,4 0,0 0))", + 16, 16); + test_geometry("spike_with_corner", + "POLYGON((0 0,0 4,4 4,4 2,6 2,6 4,6 2,4 2,4 0,0 0))", + 16, 16); + + test_geometry("triangle0", + "POLYGON((0 0,0 4,2 0,4 0,0 0))", + 4, 6 + sqrt(20.0)); + test_geometry("triangle1", + "POLYGON((0 4,2 0,4 0,0 0,0 4))", + 4, 6 + sqrt(20.0)); + test_geometry("triangle2", + "POLYGON((2 0,4 0,0 0,0 4,2 0))", + 4, 6 + sqrt(20.0)); + test_geometry("triangle3", + "POLYGON((4 0,0 0,0 4,2 0,4 0))", + 4, 6 + sqrt(20.0)); + + test_geometry("only_spike1", + "POLYGON((0 0,2 2,0 0))", + 0, 0); + test_geometry("only_spike2", + "POLYGON((0 0,2 2,4 4,2 2,0 0))", + 0, 0); + test_geometry("only_spike3", + "POLYGON((0 0,2 2,4 4,0 0))", + 0, 0); + test_geometry("only_spike4", + "POLYGON((0 0,4 4,2 2,0 0))", + 0, 0); +} + + +template +void test_multi_polygons() +{ + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + + test_geometry("multi_spike_with_corner", + "MULTIPOLYGON(((0 0,0 4,4 4,4 2,6 2,6 4,6 2,4 2,4 0,0 0)))", + 16, 16); +} + +template +void test_all() +{ + test_polygons(); + test_multi_polygons(); +} + +int test_main(int, char* []) +{ + test_all, true, true>(); + test_all, true, false>(); + return 0; +} + diff --git a/src/boost/libs/geometry/test/algorithms/reverse.cpp b/src/boost/libs/geometry/test/algorithms/reverse.cpp new file mode 100644 index 000000000..d74b756c4 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/reverse.cpp @@ -0,0 +1,75 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#include +#include +#include + +#include +#include +#include +#include + +template +void test_linestring() +{ + // Simplex + test_geometry( + "LINESTRING(0 0,1 1)", + "LINESTRING(1 1,0 0)"); + + // Three points, middle should stay the same + test_geometry( + "LINESTRING(0 0,1 1,2 2)", + "LINESTRING(2 2,1 1,0 0)"); + + // Four points + test_geometry( + "LINESTRING(0 0,1 1,2 2,3 3)", + "LINESTRING(3 3,2 2,1 1,0 0)"); +} + +template +void test_ring() +{ + test_geometry( + "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0))", + "POLYGON((4 0,2 1,0 2,0 7,4 9,8 7,8 2,4 0))"); +} + +template +void test_all() +{ + test_linestring >(); + test_linestring >(); + + // Polygon with holes + test_geometry >( + "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0),(7 3,7 6,1 6,1 3,4 3,7 3))", + "POLYGON((4 0,2 1,0 2,0 7,4 9,8 7,8 2,4 0),(7 3,4 3,1 3,1 6,7 6,7 3))"); + + // Check compilation + test_geometry("POINT(0 0)", "POINT(0 0)"); + + test_ring >(); + test_ring >(); +} + +int test_main(int, char* []) +{ + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/reverse_multi.cpp b/src/boost/libs/geometry/test/algorithms/reverse_multi.cpp new file mode 100644 index 000000000..f3a7f574d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/reverse_multi.cpp @@ -0,0 +1,51 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#include + +#include + +#include + +#include +#include + +#include + + +template +void test_all() +{ + // Multi point, should happen nothing. + test_geometry >( + "MULTIPOINT((0 0),(1 1))", + "MULTIPOINT((0 0),(1 1))"); + + test_geometry > >( + "MULTILINESTRING((0 0,1 1),(3 3,4 4))", + "MULTILINESTRING((1 1,0 0),(4 4,3 3))"); + + typedef bg::model::multi_polygon > mp; + test_geometry( + "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0)))", + "MULTIPOLYGON(((4 0,2 1,0 2,0 7,4 9,8 7,8 2,4 0)))"); + test_geometry( + "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0),(7 3,7 6,1 6,1 3,4 3,7 3)))", + "MULTIPOLYGON(((4 0,2 1,0 2,0 7,4 9,8 7,8 2,4 0),(7 3,4 3,1 3,1 6,7 6,7 3)))"); +} + +int test_main( int , char* [] ) +{ + test_all >(); + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/Jamfile b/src/boost/libs/geometry/test/algorithms/set_operations/Jamfile new file mode 100644 index 000000000..27ebad64b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/Jamfile @@ -0,0 +1,20 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2014 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2014 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014. +# Modifications copyright (c) 2014, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +build-project difference ; +build-project intersection ; +build-project sym_difference ; +build-project union ; diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/check_turn_less.hpp b/src/boost/libs/geometry/test/algorithms/set_operations/check_turn_less.hpp new file mode 100644 index 000000000..0e9984d4a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/check_turn_less.hpp @@ -0,0 +1,115 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2015, 2019, 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_TEST_CHECK_TURN_LESS_HPP +#define BOOST_GEOMETRY_TEST_CHECK_TURN_LESS_HPP + +#include + +#include "test_set_ops_linear_linear.hpp" + + +// check less functor for turns +template +inline void verify_less_for_turns(Turns turns, Less const& less) +{ + typedef typename boost::range_iterator::type iterator_type; + + if (boost::size(turns) < 2) + { + return; + } + + iterator_type last = --boost::end(turns); + for (iterator_type it1 = boost::begin(turns); it1 != last; ++it1) + { + iterator_type it2 = it1; + ++it2; + for (; it2 != boost::end(turns); ++it2) + { + if (less(*it1, *it2)) + { + BOOST_CHECK(! less(*it2, *it1)); + } + if (less(*it2, *it1)) + { + BOOST_CHECK(! less(*it1, *it2)); + } + } + } +} + + +struct check_turn_less +{ + template + struct assign_policy + { + static bool const include_no_turn = false; + static bool const include_degenerate = EnableDegenerateTurns; + static bool const include_opposite = false; + + template + < + typename Info, + typename Point1, + typename Point2, + typename IntersectionInfo + > + static inline void apply(Info& , Point1 const& , Point2 const& , + IntersectionInfo const& ) + { + } + }; + + template + static inline void apply(Geometry1 const& geometry1, + Geometry2 const& geometry2) + { + typedef typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy_type; + + typedef bg::detail::no_rescale_policy robust_policy_type; + + typedef bg::detail::relate::turns::get_turns + < + Geometry1, + Geometry2, + bg::detail::get_turns::get_turn_info_type + < + Geometry1, Geometry2, assign_policy<> + > + > get_turns_type; + + typedef typename get_turns_type::template turn_info_type + < + strategy_type, robust_policy_type + >::type turn_info; + + typedef std::vector turns_container; + + turns_container turns; + + bg::detail::get_turns::no_interrupt_policy interrupt_policy; + + get_turns_type::apply(turns, geometry1, geometry2, + interrupt_policy, + strategy_type(), robust_policy_type()); + + + typedef bg::detail::turns::less_seg_fraction_other_op<> turn_less_type; + + verify_less_for_turns(turns, turn_less_type()); + } +}; + +#endif // BOOST_GEOMETRY_TEST_CHECK_TURN_LESS_HPP diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/difference/Jamfile b/src/boost/libs/geometry/test/algorithms/set_operations/difference/Jamfile new file mode 100644 index 000000000..f10724021 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/difference/Jamfile @@ -0,0 +1,32 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2019, 2020. +# Modifications copyright (c) 2014-2020, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-difference + : + [ run difference.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE + : algorithms_difference ] + [ run difference_l_a_sph.cpp : : : : algorithms_difference_l_a_sph ] + [ run difference_linear_linear.cpp : : : : algorithms_difference_linear_linear ] + [ run difference_areal_linear.cpp : : : : algorithms_difference_areal_linear ] + [ run difference_pl_a.cpp : : : : algorithms_difference_pl_a ] + [ run difference_pl_l.cpp : : : : algorithms_difference_pl_l ] + [ run difference_pl_pl.cpp : : : : algorithms_difference_pl_pl ] + [ run difference_multi.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE + : algorithms_difference_multi ] + [ run difference_multi_areal_linear.cpp : : : : algorithms_difference_multi_areal_linear ] + [ run difference_multi_spike.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE + : algorithms_difference_multi_spike ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference.cpp new file mode 100644 index 000000000..ebc0ee1bf --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference.cpp @@ -0,0 +1,663 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2015, 2016. +// Modifications copyright (c) 2015-2016, 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 +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include "test_difference.hpp" +#include +#include +#include + + +#ifdef HAVE_TTMATH +# include +#endif + + +// Convenience macros (points are not checked) +#define TEST_DIFFERENCE(caseid, clips1, area1, clips2, area2, clips3) \ + (test_one) \ + ( #caseid, caseid[0], caseid[1], clips1, -1, area1, clips2, -1, area2, \ + clips3, -1, area1 + area2) + +#define TEST_DIFFERENCE_WITH(caseid, clips1, area1, clips2, area2, clips3) \ + (test_one) \ + ( #caseid, caseid[0], caseid[1], clips1, -1, area1, clips2, -1, area2, \ + clips3, -1, area1 + area2, settings) + +template +void test_all() +{ + typedef bg::model::polygon

polygon; + + typedef typename bg::coordinate_type

::type ct; + + ut_settings sym_settings; +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) + sym_settings.sym_difference = false; +#endif + + ut_settings ignore_validity_settings; + ignore_validity_settings.test_validity = false; + + test_one("simplex_normal", + simplex_normal[0], simplex_normal[1], + 3, 12, 2.52636706856656, + 3, 12, 3.52636706856656, + sym_settings); + + test_one("simplex_with_empty", + simplex_normal[0], polygon_empty, + 1, 4, 8.0, + 0, 0, 0.0); + + test_one( + "star_ring", example_star, example_ring, + 5, 22, 1.1901714, + 5, 27, 1.6701714, + sym_settings); + + test_one("two_bends", + two_bends[0], two_bends[1], + 1, 5, 8.0, + 1, 5, 8.0); + + test_one("star_comb_15", + star_comb_15[0], star_comb_15[1], + 30, -1, 227.658275102812, + 30, -1, 480.485775259312, + sym_settings); + + test_one("new_hole", + new_hole[0], new_hole[1], + 1, 9, 7.0, + 1, 13, 14.0); + + + test_one("crossed", + crossed[0], crossed[1], + 1, 18, 19.5, + 1, 7, 2.5); + + test_one("disjoint", + disjoint[0], disjoint[1], + 1, 5, 1.0, + 1, 5, 1.0); + + // The too small one might be discarded (depending on point-type / compiler) + // We check area only + test_one("distance_zero", + distance_zero[0], distance_zero[1], + -1, -1, 8.7048386, + -1, -1, 0.0098387, + tolerance(0.001)); + + test_one("equal_holes_disjoint", + equal_holes_disjoint[0], equal_holes_disjoint[1], + 1, 5, 9.0, + 1, 5, 9.0); + + test_one("only_hole_intersections1", + only_hole_intersections[0], only_hole_intersections[1], + 2, 10, 1.9090909, + 4, 16, 10.9090909, + sym_settings); + + test_one("only_hole_intersection2", + only_hole_intersections[0], only_hole_intersections[2], + 3, 20, 30.9090909, + 4, 16, 10.9090909, + sym_settings); + + test_one("first_within_second", + first_within_second[1], first_within_second[0], + 1, 10, 24, + 0, 0, 0); + + test_one("fitting", + fitting[0], fitting[1], + 1, 9, 21.0, + 1, 4, 4.0, + 1, 5, 25.0); + + test_one("identical", + identical[0], identical[1], + 0, 0, 0.0, + 0, 0, 0.0); + + test_one("intersect_exterior_and_interiors_winded", + intersect_exterior_and_interiors_winded[0], intersect_exterior_and_interiors_winded[1], + 4, 20, 11.533333, + 5, 26, 29.783333); + + test_one("intersect_holes_intersect_and_disjoint", + intersect_holes_intersect_and_disjoint[0], intersect_holes_intersect_and_disjoint[1], + 2, 16, 15.75, + 3, 17, 6.75, + ignore_validity_settings); + + test_one("intersect_holes_intersect_and_touch", + intersect_holes_intersect_and_touch[0], intersect_holes_intersect_and_touch[1], + 3, 21, 16.25, + 3, 17, 6.25, + ignore_validity_settings); + + { + ut_settings settings = sym_settings; + settings.percentage = 0.01; + test_one("intersect_holes_new_ring", + intersect_holes_new_ring[0], intersect_holes_new_ring[1], + 3, 15, 9.8961, + 4, 25, 121.8961, + settings); + } + + test_one("first_within_hole_of_second", + first_within_hole_of_second[0], first_within_hole_of_second[1], + 1, 5, 1, + 1, 10, 16); + + test_one("intersect_holes_disjoint", + intersect_holes_disjoint[0], intersect_holes_disjoint[1], + 2, 14, 16.0, + 2, 10, 6.0); + + test_one("intersect_holes_intersect", + intersect_holes_intersect[0], intersect_holes_intersect[1], + 2, 16, 15.75, + 2, 12, 5.75, + ignore_validity_settings); + + test_one( + "case4", case_4[0], case_4[1], + 6, 28, 2.77878787878788, + 4, 22, 4.77878787878788, + sym_settings); + + test_one( + "case5", case_5[0], case_5[1], + 8, 36, 2.43452380952381, + 7, 33, 3.18452380952381); + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // Fails with rescaling, a-b is partly generated, b-a does not have any output + // It failed already in 1.59 + test_one("case_58_iet", + case_58[0], case_58[2], + 3, 12, 0.6666666667, + 1, -1, 11.1666666667, + 2, -1, 0.6666666667 + 11.1666666667); +#endif + + test_one("case_80", + case_80[0], case_80[1], + 1, 9, 44.5, + 1, 10, 84.5); + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // Fails without rescaling, holes are not subtracted + test_one("case_81", + case_81[0], case_81[1], + 1, 8, 80.5, + 1, 8, 83.0, + 1, 12, 80.5 + 83.0); +#endif + + test_one("case_100", + case_100[0], case_100[1], + 1, 7, 3.125, + 1, 7, 16.0, + 1, 13, 16.0 + 3.125); + + test_one("case_101", + case_101[0], case_101[1], + 3, 17, 13.75, + 1, 4, 1.0); + + test_one("case_102", + case_102[0], case_102[1], + 4, 18, 1.5, + 3, 15, 4.0625); + + TEST_DIFFERENCE(case_105, 4, 8.0, 1, 16.0, 5); + TEST_DIFFERENCE(case_106, 1, 17.5, 2, 32.5, 3); + TEST_DIFFERENCE(case_107, 2, 18.0, 2, 29.0, 4); + + TEST_DIFFERENCE(case_precision_1, 1, 14.0, 1, BG_IF_KRAMER(8.00001, 8.0), 1); + TEST_DIFFERENCE(case_precision_2, 1, 14.0, 1, 8.0, 1); + TEST_DIFFERENCE(case_precision_3, 1, 14.0, 1, 8.0, 1); + TEST_DIFFERENCE(case_precision_4, 1, 14.0, 1, 8.0, 1); +#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + TEST_DIFFERENCE(case_precision_5, 1, 14.0, 1, 8.0, 1); + TEST_DIFFERENCE(case_precision_6, 0, 0.0, 1, 57.0, 1); +#endif + TEST_DIFFERENCE(case_precision_7, 1, 14.0, 1, 8.0, 1); + TEST_DIFFERENCE(case_precision_8, 0, 0.0, 1, 59.0, 1); +#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + TEST_DIFFERENCE(case_precision_9, 0, 0.0, 1, 59.0, 1); + TEST_DIFFERENCE(case_precision_10, 0, 0.0, 1, 59.0, 1); + TEST_DIFFERENCE(case_precision_11, 0, 0.0, 1, 59.0, 1); +#endif + TEST_DIFFERENCE(case_precision_12, 1, 12.0, 0, 0.0, 1); + TEST_DIFFERENCE(case_precision_13, 1, BG_IF_KRAMER(12.00002, 12.0), 0, 0.0, 1); + TEST_DIFFERENCE(case_precision_14, 1, 14.0, 1, 8.0, 1); + TEST_DIFFERENCE(case_precision_15, 0, 0.0, 1, 59.0, 1); +#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + TEST_DIFFERENCE(case_precision_16, 0, 0.0, 1, 59.0, 1); +#endif + TEST_DIFFERENCE(case_precision_17, 0, 0.0, 1, 59.0, 1); + TEST_DIFFERENCE(case_precision_18, 0, 0.0, 1, 59.0, 1); +#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + TEST_DIFFERENCE(case_precision_19, 1, 0.0, 1, 59.0, 2); +#endif + TEST_DIFFERENCE(case_precision_20, 1, 14.0, 1, 8.0, 1); + TEST_DIFFERENCE(case_precision_21, 1, 14.0, 1, 7.99999, 1); +#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + TEST_DIFFERENCE(case_precision_22, 0, 0.0, 1, 59.0, 1); + TEST_DIFFERENCE(case_precision_23, 0, 0.0, 1, 59.0, 1); +#endif + TEST_DIFFERENCE(case_precision_24, 1, 14.0, 1, 8.0, 1); + TEST_DIFFERENCE(case_precision_25, 1, 14.0, 1, 7.99999, 1); +#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + TEST_DIFFERENCE(case_precision_26, 0, 0.0, 1, 59.0, 1); +#endif + + test_one("winded", + winded[0], winded[1], + 3, 37, 61, + 1, 15, 13); + + test_one("within_holes_disjoint", + within_holes_disjoint[0], within_holes_disjoint[1], + 2, 15, 25, + 1, 5, 1); + + test_one("side_side", + side_side[0], side_side[1], + 1, 5, 1, + 1, 5, 1, + 1, 7, 2); + + test_one("buffer_mp1", + buffer_mp1[0], buffer_mp1[1], + 1, 61, 10.2717, + 1, 61, 10.2717); + + if ( BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + { + test_one("buffer_mp2", + buffer_mp2[0], buffer_mp2[1], + 1, 91, 12.09857, + 1, 155, 24.19714, + BG_IF_RESCALED(2, 1), -1, 12.09857 + 24.19714); + } + + /*** TODO: self-tangencies for difference + test_one("wrapped_a", + wrapped[0], wrapped[1], + 3, 1, 61, + 1, 0, 13); + + test_one("wrapped_b", + wrapped[0], wrapped[2], + 3, 1, 61, + 1, 0, 13); + ***/ + + { + ut_settings settings; + settings.percentage = BG_IF_RESCALED(0.001, 0.1); + settings.test_validity = BG_IF_RESCALED(true, false); + settings.sym_difference = BG_IF_RESCALED(true, false); + + // Isovist - the # output polygons differ per compiler/pointtype, (very) small + // rings might be discarded. We check area only + + // SQL Server gives: 0.279121891701124 and 224.889211358929 + // PostGIS gives: 0.279121991127244 and 224.889205853156 + // No robustness gives: 0.279121991127106 and 224.825363749290 + + test_one("isovist", + isovist1[0], isovist1[1], + -1, -1, 0.279132, + -1, -1, 224.8892, + settings); + } + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + { + ut_settings settings; + settings.percentage = 0.1; + settings.test_validity = false; + + // SQL Server gives: 0.28937764436705 and 0.000786406897532288 with 44/35 rings + // PostGIS gives: 0.30859375 and 0.033203125 with 35/35 rings + TEST_DIFFERENCE_WITH(geos_1, + -1, BG_IF_KRAMER(0.29171, 0.20705), + -1, BG_IF_KRAMER(0.00076855, 0.00060440758), + -1); + } +#endif + + { + // MSVC 14 expects 138.69214 and 211.85913: increase percentage + + ut_settings settings = sym_settings; + settings.percentage = 0.01; + settings.test_validity = false; + + // Output polygons for sym difference might be combined + test_one("geos_2", + geos_2[0], geos_2[1], + 1, -1, 138.6923828, + 1, -1, 211.859375, + BG_IF_RESCALED(2, 1), -1, 138.6923828 + 211.859375, + settings); + } + + // Output polygons for sym difference might be combined + test_one("geos_3", + geos_3[0], geos_3[1], + 1, -1, 16211128.5, + 1, -1, 13180420.0, + BG_IF_RESCALED(1, 2), -1, 16211128.5 + 13180420.0, + sym_settings); + + test_one("geos_4", + geos_4[0], geos_4[1], + 1, -1, 971.9163115, + 1, -1, 1332.4163115, + sym_settings); + + test_one("ggl_list_20110306_javier", + ggl_list_20110306_javier[0], ggl_list_20110306_javier[1], + 1, -1, 71495.3331, + 2, -1, 8960.49049, + 2, -1, 71495.3331 + 8960.49049); + + test_one("ggl_list_20110307_javier", + ggl_list_20110307_javier[0], ggl_list_20110307_javier[1], + 1, if_typed(14, 13), 16815.6, + 1, 4, 3200.4, + tolerance(0.01)); + + if ( BOOST_GEOMETRY_CONDITION((! boost::is_same::value)) ) + { + TEST_DIFFERENCE(ggl_list_20110716_enrico, + 3, 35723.8506317139, // TODO FOR GENERIC, misses one of three outputs + 1, 58456.4964294434, + 1); + } + +#if defined(BOOST_GEOMETRY_USE_RESCALING) \ + || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) \ + || defined(BOOST_GEOMETRY_TEST_FAILURES) + { + // Symmetric difference should output one polygon + // Using rescaling, it currently outputs two. + ut_settings settings; + settings.test_validity = false; + + TEST_DIFFERENCE_WITH(ggl_list_20110820_christophe, + 1, 2.8570121719168924, + 1, 64.498061986388564, + BG_IF_RESCALED(2, 1)); + } +#endif + + test_one("ggl_list_20120717_volker", + ggl_list_20120717_volker[0], ggl_list_20120717_volker[1], + 1, 11, 3370866.2295081965, + 1, 5, 384.2295081964694, + tolerance(0.01)); + + // 2011-07-02 / 2014-06-19 + // Interesting FP-precision case. + // sql server gives: 6.62295817619452E-05 + // PostGIS gives: 0.0 (no output) + // Boost.Geometry gave results depending on FP-type, and compiler, and operating system. + // With rescaling results are equal w.r.t. compiler/FP type, + // however, some long spikes are still generated in the resulting difference + // Without rescaling there is no output, like PostGIS + test_one("ggl_list_20110627_phillip", + ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1], + BG_IF_RESCALED(1, 0), -1, + BG_IF_RESCALED(if_typed_tt(0.0000000000001105367, 0.000125137888971949), 0), + 1, -1, 3577.40960816756, + tolerance(0.01) + ); + + { + // With rescaling, difference of output a-b and a sym b is invalid + ut_settings settings; + settings.test_validity = BG_IF_RESCALED(false, true); + TEST_DIFFERENCE_WITH(ggl_list_20190307_matthieu_1, + BG_IF_KRAMER(2, 1), 0.18461532, + BG_IF_KRAMER(2, 1), 0.617978, + BG_IF_KRAMER(4, 2)); + TEST_DIFFERENCE_WITH(ggl_list_20190307_matthieu_2, 2, 12.357152, 0, 0.0, 2); + } + + // Ticket 8310, one should be completely subtracted from the other. + test_one("ticket_8310a", + ticket_8310a[0], ticket_8310a[1], + 1, 10, 10.11562724, + 0, 0, 0); + test_one("ticket_8310b", + ticket_8310b[0], ticket_8310b[1], + 1, 10, 10.12655608, + 0, 0, 0); + test_one("ticket_8310c", + ticket_8310c[0], ticket_8310c[1], + 1, 10, 10.03103292, + 0, 0, 0); + + test_one("ticket_9081_15", + ticket_9081_15[0], ticket_9081_15[1], + 2, -1, 0.0334529710902111, + BG_IF_RESCALED(1, 0), -1, BG_IF_RESCALED(5.3469555172380723e-010, 0)); + + test_one("ticket_9081_314", + ticket_9081_314[0], ticket_9081_314[1], + 2, 12, 0.0451236449624935, + 0, 0, 0); + + { + ut_settings settings; + settings.test_validity = BG_IF_RESCALED(true, false); +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) && defined(BOOST_GEOMETRY_USE_KRAMER_RULE) + const int expected_count = 1; // Wrong, considers all consecutive polygons as one +#else + const int expected_count = 6; +#endif + TEST_DIFFERENCE_WITH(ticket_9563, + 0, 0, + expected_count, 20.096189, + expected_count); + } + + test_one("ticket_10108_a", + ticket_10108_a[0], ticket_10108_a[1], + 1, 4, 0.0145037, + 1, 4, 0.029019232, + sym_settings); + + test_one("ticket_10108_b", + ticket_10108_b[0], ticket_10108_b[1], + 1, -1, 1081.68697, + 1, -1, 1342.65795, + BG_IF_RESCALED(2, 1), -1, 1081.68697 + 1342.65795); + + test_one("ticket_11725", + ticket_11725[0], ticket_11725[1], + 1, -1, 3.0, + 1, -1, 4.5, + 1, -1, 7.5); + + // From assemble-test, with a u/u case + test_one("assemble_0210", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(8.5 1,9.5 1,9.5 2,8.5 2,8.5 1))", + "POLYGON((2 0.5,0.5 2,0.5 8,2 9.5,6 9.5,8.5 8,8.5 2,7 0.5,2 0.5),(2 2,7 2,7 8,2 8,2 2))", + 2, 23, 62.25, + 0, 0, 0.0); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + typedef bg::model::box

box; + typedef bg::model::ring

ring; + + // Other combinations + { + test_one( + "star_ring_ring", example_star, example_ring, + 5, 22, 1.1901714, + 5, 27, 1.6701714, + sym_settings); + + test_one( + "ring_star_ring", example_ring, example_star, + 5, 27, 1.6701714, + 5, 22, 1.1901714, + sym_settings); + + static std::string const clip = "POLYGON((2.5 0.5,5.5 2.5))"; + + test_one("star_box", + clip, example_star, + 4, 20, 2.833333, 4, 16, 0.833333); + + test_one("box_star", + example_star, clip, + 4, 16, 0.833333, 4, 20, 2.833333); + } + + // Counter clockwise + { + typedef bg::model::polygon polygon_ccw; + test_one( + "star_ring_ccw", example_star, example_ring, + 5, 22, 1.1901714, + 5, 27, 1.6701714, + sym_settings); + test_one( + "star_ring_ccw1", example_star, example_ring, + 5, 22, 1.1901714, + 5, 27, 1.6701714, + sym_settings); + test_one( + "star_ring_ccw2", example_star, example_ring, + 5, 22, 1.1901714, + 5, 27, 1.6701714, + sym_settings); + } + + // Multi/box (should be moved to multi) + { + typedef bg::model::multi_polygon mp; + + static std::string const clip = "POLYGON((2 2,4 4))"; + + test_one("simplex_multi_box_mp", + clip, case_multi_simplex[0], + 2, -1, 0.53333333333, 3, -1, 8.53333333333); + test_one("simplex_multi_mp_box", + case_multi_simplex[0], clip, + 3, -1, 8.53333333333, 2, -1, 0.53333333333); + + } +#endif + + // Rescaling generates a very small false polygon + { + ut_settings settings; +#if defined(BOOST_GEOMETRY_USE_KRAMER_RULE) + settings.test_validity = BG_IF_RESCALED(true, false); +#endif + TEST_DIFFERENCE_WITH(issue_566_a, 1, 143.662, BG_IF_RESCALED(1, 0), + BG_IF_RESCALED(1.605078e-6, 0.0), + BG_IF_RESCALED(2, 1)); + } + TEST_DIFFERENCE(issue_566_b, 1, 143.662, BG_IF_RESCALED(1, 0), + BG_IF_RESCALED(1.605078e-6, 0.0), + BG_IF_RESCALED(2, 1)); + + TEST_DIFFERENCE(mysql_21977775, 2, 160.856568913, 2, 92.3565689126, 4); + TEST_DIFFERENCE(mysql_21965285, 1, 92.0, 1, 14.0, 1); + TEST_DIFFERENCE(mysql_23023665_1, 1, 92.0, 1, 142.5, 2); + TEST_DIFFERENCE(mysql_23023665_2, 1, 96.0, 1, 16.0, 2); + TEST_DIFFERENCE(mysql_23023665_3, 1, 225.0, 1, 66.0, 2); + TEST_DIFFERENCE(mysql_23023665_5, 2, 165.23735, 2, 105.73735, 4); +#if defined(BOOST_GEOMETRY_USE_RESCALING) \ + || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) \ + || defined(BOOST_GEOMETRY_TEST_FAILURES) + // Testcases going wrong with Kramer's rule and no rescaling + TEST_DIFFERENCE(mysql_23023665_6, 2, 105.68756, 3, 10.18756, 5); + TEST_DIFFERENCE(mysql_23023665_13, 3, 99.74526, 3, 37.74526, 6); +#endif +} + + +// Test cases for integer coordinates / ccw / open +template +void test_specific() +{ + typedef bg::model::polygon polygon; + + test_one("ggl_list_20120717_volker", + ggl_list_20120717_volker[0], ggl_list_20120717_volker[1], + 1, 11, 3371540, + 1, 4, 385, + 1, 16, 3371540 + 385); + + test_one("ticket_10658", + ticket_10658[0], ticket_10658[1], + 1, 6, 1510434, + 0, 0, 0); + + test_one("ticket_11121", + ticket_11121[0], ticket_11121[1], + 2, 8, 489763.5, + 1, 4, 6731652.0); + + // Generates spikes, both a-b and b-a + TEST_DIFFERENCE(ticket_11676, 2, 2537992.5, 2, 294963.5, 3); +} + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + test_all >(); + + test_specific, false, false>(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_all >(); + +#ifdef HAVE_TTMATH + std::cout << "Testing TTMATH" << std::endl; + test_all >(); +#endif +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_areal_linear.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_areal_linear.cpp new file mode 100644 index 000000000..a44193e6e --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_areal_linear.cpp @@ -0,0 +1,260 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2015, 2017. +// Modifications copyright (c) 2015-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 +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include "test_difference.hpp" +#include +#include +#include + + +#ifdef HAVE_TTMATH +# include +#endif + +template +void test_ticket_10835(std::string const& wkt_out1, std::string const& wkt_out2) +{ + typedef bg::model::point point_type; + typedef bg::model::linestring linestring_type; + typedef bg::model::multi_linestring multilinestring_type; + typedef bg::model::polygon + < + point_type, /*ClockWise*/false, /*Closed*/false + > polygon_type; + + multilinestring_type multilinestring; + bg::read_wkt(ticket_10835[0], multilinestring); + polygon_type polygon1; + bg::read_wkt(ticket_10835[1], polygon1); + polygon_type polygon2; + bg::read_wkt(ticket_10835[2], polygon2); + + multilinestring_type multilinestringOut1; + bg::difference(multilinestring, polygon1, multilinestringOut1); + std::stringstream stream; + stream << bg::wkt(multilinestringOut1); + + BOOST_CHECK_EQUAL(stream.str(), wkt_out1); + + multilinestring_type multilinestringOut2; + bg::difference(multilinestringOut1, polygon2, multilinestringOut2); + stream.str(""); + stream.clear(); + stream << bg::wkt(multilinestringOut2); + + BOOST_CHECK_EQUAL(stream.str(), wkt_out2); +} + + +template +void test_areal_linear() +{ + typedef typename bg::point_type::type point; + typedef typename bg::coordinate_type::type ct; + + std::string const poly_simplex = "POLYGON((1 1,1 3,3 3,3 1,1 1))"; + test_one_lp("simplex", "LINESTRING(0 2,4 2)", poly_simplex, 2, 4, 2.0); + test_one_lp("case2", "LINESTRING(0 1,4 3)", poly_simplex, 2, 4, sqrt(5.0)); + test_one_lp("case3", "LINESTRING(0 1,1 2,3 2,4 3,6 3,7 4)", "POLYGON((2 0,2 5,5 5,5 0,2 0))", 2, 6, 2.0 + 2.0 * sqrt(2.0)); + test_one_lp("case4", "LINESTRING(1 1,3 2,1 3)", "POLYGON((0 0,0 4,2 4,2 0,0 0))", 1, 3, sqrt(5.0)); + + test_one_lp("case5", "LINESTRING(0 1,3 4)", poly_simplex, 2, 4, 2.0 * sqrt(2.0)); + test_one_lp("case6", "LINESTRING(1 1,10 3)", "POLYGON((2 0,2 4,3 4,3 1,4 1,4 3,5 3,5 1,6 1,6 3,7 3,7 1,8 1,8 3,9 3,9 0,2 0))", 5, 10, + // Pieces are 1 x 2/9: + 5.0 * sqrt(1.0 + 4.0/81.0)); + + + test_one_lp("case7", "LINESTRING(1.5 1.5,2.5 2.5)", poly_simplex, 0, 0, 0.0); + test_one_lp("case8", "LINESTRING(1 0,2 0)", poly_simplex, 1, 2, 1.0); + + std::string const poly_9 = "POLYGON((1 1,1 4,4 4,4 1,1 1))"; + test_one_lp("case9", "LINESTRING(0 1,1 2,2 2)", poly_9, 1, 2, sqrt(2.0)); + test_one_lp("case10", "LINESTRING(0 1,1 2,0 2)", poly_9, 1, 3, 1.0 + sqrt(2.0)); + test_one_lp("case11", "LINESTRING(2 2,4 2,3 3)", poly_9, 0, 0, 0.0); + test_one_lp("case12", "LINESTRING(2 3,4 4,5 6)", poly_9, 1, 2, sqrt(5.0)); + + test_one_lp("case13", "LINESTRING(3 2,4 4,2 3)", poly_9, 0, 0, 0.0); + test_one_lp("case14", "LINESTRING(5 6,4 4,6 5)", poly_9, 1, 3, 2.0 * sqrt(5.0)); + + test_one_lp("case15", "LINESTRING(0 2,1 2,1 3,0 3)", poly_9, 2, 4, 2.0); + test_one_lp("case16", "LINESTRING(2 2,1 2,1 3,2 3)", poly_9, 0, 0, 0.0); + + std::string const angly = "LINESTRING(2 2,2 1,4 1,4 2,5 2,5 3,4 3,4 4,5 4,3 6,3 5,2 5,2 6,0 4)"; + test_one_lp("case17", angly, "POLYGON((1 1,1 5,4 5,4 1,1 1))", 3, 11, 6.0 + 4.0 * sqrt(2.0)); + test_one_lp("case18", angly, "POLYGON((1 1,1 5,5 5,5 1,1 1))", 2, 6, 2.0 + 3.0 * sqrt(2.0)); + test_one_lp("case19", "LINESTRING(1 2,1 3,0 3)", poly_9, 1, 2, 1.0); + test_one_lp("case20", "LINESTRING(1 2,1 3,2 3)", poly_9, 0, 0, 0.0); + + // PROPERTIES CHANGED BY switch_to_integer + // TODO test_one_lp("case21", "LINESTRING(1 2,1 4,4 4,4 1,2 1,2 2)", poly_9, 0, 0, 0.0); + + // More collinear (opposite) cases + test_one_lp("case22", "LINESTRING(4 1,4 4,7 4)", poly_9, 1, 2, 3.0); + test_one_lp("case23", "LINESTRING(4 0,4 4,7 4)", poly_9, 2, 4, 4.0); + test_one_lp("case24", "LINESTRING(4 1,4 5,7 5)", poly_9, 1, 3, 4.0); + test_one_lp("case25", "LINESTRING(4 0,4 5,7 5)", poly_9, 2, 5, 5.0); + test_one_lp("case26", "LINESTRING(4 0,4 3,4 5,7 5)", poly_9, 2, 5, 5.0); + test_one_lp("case27", "LINESTRING(4 4,4 5,5 5)", poly_9, 1, 3, 2.0); + + if (BOOST_GEOMETRY_CONDITION( (! boost::is_same::value)) ) + { + // Fails for float + test_one_lp("case28", + "LINESTRING(-1.3 0,-15 0,-1.3 0)", + "POLYGON((2 3,-9 -7,12 -13,2 3))", + 1, 3, 27.4); + } + + test_one_lp("case29", + "LINESTRING(5 5,-10 5,5 5)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + 1, 3, 20); + + test_one_lp("case29a", + "LINESTRING(1 1,5 5,-10 5,5 5,6 6)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + 1, 3, 20); + + test_one_lp("case30", + "LINESTRING(-10 5,5 5,-10 5)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + 2, 4, 20); + + test_one_lp("case30a", + "LINESTRING(-20 10,-10 5,5 5,-10 5,-20 -10)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + 2, 6, 49.208096); + + test_one_lp("case31", + "LINESTRING(0 5,5 5,0 5)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + 0, 0, 0); + + test_one_lp("case31", + "LINESTRING(0 5,5 5,1 1,9 1,5 5,0 5)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + 0, 0, 0); + + test_one_lp("case32", + "LINESTRING(5 5,0 5,5 5)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + 0, 0, 0); + + test_one_lp("case32a", + "LINESTRING(-10 10,5 5,0 5,5 5,20 10)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + 2, 4, 21.081851); + + test_one_lp("case33", + "LINESTRING(-5 5,0 5,-5 5)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + 1, 3, 10); + + test_one_lp("case33a", + "LINESTRING(-10 10,-5 5,0 5,-5 5,-10 -10)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + 1, 5, 32.882456); + + test_one_lp("case33b", + "LINESTRING(0 5,-5 5,0 5)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + 1, 3, 10); + + test_one_lp("case34", + "LINESTRING(5 5,0 5,5 5,5 4,0 4,5 4)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + 0, 0, 0); + + test_one_lp("case35", + "LINESTRING(5 5,0 5,5 5,5 4,0 4,5 3)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + 0, 0, 0); + + test_one_lp("case36", + "LINESTRING(-1 -1,10 10)", + "POLYGON((5 5,15 15,15 5,5 5))", + 1, 2, 6 * std::sqrt(2.0)); + + test_one_lp("case37_1", + "LINESTRING(1 1,2 2)", + "POLYGON((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))", + 1, 2, std::sqrt(2.0)); + + test_one_lp("case37_2", + "LINESTRING(1 1,2 2,3 3)", + "POLYGON((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))", + 1, 2, std::sqrt(2.0)); + + test_one_lp("case38", + "LINESTRING(0 0,1 1,2 2,3 3)", + "POLYGON((0 0,0 9,9 9,9 0,0 0),(0 0,2 1,2 2,1 2,0 0))", + 1, 3, 2 * std::sqrt(2.0)); + + // several linestrings are in the output, the result is geometrically correct + // still single linestring could be generated + test_one_lp("case39", + "LINESTRING(0 0,1 1,2 2,3 3)", + "POLYGON((0 0,0 9,9 9,9 0,0 0),(0 0,2 1,2 2,1 2,0 0),(2 2,3 2,3 3,2 3,2 2))", + 2, 5, 3 * std::sqrt(2.0)); + test_one_lp("case40", + "LINESTRING(0 0,1 1,2 2,4 4)", + "POLYGON((0 0,0 9,9 9,9 0,0 0),(0 0,2 1,2 2,1 2,0 0),(2 2,3 2,3 3,2 3,2 2))", + 2, 5, 3 * std::sqrt(2.0)); + test_one_lp("case41", + "LINESTRING(0 0,1 1,2 2,9 9)", + "POLYGON((0 0,0 9,9 9,9 0,0 0),(0 0,2 1,2 2,1 2,0 0),(2 2,3 2,3 3,2 3,2 2),(7 7,8 7,9 9,7 8,7 7))", + 3, 7, 5 * std::sqrt(2.0)); +} + +template +void test_all() +{ + typedef bg::model::polygon

polygon; + typedef bg::model::linestring

linestring; + + test_areal_linear(); +} + + +int test_main(int, char* []) +{ + test_all >(); + + test_ticket_10835 + ("MULTILINESTRING((5239 2113,5233 2114),(4794 2205,1020 2986))", + "MULTILINESTRING((5239 2113,5233 2114),(4794 2205,1460 2895))"); + + test_ticket_10835 + ("MULTILINESTRING((5239 2113,5232.52 2114.34),(4794.39 2205,1020 2986))", + "MULTILINESTRING((5239 2113,5232.52 2114.34),(4794.39 2205,1459.78 2895))"); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_l_a_sph.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_l_a_sph.cpp new file mode 100644 index 000000000..2dbb3d0c1 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_l_a_sph.cpp @@ -0,0 +1,36 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2019, 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) + +#include "test_difference.hpp" + +void test_all() +{ + typedef bg::model::point > point; + typedef bg::model::linestring linestring; + typedef bg::model::polygon polygon; + + // https://github.com/boostorg/geometry/issues/619 + + test_one_lp( + "issue_619", + "LINESTRING(-106.373725 39.638846, -106.373486 39.639362, -106.368378 39.614603)", + "POLYGON((-106.374074 39.638593, -106.373626 39.639230, -106.373594 39.639232, " + "-106.373366 39.638502, -106.373299 39.638459, -106.373369 39.638382, " + "-106.374074 39.638593))", + 2, 5, 0.00044107988528133710); +} + +int test_main(int, char* []) +{ + test_all(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_linear_linear.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_linear_linear.cpp new file mode 100644 index 000000000..df8227d93 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_linear_linear.cpp @@ -0,0 +1,1542 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_difference_linear_linear +#endif + +#ifdef BOOST_GEOMETRY_TEST_DEBUG +#define BOOST_GEOMETRY_DEBUG_TURNS +#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER +#endif + +#include + +#include "test_difference_linear_linear.hpp" + +#include +#include +#include + +typedef bg::model::point point_type; +typedef bg::model::segment segment_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_linestring multi_linestring_type; + + + +//=========================================================================== +//=========================================================================== +//=========================================================================== + + +BOOST_AUTO_TEST_CASE( test_difference_linestring_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** LINESTRING / LINESTRING DIFFERENCE ***" << std::endl; + std::cout << std::endl; +#endif + + typedef linestring_type L; + typedef multi_linestring_type ML; + + typedef test_difference_of_geometries tester; + + tester::apply + (from_wkt("LINESTRING(0 0,1 1,2 1,3 2)"), + from_wkt("LINESTRING(0 2,1 1,2 1,3 0)"), + from_wkt("MULTILINESTRING((0 0,1 1),(2 1,3 2))"), + "lldf00"); + + tester::apply + (from_wkt("LINESTRING(0 2,1 1,2 1,3 0)"), + from_wkt("LINESTRING(0 0,1 1,2 1,3 2)"), + from_wkt("MULTILINESTRING((0 2,1 1),(2 1,3 0))"), + "lldf00-1"); + + tester::apply + (from_wkt("LINESTRING(0 0,5 0)"), + from_wkt("LINESTRING(3 0,4 0)"), + from_wkt("MULTILINESTRING((0 0,3 0),(4 0,5 0))"), + "lldf01"); + + tester::apply + (from_wkt("LINESTRING(3 0,4 0)"), + from_wkt("LINESTRING(0 0,5 0)"), + from_wkt("MULTILINESTRING()"), + "lldf01-1"); + + tester::apply + (from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("LINESTRING(3 0,6 0)"), + from_wkt("MULTILINESTRING((0 0,3 0))"), + "lldf01-2"); + + tester::apply + (from_wkt("LINESTRING(3 0,6 0)"), + from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("MULTILINESTRING((4 0,6 0))"), + "lldf01-3"); + + tester::apply + (from_wkt("LINESTRING(0 0,6 0)"), + from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("MULTILINESTRING((4 0,6 0))"), + "lldf01-4"); + + tester::apply + (from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("LINESTRING(0 0,6 0)"), + from_wkt("MULTILINESTRING()"), + "lldf01-5"); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("LINESTRING(0 0,1 1,2 0,3 1,4 0,5 0,6 1,7 -1,8 0)"), + from_wkt("MULTILINESTRING((0 0,4 0),(5 0,20 0))"), + "lldf01-6"); + + tester::apply + (from_wkt("LINESTRING(-20 0,20 0)"), + from_wkt("LINESTRING(0 0,1 1,2 0,3 1,4 0,5 0,6 1,7 -1,8 0)"), + from_wkt("MULTILINESTRING((-20 0,4 0),(5 0,20 0))"), + "lldf01-7"); + + tester::apply + (from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("LINESTRING(2 0,4 0)"), + from_wkt("MULTILINESTRING((0 0,2 0))"), + "lldf01-8"); + + tester::apply + (from_wkt("LINESTRING(2 0,4 0)"), + from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("MULTILINESTRING()"), + "lldf01-9"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("LINESTRING(4 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,2 0))"), + "lldf01-10"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("LINESTRING(2 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,2 0))"), + "lldf01-11"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,4 0)"), + from_wkt("LINESTRING(3 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,1 0,3 0))"), + "lldf01-11a"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,4 0)"), + from_wkt("LINESTRING(3 0,4 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,1 0,3 0))"), + "lldf01-11b"); + + tester::apply + (from_wkt("LINESTRING(0 0,6 0)"), + from_wkt("LINESTRING(2 0,4 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,2 0),(5 0,6 0))"), + "lldf01-12"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,5 5,10 5,15 0)"), + from_wkt("LINESTRING(-1 6,0 5,15 5)"), + from_wkt("MULTILINESTRING((0 0,1 0,5 5),(10 5,15 0))"), + "lldf02"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0))"), + "lldf03"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,5 5,10 5,15 0,20 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((1 0,5 5,10 5,15 0))"), + "lldf04"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,25 1)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (20 0,25 1))"), + "lldf05"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,30 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0))"), + "lldf05-1"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (30 0,31 0))"), + "lldf06"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0)"), + from_wkt("LINESTRING(-1 0,25 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (30 0,31 0))"), + "lldf07"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0)"), + from_wkt("LINESTRING(-1 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (30 0,31 0))"), + "lldf08"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,30 0,31 1)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (30 0,31 1))"), + "lldf09"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,30 0,31 1)"), + from_wkt("LINESTRING(-1 -1,0 0,1 0,2 1,3 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (30 0,31 1))"), + "lldf10"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,20 0,\ + 30 0,31 1)"), + from_wkt("LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(2 0,3 0),\ + (4 0,5 5,10 5,15 0),(30 0,31 1))"), + "lldf11"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)"), + from_wkt("LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(2 0,3 0),\ + (4 0,5 5,10 5,15 0),(30 0,31 0))"), + "lldf11-1"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0,3 1)"), + from_wkt("LINESTRING(0 0,2 0,3 1)"), + from_wkt("MULTILINESTRING()"), + "lldf12"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0,3 1)"), + from_wkt("LINESTRING(3 1,2 0,0 0)"), + from_wkt("MULTILINESTRING()"), + "lldf12-1"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 5,4 0)"), + from_wkt("LINESTRING(1 0,2 1,3 5,4 0,5 10)"), + from_wkt("MULTILINESTRING((0 0,1 0))"), + "lldf13"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)"), + from_wkt("LINESTRING(0 0,2 0,2.5 0,3 1)"), + from_wkt("MULTILINESTRING()"), + "lldf14"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 5,4 0)"), + from_wkt("LINESTRING(1 0,2 1,3 5)"), + from_wkt("MULTILINESTRING((0 0,1 0),(3 5,4 0))"), + "lldf15"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 2)"), + from_wkt("LINESTRING(0.5 0,1 0,3 2,4 5)"), + from_wkt("MULTILINESTRING((0 0,0.5 0))"), + "lldf16"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 2)"), + from_wkt("LINESTRING(4 5,3 2,1 0,0.5 0)"), + from_wkt("MULTILINESTRING((0 0,0.5 0))"), + "lldf16-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1,30 1)"), + from_wkt("LINESTRING(1 1,2 0,3 1,20 1,25 1)"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(25 1,30 1))"), + "lldf17"); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1,21 0,30 0)"), + from_wkt("LINESTRING(1 1,2 0,3 1,20 1,25 0)"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1,21 0,30 0))"), + "lldf18"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 1)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0))"), + "lldf19"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(5 1,4 0,4 1,20 1,5 0,1 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0))"), + "lldf19-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0))"), + "lldf19a"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(4 0,4 1,20 1,5 0,1 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0))"), + "lldf19a-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0))"), + "lldf19b"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0,6 1)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0))"), + "lldf19c"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,3 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0))"), + "lldf19d"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,3 0,3 1)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0))"), + "lldf19e"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0,5 1)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0))"), + "lldf19f"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(5 1,5 0,4 0,4 1,20 1,5 0,1 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0))"), + "lldf19f-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,5 0,5 1)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0))"), + "lldf19g"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(5 1,5 0,4 1,20 1,5 0,1 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0))"), + "lldf19g-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0,30 30,10 30,10 -10,15 0,40 0)"), + from_wkt("LINESTRING(5 5,10 0,10 30,20 0,25 0,25 25,50 0,35 0)"), + from_wkt("MULTILINESTRING((0 0,20 0),(25 0,30 0,30 30,10 30),\ + (10 0,10 -10,15 0,20 0),(25 0,35 0))"), + "lldf20"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0,30 30,10 30,10 -10,15 0,40 0)"), + from_wkt("LINESTRING(5 5,10 0,10 30,20 0,25 0,25 25,50 0,15 0)"), + from_wkt("MULTILINESTRING((0 0,15 0),(30 0,30 30,10 30),\ + (10 0,10 -10,15 0))"), + "lldf20a"); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("LINESTRING(2 2,5 -1,15 2,18 0,20 0)"), + from_wkt("MULTILINESTRING((0 0,18 0),(20 0,30 0))"), + "lldf21" + ); + + tester::apply + (from_wkt("LINESTRING(2 2,5 -1,15 2,18 0,20 0)"), + from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((2 2,5 -1,15 2,18 0))"), + "lldf21a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0)"), + from_wkt("LINESTRING(1 0,4 0,2 1,5 1,4 0,8 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(8 0,10 0))"), + "lldf22" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0)"), + from_wkt("LINESTRING(4 0,5 0,5 1,1 1,1 0,4 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,10 0))"), + "lldf23" + ); + + // the following two tests have been discussed with by Adam + tester::apply + (from_wkt("LINESTRING(1 0,1 1,2 1)"), + from_wkt("LINESTRING(2 1,1 1,1 0)"), + from_wkt("MULTILINESTRING()"), + "lldf24" + ); + + tester::apply + (from_wkt("LINESTRING(1 0,1 1,2 1)"), + from_wkt("LINESTRING(1 2,1 1,1 0)"), + from_wkt("MULTILINESTRING((1 1,2 1))"), + "lldf25" + ); + + tester::apply + (from_wkt("LINESTRING(6 0,0 0,5 0)"), + from_wkt("LINESTRING(2 0,-10 0)"), + from_wkt("MULTILINESTRING((6 0,2 0),(2 0,5 0))"), + "lldf27a" + ); + + tester::apply + (from_wkt("LINESTRING(6 0,0 0,5 0)"), + from_wkt("LINESTRING(2 0,-1 0,-10 0)"), + from_wkt("MULTILINESTRING((6 0,2 0),(2 0,5 0))"), + "lldf27b" + ); + + tester::apply + (from_wkt("LINESTRING(6 0,0 0,5 0)"), + from_wkt("LINESTRING(2 0,0 0,-10 0)"), + from_wkt("MULTILINESTRING((6 0,2 0),(2 0,5 0))"), + "lldf27c" + ); + + tester::apply + (from_wkt("LINESTRING(2 0,0 0,-10 0)"), + from_wkt("LINESTRING(6 0,0 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,-10 0))"), + "lldf27d" + ); + + tester::apply + (from_wkt("LINESTRING(-3 6,-3 0,-3 5)"), + from_wkt("LINESTRING(-3 2,-3 0,-3 -10)"), + from_wkt("MULTILINESTRING((-3 6,-3 2),(-3 2,-3 5))"), + "lldf28a" + ); + + tester::apply + (from_wkt("LINESTRING(-3 2,-3 0,-3 -10)"), + from_wkt("LINESTRING(-3 6,-3 0,-3 5)"), + from_wkt("MULTILINESTRING((-3 0,-3 -10))"), + "lldf28b" + ); + + tester::apply + (from_wkt("LINESTRING(-3 6,-3 0,-3 5)"), + from_wkt("LINESTRING(-3 2,-3 0,-3 -10)"), + from_wkt("MULTILINESTRING((-3 6,-3 2),(-3 2,-3 5))"), + "lldf28c" + ); + + tester::apply + (from_wkt("LINESTRING(-7 -8,3 0,4 -1)"), + from_wkt("LINESTRING(-5 -4,3 0,4 -1,7 -4)"), + from_wkt("MULTILINESTRING((-7 -8,3 0))"), + "lldf29a" + ); + + tester::apply + (from_wkt("LINESTRING(-7 -8,3 0,4 -1,-7 10)"), + from_wkt("LINESTRING(-5 -4,3 0,4 -1,2 -1)"), + from_wkt("MULTILINESTRING((-7 -8,3 0),(3 0,-7 10))"), + "lldf29b" + ); + + tester::apply + (from_wkt("LINESTRING(-7 -8,3 0,4 -1,-7 10)"), + from_wkt("LINESTRING(-5 -4,3 0,4 -1,7 -4,2 -1)"), + from_wkt("MULTILINESTRING((-7 -8,3 0),(3 0,-7 10))"), + "lldf29c" + ); + + tester::apply + (from_wkt("LINESTRING(-5 -4,3 0,4 -1,7 -4,2 -1)"), + from_wkt("LINESTRING(-7 -8,3 0,4 -1,-7 10)"), + from_wkt("MULTILINESTRING((-5 -4,3 0),(4 -1,7 -4,2 -1))"), + "lldf29c-r" + ); + + tester::apply + (from_wkt("LINESTRING(-2 -2,-4 0,1 -8,-2 6,8 5,-7 -8,\ + 3 0,4 -1,-7 10,-4 10)"), + from_wkt("LINESTRING(-5 -4,3 0,4 -1,7 -4,2 -1,-4 -1,-2 6)"), + from_wkt("MULTILINESTRING((-2 -2,-4 0,1 -8,-2 6,8 5,-7 -8,\ + 3 0),(3 0,-7 10,-4 10))"), + "lldf29d" + ); + +#ifdef BOOST_GEOMETRY_TEST_FAILURES + tester::apply + (from_wkt("LINESTRING(8 5,5 1,-2 3,1 10)"), + from_wkt("LINESTRING(1.9375 1.875,\ + 1.7441860465116283 1.9302325581395348,\ + -0.7692307692307692 2.6483516483516487,\ + -2 3,-1.0071942446043165 5.316546762589928)"), + from_wkt("MULTILINESTRING((8 5,5 1,-2 3,1 10))"), + "lldf30a" + ); + + tester::apply + (from_wkt("LINESTRING(1.9375 1.875,\ + 1.7441860465116283 1.9302325581395348,\ + -0.7692307692307692 2.6483516483516487,\ + -2 3,-1.0071942446043165 5.316546762589928)"), + from_wkt("LINESTRING(8 5,5 1,-2 3,1 10)"), + from_wkt("MULTILINESTRING((1.9375 1.875,\ + 1.7441860465116283 1.9302325581395348,\ + -0.7692307692307692 2.6483516483516487,\ + -2 3,-1.0071942446043165 5.316546762589928))"), + "lldf30b" + ); + + tester::apply + (from_wkt("LINESTRING(5 -8,-7 -6,-3 6,-3 1,-5 4,-1 0,8 5,\ + 5 1,-2 3,1 10,8 5,6 2,7 4)"), + from_wkt("LINESTRING(1.9375 1.875,\ + 1.7441860465116283 1.9302325581395348,\ + -0.7692307692307692 2.6483516483516487,\ + -2 3,-1.0071942446043165 5.316546762589928)"), + from_wkt("MULTILINESTRING((5 -8,-7 -6,-3 6,-3 1,-5 4,-1 0,8 5,\ + 5 1,-2 3,1 10,8 5,6 2,7 4))"), + + "lldf30c" + ); +#endif + + tester::apply + (from_wkt("LINESTRING(8 1, 4 .4)"), + from_wkt("LINESTRING(0 -.2, 8 1)"), + from_wkt("MULTILINESTRING()"), + "lldf31s" + ); + + tester::apply + (from_wkt("LINESTRING(8 1, 4 .4,2 8)"), + from_wkt("LINESTRING(0 -.2, 8 1)"), + from_wkt("MULTILINESTRING((4 .4,2 8))"), + "lldf31x", + 1e-10 + ); + + tester::apply + (from_wkt("LINESTRING(2 8,4 .4,8 1)"), + from_wkt("LINESTRING(0 -.2, 8 1)"), + from_wkt("MULTILINESTRING((2 8,4 .4))"), + "lldf31x-r", + 1e-10 + ); + + tester::apply + (from_wkt("LINESTRING(0 5, 8 1, 4 .4, 2 8)"), + from_wkt("LINESTRING(0 -.2, 8 1, -.5 7)"), + from_wkt("MULTILINESTRING((0 5,8 1),(4 .4,2 8))"), + "lldf31y", + 1e-10 + ); + + tester::apply + (from_wkt("LINESTRING(0 -.2, 8 1, -.5 7)"), + from_wkt("LINESTRING(0 5, 8 1, 4 .4, 2 8)"), + from_wkt("MULTILINESTRING((0 -.2,4 .4),(8 1,-.5 7))"), + "lldf31y-r", + 1e-10 + ); + + tester::apply + (from_wkt("LINESTRING(0 5, 8 1, 4 .4, 2 8)"), + from_wkt("LINESTRING(0 -.2, 8 1, -.5 7, 6 +.2)"), + from_wkt("MULTILINESTRING((0 5,8 1),(4 .4,2 8))"), + "lldf31y+", + 1e-10 + ); + + tester::apply + (from_wkt("LINESTRING(10.0002 2,9 -1032.34324, .3 8, 0 5, 8 1, 4 .4, 2 8)"), + from_wkt("LINESTRING(0 -.2, 8 1, -.5 7, 6 +.2)"), + from_wkt("MULTILINESTRING((10.0002 2,9 -1032.34324,.3 8,0 5,8 1),(4 .4,2 8))"), + "lldf31z", + 1e-10 + ); + + tester::apply + (from_wkt("LINESTRING(0 -.2, 8 1, -.5 7, 6 +.2)"), + from_wkt("LINESTRING(10.0002 2,9 -1032.34324, .3 8, 0 5, 8 1, 4 .4, 2 8)"), + from_wkt("MULTILINESTRING((0 -.2,4 .4),(8 1,-.5 7,6 .2))"), + "lldf31z-r", + 1e-10 + ); + + tester::apply + (from_wkt("LINESTRING(0 0, 8 1, -.5 7)"), + from_wkt("LINESTRING(0 5, 8 1, 4 .5, 2 8)"), + from_wkt("MULTILINESTRING((0 0,4 .5),(8 1,-.5 7))"), + "lldf32" + ); +} + + + +BOOST_AUTO_TEST_CASE( test_difference_linestring_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** LINESTRING / MULTILINESTRING DIFFERENCE ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef linestring_type L; + typedef multi_linestring_type ML; + + typedef test_difference_of_geometries tester; + + // disjoint linestrings + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 2,4 3),(1 1,2 2,5 3))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1))"), + "lmldf01" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,4 0))"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,10 0,20 1))"), + "lmldf02" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,5 0))"), + from_wkt("MULTILINESTRING((0 0,2 0),(5 0,10 0,20 1))"), + "lmldf03" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0))"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,10 0,20 1))"), + "lmldf04" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,101 0)"), + from_wkt("MULTILINESTRING((-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0))"), + "lmldf07" + ); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,101 0)"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((-1 1,0 0))"), + "lmldf07a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,101 0)"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING()"), + "lmldf07b" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,101 0)"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0))"), + "lmldf08" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 0.5,3 0,101 0)"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0,2 0.5,3 0))"), + "lmldf09" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,1.5 0,2 0.5,3 0,101 0)"), + from_wkt("MULTILINESTRING((0 1,1 1,1 0,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(1.5 0,2 0.5,3 0))"), + "lmldf10" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (1 1,2 0,18 0,19 1),(2 1,3 0,17 0,18 1),\ + (3 1,4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "lmldf12" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((1 0,19 0,20 1),\ + (2 0,18 0,19 1),(3 0,17 0,18 1),\ + (4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "lmldf13" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "lmldf14" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,6 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "lmldf15" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "lmldf15a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,5 0,6 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "lmldf16" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,5 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "lmldf16a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0))"), + "lmldf17" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0,26 2))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0))"), + "lmldf17a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0))"), + "lmldf18" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0))"), + "lmldf18a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0,20 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(20 0,30 0))"), + "lmldf18b" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,25 0,26 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,25 0),(26 0,30 0))"), + "lmldf18c" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,25 0,21 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,21 0),(25 0,30 0))"), + "lmldf18d" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0)"), + from_wkt("MULTILINESTRING((0 5,1 0,9 0,10 5),(0 1,2 0,3 1),\ + (0 -2,3 0,4 4),(0 -5,4 0,5 0,6 3))"), + from_wkt("MULTILINESTRING((0 0,1 0),(9 0,10))"), + "lmldf19" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0)"), + from_wkt("MULTILINESTRING((-1 0,0 0),(10 0,12 0))"), + from_wkt("MULTILINESTRING((0 0,10 0))"), + "lmldf20" + ); +} + + + + + +BOOST_AUTO_TEST_CASE( test_difference_multilinestring_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTILINESTRING / LINESTRING DIFFERENCE ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef linestring_type L; + typedef multi_linestring_type ML; + + typedef test_difference_of_geometries tester; + + // disjoint linestrings + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("LINESTRING(1 1,2 2,4 3)"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + "mlldf01" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("LINESTRING(1 1,2 0,4 0)"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,10 0,20 1),\ + (1 0,2 0),(4 0,7 0))"), + "mlldf02" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("LINESTRING(-1 -1,1 0,101 0,200 -1)"), + from_wkt("MULTILINESTRING((0 0,1 0))"), + "mlldf03" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("LINESTRING(0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1)"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "mlldf04" + ); + + tester::apply + (from_wkt("MULTILINESTRING((-1 0,-1 10),(0 0,20 0),(25 0,30 0))"), + from_wkt("LINESTRING(0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1)"), + from_wkt("MULTILINESTRING((-1 0,-1 10),(0 0,1 0),(19 0,20 0),(25 0,30 0))"), + "mlldf05" + ); + + tester::apply + (from_wkt("MULTILINESTRING((-3 2,-3 0,-3 -10))"), + from_wkt("LINESTRING(-3 6,-3 0,-3 5)"), + from_wkt("MULTILINESTRING((-3 0,-3 -10))"), + "mlldf06a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((6 6,-3 2,-3 0,-3 -10,9 -2))"), + from_wkt("LINESTRING(-3 6,-3 0,-3 5,2 -3,-6 10,5 0,2 8,\ + -6 1,10 -6)"), + from_wkt("MULTILINESTRING((6 6,-3 2),(-3 0,-3 -10,9 -2))"), + "mlldf06b" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 -3,5 4,6 6,-3 2,-3 0,-3 -10,\ + 9 -2,9 5,5 -5,-4 -8,9 0))"), + from_wkt("LINESTRING(-3 6,-3 0,-3 5,2 -3,-6 10,5 0,2 8,\ + -6 1,10 -6)"), + from_wkt("MULTILINESTRING((0 -3,5 4,6 6,-3 2),\ + (-3 0,-3 -10,9 -2,9 5,5 -5,-4 -8,9 0))"), + "mlldf06c" + ); +} + + + + + + + +BOOST_AUTO_TEST_CASE( test_difference_multilinestring_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTILINESTRING / MULTILINESTRING DIFFERENCE ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef multi_linestring_type ML; + + typedef test_difference_of_geometries tester; + + // disjoint linestrings + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 2,4 3),(1 1,2 2,5 3))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + "mlmldf01" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,4 0))"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,10 0,20 1),\ + (1 0,2 0),(4 0,7 0))"), + "mlmldf02" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,5 0))"), + from_wkt("MULTILINESTRING((0 0,2 0),(5 0,10 0,20 1),\ + (1 0,2 0),(5 0,7 0))"), + "mlmldf03" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0))"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,10 0,20 1),\ + (1 0,2 0),(4 0,7 0))"), + "mlmldf04" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0),\ + (10 10,20 10,30 20))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (10 20,15 10,25 10,30 15))"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,10 0,20 1),\ + (1 0,2 0),(4 0,7 0),(10 10,15 10),(20 10,30 20))"), + "mlmldf05" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 10),(1 0,7 0),\ + (10 10,20 10,30 20))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (-1 -1,0 0,9 0,11 10,12 10,13 3,14 4,15 5),\ + (10 20,15 10,25 10,30 15))"), + from_wkt("MULTILINESTRING((9 0,10 0,13 3),(15 5,20 10),\ + (10 10,11 10),(12 10,15 10),(20 10,30 20))"), + "mlmldf06" + ); + + tester::apply + (from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (-1 -1,0 0,9 0,11 10,12 10,13 3,14 4,15 5),\ + (10 20,15 10,25 10,30 15))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 10),(1 0,7 0),\ + (10 10,20 10,30 20))"), + from_wkt("MULTILINESTRING((1 1,2 0),(-1 -1,0 0),(9 0,11 10),\ + (12 10,13 3),(10 20,15 10),(20 10,25 10,30 15))"), + "mlmldf06a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0))"), + "mlmldf07" + ); + + tester::apply + (from_wkt("MULTILINESTRING((-1 1,0 0,101 0))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((-1 1,0 0))"), + "mlmldf07a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING()"), + "mlmldf07b" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0))"), + "mlmldf08" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 0,2 0.5,3 0,101 0))"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0,2 0.5,3 0))"), + "mlmldf09" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 0,1.5 0,2 0.5,3 0,101 0))"), + from_wkt("MULTILINESTRING((0 1,1 1,1 0,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(1.5 0,2 0.5,3 0))"), + "mlmldf10" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 1,100 1,101 0),\ + (0 0,101 0))"), + from_wkt("MULTILINESTRING((1 0,1 1,2 1,3 0,4 0,5 1,6 1,\ + 7 0,8 0,9 1,10 1,11 0,12 0,13 1,14 1,15 0),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 1),(2 1,5 1),(6 1,9 1),\ + (10 1,13 1),(14 1,100 1,101 0),(0 0,1 0))"), + "mlmldf11" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (1 1,2 0,18 0,19 1),(2 1,3 0,17 0,18 1),\ + (3 1,4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "mlmldf12" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((1 0,19 0,20 1),\ + (2 0,18 0,19 1),(3 0,17 0,18 1),\ + (4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "mlmldf13" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "mlmldf14" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,6 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "mlmldf15" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "mlmldf15a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,5 0,6 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "mlmldf16" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,5 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "mlmldf16a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0))"), + "mlmldf17" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0,26 2))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0))"), + "mlmldf17a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0))"), + "mlmldf18" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,18 0,19 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0))"), + "mlmldf18a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((-1 0,0 0),(10 0,12 0))"), + from_wkt("MULTILINESTRING((0 0,10 0))"), + "mlmldf19" + ); + + tester::apply + (from_wkt("MULTILINESTRING((1 5, -4.3 -.1), (0 6, 8.6 6, 189.7654 5, 1 3, 6 3, 3 5, 6 2.232432, 0 4), (-6 5, 1 2.232432), (3 -1032.34324, 9 0, 189.7654 1, -1.4 3, 3 189.7654, +.3 10.0002, 1 5, 6 3, 5 1, 9 1, 10.0002 -1032.34324, -0.7654 0, 5 3, 3 4), (2.232432 2.232432, 8.6 +.4, 0.0 2.232432, 4 0, -8.8 10.0002), (1 0, 6 6, 7 2, -0 8.4), (-0.7654 3, +.6 8, 4 -1032.34324, 1 6, 0 4), (0 7, 2 1, 8 -7, 7 -.7, -1032.34324 9), (5 0, 10.0002 4, 8 7, 3 3, -8.1 5))"), + from_wkt("MULTILINESTRING((5 10.0002, 2 7, -0.7654 0, 5 3), (0 -0.7654, 4 10.0002, 4 +.1, -.8 3, -.1 8, 10.0002 2, +.9 -1032.34324))"), + from_wkt("MULTILINESTRING((1 5,-4.3 -0.1),(0 6,8.6 6,189.7654 5,1 3,6 3,3 5,6 2.232432,0 4),(-6 5,1 2.232432),(5 3,3 4),(3 -1032.34324,9 0,189.7654 1,-1.4 3,3 189.7654,0.3 10.0002,1 5,6 3,5 1,9 1,10.0002 -1032.34324,-0.7654 0),(2.232432 2.232432,8.6 0.4,0 2.232432,4 0,-8.8 10.0002),(1 0,6 6,7 2,-0 8.4),(-0.7654 3,0.6 8,4 -1032.34324,1 6,0 4),(0 7,2 1,8 -7,7 -0.7,-1032.34324 9),(5 0,10.0002 4,8 7,3 3,-8.1 5))"), + "mlmldf24", + 1e-10 + ); + + tester::apply + (from_wkt("MULTILINESTRING((5 10.0002, 2 7, -0.7654 0, 5 3), (0 -0.7654, 4 10.0002, 4 +.1, -.8 3, -.1 8, 10.0002 2, +.9 -1032.34324))"), + from_wkt("MULTILINESTRING((1 5, -4.3 -.1), (0 6, 8.6 6, 189.7654 5, 1 3, 6 3, 3 5, 6 2.232432, 0 4), (-6 5, 1 2.232432), (3 -1032.34324, 9 0, 189.7654 1, -1.4 3, 3 189.7654, +.3 10.0002, 1 5, 6 3, 5 1, 9 1, 10.0002 -1032.34324, -0.7654 0, 5 3, 3 4), (2.232432 2.232432, 8.6 +.4, 0.0 2.232432, 4 0, -8.8 10.0002), (1 0, 6 6, 7 2, -0 8.4), (-0.7654 3, +.6 8, 4 -1032.34324, 1 6, 0 4), (0 7, 2 1, 8 -7, 7 -.7, -1032.34324 9), (5 0, 10.0002 4, 8 7, 3 3, -8.1 5))"), + from_wkt("MULTILINESTRING((5 10.0002,2 7,-0.7654 8.88178e-16),(0 -0.7654,4 10.0002,4 0.1,-0.8 3,-0.1 8,10.0002 2,0.9 -1032.34324))"), + "mlmldf24-r", + 1e-10 + ); + + tester::apply + (from_wkt("MULTILINESTRING((-.4 2, 2.232432 3, 6 9, 8 189.7654, -1032.34324 5.4, 2.232432 9), (-1032.34324 3, 8 -1.6), (0 -.2, 8 1, -.5 7, 6 +.2))"), + from_wkt("MULTILINESTRING((-8 1, 4.8 6, 2 +.5), (10.0002 2,9 -1032.34324, .3 8, 0 5, 8 1, 4 .4, 2 8), (6 7, +.1 7, 0 -.5))"), + from_wkt("MULTILINESTRING((-0.4 2,2.232432 3,6 9,8 189.7654,-1032.34324 5.4,2.232432 9),(-1032.34324 3,8 -1.6),(0 -0.2,4 0.4),(8 1,-0.5 7,6 0.2))"), + "mlmldf25", + 1e-10 + ); + + tester::apply + (from_wkt("MULTILINESTRING((-8 1, 4.8 6, 2 +.5), (10.0002 2,9 -1032.34324, .3 8, 0 5, 8 1, 4 .4, 2 8), (6 7, +.1 7, 0 -.5))"), + from_wkt("MULTILINESTRING((-.4 2, 2.232432 3, 6 9, 8 189.7654, -1032.34324 5.4, 2.232432 9), (-1032.34324 3, 8 -1.6), (0 -.2, 8 1, -.5 7, 6 +.2))"), + from_wkt("MULTILINESTRING((-8 1,4.8 6,2 0.5),(10.0002 2,9 -1032.34324,0.3 8,0 5,8 1),(4 0.4,2 8),(6 7,0.1 7,0 -0.5))"), + "mlmldf25-r", + 1e-10 + ); + + { + std::string wkt1 = "MULTILINESTRING((0 -18,17 -9,8.422018348623853 -6.477064220183486),(4.0893470790378 -5.202749140893471,0 -4,6.049382716049383 -7.4567901234567895),(9.21951219512195 -9.26829268292683,14 -12),(-7 3,-5.903614457831325 6.289156626506024),(-5.277777777777778 8.166666666666668,-5 9,-5.445859872611465 8.26751592356688),(-6.342710997442455 6.794117647058823,-19 -14,-6.2338779019776425 6.668959587274291),(-5.3004291845493565 8.180257510729614,-3.579710144927536 10.966183574879228),(-3.390625 11.272321428571429,2 20),(20 -19,14 -3,3.258064516129032 1.774193548387096),(-5.275590551181104 5.5669291338582685,-13 9,-8.678414096916299 9.480176211453745),(-7.65625 9.59375,-4 10),(-2 -4,-0.15873015873015883 -0.31746031746031766),(1.875 3.75,9 18,6 8,13 17),(12 -11,6 4))"; + + std::string wkt2 = "MULTILINESTRING((1 16,-16 18),(17 10,15 4),(0 -14,-7 3),(-16 3,-6.471885336273427 6.942668136714442),(-4.557823129251701 7.73469387755102,-2.220994475138122 8.701657458563536),(-1.7326203208556137 8.90374331550802,13 15,15 -16,11 -11),(-6 11,-4.285714285714287 7.571428571428573),(-0.5882352941176467 0.1764705882352935,4 -9,-4 -8,-4 4.1),(-4 7.4,-4 11.666666666666666),(-4 12.142857142857142,-4 19),(-17 -1,-3.5989717223650377 3.638817480719794),(0.8699690402476783 5.185758513931889,9 8),(18 10,2.814814814814815 2.4074074074074057),(-0.9090909090909101 0.545454545454545,-4 -1,-3 -16,1.272141706924316 -1.9629629629629637),(2.666666666666667 2.6190476190476204,4 7),(-1 18,11 -6))"; + + std::string wkt_out = "MULTILINESTRING((0 -18,17 -9,8.4220183486238529 -6.47706422018348604),(4.08934707903780037 -5.20274914089347096,0 -4,6.04938271604938294 -7.45679012345678949),(9.21951219512195053 -9.26829268292683039,14 -12),(-7 3,-5.90361445783132499 6.28915662650602414),(-5.27777777777777768 8.16666666666666785,-5 9,-5.44585987261146531 8.26751592356687937),(-6.34271099744245515 6.79411764705882337,-19 -14,-6.23387790197764247 6.66895958727429061),(-5.30042918454935652 8.18025751072961427,-3.57971014492753614 10.9661835748792278),(-3.390625 11.2723214285714288,2 20),(20 -19,14 -3,3.25806451612903203 1.77419354838709609),(-5.27559055118110365 5.56692913385826849,-13 9,-8.67841409691629906 9.48017621145374534),(-7.65625 9.59375,-4 10),(-2 -4,-0.158730158730158832 -0.317460317460317665),(1.875 3.75,9 18,6 8,13 17),(12 -11,6 4))"; + + ML mls1, mls2, mls_out; + bg::read_wkt(wkt1, mls1); + bg::read_wkt(wkt2, mls2); + bg::read_wkt(wkt_out, mls_out); + + tester::apply(mls1, mls2, mls_out, "mlmldf26", 1e-10); + } + { + std::string wkt1 = "MULTILINESTRING((12 -11,6 4))"; + std::string wkt2 = "MULTILINESTRING((18 10,2.814814814814815 2.4074074074074057),(-1 18,11 -6))"; + + std::string wkt_out = "MULTILINESTRING((12 -11,6 4))"; + + ML mls1, mls2, mls_out; + bg::read_wkt(wkt1, mls1); + bg::read_wkt(wkt2, mls2); + bg::read_wkt(wkt_out, mls_out); + + tester::apply(mls1, mls2, mls_out, "mlmldf27"); + } +} + + + + + + +#ifndef BOOST_GEOMETRY_TEST_NO_DEGENERATE +BOOST_AUTO_TEST_CASE( test_difference_ml_ml_degenerate ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTILINESTRING / MULTILINESTRING DIFFERENCE" + << " (DEGENERATE) ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef multi_linestring_type ML; + + typedef test_difference_of_geometries tester; + + // the following test cases concern linestrings with duplicate + // points and possibly linestrings with zero length. + + tester::apply + (from_wkt("MULTILINESTRING((5 5,5 5),(0 0,18 0,18 0,\ + 19 0,19 0,19 0,30 0),(2 0,2 0),(4 10,4 10))"), + from_wkt("MULTILINESTRING((-10 0,-9 0),(0 10,5 0,20 0,20 0,30 10),\ + (1 1,2 2),(1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0),(0 0,0 10),\ + (4 0,4 10),(5 5,5 5))"), + from_wkt("MULTILINESTRING((0 0,5 0),(20 0,30 0))"), + "mlmldf20a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((5 5,5 5),(0 0,0 0,18 0,18 0,\ + 19 0,19 0,19 0,30 0,30 0),(2 0,2 0),(4 10,4 10))"), + from_wkt("MULTILINESTRING((-10 0,-9 0),(0 10,5 0,20 0,20 0,30 10),\ + (1 1,1 1,2 2,2 2),(1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0),(0 0,0 0,0 10,0 10),\ + (4 0,4 10,4 10),(5 5,5 5))"), + from_wkt("MULTILINESTRING((0 0,5 0),(20 0,30 0))"), + "mlmldf20aa" + ); + + tester::apply + (from_wkt("MULTILINESTRING((10 10,10 10),(0 0,0 0,18 0,18 0,\ + 19 0,19 0,19 0,30 0,30 0),(2 0,2 0),(4 10,4 10))"), + from_wkt("MULTILINESTRING((-10 0,-9 0),(0 10,5 0,20 0,20 0,30 10),\ + (1 1,1 1,2 2,2 2),(1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0),(0 0,0 0,0 10,0 10),\ + (4 0,4 10,4 10),(5 5,5 5))"), + from_wkt("MULTILINESTRING((10 10,10 10),(0 0,5 0),(20 0,30 0))"), + "mlmldf20aaa" + ); + + tester::apply + (from_wkt("MULTILINESTRING((10 10),(0 0,0 0,18 0,18 0,\ + 19 0,19 0,19 0,30 0,30 0),(2 0,2 0),(4 10,4 10))"), + from_wkt("MULTILINESTRING((-10 0,-9 0),(0 10,5 0,20 0,20 0,30 10),\ + (1 1,1 1,2 2,2 2),(1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0),(0 0,0 0,0 10,0 10),\ + (4 0,4 10,4 10),(5 5,5 5))"), + from_wkt("MULTILINESTRING((10 10,10 10),(0 0,5 0),(20 0,30 0))"), + "mlmldf20aaaa" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,0 0),(1 1,1 1))"), + from_wkt("MULTILINESTRING((1 1,1 1))"), + from_wkt("MULTILINESTRING((0 0,0 0))"), + "mlmldf21" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,0 0),(2 2,2 2),(1 1,1 1))"), + from_wkt("MULTILINESTRING((1 1,1 1))"), + from_wkt("MULTILINESTRING((0 0,0 0),(2 2,2 2))"), + "mlmldf22" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,0 0),(1 1,1 1),(2 2,2 2))"), + from_wkt("MULTILINESTRING((1 1,1 1))"), + from_wkt("MULTILINESTRING((0 0,0 0),(2 2,2 2))"), + "mlmldf23" + ); +} +#endif // BOOST_GEOMETRY_TEST_NO_DEGENERATE + + + + +BOOST_AUTO_TEST_CASE( test_difference_ml_ml_spikes ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTILINESTRING / MULTILINESTRING DIFFERENCE" + << " (WITH SPIKES) ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef multi_linestring_type ML; + + typedef test_difference_of_geometries tester; + + // the following test cases concern linestrings with spikes + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,9 0,5 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(9 0,10 0))"), + "mlmldf-spikes-01" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((9 0,1 0,5 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(9 0,10 0))"), + "mlmldf-spikes-02" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,9 0,2 0,8 0,3 0,7 0,4 0,5 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(9 0,10 0))"), + "mlmldf-spikes-03" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,3 0,2 0,4 0,3 0,5 0,4 0,6 0,\ + 5 0,7 0,6 0,8 0,7 0,9 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(9 0,10 0))"), + "mlmldf-spikes-04" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(7 0,8 0,7 0),\ + (9 1,9 0,9 2))"), + from_wkt("MULTILINESTRING((0 0,1 0),(6 0,7 0),(8 0,10 0))"), + "mlmldf-spikes-05" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(7 0,8 0,7 0),\ + (9 0,9 2,9 1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(6 0,7 0),(8 0,10 0))"), + "mlmldf-spikes-05a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(9 0,6 0,8 0),\ + (11 0,8 0,12 0))"), + from_wkt("MULTILINESTRING((0 0,1 0))"), + "mlmldf-spikes-06" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((-1 0,0 0,-2 0),(11 0,10 0,12 0))"), + from_wkt("MULTILINESTRING((0 0,10 0))"), + "mlmldf-spikes-07" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,-2 -2),(11 1,10 0,12 2))"), + from_wkt("MULTILINESTRING((0 0,10 0))"), + "mlmldf-spikes-07a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(11 0,10 0,12 0),\ + (7 5,7 0,8 0,6.5 0,8.5 0,8.5 5))"), + from_wkt("MULTILINESTRING((0 0,1 0),(6 0,6.5 0),(8.5 0,10 0))"), + "mlmldf-spikes-08" + ); + + // now the first geometry has a spike + tester::apply + (from_wkt("MULTILINESTRING((0 0,7 0,4 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,8 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(8 0,10 0))"), + "mlmldf-spikes-09" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,7 0,4 0,10 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(9 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,7 0,4 0,9 0))"), + "mlmldf-spikes-09a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,7 0,4 0,10 0))"), + from_wkt("MULTILINESTRING((0 0,5 0),(9 0,10 0))"), + from_wkt("MULTILINESTRING((5 0,7 0,5 0),(5 0,9 0))"), + "mlmldf-spikes-09b" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,7 0,4 0,10 0))"), + from_wkt("MULTILINESTRING((0 0,5 0),(6 0,10 0))"), + from_wkt("MULTILINESTRING((5 0,6 0),(6 0,5 0),(5 0,6 0))"), + "mlmldf-spikes-09c" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,8 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(8 0,10 0,8 0))"), + "mlmldf-spikes-10" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,8 0,4 0),(2 0,9 0,5 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(9 0,10 0,9 0))"), + "mlmldf-spikes-11" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,5 0))"), + from_wkt("MULTILINESTRING((11 1,10 0,12 2))"), + from_wkt("MULTILINESTRING((0 0,10 0,5 0))"), + "mlmldf-spikes-12" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,5 0))"), + from_wkt("MULTILINESTRING((11 -1,10 0,12 -2))"), + from_wkt("MULTILINESTRING((0 0,10 0,5 0))"), + "mlmldf-spikes-12a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,5 0))"), + from_wkt("MULTILINESTRING((11 0,10 0,12 0))"), + from_wkt("MULTILINESTRING((0 0,10 0,5 0))"), + "mlmldf-spikes-13" + ); + + // the following three tests have been discussed with Adam + tester::apply + (from_wkt("MULTILINESTRING((1 0,1 1,2 1))"), + from_wkt("MULTILINESTRING((1 2,1 1,1 2))"), + from_wkt("MULTILINESTRING((1 0,1 1,2 1))"), + "mlmldf-spikes-14" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 0,0 0))"), + from_wkt("MULTILINESTRING((2 0,1 0,2 0))"), + from_wkt("MULTILINESTRING((0 0,1 0,0 0))"), + "mlmldf-spikes-15" + ); + + tester::apply + (from_wkt("MULTILINESTRING((1 0,1 1,2 1))"), + from_wkt("MULTILINESTRING((2 0,1 1,2 0))"), + from_wkt("MULTILINESTRING((1 0,1 1,2 1))"), + "mlmldf-spikes-16" + ); + + tester::apply + (from_wkt("MULTILINESTRING((1 0,1 1,2 1))"), + from_wkt("MULTILINESTRING((2 1,1 1,2 1))"), + from_wkt("MULTILINESTRING((1 0,1 1))"), + "mlmldf-spikes-17" + ); + + // test cases sent by Adam on the mailing list (equal slikes) + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 1,0 0))"), + from_wkt("MULTILINESTRING((0 0,1 1,0 0))"), + from_wkt("MULTILINESTRING()"), + "mlmldf-spikes-18" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 1,0 0))"), + from_wkt("MULTILINESTRING((1 1,0 0,1 1))"), + from_wkt("MULTILINESTRING()"), + "mlmldf-spikes-19" + ); +} + +BOOST_AUTO_TEST_CASE( test_difference_ls_mls_geo_rad ) +{ + typedef bg::model::point > pt; + typedef bg::model::linestring ls; + typedef bg::model::multi_linestring mls; + + bg::srs::spheroid sph_wgs84(6378137.0, 6356752.3142451793); + boost::geometry::strategy::intersection::geographic_segments<> wgs84(sph_wgs84); + + ls g1 = from_wkt("LINESTRING(0 0, -3.14159265358979 0)"); + mls g2 = from_wkt("MULTILINESTRING((-2.1467549799530232 -0.12217304763960295," + "-2.5481807079117185 -0.90757121103705041," + "-2.6529004630313784 0.85521133347722067," + " 0.92502450355699373 0.62831853071795796," + "-2.5307274153917754 0," + " 2.8099800957108676 1.0646508437165401," + "-1.6057029118347816 -1.5009831567151219," + " 0.2268928027592626 1.0646508437165401," + "-2.199114857512853 -0.017453292519943278," + " 0 0.31415926535897898," + " 0 0.57595865315812822," + " 1.0471975511965967 -0.73303828583761765," + " 2.1118483949131366 -0.54105206811824158))"); + mls out; + bg::difference(g1, g2, out, wgs84); + + check_result(g1, g2, out, + from_wkt("MULTILINESTRING((0 0,0 0.31415926535897897853)," + "(0 0.57595865315812821983,-3.1415926535897900074 0))"), + "geo_lmldf-1"); +} \ No newline at end of file diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_multi.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_multi.cpp new file mode 100644 index 000000000..374e5d450 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_multi.cpp @@ -0,0 +1,531 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#include "test_difference.hpp" +#include +#include + +#include +#include + +#include +#include +#include + +#include + +// Convenience macros (points are not checked) +#define TEST_DIFFERENCE(caseid, clips1, area1, clips2, area2, clips3) \ + (test_one) \ + ( #caseid, caseid[0], caseid[1], clips1, -1, area1, clips2, -1, area2, \ + clips3, -1, area1 + area2) + +#define TEST_DIFFERENCE_IGNORE(caseid, clips1, area1, clips2, area2, clips3) \ + { ut_settings ignore_validity; ignore_validity.test_validity = false; \ + (test_one) \ + ( #caseid, caseid[0], caseid[1], clips1, -1, area1, clips2, -1, area2, \ + clips3, -1, area1 + area2, ignore_validity); } + +#define TEST_DIFFERENCE_WITH(index1, index2, caseid, clips1, area1, \ + clips2, area2, clips3) \ + (test_one) \ + ( #caseid "_" #index1 "_" #index2, caseid[index1], caseid[index2], \ + clips1, -1, area1, \ + clips2, -1, area2, \ + clips3, -1, area1 + area2, settings) + + +template +void test_areal() +{ + test_one("simplex_multi", + case_multi_simplex[0], case_multi_simplex[1], + 5, 21, 5.58, 4, 17, 2.58); + + test_one("case_multi_no_ip", + case_multi_no_ip[0], case_multi_no_ip[1], + 2, 12, 24.0, 2, 12, 34.0); + test_one("case_multi_2", + case_multi_2[0], case_multi_2[1], + 2, 15, 19.6, 2, 13, 33.6); + + test_one("simplex_multi_mp_p", + case_multi_simplex[0], case_single_simplex, + 5, 21, 5.58, 4, 17, 2.58); + test_one("simplex_multi_r_mp", + case_single_simplex, case_multi_simplex[0], + 4, 17, 2.58, 5, 21, 5.58); + test_one("simplex_multi_mp_r", + case_multi_simplex[0], case_single_simplex, + 5, 21, 5.58, 4, 17, 2.58); + + // Constructed cases for multi/touch/equal/etc + test_one("case_61_multi", + case_61_multi[0], case_61_multi[1], + 2, 10, 2, 2, 10, 2, 1, 10, 4); + test_one("case_62_multi", + case_62_multi[0], case_62_multi[1], + 0, 0, 0, 1, 5, 1); + test_one("case_63_multi", + case_63_multi[0], case_63_multi[1], + 0, 0, 0, 1, 5, 1); + test_one("case_64_multi", + case_64_multi[0], case_64_multi[1], + 1, 5, 1, 1, 5, 1, 1, 7, 2); + test_one("case_65_multi", + case_65_multi[0], case_65_multi[1], + 0, 0, 0, 2, 10, 3); + + test_one("case_72_multi", + case_72_multi[0], case_72_multi[1], + 3, 13, 1.65, 3, 17, 6.15); + + test_one("case_77_multi", + case_77_multi[0], case_77_multi[1], + 6, 31, 7.0, + 5, 33, 13.0, + 5, 38, 7.0 + 13.0); + + test_one("case_78_multi", + case_78_multi[0], case_78_multi[1], + 1, 5, 1.0, 1, 5, 1.0); + + TEST_DIFFERENCE(case_123_multi, 1, 0.25, 2, 0.625, 3); + TEST_DIFFERENCE(case_124_multi, 1, 0.25, 2, 0.4375, 3); + TEST_DIFFERENCE(case_125_multi, 1, 0.25, 2, 0.400, 3); + + // A should have 3 clips, B should have 5 clips + TEST_DIFFERENCE(case_126_multi, 4, 16.0, 5, 27.0, 9); + + { + ut_settings settings; + + settings.sym_difference = BG_IF_RESCALED(false, true); + + test_one("case_108_multi", + case_108_multi[0], case_108_multi[1], + 7, 32, 5.5, + 4, 24, 9.75, + 7, 45, 15.25, + settings); + } + + // Ticket on GGL list 2011/10/25 + // to mix polygon/multipolygon in call to difference + test_one("ggl_list_20111025_vd_pp", + ggl_list_20111025_vd[0], ggl_list_20111025_vd[1], + 1, 4, 8.0, 1, 4, 12.5); + test_one("ggl_list_20111025_vd_pm", + ggl_list_20111025_vd[0], ggl_list_20111025_vd[3], + 1, 4, 8.0, 1, 4, 12.5); + test_one("ggl_list_20111025_vd_mp", + ggl_list_20111025_vd[2], ggl_list_20111025_vd[1], + 1, 4, 8.0, 1, 4, 12.5); + test_one("ggl_list_20111025_vd_mm", + ggl_list_20111025_vd[2], ggl_list_20111025_vd[3], + 1, 4, 8.0, 1, 4, 12.5); + + test_one("ggl_list_20111025_vd_2", + ggl_list_20111025_vd_2[0], ggl_list_20111025_vd_2[1], + 1, 7, 10.0, 2, 10, 6.0); + + test_one("ggl_list_20120915_h2_a", + ggl_list_20120915_h2[0], ggl_list_20120915_h2[1], + 2, 13, 17.0, 0, 0, 0.0); + test_one("ggl_list_20120915_h2_b", + ggl_list_20120915_h2[0], ggl_list_20120915_h2[2], + 2, 13, 17.0, 0, 0, 0.0); + + { + ut_settings settings; + settings.percentage = 0.001; + settings.test_validity = BG_IF_RESCALED(true, false); + TEST_DIFFERENCE_WITH(0, 1, ggl_list_20120221_volker, 2, 7962.66, 2, 2775258.93, 4); + } + + { + // With rescaling, A is invalid (this is a robustness problem) and the other + // output is discarded because of zero area + // POSTGIS areas: 3.75893745345145, 2.5810000723917e-15 + ut_settings settings; + settings.sym_difference = BG_IF_RESCALED(false, true); + settings.test_validity = BG_IF_RESCALED(false, true); +#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) + // No output for B + TEST_DIFFERENCE_WITH(0, 1, bug_21155501, 1, 3.758937, 0, 0.0, 1); +#else + // Very small sliver for B, and sym difference is not considered valid + settings.test_validity = false; + TEST_DIFFERENCE_WITH(0, 1, bug_21155501, 1, 3.758937, 1, 1.7763568394002505e-15, 2); +#endif + } + +#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + { + // With rescaling, it is complete but invalid + ut_settings settings; + settings.percentage = 0.001; + settings.test_validity = BG_IF_RESCALED(false, true); + TEST_DIFFERENCE_WITH(0, 1, ticket_9081, + 2, 0.0907392476356186, + 4, 0.126018011439877, + BG_IF_RESCALED(4, 3)); + } +#endif + + TEST_DIFFERENCE(ticket_12503, 46, 920.625, 4, 7.625, 50); + + { + // Reported issues going wrong with rescaling (except for 630b) + ut_settings settings; + settings.percentage = 0.001; + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + TEST_DIFFERENCE_WITH(0, 1, issue_630_a, 0, 0.0, 1, BG_IF_KRAMER(2.023326, 2.200326), 1); +#endif + TEST_DIFFERENCE_WITH(0, 1, issue_630_b, 1, 0.0056089, 2, 1.498976, 3); +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + +#if defined(BOOST_GEOMETRY_USE_KRAMER) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // Only succeeds with Kramer rule and no rescaling + TEST_DIFFERENCE_WITH(0, 1, issue_630_c, 0, 0, 1, 1.493367, 1); +#endif + + TEST_DIFFERENCE_WITH(0, 1, issue_643, 1, 76.5385, BG_IF_KRAMER(1, 0), BG_IF_KRAMER(2.8634e-09, 0.0), 1); +#endif + } + + // Areas and #clips correspond with POSTGIS (except sym case) + test_one("case_101_multi", + case_101_multi[0], case_101_multi[1], + 5, 23, 4.75, + 5, 40, 12.75, + 5, 48, 4.75 + 12.75); + + // Areas and #clips correspond with POSTGIS + test_one("case_102_multi", + case_102_multi[0], case_102_multi[1], + 2, 8, 0.75, + 6, 25, 3.75, + 6, 27, 0.75 + 3.75); + + // Areas and #clips correspond with POSTGIS + test_one("case_107_multi", + case_107_multi[0], case_107_multi[1], + 2, 11, 2.25, + 3, 14, 3.0, + 4, 21, 5.25); + + TEST_DIFFERENCE(case_133_multi, 3, 16.0, 2, 8.0, 5); + TEST_DIFFERENCE(case_134_multi, 3, 16.0, 2, 8.0, 5); + TEST_DIFFERENCE(case_135_multi, 2, 2.0, 2, 13.0, 2); + TEST_DIFFERENCE(case_136_multi, 2, 2.0, 3, 13.5, 3); + TEST_DIFFERENCE(case_137_multi, 2, 2.5, 2, 13.0, 2); + TEST_DIFFERENCE(case_138_multi, 5, 16.6, 3, 8.225, 8); + TEST_DIFFERENCE(case_139_multi, 4, 16.328125, 3, 8.078125, 7); + TEST_DIFFERENCE(case_140_multi, 4, 16.328125, 3, 8.078125, 7); + TEST_DIFFERENCE(case_141_multi, 5, 15.5, 5, 10.0, 10); + + // Areas correspond with POSTGIS, + // #clips in PostGIS is 11,11,5 but should most probably be be 12,12,6 + TEST_DIFFERENCE(case_recursive_boxes_1, 12, 26.0, 12, 24.0, 6); + + // Areas and #clips correspond with POSTGIS + test_one("case_recursive_boxes_2", + case_recursive_boxes_2[0], case_recursive_boxes_2[1], + 3, 15, 3.0, + 7, 33, 7.0, + 10, 48, 10.0); + + // Areas and #clips by POSTGIS (except sym case) + test_one("case_recursive_boxes_3", + case_recursive_boxes_3[0], case_recursive_boxes_3[1], + 24, -1, 21.5, + 25, -1, 22.5, + 37, -1, 44.0); + + // 4, input is not valid + + TEST_DIFFERENCE(case_recursive_boxes_5, 16, 22.0, 12, 27.0, 10); + TEST_DIFFERENCE(case_recursive_boxes_6, 7, 3.5, 3, 1.5, 9); + + test_one("case_recursive_boxes_7", + case_recursive_boxes_7[0], case_recursive_boxes_7[1], + 3, 15, 2.75, + 4, 19, 2.75, + 3, 22, 5.5); + + test_one("case_recursive_boxes_8", + case_recursive_boxes_8[0], case_recursive_boxes_8[1], + 2, -1, 2.50, + 4, -1, 5.75, + 4, -1, 8.25); + + test_one("case_recursive_boxes_9", + case_recursive_boxes_9[0], case_recursive_boxes_9[1], + 3, -1, 1.5, + 4, -1, 2.5, + 6, -1, 4.0); + + test_one("case_recursive_boxes_10", + case_recursive_boxes_10[0], case_recursive_boxes_10[1], + 2, -1, 1.25, + 2, -1, 0.75, + 4, -1, 2.00); + + test_one("case_recursive_boxes_11", + case_recursive_boxes_11[0], case_recursive_boxes_11[1], + 3, -1, 2.5, + 3, -1, 4.5, + 3, -1, 7.0); + + TEST_DIFFERENCE(case_recursive_boxes_12, 4, 2.75, 3, 2.75, 6); + TEST_DIFFERENCE(case_recursive_boxes_13, 4, 4.75, 3, 5.5, 3); + TEST_DIFFERENCE(case_recursive_boxes_14, 3, 2.0, 4, 2.5, 5); + TEST_DIFFERENCE(case_recursive_boxes_15, 3, 3.0, 2, 2.5, 3); + TEST_DIFFERENCE(case_recursive_boxes_16, 8, 6.5, 3, 5.5, 9); + TEST_DIFFERENCE(case_recursive_boxes_17, 10, 7.75, 7, 5.5, 13); + TEST_DIFFERENCE(case_recursive_boxes_18, 2, 1.0, 1, 1.5, 3); + TEST_DIFFERENCE(case_recursive_boxes_19, 2, 1.0, 2, 1.5, 3); + TEST_DIFFERENCE(case_recursive_boxes_20, 2, 1.0, 0, 0.0, 2); + + TEST_DIFFERENCE(case_recursive_boxes_21, 2, 1.0, 1, 1.0, 1); + TEST_DIFFERENCE(case_recursive_boxes_22, 2, 1.25, 2, 2.0, 2); + TEST_DIFFERENCE(case_recursive_boxes_23, 2, 0.75, 1, 0.5, 3); + TEST_DIFFERENCE(case_recursive_boxes_24, 3, 2.5, 2, 2.0, 5); + TEST_DIFFERENCE(case_recursive_boxes_25, 2, 2.5, 3, 2.5, 2); + TEST_DIFFERENCE(case_recursive_boxes_26, 2, 1.5, 3, 2.0, 4); + TEST_DIFFERENCE(case_recursive_boxes_27, 1, 1.5, 3, 2.5, 3); + TEST_DIFFERENCE(case_recursive_boxes_28, 3, 2.5, 2, 3.0, 4); + TEST_DIFFERENCE(case_recursive_boxes_29, 5, 7.25, 5, 4.5, 5); + TEST_DIFFERENCE(case_recursive_boxes_30, 6, 4.25, 3, 7.25, 7); + + TEST_DIFFERENCE(case_recursive_boxes_31, 2, 2.0, 1, 0.5, 2); + TEST_DIFFERENCE(case_recursive_boxes_32, 2, 2.75, 2, 1.25, 2); + TEST_DIFFERENCE(case_recursive_boxes_33, 4, 3.0, 3, 6.0, 4); + TEST_DIFFERENCE(case_recursive_boxes_34, 7, 7.25, 1, 0.5, 8); + TEST_DIFFERENCE(case_recursive_boxes_35, 5, 1.75, 5, 2.75, 10); + TEST_DIFFERENCE(case_recursive_boxes_36, 2, 1.0, 2, 1.5, 3); + TEST_DIFFERENCE(case_recursive_boxes_37, 3, 2.5, 2, 4.25, 2); + TEST_DIFFERENCE(case_recursive_boxes_38, 5, 7.75, 4, 3.5, 3); + TEST_DIFFERENCE(case_recursive_boxes_39, 3, 6.0, 3, 3.0, 4); + TEST_DIFFERENCE(case_recursive_boxes_40, 11, 14.0, 9, 13.0, 11); + + TEST_DIFFERENCE(case_recursive_boxes_41, 1, 0.5, 1, 0.5, 2); + TEST_DIFFERENCE(case_recursive_boxes_42, 1, 1.0, 4, 4.0, 5); + TEST_DIFFERENCE(case_recursive_boxes_43, 1, 0.5, 3, 2.0, 4); + TEST_DIFFERENCE(case_recursive_boxes_44, 3, 5.0, 0, 0.0, 3); + TEST_DIFFERENCE(case_recursive_boxes_45, 6, 20.0, 7, 20.0, 3); + TEST_DIFFERENCE(case_recursive_boxes_46, 4, 14.0, 5, 12.0, 5); + TEST_DIFFERENCE(case_recursive_boxes_47, 4, 10.0, 7, 11.0, 1); + TEST_DIFFERENCE(case_recursive_boxes_48, 0, 0.0, 1, 9.0, 1); + TEST_DIFFERENCE(case_recursive_boxes_49, 10, 22.0, 10, 17.0, 11); + TEST_DIFFERENCE(case_recursive_boxes_50, 14, 21.0, 16, 21.0, 14); + TEST_DIFFERENCE(case_recursive_boxes_51, 14, 25.0, 12, 31.0, 7); + TEST_DIFFERENCE(case_recursive_boxes_52, 13, 30.0, 15, 25.0, 8); + TEST_DIFFERENCE(case_recursive_boxes_53, 6, 3.5, 4, 1.5, 9); + TEST_DIFFERENCE(case_recursive_boxes_54, 6, 6.5, 8, 6.0, 7); + TEST_DIFFERENCE(case_recursive_boxes_55, 4, 5.5, 6, 7.75, 4); + TEST_DIFFERENCE(case_recursive_boxes_56, 4, 4.5, 5, 2.75, 6); + TEST_DIFFERENCE(case_recursive_boxes_57, 5, 3.75, 9, 6.5, 10); + TEST_DIFFERENCE(case_recursive_boxes_58, 4, 2.25, 6, 3.75, 7); + TEST_DIFFERENCE(case_recursive_boxes_59, 8, 6.5, 7, 7.0, 12); + TEST_DIFFERENCE(case_recursive_boxes_60, 6, 5.25, 7, 5.25, 11); + TEST_DIFFERENCE(case_recursive_boxes_61, 2, 1.5, 6, 2.0, 7); +#if defined(BOOST_GEOMETRY_TEST_FAILURES) + // Misses one triangle, should be fixed in traversal. + // It is not related to rescaling. + TEST_DIFFERENCE(case_recursive_boxes_62, 5, 5.0, 11, 5.75, 12); +#endif + + TEST_DIFFERENCE(case_recursive_boxes_63, 9, 10.5, 5, 27.75, 4); + TEST_DIFFERENCE(case_recursive_boxes_64, 6, 2.75, 7, 4.5, 11); + TEST_DIFFERENCE(case_recursive_boxes_65, 6, 4.25, 7, 3.0, 13); + TEST_DIFFERENCE(case_recursive_boxes_66, 5, 4.75, 7, 4.0, 9); + TEST_DIFFERENCE(case_recursive_boxes_67, 7, 6.25, 9, 6.0, 10); + TEST_DIFFERENCE(case_recursive_boxes_68, 10, 6.5, 9, 6.5, 7); + TEST_DIFFERENCE(case_recursive_boxes_69, 5, 6.25, 5, 6.75, 8); + TEST_DIFFERENCE(case_recursive_boxes_70, 5, 2.0, 8, 4.5, 11); + TEST_DIFFERENCE(case_recursive_boxes_71, 7, 8.25, 7, 5.75, 8); + TEST_DIFFERENCE(case_recursive_boxes_72, 6, 6.5, 7, 4.0, 10); + TEST_DIFFERENCE(case_recursive_boxes_73, 4, 1.75, 5, 4.0, 8); + TEST_DIFFERENCE(case_recursive_boxes_74, 3, 3.00, 3, 1.5, 5); + TEST_DIFFERENCE(case_recursive_boxes_75, 7, 4.5, 4, 2.0, 11); + TEST_DIFFERENCE(case_recursive_boxes_76, 7, 3.75, 4, 2.5, 9); + TEST_DIFFERENCE(case_recursive_boxes_77, 4, 3.75, 7, 6.25, 8); + TEST_DIFFERENCE(case_recursive_boxes_78, 11, 5.5, 8, 4.5, 14); + TEST_DIFFERENCE(case_recursive_boxes_79, 2, 1.25, 6, 4.5, 8); + + // one polygon is divided into two, for same reason as union creates a small + // interior ring there + TEST_DIFFERENCE(case_recursive_boxes_80, 1, 0.5, 2, 0.75, BG_IF_RESCALED(3, 2)); + + TEST_DIFFERENCE(case_recursive_boxes_81, 3, 5.0, 6, 6.75, 6); + TEST_DIFFERENCE(case_recursive_boxes_82, 5, 7.25, 7, 4.5, 8); + TEST_DIFFERENCE(case_recursive_boxes_83, 9, 5.25, 8, 5.25, 12); + TEST_DIFFERENCE(case_recursive_boxes_84, 4, 8.0, 7, 9.0, 4); +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + TEST_DIFFERENCE(case_recursive_boxes_85, 4, 4.0, 7, 3.75, 9); +#endif + + TEST_DIFFERENCE(case_recursive_boxes_86, 1, 1.5, 2, 1.5, 3); + TEST_DIFFERENCE(case_recursive_boxes_87, 4, 2.0, 4, 2.5, 8); + TEST_DIFFERENCE(case_recursive_boxes_88, 3, 4.75, 5, 6.75, 4); + + // Output of A can be 0 or 1 polygons (with a very small area) + TEST_DIFFERENCE(case_precision_m1, -1, 0.0, 1, 57.0, -1); + // Output of A can be 1 or 2 polygons (one with a very small area) + TEST_DIFFERENCE(case_precision_m2, -1, 1.0, 1, 57.75, -1); + + { + ut_settings sym_settings; + #if ! defined(BOOST_GEOMETRY_USE_RESCALING) + sym_settings.sym_difference = false; + #endif + test_one("mysql_21965285_b", + mysql_21965285_b[0], + mysql_21965285_b[1], + 2, -1, 183.71376870369406, + 2, -1, 131.21376870369406, + sym_settings); + } + + TEST_DIFFERENCE(mysql_regression_1_65_2017_08_31, + BG_IF_RESCALED(1, 0), BG_IF_RESCALED(4.30697514e-7, 0), + 3, 152.0642, BG_IF_RESCALED(4, 3)); +} + + +template +void test_all() +{ + typedef bg::model::ring

ring; + typedef bg::model::polygon

polygon; + typedef bg::model::multi_polygon multi_polygon; + test_areal(); +} + + +// Test cases for integer coordinates / ccw / open +template +void test_specific_areal() +{ + { + // Spikes in a-b and b-a, failure in symmetric difference + ut_settings settings; + settings.sym_difference = false; + settings.test_validity = false; + + TEST_DIFFERENCE_WITH(0, 1, ticket_11674, + BG_IF_KRAMER(3, 4), + BG_IF_KRAMER(9105781.5, 9105473.5), + 5, + BG_IF_KRAMER(119059.5, 119423), -1); + } + + { + // Ticket 12751 (Volker) + // Spikes in a-b and b-a, failure in symmetric difference + + ut_settings settings; + settings.remove_spikes = true; + + TEST_DIFFERENCE_WITH(0, 1, ticket_12751, 1, + BG_IF_KRAMER(2781965.0, 2782114), 1, + BG_IF_KRAMER(597.0, 598.0), 2); + +#if ! defined(BOOST_GEOMETRY_USE_KRAMER) + // Fails with general line form intersection, symmetric version misses one outcut + // TODO GENERAL FORM + settings.test_validity = false; + settings.sym_difference = false; +#endif + + TEST_DIFFERENCE_WITH(2, 3, ticket_12751, + 2, BG_IF_KRAMER(2537992.5, 2538305), + 2, BG_IF_KRAMER(294963.5, 294737), + 3); + } + + { + // Ticket 12752 (Volker) + // Spikes in a-b and b-a, failure in symmetric difference + ut_settings settings; + settings.remove_spikes = true; + settings.sym_difference = false; + TEST_DIFFERENCE_WITH(0, 1, ticket_12752, + BG_IF_KRAMER(3, 2), BG_IF_KRAMER(2776692.0, 2776657), + 3, BG_IF_KRAMER(7893.0, 7710.5), + 2); + } + + { +#if defined(BOOST_GEOMETRY_USE_KRAMER) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // Fails completely with general line form intersection + // There is something with scale. + // TODO GENERAL FORM + const std::string a_min_b = + TEST_DIFFERENCE(ticket_10661, 2, 1441632.5, 2, 13167454, 4); + + test_one("ticket_10661_2", + a_min_b, ticket_10661[2], + 1, 8, 825192.0, + 1, 10, BG_IF_KRAMER(27226370.5, 27842811), + 1, -1, 825192.0 + 27226370.5); +#endif + } + + { + ut_settings settings; + settings.sym_difference = false; + +#if defined(BOOST_GEOMETRY_USE_KRAMER) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // Fails with general line form intersection + // Misses one clip + // TODO GENERAL FORM + TEST_DIFFERENCE_WITH(0, 1, ticket_9942, 4, 7427727.5, 4, + BG_IF_KRAMER(131506, 130083.5), 4); +#endif + TEST_DIFFERENCE_WITH(0, 1, ticket_9942a, 2, + BG_IF_KRAMER(412676.5, 413183.5), 2, + BG_IF_KRAMER(76779.5, 76924), 4); + } +} + +template +void test_specific() +{ + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + test_specific_areal(); +} + + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + test_all >(); + + test_specific, false, false>(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_all >(); + +#if defined(HAVE_TTMATH) + std::cout << "Testing TTMATH" << std::endl; + test_all >(); +#endif + +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_multi_areal_linear.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_multi_areal_linear.cpp new file mode 100644 index 000000000..2a15e555c --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_multi_areal_linear.cpp @@ -0,0 +1,83 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +//#define HAVE_TTMATH +//#define BOOST_GEOMETRY_DEBUG_ASSEMBLE +//#define BOOST_GEOMETRY_CHECK_WITH_SQLSERVER + +//#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER +//#define BOOST_GEOMETRY_DEBUG_FOLLOW +//#define BOOST_GEOMETRY_DEBUG_TRAVERSE + + +#include "test_difference.hpp" +#include +#include + +#include +#include +#include + +#include + + +template +void test_areal_linear() +{ + typedef typename boost::range_value::type polygon; + typedef typename boost::range_value::type linestring; + typedef typename bg::point_type::type point; + typedef bg::model::ring ring; + + test_one_lp("case_mp_ls_1", "LINESTRING(2 0,2 5)", case_multi_simplex[0], 2, 4, 1.30); + test_one_lp("case_p_mls_1", "MULTILINESTRING((2 0,2 5),(3 0,3 5))", case_single_simplex, 3, 6, 2.5); + test_one_lp("case_mp_mls_1", "MULTILINESTRING((2 0,2 5),(3 0,3 5))", case_multi_simplex[0], 5, 10, 3.1666667); + test_one_lp("case_r_mls_1", "MULTILINESTRING((2 0,2 5),(3 0,3 5))", case_single_simplex, 3, 6, 2.5); + + // Collinear cases, with multiple turn points at the same location + test_one_lp("case_mp_ls_2a", "LINESTRING(1 0,1 1,2 1,2 0)", "MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)),((1 1,1 2,2 2,2 1,1 1)))", 1, 2, 1.0); + test_one_lp("case_mp_ls_2b", "LINESTRING(1 0,1 1,2 1,2 0)", "MULTIPOLYGON(((1 1,1 2,2 2,2 1,1 1)),((0 0,0 1,1 1,1 0,0 0)))", 1, 2, 1.0); + + test_one_lp("case_mp_ls_3", + "LINESTRING(6 6,6 7,7 7,7 6,8 6,8 7,9 7,9 6)", + "MULTIPOLYGON(((5 7,5 8,6 8,6 7,5 7)),((6 6,6 7,7 7,7 6,6 6)),((8 8,9 8,9 7,8 7,7 7,7 8,8 8)))", 2, 5, 3.0); + + return; + + // TODO: this case contains collinearities and should still be solved + test_one_lp("case_mp_ls_4", + "LINESTRING(0 5,0 6,1 6,1 5,2 5,2 6,3 6,3 5,3 4,3 3,2 3,2 4,1 4,1 3,0 3,0 4)", + "MULTIPOLYGON(((0 2,0 3,1 2,0 2)),((2 5,3 6,3 5,2 5)),((1 5,1 6,2 6,2 5,1 5)),((2 3,2 4,3 4,2 3)),((0 3,1 4,1 3,0 3)),((4 3,3 3,3 5,4 5,4 4,4 3)))", 5, 11, 6.0); +} + + +template +void test_all() +{ + typedef bg::model::polygon

polygon; + typedef bg::model::linestring

linestring; + typedef bg::model::multi_polygon multi_polygon; + typedef bg::model::multi_linestring multi_linestring; + test_areal_linear(); +} + + +int test_main(int, char* []) +{ + test_all >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_multi_spike.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_multi_spike.cpp new file mode 100644 index 000000000..8e173b74a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_multi_spike.cpp @@ -0,0 +1,121 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2013-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#include +#include +#include + +#include "test_difference.hpp" + + +template +void test_spikes_in_ticket_8364() +{ + ut_settings ignore_validity; + ignore_validity.test_validity = false; + + // See: https://svn.boost.org/trac/boost/ticket/8364 + //_TPolygon polygon( "MULTIPOLYGON(((1031 1056,3232 1056,3232 2856,1031 2856)))" ); + //polygon -= _TPolygon( "MULTIPOLYGON(((1032 1458,1032 1212,2136 2328,3234 2220,3234 2412,2136 2646)))" ); + //polygon -= _TPolygon( "MULTIPOLYGON(((1032 1764,1032 1458,2136 2646,3234 2412,3234 2532,2136 2790)))" ); + // RESULTS OF ABOVE IS USED IN STEP 3 BELOW + //polygon -= _TPolygon( "MULTIPOLYGON(((1032 2130,1032 1764,2052 2712)),((3234 2580,2558 2690,3234 2532)),((2558 2690,2136 2790,2052 2712,2136 2760)))" ); USED IN STEP 3 + //polygon -= _TPolygon( "MULTIPOLYGON(((1032 2556,1032 2130,1778 2556)),((3234 2580,2136 2760,1778 2556,3234 2556)))" ); USED IN STEP 4 + // NOTE: polygons below are closed and clockwise + + typedef typename bg::coordinate_type

::type ct; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + + // The difference of polygons below result in a spike. The spike should be there, it is also generated in ttmath, + // and (e.g.) in SQL Server. However, using int-coordinates, the spike makes the polygon invalid. Therefore it is now (since August 2013) checked and removed. + +#ifdef BOOST_GEOMETRY_TEST_FAILURES + // TODO: commented working at ii/validity, this changes the area slightly, to be checked + // So using int's, the spike is removed automatically. Therefore there is one polygon less, and less points. Also area differs + test_one("ticket_8364_step3", + "MULTIPOLYGON(((3232 2532,2136 2790,1032 1764,1032 1458,1032 1212,2136 2328,3232 2220,3232 1056,1031 1056,1031 2856,3232 2856,3232 2532)))", + "MULTIPOLYGON(((1032 2130,2052 2712,1032 1764,1032 2130)),((3234 2580,3234 2532,2558 2690,3234 2580)),((2558 2690,2136 2760,2052 2712,2136 2790,2558 2690)))", + 2, + if_typed(19, 22), + if_typed(2775595.5, 2775256.487954), // SQL Server: 2775256.47588724 + 3, + -1, // don't check point-count + if_typed(7893.0, 7810.487954), // SQL Server: 7810.48711165739 + if_typed(1, 5), + -1, + if_typed(2783349.5, 2775256.487954 + 7810.487954), + ignore_validity); +#endif + + // TODO: behaviour is not good yet. It is changed at introduction of self-turns. + test_one("ticket_8364_step4", + "MULTIPOLYGON(((2567 2688,2136 2790,2052 2712,1032 2130,1032 1764,1032 1458,1032 1212,2136 2328,3232 2220,3232 1056,1031 1056,1031 2856,3232 2856,3232 2580,2567 2688)))", + "MULTIPOLYGON(((1032 2556,1778 2556,1032 2130,1032 2556)),((3234 2580,3234 2556,1778 2556,2136 2760,3234 2580)))", + if_typed(1, 2), + if_typed(17, 20), + if_typed(2615783.5, 2616029.559567), // SQL Server: 2616029.55616044 + 1, + if_typed(9, 11), + if_typed(161133.5, 161054.559567), // SQL Server: 161054.560110092 + if_typed(1, 3), + if_typed(25, 31), + if_typed(2776875.5, 2616029.559567 + 161054.559567)); +} + +template +void test_spikes_in_ticket_8365() +{ + // See: https://svn.boost.org/trac/boost/ticket/8365 + // NOTE: polygons below are closed and clockwise + + typedef typename bg::coordinate_type

::type ct; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + + test_one("ticket_8365_step2", + "MULTIPOLYGON(((971 2704,971 1402,4640 1402,3912 1722,3180 2376,3912 1884,4643 1402,5395 1402,5395 3353,971 3353,971 2865,1704 3348)))", + "MULTIPOLYGON(((5388 1560,4650 1722,3912 1884,4650 1398)),((2442 3186,1704 3348,966 2700,1704 3024)))", + 2, + 18, + if_typed(7975092.5, 7975207.6047877), // SQL Server: + 2, + -1, + if_typed(196.5, 197.1047877), // SQL Server: + if_typed(3, 4), + -1, + if_typed(7975092.5 + 196.5, 7975207.6047877 + 197.1047877)); +} + + + + + +int test_main(int, char* []) +{ + test_spikes_in_ticket_8364, true, true>(); + test_spikes_in_ticket_8364, false, false>(); + test_spikes_in_ticket_8365, true, true>(); + test_spikes_in_ticket_8365, false, false>(); + + test_spikes_in_ticket_8364, true, true>(); + test_spikes_in_ticket_8364, false, false>(); + test_spikes_in_ticket_8365, true, true >(); + test_spikes_in_ticket_8365, false, false >(); + +#ifdef HAVE_TTMATH + std::cout << "Testing TTMATH" << std::endl; + test_spikes_in_ticket_8364, true, true>(); + test_spikes_in_ticket_8365, true, true>(); +#endif + + return 0; +} + diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_pl_a.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_pl_a.cpp new file mode 100644 index 000000000..df8405290 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_pl_a.cpp @@ -0,0 +1,212 @@ +// Boost.Geometry + +// Copyright (c) 2020, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_difference_pointlike_areal +#endif + +#include +#include + +#include + +#include "../test_set_ops_pointlike.hpp" + +#include +#include +#include +#include +#include + +typedef bg::model::point Pt; +typedef bg::model::ring R; +typedef bg::model::polygon Po; +typedef bg::model::multi_point MPt; +typedef bg::model::multi_polygon MPo; + +BOOST_AUTO_TEST_CASE( test_difference_point_ring ) +{ + typedef test_set_op_of_pointlike_geometries + < + Pt, R, MPt, bg::overlay_difference + > tester; + + tester::apply( + "pt-r-01", + from_wkt("POINT(0 0)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply( + "pt-r-02", + from_wkt("POINT(3 5)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply( + "pt-r-03", + from_wkt("POINT(6 3)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))"), + from_wkt("MULTIPOINT(6 3)") + ); +} + +BOOST_AUTO_TEST_CASE( test_difference_point_polygon ) +{ + typedef test_set_op_of_pointlike_geometries + < + Pt, Po, MPt, bg::overlay_difference + > tester; + + tester::apply( + "pt-po-01", + from_wkt("POINT(0 0)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply( + "pt-po-02", + from_wkt("POINT(4 4)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply( + "pt-po-03", + from_wkt("POINT(3 3)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))"), + from_wkt("MULTIPOINT(3 3)") + ); + + tester::apply( + "pt-po-04", + from_wkt("POINT(6 0)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))"), + from_wkt("MULTIPOINT(6 0)") + ); +} + +BOOST_AUTO_TEST_CASE( test_difference_point_multipolygon ) +{ + typedef test_set_op_of_pointlike_geometries + < + Pt, MPo, MPt, bg::overlay_difference + > tester; + + tester::apply( + "pt-mpo-01", + from_wkt("POINT(0 0)"), + from_wkt("MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))," + "((5 5, 5 7, 7 7, 7 5, 5 5)))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply( + "pt-mpo-02", + from_wkt("POINT(3 3)"), + from_wkt("MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))," + "((5 5, 5 7, 7 7, 7 5, 5 5)))"), + from_wkt("MULTIPOINT(3 3)") + ); + + tester::apply( + "pt-mpo-03", + from_wkt("POINT(4 4)"), + from_wkt("MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))," + "((5 5, 5 7, 7 7, 7 5, 5 5)))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply( + "pt-mpo-04", + from_wkt("POINT(5 5)"), + from_wkt("MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))," + "((5 5, 5 7, 7 7, 7 5, 5 5)))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply( + "pt-mpo-05", + from_wkt("POINT(6 6)"), + from_wkt("MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))," + "((5 5, 5 7, 7 7, 7 5, 5 5)))"), + from_wkt("MULTIPOINT()") + ); +} + +BOOST_AUTO_TEST_CASE( test_difference_multipoint_ring ) +{ + typedef test_set_op_of_pointlike_geometries + < + MPt, R, MPt, bg::overlay_difference + > tester; + + tester::apply( + "mpt-r-01", + from_wkt("MULTIPOINT(0 0, 1 1, 5 5, 6 6)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))"), + from_wkt("MULTIPOINT(6 6)") + ); + + tester::apply( + "mpt-r-02", + from_wkt("MULTIPOINT(3 5, 5 3, 3 0, 0 3, 3 6, 6 3, 3 -1, -1 3)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))"), + from_wkt("MULTIPOINT(3 6, 6 3, 3 -1, -1 3)") + ); +} + +BOOST_AUTO_TEST_CASE( test_difference_multipoint_polygon ) +{ + typedef test_set_op_of_pointlike_geometries + < + MPt, Po, MPt, bg::overlay_difference + > tester; + + tester::apply( + "mpt-po-01", + from_wkt("MULTIPOINT(0 0, 1 1, 4 4, 5 5, 6 6)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))"), + from_wkt("MULTIPOINT(1 1, 6 6)") + ); + + tester::apply( + "mpt-po-02", + from_wkt("MULTIPOINT(3 5, 5 3, 3 0, 0 3, 3 6, 6 3, 3 -1, -1 3, 2 0.5, 0.5 2, 2 4, 4 2)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))"), + from_wkt("MULTIPOINT(3 6, 6 3, 3 -1, -1 3)") + ); +} + +BOOST_AUTO_TEST_CASE(test_difference_multipoint_multipolygon) +{ + typedef test_set_op_of_pointlike_geometries + < + MPt, MPo, MPt, bg::overlay_difference + > tester; + + tester::apply( + "mpt-mpo-01", + from_wkt("MULTIPOINT(0 0, 1 1, 4 4, 5 5, 6 6)"), + from_wkt("MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))," + "((5 5, 5 7, 7 7, 7 5, 5 5)))"), + from_wkt("MULTIPOINT(1 1)") + ); + + tester::apply( + "mpt-mpo-02", + from_wkt("MULTIPOINT(3 5, 5 3, 3 0, 0 3, 3 6, 6 3, 3 -1, -1 3, 2 0.5, 0.5 2, 2 4, 4 2, 6 5, 6 7, 5 6, 7 6)"), + from_wkt("MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))," + "((5 5, 5 7, 7 7, 7 5, 5 5)))"), + from_wkt("MULTIPOINT(3 6, 6 3, 3 -1, -1 3)") + ); +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_pl_l.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_pl_l.cpp new file mode 100644 index 000000000..9592ec56d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_pl_l.cpp @@ -0,0 +1,674 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_difference_pointlike_linear +#endif + +#include +#include + +#include + +#include "../test_set_ops_pointlike.hpp" + +#include +#include +#include +#include +#include + +typedef bg::model::point point_type; +typedef bg::model::segment segment_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_point multi_point_type; +typedef bg::model::multi_linestring multi_linestring_type; + + +//=========================================================================== +//=========================================================================== +//=========================================================================== + + +BOOST_AUTO_TEST_CASE( test_difference_point_segment ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "size of std::size_t: " << sizeof(std::size_t) << std::endl; + std::cout << "size of range_iterator: " + << sizeof(boost::range_iterator::type) + << std::endl; + std::cout << "size of range_iterator: " + << sizeof(boost::range_iterator::type) + << std::endl; + std::cout << "size of point_iterator: " + << sizeof(bg::point_iterator) << std::endl; + std::cout << "size of point_iterator: " + << sizeof(bg::point_iterator) << std::endl; + std::cout << "size of point_iterator: " + << sizeof(bg::point_iterator) << std::endl; + std::cout << "size of segment_iterator: " + << sizeof(bg::segment_iterator) << std::endl; + std::cout << "size of segment_iterator: " + << sizeof(bg::segment_iterator) << std::endl; + + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** POINT / SEGMENT DIFFERENCE ***" << std::endl; + std::cout << std::endl; +#endif + + typedef point_type P; + typedef segment_type S; + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + P, S, MP, bg::overlay_difference + > tester; + + tester::apply + ("psdf01", + from_wkt

("POINT(0 0)"), + from_wkt("SEGMENT(1 1,2 2)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("psdf02", + from_wkt

("POINT(0 0)"), + from_wkt("SEGMENT(0 0,1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("psdf03", + from_wkt

("POINT(1 1)"), + from_wkt("SEGMENT(0 0,2 2)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("psdf04", + from_wkt

("POINT(3 3)"), + from_wkt("SEGMENT(0 0,2 2)"), + from_wkt("MULTIPOINT(3 3)") + ); +} + + +BOOST_AUTO_TEST_CASE( test_difference_point_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** POINT / LINESTRING DIFFERENCE ***" << std::endl; + std::cout << std::endl; +#endif + + typedef point_type P; + typedef linestring_type L; + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + P, L, MP, bg::overlay_difference + > tester; + + tester::apply + ("pldf01", + from_wkt

("POINT(0 0)"), + from_wkt("LINESTRING(1 1,2 2)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("pldf02", + from_wkt

("POINT(0 0)"), + from_wkt("LINESTRING(0 0,1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pldf03", + from_wkt

("POINT(1 1)"), + from_wkt("LINESTRING(0 0,2 2)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pldf04", + from_wkt

("POINT(3 3)"), + from_wkt("LINESTRING(0 0,2 2)"), + from_wkt("MULTIPOINT(3 3)") + ); + + // linestrings with more than two points + tester::apply + ("pldf05", + from_wkt

("POINT(1 1)"), + from_wkt("LINESTRING(0 0,1 1,2 2)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pldf06", + from_wkt

("POINT(2 2)"), + from_wkt("LINESTRING(0 0,1 1,4 4)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pldf07", + from_wkt

("POINT(10 10)"), + from_wkt("LINESTRING(0 0,1 1,4 4)"), + from_wkt("MULTIPOINT(10 10)") + ); + + tester::apply + ("pldf08", + from_wkt

("POINT(0 1)"), + from_wkt("LINESTRING(0 0,1 1,4 4)"), + from_wkt("MULTIPOINT(0 1)") + ); + + tester::apply + ("pldf09", + from_wkt

("POINT(4 4)"), + from_wkt("LINESTRING(0 0,1 1,4 4)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pldf10", + from_wkt

("POINT(0 0)"), + from_wkt("LINESTRING(0 0,1 1,4 4)"), + from_wkt("MULTIPOINT()") + ); +} + + +BOOST_AUTO_TEST_CASE( test_difference_point_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** POINT / MULTILINESTRING DIFFERENCE ***" << std::endl; + std::cout << std::endl; +#endif + + typedef point_type P; + typedef multi_linestring_type ML; + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + P, ML, MP, bg::overlay_difference + > tester; + + tester::apply + ("pmldf01", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((1 1,2 2))"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("pmldf02", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((0 0,1 1))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pmldf03", + from_wkt

("POINT(1 1)"), + from_wkt("MULTILINESTRING((0 0,2 2))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pmldf04", + from_wkt

("POINT(3 3)"), + from_wkt("MULTILINESTRING((0 0,2 2))"), + from_wkt("MULTIPOINT(3 3)") + ); + + // linestrings with more than two points + tester::apply + ("pmldf05", + from_wkt

("POINT(1 1)"), + from_wkt("MULTILINESTRING((0 0,1 1,2 2))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pmldf06", + from_wkt

("POINT(2 2)"), + from_wkt("MULTILINESTRING((0 0,1 1,4 4))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pmldf07", + from_wkt

("POINT(10 10)"), + from_wkt("MULTILINESTRING((0 0,1 1,4 4))"), + from_wkt("MULTIPOINT(10 10)") + ); + + tester::apply + ("pmldf08", + from_wkt

("POINT(0 1)"), + from_wkt("MULTILINESTRING((0 0,1 1,4 4))"), + from_wkt("MULTIPOINT(0 1)") + ); + + tester::apply + ("pmldf09", + from_wkt

("POINT(4 4)"), + from_wkt("MULTILINESTRING((0 0,1 1,4 4))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pmldf10", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((0 0,1 1,4 4))"), + from_wkt("MULTIPOINT()") + ); + + // multilinestrings with more than one linestring + tester::apply + ("pmldf11", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((-10,-10),(0 0,1 1,4 4))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pmldf12", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((-10 0,0 0,10 0),(0 0,1 1,4 4))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pmldf13", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((-10 0,10 0),(0 0,1 1,4 4))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pmldf14", + from_wkt

("POINT(-20 0)"), + from_wkt("MULTILINESTRING((-10 0,10 0),(0 0,1 1,4 4))"), + from_wkt("MULTIPOINT(-20 0)") + ); + + tester::apply + ("pmldf15", + from_wkt

("POINT(0 1)"), + from_wkt("MULTILINESTRING((-10 0,10 0),(0 0,1 1,4 4))"), + from_wkt("MULTIPOINT(0 1)") + ); +} + + +BOOST_AUTO_TEST_CASE( test_difference_multipoint_segment ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTIPOINT / SEGMENT DIFFERENCE ***" << std::endl; + std::cout << std::endl; +#endif + + typedef multi_point_type MP; + typedef segment_type S; + + typedef test_set_op_of_pointlike_geometries + < + MP, S, MP, bg::overlay_difference + > tester; + + tester::apply + ("mpsdf01", + from_wkt("MULTIPOINT(0 0)"), + from_wkt("SEGMENT(1 1,2 2)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("mpsdf02", + from_wkt("MULTIPOINT(0 0)"), + from_wkt("SEGMENT(0 0,1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpsdf03", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt("SEGMENT(1 1,2 2)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpsdf04", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt("SEGMENT(0 0,1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpsdf05", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt("SEGMENT(1 1,2 2)"), + from_wkt("MULTIPOINT(0 0,0 0,1 0)") + ); + + tester::apply + ("mpsf06", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt("SEGMENT(1 0,2 0)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpsdf07", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(0 0,1 0)"), + from_wkt("MULTIPOINT(2 0)") + ); + + tester::apply + ("mpsdf08", + from_wkt("MULTIPOINT()"), + from_wkt("SEGMENT(0 0,1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpsdf09", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(-1 0,1 0)"), + from_wkt("MULTIPOINT(2 0)") + ); + + tester::apply + ("mpsdf10", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(1 0,3 0)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpsdf11", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(-1 0,3 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpsdf12", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(3 0,3 0)"), + from_wkt("MULTIPOINT(0 0,0 0,2 0)") + ); + + tester::apply + ("mpsdf12a", + from_wkt("MULTIPOINT(0 0,2 0,0 0)"), + from_wkt("SEGMENT(3 0,3 0)"), + from_wkt("MULTIPOINT(0 0,0 0,2 0)") + ); + + tester::apply + ("mpsdf12b", + from_wkt("MULTIPOINT(0 0,2 0,0 0,2 0)"), + from_wkt("SEGMENT(3 0,3 0)"), + from_wkt("MULTIPOINT(0 0,0 0,2 0,2 0)") + ); + + tester::apply + ("mpsdf12c", + from_wkt("MULTIPOINT(0 0,2 0,0 0,2 0,0 0)"), + from_wkt("SEGMENT(3 0,3 0)"), + from_wkt("MULTIPOINT(0 0,0 0,0 0,2 0,2 0)") + ); + + tester::apply + ("mpsdf13", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(2 0,2 0)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpsdf14", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(0 0,0 0)"), + from_wkt("MULTIPOINT(2 0)") + ); + + tester::apply + ("mpsdf15", + from_wkt("MULTIPOINT()"), + from_wkt("SEGMENT(0 0,1 0)"), + from_wkt("MULTIPOINT()") + ); +} + + +BOOST_AUTO_TEST_CASE( test_difference_multipoint_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTIPOINT / LINESTRING DIFFERENCE ***" << std::endl; + std::cout << std::endl; +#endif + + typedef multi_point_type MP; + typedef linestring_type L; + + typedef test_set_op_of_pointlike_geometries + < + MP, L, MP, bg::overlay_difference + > tester; + + tester::apply + ("mpldf01", + from_wkt("MULTIPOINT(0 0)"), + from_wkt("LINESTRING(1 1,2 2,3 3,4 4,5 5)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("mpldf02", + from_wkt("MULTIPOINT(0 0)"), + from_wkt("LINESTRING(0 0,1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpldf03", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt("LINESTRING(1 1,2 2)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpldf04", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt("LINESTRING(0 0,1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpldf05", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt("LINESTRING(1 1,2 2)"), + from_wkt("MULTIPOINT(0 0,0 0,1 0)") + ); + + tester::apply + ("mplf06", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt("LINESTRING(1 0,2 0)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpldf07", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(0 0,1 0)"), + from_wkt("MULTIPOINT(2 0)") + ); + + tester::apply + ("mpldf08", + from_wkt("MULTIPOINT()"), + from_wkt("LINESTRING(0 0,1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpldf09", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(-1 0,1 0)"), + from_wkt("MULTIPOINT(2 0)") + ); + + tester::apply + ("mpldf10", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(1 0,3 0)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpldf11", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(-1 0,3 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpldf12", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(3 0,3 0)"), + from_wkt("MULTIPOINT(0 0,0 0,2 0)") + ); + + tester::apply + ("mpldf13", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(2 0,2 0)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpldf14", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(0 0,0 0)"), + from_wkt("MULTIPOINT(2 0)") + ); + + tester::apply + ("mpldf15", + from_wkt("MULTIPOINT()"), + from_wkt("LINESTRING(0 0,1 0,2 0,3 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpldf16", + from_wkt("MULTIPOINT()"), + from_wkt("LINESTRING()"), + from_wkt("MULTIPOINT()") + ); +} + + +BOOST_AUTO_TEST_CASE( test_difference_multipoint_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTIPOINT / MULTILINESTRING DIFFERENCE ***" << std::endl; + std::cout << std::endl; +#endif + + typedef multi_point_type MP; + typedef multi_linestring_type ML; + + typedef test_set_op_of_pointlike_geometries + < + MP, ML, MP, bg::overlay_difference + > tester; + + tester::apply + ("mpmldf01", + from_wkt("MULTIPOINT(0 0,1 0,2 0)"), + from_wkt("MULTILINESTRING((1 0,1 1,1 1,4 4))"), + from_wkt("MULTIPOINT(0 0,2 0)") + ); + + tester::apply + ("mpmldf02", + from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"), + from_wkt("MULTILINESTRING((1 0,1 1,1 1,4 4))"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpmldf03", + from_wkt("MULTIPOINT(5 5,3 3,0 0,0 0,5 5,1 1,1 1,1 0,1 0)"), + from_wkt("MULTILINESTRING((1 0,1 1,1 1,4 4))"), + from_wkt("MULTIPOINT(5 5,5 5,0 0,0 0)") + ); + + tester::apply + ("mpmldf04", + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTILINESTRING((1 0,0 0,1 1,0 0))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpmldf05", + from_wkt("MULTIPOINT(0 0,1 0,2 0,5 0)"), + from_wkt("MULTILINESTRING((0 1,0 0,1 2,1 0),\ + (0 1,2 0,0 10,2 0,2 10,5 10,5 0,5 10))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpmldf05a", + from_wkt("MULTIPOINT(0 0,1 0,6 0,7 0,2 0,5 0,7 0,8 0)"), + from_wkt("MULTILINESTRING((0 1,0 0,1 2,1 0),\ + (0 1,2 0,0 10,2 0,2 10,5 10,5 0,5 10))"), + from_wkt("MULTIPOINT(7 0,7 0,8 0,6 0)") + ); + + tester::apply + ("mpmldf06", + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTILINESTRING(())"), + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)") + ); + + tester::apply + ("mpmldf07", + from_wkt("MULTIPOINT()"), + from_wkt("MULTILINESTRING(())"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpmldf08", + from_wkt("MULTIPOINT()"), + from_wkt("MULTILINESTRING((0 0,1 0),(9 0,10 0))"), + from_wkt("MULTIPOINT()") + ); +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_pl_pl.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_pl_pl.cpp new file mode 100644 index 000000000..eaf58b216 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/difference/difference_pl_pl.cpp @@ -0,0 +1,244 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_difference_pointlike_pointlike +#endif + +#ifdef BOOST_GEOMETRY_TEST_DEBUG +#define BOOST_GEOMETRY_DEBUG_TURNS +#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER +#endif + +#include + +#include "../test_set_ops_pointlike.hpp" + +#include + +typedef bg::model::point point_type; +typedef bg::model::multi_point multi_point_type; + + + +//=========================================================================== +//=========================================================================== +//=========================================================================== + + +BOOST_AUTO_TEST_CASE( test_difference_point_point ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** POINT / POINT DIFFERENCE ***" << std::endl; + std::cout << std::endl; +#endif + + typedef point_type P; + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + P, P, MP, bg::overlay_difference + > tester; + + tester::apply + ("ppdf01", + from_wkt

("POINT(0 0)"), + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT(0 0)"), + from_wkt("MULTIPOINT(1 1)") + ); + + tester::apply + ("ppdf02", + from_wkt

("POINT(0 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT()") + ); +} + + +BOOST_AUTO_TEST_CASE( test_difference_multipoint_point ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTIPOINT / POINT DIFFERENCE ***" << std::endl; + std::cout << std::endl; +#endif + + typedef point_type P; + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + MP, P, MP, bg::overlay_difference + > tester; + + tester::apply + ("mppdf01", + from_wkt("MULTIPOINT(0 0)"), + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT(0 0)"), + from_wkt("MULTIPOINT(1 1)") + ); + + tester::apply + ("mppdf02", + from_wkt("MULTIPOINT(0 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mppdf03", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt("MULTIPOINT(1 1)") + ); + + tester::apply + ("mppdf04", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mppdf05", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt("MULTIPOINT(1 1)") + ); + + tester::apply + ("mppdf06", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt

("POINT(1 0)"), + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mppdf07", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(1 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mppdf08", + from_wkt("MULTIPOINT()"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT(0 0)") + ); +} + + +BOOST_AUTO_TEST_CASE( test_difference_point_multipoint ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** POINT / MULTIPOINT DIFFERENCE ***" << std::endl; + std::cout << std::endl; +#endif + + typedef point_type P; + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + P, MP, MP, bg::overlay_difference + > tester; + + tester::apply + ("pmpdf01", + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(1 0,1 1,1 1)"), + from_wkt("MULTIPOINT(0 0)"), + from_wkt("MULTIPOINT(1 0,1 1,1 1)") + ); + + tester::apply + ("pmpdf02", + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT(1 0,1 1)") + ); + + tester::apply + ("pmpdf03", + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT(0 0)"), + from_wkt("MULTIPOINT()") + ); +} + + +BOOST_AUTO_TEST_CASE( test_difference_multipoint_multipoint ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTIPOINT / MULTIPOINT DIFFERENCE ***" << std::endl; + std::cout << std::endl; +#endif + + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + MP, MP, MP, bg::overlay_difference + > tester; + + tester::apply + ("mpmpdf01", + from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"), + from_wkt("MULTIPOINT(1 0,1 1,1 1,4 4)"), + from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2)"), + from_wkt("MULTIPOINT(4 4)") + ); + + tester::apply + ("mpmpdf02", + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpmpdf03", + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)") + ); + + tester::apply + ("mpmpdf04", + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpmpdf05", + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT()") + ); +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/difference/test_difference.hpp b/src/boost/libs/geometry/test/algorithms/set_operations/difference/test_difference.hpp new file mode 100644 index 000000000..9baeb293b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/difference/test_difference.hpp @@ -0,0 +1,478 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2016, 2017, 2019. +// Modifications copyright (c) 2016-2019, 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) + +#ifndef BOOST_GEOMETRY_TEST_DIFFERENCE_HPP +#define BOOST_GEOMETRY_TEST_DIFFERENCE_HPP + +#include +#include + +#include +#include +#include "../setop_output_type.hpp" + +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + + +#include +#include +#include + +#include + +#include + + +#if defined(TEST_WITH_SVG) +# define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER +# define BOOST_GEOMETRY_DEBUG_IDENTIFIER +# include +# include +#endif + + +struct ut_settings +{ + double percentage; + bool sym_difference; + bool remove_spikes; + + bool test_validity; + + ut_settings() + : percentage(0.0001) + , sym_difference(true) + , remove_spikes(false) + , test_validity(true) + {} + +}; + +inline ut_settings tolerance(double percentage) +{ + ut_settings result; + result.percentage = percentage; + return result; +} + + +template +void difference_output(std::string const& caseid, G1 const& g1, G2 const& g2, Output const& output) +{ + boost::ignore_unused(caseid, g1, g2, output); + +#if defined(TEST_WITH_SVG) + { + typedef typename bg::coordinate_type::type coordinate_type; + typedef typename bg::point_type::type point_type; + + bool const ccw = + bg::point_order::value == bg::counterclockwise + || bg::point_order::value == bg::counterclockwise; + bool const open = + bg::closure::value == bg::open + || bg::closure::value == bg::open; + + std::ostringstream filename; + filename << "difference_" + << caseid << "_" + << string_from_type::name() + << (ccw ? "_ccw" : "") + << (open ? "_open" : "") +#if defined(BOOST_GEOMETRY_USE_RESCALING) + << "_rescaled" +#endif + << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 500, 500); + + mapper.add(g1); + mapper.add(g2); + + mapper.map(g1, "fill-opacity:0.3;fill:rgb(51,51,153);stroke:rgb(51,51,153);stroke-width:3"); + mapper.map(g2, "fill-opacity:0.5;fill:rgb(153,204,0);stroke:rgb(153,204,0);stroke-width:3"); + + + for (typename Output::const_iterator it = output.begin(); it != output.end(); ++it) + { + mapper.map(*it, + //sym ? "fill-opacity:0.2;stroke-opacity:0.4;fill:rgb(255,255,0);stroke:rgb(255,0,255);stroke-width:8" : + "fill-opacity:0.2;stroke-opacity:0.4;fill:rgb(255,0,0);stroke:rgb(255,0,255);stroke-width:8"); + } + } +#endif +} + +template +std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g2, + int expected_count, int expected_rings_count, int expected_point_count, + double expected_area, + bool sym, + ut_settings const& settings) +{ + typedef typename bg::coordinate_type::type coordinate_type; + boost::ignore_unused(); + + bg::model::multi_polygon result; + + + if (sym) + { + bg::sym_difference(g1, g2, result); + } + else + { + bg::difference(g1, g2, result); + } + + if (settings.remove_spikes) + { + bg::remove_spikes(result); + } + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + { + bg::model::multi_polygon result_s; + typedef typename bg::strategy::relate::services::default_strategy + < + G1, G2 + >::type strategy_type; + if (sym) + { + bg::sym_difference(g1, g2, result_s, strategy_type()); + } + else + { + bg::difference(g1, g2, result_s, strategy_type()); + } + + if (settings.remove_spikes) + { + bg::remove_spikes(result_s); + } + BOOST_CHECK_EQUAL(bg::num_points(result), bg::num_points(result_s)); + } +#endif + + + std::ostringstream return_string; + return_string << bg::wkt(result); + + typename bg::default_area_result::type const area = bg::area(result); + +#if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST) +#if ! defined(BOOST_GEOMETRY_TEST_ALWAYS_CHECK_VALIDITY) + if (settings.test_validity) +#endif + { + // std::cout << bg::dsv(result) << std::endl; + typedef bg::model::multi_polygon result_type; + std::string message; + bool const valid = check_validity::apply(result, caseid, g1, g2, message); + BOOST_CHECK_MESSAGE(valid, + "difference: " << caseid << " not valid " << message + << " type: " << (type_for_assert_message())); + } +#endif + + difference_output(caseid, g1, g2, result); + +#if ! (defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) \ + || defined(BOOST_GEOMETRY_DEBUG_ASSEMBLE)) + { + // Test inserter functionality + // Test if inserter returns output-iterator (using Boost.Range copy) + typename setop_output_type::type + inserted, array_with_one_empty_geometry; + array_with_one_empty_geometry.push_back(OutputType()); + if (sym) + { + boost::copy(array_with_one_empty_geometry, + bg::detail::sym_difference::sym_difference_insert + (g1, g2, std::back_inserter(inserted))); + } + else + { + boost::copy(array_with_one_empty_geometry, + bg::detail::difference::difference_insert( + g1, g2, std::back_inserter(inserted))); + } + + BOOST_CHECK_EQUAL(boost::size(result), boost::size(inserted) - 1); + } +#endif + + + +#if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST) +#if defined(BOOST_GEOMETRY_USE_RESCALING) + if (expected_point_count >= 0) + { + std::size_t const n = bg::num_points(result); + BOOST_CHECK_MESSAGE(bg::math::abs(int(n) - expected_point_count) < 3, + "difference: " << caseid + << " #points expected: " << expected_point_count + << " detected: " << n + << " type: " << (type_for_assert_message()) + ); + } +#endif + + if (expected_count >= 0) + { + BOOST_CHECK_MESSAGE(int(boost::size(result)) == expected_count, + "difference: " << caseid + << " #outputs expected: " << expected_count + << " detected: " << result.size() + << " type: " << (type_for_assert_message()) + ); + } + + if (expected_rings_count >= 0) + { + int nrings = int(boost::size(result) + bg::num_interior_rings(result)); + BOOST_CHECK_MESSAGE(nrings == expected_rings_count, + "difference: " << caseid + << " #rings expected: " << expected_rings_count + << " detected: " << nrings + << " type: " << (type_for_assert_message()) + ); + } + + if (expected_area > 0) + { + BOOST_CHECK_CLOSE(area, expected_area, settings.percentage); + } + else + { + // Compare 0 with 0 or a very small detected area + BOOST_CHECK_LE(area, settings.percentage); + } +#endif + + return return_string.str(); +} + +template +std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g2, + int expected_count, int expected_point_count, + double expected_area, + bool sym, + ut_settings const& settings) +{ + return test_difference(caseid, g1, g2, + expected_count, -1, expected_point_count, expected_area, + sym, settings); +} + +#ifdef BOOST_GEOMETRY_CHECK_WITH_POSTGIS +static int counter = 0; +#endif + + +template +std::string test_one(std::string const& caseid, + std::string const& wkt1, std::string const& wkt2, + int expected_count1, + int expected_rings_count1, + int expected_point_count1, + double expected_area1, + int expected_count2, + int expected_rings_count2, + int expected_point_count2, + double expected_area2, + int expected_count_s, + int expected_rings_count_s, + int expected_point_count_s, + double expected_area_s, + ut_settings const& settings = ut_settings()) +{ + G1 g1; + bg::read_wkt(wkt1, g1); + + G2 g2; + bg::read_wkt(wkt2, g2); + + bg::correct(g1); + bg::correct(g2); + + std::string result = test_difference(caseid + "_a", g1, g2, + expected_count1, expected_rings_count1, expected_point_count1, + expected_area1, false, settings); + +#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE + return result; +#endif + + test_difference(caseid + "_b", g2, g1, + expected_count2, expected_rings_count2, expected_point_count2, + expected_area2, false, settings); + +#if ! defined(BOOST_GEOMETRY_TEST_ALWAYS_CHECK_SYMDIFFERENCE) + if (settings.sym_difference) +#endif + { + test_difference(caseid + "_s", g1, g2, + expected_count_s, + expected_rings_count_s, + expected_point_count_s, + expected_area_s, + true, settings); + } + return result; +} + +template +std::string test_one(std::string const& caseid, + std::string const& wkt1, std::string const& wkt2, + int expected_count1, + int expected_rings_count1, + int expected_point_count1, + double expected_area1, + int expected_count2, + int expected_rings_count2, + int expected_point_count2, + double expected_area2, + ut_settings const& settings = ut_settings()) +{ + return test_one(caseid, wkt1, wkt2, + expected_count1, expected_rings_count1, expected_point_count1, expected_area1, + expected_count2, expected_rings_count2, expected_point_count2, expected_area2, + expected_count1 + expected_count2, + expected_rings_count1 + expected_rings_count2, + expected_point_count1 >= 0 && expected_point_count2 >= 0 + ? (expected_point_count1 + expected_point_count2) : -1, + expected_area1 + expected_area2, + settings); +} + +template +std::string test_one(std::string const& caseid, + std::string const& wkt1, std::string const& wkt2, + int expected_count1, + int expected_point_count1, + double expected_area1, + int expected_count2, + int expected_point_count2, + double expected_area2, + int expected_count_s, + int expected_point_count_s, + double expected_area_s, + ut_settings const& settings = ut_settings()) +{ + return test_one(caseid, wkt1, wkt2, + expected_count1, -1, expected_point_count1, expected_area1, + expected_count2, -1, expected_point_count2, expected_area2, + expected_count_s, -1, expected_point_count_s, expected_area_s, + settings); +} + +template +std::string test_one(std::string const& caseid, + std::string const& wkt1, std::string const& wkt2, + int expected_count1, + int expected_point_count1, + double expected_area1, + int expected_count2, + int expected_point_count2, + double expected_area2, + ut_settings const& settings = ut_settings()) +{ + return test_one(caseid, wkt1, wkt2, + expected_count1, expected_point_count1, expected_area1, + expected_count2, expected_point_count2, expected_area2, + expected_count1 + expected_count2, + expected_point_count1 >= 0 && expected_point_count2 >= 0 + ? (expected_point_count1 + expected_point_count2) : -1, + expected_area1 + expected_area2, + settings); +} + +template +void test_one_lp(std::string const& caseid, + std::string const& wkt1, std::string const& wkt2, + std::size_t expected_count, + int expected_point_count, + double expected_length) +{ + G1 g1; + bg::read_wkt(wkt1, g1); + + G2 g2; + bg::read_wkt(wkt2, g2); + + bg::correct(g1); + bg::correct(g2); + + typedef typename setop_output_type::type result_type; + result_type pieces; + bg::difference(g1, g2, pieces); + + typename bg::default_length_result::type length = 0; + std::size_t n = 0; + std::size_t piece_count = 0; + for (typename result_type::iterator it = pieces.begin(); + it != pieces.end(); + ++it) + { + if (expected_point_count >= 0) + { + n += bg::num_points(*it); + } + piece_count++; + length += bg::length(*it); + } + + BOOST_CHECK_MESSAGE(piece_count == expected_count, + "difference: " << caseid + << " #outputs expected: " << expected_count + << " detected: " << pieces.size() + ); + + if (expected_point_count >= 0) + { + BOOST_CHECK_MESSAGE(n == std::size_t(expected_point_count), + "difference: " << caseid + << " #points expected: " << std::size_t(expected_point_count) + << " detected: " << n + << " type: " << (type_for_assert_message()) + ); + } + + BOOST_CHECK_CLOSE(length, expected_length, 0.001); + + std::string lp = "lp_"; + difference_output(lp + caseid, g1, g2, pieces); +} + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/difference/test_difference_linear_linear.hpp b/src/boost/libs/geometry/test/algorithms/set_operations/difference/test_difference_linear_linear.hpp new file mode 100644 index 000000000..14f6b039a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/difference/test_difference_linear_linear.hpp @@ -0,0 +1,186 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#ifndef BOOST_GEOMETRY_TEST_DIFFERENCE_LINEAR_LINEAR_HPP +#define BOOST_GEOMETRY_TEST_DIFFERENCE_LINEAR_LINEAR_HPP + +#include + +#include +#include "../test_set_ops_linear_linear.hpp" +#include "../check_turn_less.hpp" +#include +#include + + +//================================================================== +//================================================================== +// difference of (linear) geometries +//================================================================== +//================================================================== + +template +inline void check_result(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_output, + MultiLineString const& mls_diff, + std::string const& case_id, + double tolerance = std::numeric_limits::epsilon()) +{ + BOOST_CHECK_MESSAGE( equals::apply(mls_diff, mls_output, tolerance), + "case id: " << case_id + << ", difference L/L: " << bg::wkt(geometry1) + << " " << bg::wkt(geometry2) + << " -> Expected: " << bg::wkt(mls_diff) + << std::setprecision(20) + << " computed: " << bg::wkt(mls_output) ); +} + +template +< + typename Geometry1, typename Geometry2, + typename MultiLineString +> +class test_difference_of_geometries +{ +private: + static inline void base_test(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_diff, + std::string const& case_id, + double tolerance, + bool test_vector_and_deque = true, + bool reverse_output_for_checking = false) + { + static bool vector_deque_already_tested = false; + + typedef typename boost::range_value::type LineString; + typedef std::vector linestring_vector; + typedef std::deque linestring_deque; + + MultiLineString mls_output; + + linestring_vector ls_vector_output; + linestring_deque ls_deque_output; + + // Check strategy passed explicitly + typedef typename bg::strategy::relate::services::default_strategy + < + Geometry1, Geometry2 + >::type strategy_type; + bg::difference(geometry1, geometry2, mls_output, strategy_type()); + + if (reverse_output_for_checking) + { + bg::reverse(mls_output); + } + + check_result(geometry1, geometry2, mls_output, mls_diff, case_id, tolerance); + + // Check normal behaviour + bg::clear(mls_output); + bg::difference(geometry1, geometry2, mls_output); + + if ( reverse_output_for_checking ) + { + bg::reverse(mls_output); + } + + check_result(geometry1, geometry2, mls_output, mls_diff, case_id, tolerance); + + set_operation_output("difference", case_id, + geometry1, geometry2, mls_output); + + if ( !vector_deque_already_tested && test_vector_and_deque ) + { + vector_deque_already_tested = true; +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "Testing with vector and deque as output container..." + << std::endl; +#endif + bg::difference(geometry1, geometry2, ls_vector_output); + bg::difference(geometry1, geometry2, ls_deque_output); + + BOOST_CHECK(multilinestring_equals + < + false + >::apply(mls_diff, ls_vector_output, tolerance)); + + BOOST_CHECK(multilinestring_equals + < + false + >::apply(mls_diff, ls_deque_output, tolerance)); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Done!" << std::endl << std::endl; +#endif + } + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Geometry #1: " << bg::wkt(geometry1) << std::endl; + std::cout << "Geometry #2: " << bg::wkt(geometry2) << std::endl; + std::cout << "difference : " << bg::wkt(mls_output) << std::endl; + std::cout << "expected difference : " << bg::wkt(mls_diff) << std::endl; + std::cout << std::endl; + std::cout << "************************************" << std::endl; + std::cout << std::endl; + std::cout << std::endl; +#endif + + check_turn_less::apply(geometry1, geometry2); + } + + +public: + static inline void apply(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_diff, + std::string const& case_id, + double tolerance + = std::numeric_limits::epsilon()) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "test case: " << case_id << std::endl; + std::stringstream sstr; + sstr << "svgs/" << case_id << ".svg"; +#ifdef TEST_WITH_SVG + to_svg(geometry1, geometry2, sstr.str()); +#endif +#endif + + Geometry1 rg1(geometry1); + bg::reverse(rg1); + + Geometry2 rg2(geometry2); + bg::reverse(rg2); + + test_get_turns_ll_invariance<>::apply(geometry1, geometry2); +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl + << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" + << std::endl << std::endl; +#endif + test_get_turns_ll_invariance<>::apply(rg1, geometry2); + + base_test(geometry1, geometry2, mls_diff, case_id, tolerance); + base_test(geometry1, rg2, mls_diff, case_id, tolerance, false); + base_test(rg1, geometry2, mls_diff, case_id, tolerance, false, true); + base_test(rg1, rg2, mls_diff, case_id, tolerance, false, true); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << std::endl; +#endif + } +}; + + +#endif // BOOST_GEOMETRY_TEST_DIFFERENCE_LINEAR_LINEAR_HPP diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/intersection/Jamfile b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/Jamfile new file mode 100644 index 000000000..783c20781 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/Jamfile @@ -0,0 +1,29 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2020. +# Modifications copyright (c) 2014-2020, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-intersection + : + [ run intersection.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE + : algorithms_intersection ] + [ run intersection_areal_areal_linear.cpp : : : : algorithms_intersection_areal_areal_linear ] + [ run intersection_linear_linear.cpp : : : : algorithms_intersection_linear_linear ] + [ run intersection_multi.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE + : algorithms_intersection_multi ] + [ run intersection_pl_a.cpp : : : : algorithms_intersection_pl_a ] + [ run intersection_pl_l.cpp : : : : algorithms_intersection_pl_l ] + [ run intersection_pl_pl.cpp : : : : algorithms_intersection_pl_pl ] + [ run intersection_tupled.cpp : : : : algorithms_intersection_tupled ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection.cpp new file mode 100644 index 000000000..01c958171 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection.cpp @@ -0,0 +1,974 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2015, 2016, 2017. +// Modifications copyright (c) 2015-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 + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include "test_intersection.hpp" +#include + +#include + +#include +#include +#include + + +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) + +#define TEST_INTERSECTION(caseid, clips, points, area) \ + (test_one) \ + ( #caseid, caseid[0], caseid[1], clips, points, area) + +#define TEST_INTERSECTION_REV(caseid, clips, points, area) \ + (test_one) \ + ( #caseid "_rev", caseid[1], caseid[0], clips, points, area) + +#define TEST_INTERSECTION_WITH(caseid, index1, index2, \ + clips, points, area, settings) \ + (test_one) \ + ( #caseid "_" #index1 "_" #index2, caseid[index1], caseid[index2], \ + clips, points, area, settings) + +template +void test_areal() +{ + typedef typename bg::coordinate_type::type ct; + bool const ccw = bg::point_order::value == bg::counterclockwise; + bool const open = bg::closure::value == bg::open; + + test_one("simplex_with_empty_1", + simplex_normal[0], polygon_empty, + 0, 0, 0.0); + test_one("simplex_with_empty_2", + polygon_empty, simplex_normal[0], + 0, 0, 0.0); + + test_one("simplex_normal", + simplex_normal[0], simplex_normal[1], + 1, 7, 5.47363293); + test_one("star_ring", example_star, example_ring, + 1, 18, 2.80983); + + test_one("star_poly", example_star, example_polygon, + 1, 0, // CLN: 23 points, other types: 22 point (one is merged) + 2.5020508); + test_one("first_within_second1", + first_within_second[0], first_within_second[1], + 1, 5, 1.0); + + test_one("first_within_second2", + first_within_second[1], first_within_second[0], + 1, 5, 1.0); + + test_one("first_within_hole_of_second", + first_within_hole_of_second[0], first_within_hole_of_second[1], + 0, 0, 0.0); + + // Two forming new hole + test_one("new_hole", + new_hole[0], new_hole[1], + 2, 10, 2.0); + + // Two identical + test_one("identical", + identical[0], identical[1], + 1, 5, 1.0); + + test_one("intersect_exterior_and_interiors_winded", + intersect_exterior_and_interiors_winded[0], intersect_exterior_and_interiors_winded[1], + 1, 14, 25.2166667); + + test_one("intersect_holes_disjoint", + intersect_holes_disjoint[0], intersect_holes_disjoint[1], + 1, 15, 18.0); + + test_one("intersect_holes_intersect", + intersect_holes_intersect[0], intersect_holes_intersect[1], + 1, 14, 18.25); + + test_one("intersect_holes_intersect_and_disjoint", + intersect_holes_intersect_and_disjoint[0], intersect_holes_intersect_and_disjoint[1], + 1, 19, 17.25); + + test_one("intersect_holes_intersect_and_touch", + intersect_holes_intersect_and_touch[0], intersect_holes_intersect_and_touch[1], + 1, 23, 17.25); + + test_one("intersect_holes_new_ring", + intersect_holes_new_ring[0], intersect_holes_new_ring[1], + 2, 23, 122.1039); + + test_one("winded", + winded[0], winded[1], + 1, 22, 40.0); + + test_one("within_holes_disjoint", + within_holes_disjoint[0], within_holes_disjoint[1], + 1, 15, 23.0); + + test_one("side_side", + side_side[0], side_side[1], + 0, 0, 0.0); + + test_one("two_bends", + two_bends[0], two_bends[1], + 1, 7, 24.0); + + test_one("star_comb_15", + star_comb_15[0], star_comb_15[1], + 28, 150, 189.952883); + + test_one("simplex_normal", + simplex_normal[0], simplex_normal[1], + 1, 7, 5.47363293); + + test_one("distance_zero", + distance_zero[0], distance_zero[1], + 1, 0 /* f: 4, other: 5 */, 0.29516139, ut_settings(0.01)); + + test_one("equal_holes_disjoint", + equal_holes_disjoint[0], equal_holes_disjoint[1], + 1, 20, 81.0 - 2.0 * 3.0 * 3.0 - 3.0 * 7.0); + + test_one("only_hole_intersections1", + only_hole_intersections[0], only_hole_intersections[1], + 1, 21, 178.090909); + test_one("only_hole_intersection2", + only_hole_intersections[0], only_hole_intersections[2], + 1, 21, 149.090909); + + test_one("fitting", + fitting[0], fitting[1], + 0, 0, 0.0); + + test_one("crossed", + crossed[0], crossed[1], + 3, 0, 1.5); + + test_one("pie_2_3_23_0", + pie_2_3_23_0[0], pie_2_3_23_0[1], + 1, 4, 163292.679042133, ut_settings(0.1)); + + { + ut_settings settings(if_typed_tt(0.01, 0.1)); + settings.test_validity = BG_IF_RESCALED(true, false); + + // SQL Server gives: 88.1920416352664 + // PostGIS gives: 88.19203677911 + test_one("isovist", + isovist1[0], isovist1[1], + 1, 19, 88.192037, + settings); + } + + if (! BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + { + test_one("geos_1", + geos_1[0], geos_1[1], + 1, -1, BG_IF_RESCALED(3461.12321694, BG_IF_KRAMER(3461.02336, 3461.105448)), // MSVC 14 reports 3461.025390625 + ut_settings(0.01, false)); + } + + // Expectations: + // In most cases: 0 (no intersection) + // In some cases: 1.430511474609375e-05 (clang/gcc on Xubuntu using b2) + // In some cases: 5.6022983000000002e-05 (powerpc64le-gcc-6-0) + test_one("geos_2", geos_2[0], geos_2[1], + 0, 0, 6.0e-5, ut_settings(-1.0)); // -1 denotes: compare with <= + + test_one("geos_3", + geos_3[0], geos_3[1], + 0, 0, 0.0); + test_one("geos_4", + geos_4[0], geos_4[1], + 1, -1, 0.08368849, ut_settings(0.01)); + + + if ( BOOST_GEOMETRY_CONDITION(! ccw && open) ) + { + // Pointcount for ttmath/double (both 5) or float (4) + // double returns 5 (since method append_no_dups_or_spikes) + // but not for ccw/open. Those cases has to be adapted once, anyway, + // because for open always one point too much is generated... + test_one("ggl_list_20110306_javier", + ggl_list_20110306_javier[0], ggl_list_20110306_javier[1], + 1, if_typed(4, 5), + 0.6649875, + ut_settings(if_typed(1.0, 0.01))); + } + + // SQL Server reports: 0.400390625 + // PostGIS reports 0.4 + // BG did report 0.4 but with rescaling 0.397 + // when selecting other IP closer at endpoint or if segment B is smaller than A + test_one("ggl_list_20110307_javier", + ggl_list_20110307_javier[0], ggl_list_20110307_javier[1], + 1, 4, BG_IF_RESCALED(0.397162651, 0.40), ut_settings(0.01)); + + test_one("ggl_list_20110627_phillip", + ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1], + 1, if_typed_tt(6, 5), 11151.6618); + + test_one("ggl_list_20110716_enrico", + ggl_list_20110716_enrico[0], ggl_list_20110716_enrico[1], + 3, 16, 35723.8506317139); + + test_one("ggl_list_20131119_james", + ggl_list_20131119_james[0], ggl_list_20131119_james[1], + 1, 4, 6.6125873045, ut_settings(0.1)); + + test_one("ggl_list_20140223_shalabuda", + ggl_list_20140223_shalabuda[0], ggl_list_20140223_shalabuda[1], + 1, 4, 3.77106, ut_settings(0.001)); + + // Mailed to the Boost.Geometry list on 2014/03/21 by 7415963@gmail.com + test_one("ggl_list_20140321_7415963", + ggl_list_20140321_7415963[0], ggl_list_20140321_7415963[1], + 0, 0, 0, ut_settings(0.1)); + + TEST_INTERSECTION(ggl_list_20190307_matthieu_1, 2, -1, 0.035136); + TEST_INTERSECTION(ggl_list_20190307_matthieu_2, 1, -1, 3.64285); + +#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + test_one("buffer_rt_f", buffer_rt_f[0], buffer_rt_f[1], + 1, 4, 0.00029437899183903937, ut_settings(0.01)); +#endif + test_one("buffer_rt_g", buffer_rt_g[0], buffer_rt_g[1], + 1, 0, 2.914213562373); + + test_one("ticket_8254", ticket_8254[0], ticket_8254[1], + if_typed(0, 1), -1, if_typed(0.0, 3.635930e-08), ut_settings(0.01)); + test_one("ticket_6958", ticket_6958[0], ticket_6958[1], + if_typed(0, 1), -1, if_typed(0.0, 4.34355e-05), ut_settings(0.01)); + test_one("ticket_8652", ticket_8652[0], ticket_8652[1], + 1, 4, 0.0003); + + TEST_INTERSECTION(ticket_8310a, 1, 5, 0.3843747); + TEST_INTERSECTION(ticket_8310b, 1, 5, 0.3734379); + TEST_INTERSECTION(ticket_8310c, 1, 5, 0.4689541); + TEST_INTERSECTION_REV(ticket_8310a, 1, 5, 0.3843747); + TEST_INTERSECTION_REV(ticket_8310b, 1, 5, 0.3734379); + TEST_INTERSECTION_REV(ticket_8310c, 1, 5, 0.4689541); + + test_one("ticket_9081_15", + ticket_9081_15[0], ticket_9081_15[1], + 1, 4, 0.0068895780745301394); + + test_one("ticket_10108_a", + ticket_10108_a[0], ticket_10108_a[1], + 0, 0, 0.0); + + // msvc 5.6023011e-5 + // mingw 5.6022954e-5 + test_one("ticket_10108_b", + ticket_10108_b[0], ticket_10108_b[1], + 0, 0, 5.6022983e-5, ut_settings(-1.0)); + + test_one("ticket_10747_a", + ticket_10747_a[0], ticket_10747_a[1], + 1, 4, 70368744177664.0); + test_one("ticket_10747_b", + ticket_10747_b[0], ticket_10747_b[1], + 1, 4, 7036874417766400.0); + test_one("ticket_10747_c", + ticket_10747_c[0], ticket_10747_c[1], + 1, 4, 17592186044416.0); + test_one("ticket_10747_d", + ticket_10747_d[0], ticket_10747_d[1], + 1, 4, 703687777321.0); + + // Delivers very small triangle < 1.0e-13, or zero + test_one("ticket_10747_e", + ticket_10747_e[0], ticket_10747_e[1], + BG_IF_RESCALED(1, 0), -1, 1.0e-13, ut_settings(-1.0)); + + test_one("ticket_11576", + ticket_11576[0], ticket_11576[1], + if_typed(0, 1), -1, if_typed(0.0, 5.585617332907136e-07)); + + { + // Not yet valid when rescaling is turned off + ut_settings settings; + settings.test_validity = BG_IF_RESCALED(true, false); + test_one("ticket_9563", ticket_9563[0], ticket_9563[1], + 1, 8, 129.90381, settings); + } + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // With rescaling the output is empty + TEST_INTERSECTION(issue_548, 1, -1, 1958824415.2151); +#endif + + TEST_INTERSECTION(issue_566_a, 1, -1, 70.7107); + TEST_INTERSECTION(issue_566_b, 1, -1, 70.7107); + + test_one("buffer_mp1", buffer_mp1[0], buffer_mp1[1], + 1, 31, 2.271707796); + test_one("buffer_mp2", buffer_mp2[0], buffer_mp2[1], + 1, 29, 0.457126); + + test_one("case_58_iet", + case_58[0], case_58[2], + 2, -1, 1.0 / 3.0); + + test_one("case_80", + case_80[0], case_80[1], + 0, -1, 0.0); + + test_one("case_81", + case_81[0], case_81[1], + 0, -1, 0.0); + + test_one("case_101", + case_101[0], case_101[1], + 0, -1, 6.25); + test_one("case_102", + case_102[0], case_102[1], + 0, -1, 3.1875); + + test_one("case_103", + case_103[0], case_103[1], + 1, -1, 0.5); + test_one("case_104", + case_104[0], case_104[1], + 0, -1, 0.0); + + TEST_INTERSECTION(case_105, 1, 34, 76.0); + TEST_INTERSECTION(case_106, 2, -1, 3.5); + TEST_INTERSECTION(case_107, 3, -1, 3.0); + + TEST_INTERSECTION(case_precision_1, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_2, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_3, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_4, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_5, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_6, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_7, 0, -1, 0.0); + TEST_INTERSECTION(case_precision_8, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_9, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_10, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_11, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_12, 1, -1, 2.0); + TEST_INTERSECTION(case_precision_13, 1, -1, 1.99998); + TEST_INTERSECTION(case_precision_14, 0, -1, 0.0); + TEST_INTERSECTION(case_precision_15, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_16, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_17, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_18, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_19, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_20, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_21, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_22, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_23, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_24, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_25, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_26, 1, -1, 14.0); + + TEST_INTERSECTION_REV(case_precision_1, 0, 0, 0.0); + TEST_INTERSECTION_REV(case_precision_2, 0, 0, 0.0); + TEST_INTERSECTION_REV(case_precision_3, 0, 0, 0.0); + TEST_INTERSECTION_REV(case_precision_4, 0, 0, 0.0); + TEST_INTERSECTION_REV(case_precision_5, 0, 0, 0.0); + TEST_INTERSECTION_REV(case_precision_6, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_7, 0, -1, 0.0); + TEST_INTERSECTION_REV(case_precision_8, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_9, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_10, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_11, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_12, 1, -1, 2.0); + TEST_INTERSECTION_REV(case_precision_13, 1, -1, 1.99998); + TEST_INTERSECTION_REV(case_precision_14, 0, -1, 0.0); + TEST_INTERSECTION_REV(case_precision_15, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_16, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_17, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_18, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_19, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_20, 0, 0, 0.0); + TEST_INTERSECTION_REV(case_precision_21, 0, 0, 0.0); + TEST_INTERSECTION_REV(case_precision_22, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_23, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_24, 0, 0, 0.0); + TEST_INTERSECTION_REV(case_precision_25, 0, 0, 0.0); + TEST_INTERSECTION_REV(case_precision_26, 1, -1, 14.0); + + test_one("mysql_21964049", + mysql_21964049[0], mysql_21964049[1], + 0, -1, 0.0); + + test_one("mysql_21964465", + mysql_21964465[0], mysql_21964465[1], + 0, -1, 0.0); + + test_one("mysql_21965285_b_inv", + mysql_21965285_b_inv[0], + mysql_21965285_b_inv[1], + 2, -1, 183.71376870369406); + + TEST_INTERSECTION(mysql_23023665_6, 2, 0, 11.812440191387557); + + test_one("mysql_23023665_10", + mysql_23023665_10[0], mysql_23023665_10[1], + 1, 0, -1, 54.701340543162523); + + test_one("mysql_23023665_11", + mysql_23023665_11[0], mysql_23023665_11[1], + 1, 0, -1, 35.933385462482065); + +// test_one( +// "polygon_pseudo_line", +// "Polygon((0 0,0 4,4 4,4 0,0 0))", +// "Polygon((2 -2,2 -1,2 6,2 -2))", +// 5, 22, 1.1901714); +} + +template +void test_areal_clip() +{ + test_one("boxring", example_box, example_ring, + 2, 12, 1.09125); + test_one("boxring2", example_ring,example_box, + 2, 12, 1.09125); + + test_one("boxpoly", example_box, example_polygon, + 3, 19, 0.840166); + + test_one("poly1", example_box, + "POLYGON((3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2))", + 2, 12, 1.09125); + + test_one("clip_poly2", example_box, + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,5.3 2.5,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))", + 2, 12, 1.00375); + + test_one("clip_poly3", example_box, + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 2.5,4.5 1.2,4.9 0.8,2.9 0.7,2 1.3))", + 2, 12, 1.00375); + + test_one("clip_poly4", example_box, + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 2.5,4.5 2.3,5.0 2.3,5.0 2.1,4.5 2.1,4.5 1.9,4.0 1.9,4.5 1.2,4.9 0.8,2.9 0.7,2 1.3))", + 2, 16, 0.860892); + + test_one("clip_poly5", example_box, + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 1.2,2.9 0.7,2 1.3))", + 2, 11, 0.7575961); + + test_one("clip_poly6", example_box, + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.0 3.0,5.0 2.0,2.9 0.7,2 1.3))", + 2, 13, 1.0744456); + + test_one("clip_poly7", "Box(0 0, 3 3)", + "POLYGON((2 2, 1 4, 2 4, 3 3, 2 2))", + 1, 4, 0.75); +} + + +template +void test_boxes(std::string const& wkt1, std::string const& wkt2, double expected_area, bool expected_result) +{ + Box box1, box2; + bg::read_wkt(wkt1, box1); + bg::read_wkt(wkt2, box2); + + Box box_out; + bg::assign_zero(box_out); + bool detected = bg::intersection(box1, box2, box_out); + typename bg::default_area_result::type area = bg::area(box_out); + + BOOST_CHECK_EQUAL(detected, expected_result); + if (detected && expected_result) + { + BOOST_CHECK_CLOSE(area, expected_area, 0.01); + } +} + +template +void test_point_output() +{ + typedef bg::model::linestring

linestring; + typedef bg::model::polygon

polygon; + typedef bg::model::box

box; + //typedef bg::model::segment

segment; + + test_point_output(simplex_normal[0], simplex_normal[1], 6); + test_point_output("box(1 1,6 4)", simplex_normal[0], 4); + test_point_output("linestring(0 2,6 2)", simplex_normal[0], 2); + // NYI because of sectionize: + // test_point_output("linestring(0 2,6 2)", simplex_normal[0], 2); + // NYI because needs special treatment: + // test_point_output("box(0 0,4 4)", "box(2 2,6 6)", 2); +} + + +template +void test_areal_linear() +{ + std::string const poly_simplex = "POLYGON((1 1,1 3,3 3,3 1,1 1))"; + + test_one_lp("simplex", poly_simplex, "LINESTRING(0 2,4 2)", 1, 2, 2.0); + test_one_lp("case2", poly_simplex, "LINESTRING(0 1,4 3)", 1, 2, sqrt(5.0)); + test_one_lp("case3", "POLYGON((2 0,2 5,5 5,5 0,2 0))", "LINESTRING(0 1,1 2,3 2,4 3,6 3,7 4)", 1, 4, 2 + sqrt(2.0)); + test_one_lp("case4", "POLYGON((0 0,0 4,2 4,2 0,0 0))", "LINESTRING(1 1,3 2,1 3)", 2, 4, sqrt(5.0)); + + test_one_lp("case5", poly_simplex, "LINESTRING(0 1,3 4)", 1, 2, sqrt(2.0)); + test_one_lp("case6", "POLYGON((2 0,2 4,3 4,3 1,4 1,4 3,5 3,5 1,6 1,6 3,7 3,7 1,8 1,8 3,9 3,9 0,2 0))", "LINESTRING(1 1,10 3)", 4, 8, + // Pieces are 1 x 2/9: + 4.0 * sqrt(1.0 + 4.0/81.0)); + test_one_lp("case7", poly_simplex, "LINESTRING(1.5 1.5,2.5 2.5)", 1, 2, sqrt(2.0)); + test_one_lp("case8", poly_simplex, "LINESTRING(1 0,2 0)", 0, 0, 0.0); + + std::string const poly_9 = "POLYGON((1 1,1 4,4 4,4 1,1 1))"; + test_one_lp("case9", poly_9, "LINESTRING(0 1,1 2,2 2)", 1, 2, 1.0); + test_one_lp("case10", poly_9, "LINESTRING(0 1,1 2,0 2)", 0, 0, 0.0); + test_one_lp("case11", poly_9, "LINESTRING(2 2,4 2,3 3)", 1, 3, 2.0 + sqrt(2.0)); + test_one_lp("case12", poly_9, "LINESTRING(2 3,4 4,5 6)", 1, 2, sqrt(5.0)); + + test_one_lp("case13", poly_9, "LINESTRING(3 2,4 4,2 3)", 1, 3, 2.0 * sqrt(5.0)); + test_one_lp("case14", poly_9, "LINESTRING(5 6,4 4,6 5)", 0, 0, 0.0); + test_one_lp("case15", poly_9, "LINESTRING(0 2,1 2,1 3,0 3)", 1, 2, 1.0); + test_one_lp("case16", poly_9, "LINESTRING(2 2,1 2,1 3,2 3)", 1, 4, 3.0); + + std::string const angly = "LINESTRING(2 2,2 1,4 1,4 2,5 2,5 3,4 3,4 4,5 4,3 6,3 5,2 5,2 6,0 4)"; + // PROPERTIES CHANGED BY switch_to_integer + // TODO test_one_lp("case17", "POLYGON((1 1,1 5,4 5,4 1,1 1))", angly, 3, 8, 6.0); + test_one_lp("case18", "POLYGON((1 1,1 5,5 5,5 1,1 1))", angly, 2, 12, 10.0 + sqrt(2.0)); + test_one_lp("case19", poly_9, "LINESTRING(1 2,1 3,0 3)", 1, 2, 1.0); + test_one_lp("case20", poly_9, "LINESTRING(1 2,1 3,2 3)", 1, 3, 2.0); + + test_one_lp("case21", + "POLYGON((2 3,-9 -7,12 -13,2 3))", + "LINESTRING(-1.3 0,-15 0,-1.3 0)", + 0, 0, 0); + + test_one_lp("case22", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(5 5,-10 5,5 5)", + 2, 4, 10); + + test_one_lp("case22a", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(1 1,5 5,-10 5,5 5,6 6)", + 2, 6, 17.071068); + + test_one_lp("case23", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(-10 5,5 5,-10 5)", + 1, 3, 10); + + test_one_lp("case23a", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(-20 10,-10 5,5 5,-10 5,-20 -10)", + 1, 3, 10); + + test_one_lp("case24", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(0 5,5 5,0 5)", + 1, 3, 10); + + test_one_lp("case24", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(0 5,5 5,1 1,9 1,5 5,0 5)", + 1, 6, 29.313708); + + test_one_lp("case25", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(5 5,0 5,5 5)", + 1, 3, 10); + + test_one_lp("case25a", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(-10 10,5 5,0 5,5 5,20 10)", + 1, 4, 20.540925); + + test_one_lp("case25b", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(-10 10,5 5,1 5,5 5,20 10)", + 1, 4, 18.540925); + + test_one_lp("case25c", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(-10 10,5 5,-1 5,5 5,20 10)", + 2, 6, 20.540925); + + test_one_lp("case26", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(-5 5,0 5,-5 5)", + 0, 0, 0); + + test_one_lp("case26a", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(-10 10,-5 5,0 5,-5 5,-10 -10)", + 0, 0, 0); + + test_one_lp("case27", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(5 5,0 5,5 5,5 4,0 4,5 4)", + 1, 6, 21.0); + + test_one_lp("case28", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + "LINESTRING(5 5,0 5,5 5,5 4,0 4,5 3)", + 1, 6, 21.099019); + + test_one_lp("case29", + "POLYGON((5 5,15 15,15 5,5 5))", + "LINESTRING(0 0,10 10)", + 1, 2, 5 * std::sqrt(2.0)); + + // PROPERTIES CHANGED BY switch_to_integer + // TODO test_one_lp("case21", poly_9, "LINESTRING(1 2,1 4,4 4,4 1,2 1,2 2)", 1, 6, 11.0); + + // Compile test - arguments in any order: + test_one("simplex", poly_simplex, "LINESTRING(0 2,4 2)", 1, 2, 2.0); + test_one("simplex", "LINESTRING(0 2,4 2)", poly_simplex, 1, 2, 2.0); + + typedef typename bg::point_type::type Point; + test_one, LineString>("simplex", poly_simplex, "LINESTRING(0 2,4 2)", 1, 2, 2.0); + + test_one_lp("case30", + "POLYGON((25 0,0 15,30 15,22 10,25 0))", + "LINESTRING(10 15,20 15)", + 1, 2, 10.0); + + test_one_lp("case31", + "POLYGON((25 0,0 15,30 15,22 10,25 0))", + "LINESTRING(0 15,20 15)", + 1, 2, 20.0); + + test_one_lp("case32", + "POLYGON((25 0,0 15,30 15,22 10,25 0))", + "LINESTRING(25 0, 0 15,20 15)", + 1, 3, 49.15475947422650 /*sqrt(25^2+15^2)+20*/); + + typedef typename bg::point_type::type P; + + test_one_lp("case30p", + "POLYGON((25 0,0 15,30 15,22 10,25 0))", + "LINESTRING(10 15,20 15)", + 2, 2, 0); +} + + +template +void test_linear_box() +{ + typedef bg::model::multi_linestring multi_linestring_type; + + test_one_lp + ("case-l-b-01", + "BOX(-10 -10,10 10)", + "LINESTRING(-20 -20, 0 0,20 20)", + 1, 3, 20 * sqrt(2.0)); + + test_one_lp + ("case-l-b-02", + "BOX(-10 -10,10 10)", + "LINESTRING(-20 -20, 20 20)", + 1, 2, 20.0 * sqrt(2.0)); + + test_one_lp + ("case-l-b-02", + "BOX(-10 -10,10 10)", + "LINESTRING(-20 -20, 20 20,15 0,0 -15)", + 2, 4, 25.0 * sqrt(2.0)); + + test_one_lp + ("case-ml-b-01", + "BOX(-10 -10,10 10)", + "MULTILINESTRING((-20 -20, 20 20),(0 -15,15 0))", + 2, 4, 25.0 * sqrt(2.0)); +} + + +template +void test_all() +{ + typedef bg::model::linestring

linestring; + typedef bg::model::polygon

polygon; + typedef bg::model::box

box; + typedef bg::model::segment

segment; + + typedef bg::model::polygon polygon_ccw; + typedef bg::model::polygon polygon_open; + typedef bg::model::polygon polygon_ccw_open; + boost::ignore_unused(); + + ut_settings ignore_validity; + ignore_validity.test_validity = false; + + std::string clip = "box(2 2,8 8)"; + + test_areal_linear(); +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_areal_linear(); + test_areal_linear(); + test_areal_linear(); +#endif + + test_linear_box(); + + // Test polygons clockwise and counter clockwise + test_areal(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_areal(); + test_areal(); + test_areal(); +#endif + + test_areal_clip(); +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_areal_clip(); +#endif + +#if defined(TEST_FAIL_DIFFERENT_ORIENTATIONS) + // Should NOT compile + // NOTE: this can probably be relaxed later on. + test_one("simplex_normal", + simplex_normal[0], simplex_normal[1], + 1, 7, 5.47363293); + // Output ccw, nyi (should be just reversing afterwards) + test_one("simplex_normal", + simplex_normal[0], simplex_normal[1], + 1, 7, 5.47363293); +#endif + + // Basic check: box/linestring, is clipping OK? should compile in any order + test_one("llb", "LINESTRING(0 0,10 10)", clip, 1, 2, sqrt(2.0 * 6.0 * 6.0)); + test_one("lbl", clip, "LINESTRING(0 0,10 10)", 1, 2, sqrt(2.0 * 6.0 * 6.0)); + + // Box/segment + test_one("lsb", "LINESTRING(0 0,10 10)", clip, 1, 2, sqrt(2.0 * 6.0 * 6.0)); + test_one("lbs", clip, "LINESTRING(0 0,10 10)", 1, 2, sqrt(2.0 * 6.0 * 6.0)); + + // Completely inside + test_one("llbi", "LINESTRING(3 3,7 7)", clip, 1, 2, sqrt(2.0 * 4.0 * 4.0)); + + // Completely outside + test_one("llbo", "LINESTRING(9 9,10 10)", clip, 0, 0, 0.0); + + // Touching with point (-> output linestring with ONE point) + test_one("llb_touch", "LINESTRING(8 8,10 10)", clip, 1, 1, 0.0, ignore_validity); + + // Along border + test_one("llb_along", "LINESTRING(2 2,2 8)", clip, 1, 2, 6.0); + + // Outputting two lines (because of 3-4-5 constructions (0.3,0.4,0.5) + // which occur 4 times, the length is expected to be 2.0) + test_one("llb_2", "LINESTRING(1.7 1.6,2.3 2.4,2.9 1.6,3.5 2.4,4.1 1.6)", clip, 2, 6, 4.0 * 0.5); + + // linear + test_one("llp1", "LINESTRING(0 0,1 1)", "LINESTRING(0 1,1 0)", 1, 1, 0.0); + test_one("ssp1", "LINESTRING(0 0,1 1)", "LINESTRING(0 1,1 0)", 1, 1, 0.0); + test_one("llp2", "LINESTRING(0 0,1 1)", "LINESTRING(0 0,2 2)", 2, 2, 0.0); + + // polygons outputing points + //test_one("ppp1", simplex_normal[0], simplex_normal[1], 1, 7, 5.47363293); + + test_boxes("box(2 2,8 8)", "box(4 4,10 10)", 16, true); + test_boxes("box(2 2,8 7)", "box(4 4,10 10)", 12, true); + test_boxes("box(2 2,8 7)", "box(14 4,20 10)", 0, false); + test_boxes("box(2 2,4 4)", "box(4 4,8 8)", 0, true); + + test_point_output

(); + + + /* + test_one(99, "box(115041.10 471900.10, 118334.60 474523.40)", + "POLYGON ((115483.40 474533.40, 116549.40 474059.20, 117199.90 473762.50, 117204.90 473659.50, 118339.40 472796.90, 118334.50 472757.90, 118315.10 472604.00, 118344.60 472520.90, 118277.90 472419.10, 118071.40 472536.80, 118071.40 472536.80, 117943.10 472287.70, 117744.90 472248.40, 117708.00 472034.50, 117481.90 472056.90, 117481.90 472056.90, 117272.30 471890.10, 117077.90 472161.20, 116146.60 473054.50, 115031.10 473603.30, 115483.40 474533.40))", + 1, 26, 3727690.74); + */ + +} + +void test_pointer_version() +{ + std::vector ln; + test::test_point_xy* p; + p = new test::test_point_xy; p->x = 0; p->y = 0; ln.push_back(p); + p = new test::test_point_xy; p->x = 10; p->y = 10; ln.push_back(p); + + bg::model::box > box; + bg::assign_values(box, 2, 2, 8, 8); + + typedef bg::model::linestring > output_type; + std::vector clip; + bg::detail::intersection::intersection_insert(box, ln, std::back_inserter(clip)); + + double length = 0; + std::size_t n = 0; + for (std::vector::const_iterator it = clip.begin(); + it != clip.end(); ++it) + { + length += bg::length(*it); + n += bg::num_points(*it); + } + + BOOST_CHECK_EQUAL(clip.size(), 1u); + BOOST_CHECK_EQUAL(n, 2u); + BOOST_CHECK_CLOSE(length, sqrt(2.0 * 6.0 * 6.0), 0.001); + + for (std::size_t i = 0; i < ln.size(); i++) + { + delete ln[i]; + } +} + + +template +void test_exception() +{ + typedef bg::model::polygon

polygon; + + try + { + // Define polygon with a spike (= invalid) + std::string spike = "POLYGON((0 0,0 4,2 4,2 6,2 4,4 4,4 0,0 0))"; + + test_one("with_spike", + simplex_normal[0], spike, + 0, 0, 0); + } + catch(bg::overlay_invalid_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "No exception thrown"); +} + +template +void test_rational() +{ + typedef bg::model::polygon polygon; + test_one("simplex_normal", + simplex_normal[0], simplex_normal[1], + 1, 7, 5.47363293); +} + + +template +void test_boxes_per_d(P const& min1, P const& max1, P const& min2, P const& max2, bool expected_result) +{ + typedef bg::model::box

box; + + box box_out; + bool detected = bg::intersection(box(min1, max1), box(min2, max2), box_out); + + BOOST_CHECK_EQUAL(detected, expected_result); + if ( detected && expected_result ) + { + BOOST_CHECK( bg::equals(box_out, box(min2,max1)) ); + } +} + +template +void test_boxes_nd() +{ + typedef bg::model::point p1; + typedef bg::model::point p2; + typedef bg::model::point p3; + + test_boxes_per_d(p1(0), p1(5), p1(3), p1(6), true); + test_boxes_per_d(p2(0,0), p2(5,5), p2(3,3), p2(6,6), true); + test_boxes_per_d(p3(0,0,0), p3(5,5,5), p3(3,3,3), p3(6,6,6), true); +} + + +template +void test_ticket_10868(std::string const& wkt_out) +{ + typedef bg::model::point point_type; + typedef bg::model::polygon + < + point_type, /*ClockWise*/false, /*Closed*/false + > polygon_type; + typedef bg::model::multi_polygon multipolygon_type; + + polygon_type polygon1; + bg::read_wkt(ticket_10868[0], polygon1); + polygon_type polygon2; + bg::read_wkt(ticket_10868[1], polygon2); + + multipolygon_type multipolygon_out; + bg::intersection(polygon1, polygon2, multipolygon_out); + std::stringstream stream; + stream << bg::wkt(multipolygon_out); + + BOOST_CHECK_EQUAL(stream.str(), wkt_out); + + test_one("ticket_10868", + ticket_10868[0], ticket_10868[1], + 1, 7, 20266195244586.0); +} + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + test_all >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_all >(); + +#if defined(HAVE_TTMATH) + std::cout << "Testing TTMATH" << std::endl; + test_all >(); +#endif + + + // Commented, because exception is now disabled: + // test_exception >(); + + test_pointer_version(); +#if ! defined(BOOST_GEOMETRY_RESCALE_TO_ROBUST) + test_rational > >(); +#endif + + test_boxes_nd(); + +#if defined(BOOST_GEOMETRY_TEST_FAILURES) + // ticket #10868 still fails for 32-bit integers + test_ticket_10868("MULTIPOLYGON(((33520458 6878575,33480192 14931538,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575)))"); + +#if !defined(BOOST_NO_INT64) || defined(BOOST_HAS_INT64_T) || defined(BOOST_HAS_MS_INT64) + test_ticket_10868("MULTIPOLYGON(((33520458 6878575,33480192 14931538,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575)))"); +#endif + + if (BOOST_GEOMETRY_CONDITION(sizeof(long) * CHAR_BIT >= 64)) + { + test_ticket_10868("MULTIPOLYGON(((33520458 6878575,33480192 14931538,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575)))"); + } + +#if defined(BOOST_HAS_LONG_LONG) + test_ticket_10868("MULTIPOLYGON(((33520458 6878575,33480192 14931538,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575)))"); +#endif +#endif +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_aa_sph.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_aa_sph.cpp new file mode 100644 index 000000000..4a96359bd --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_aa_sph.cpp @@ -0,0 +1,39 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016, 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) + +#include "test_intersection.hpp" + +template +void test_all() +{ + typedef bg::model::polygon

polygon; + + // https://svn.boost.org/trac/boost/ticket/11789 + test_one("poly_poly_se_ticket_11789", + "POLYGON((-4.5726431789237223 52.142932977753595, \ + -4.5743166242433153 52.143359442355219, \ + -4.5739141406075410 52.143957260988416, \ + -4.5722406991324354 52.143530796430468, \ + -4.5726431789237223 52.142932977753595))", + "POLYGON((-4.5714644516017975 52.143819810922480, \ + -4.5670821923630358 52.143819810922480, \ + -4.5670821923630358 52.143649055226163, \ + -4.5714644516017975 52.143649055226163, \ + -4.5714644516017975 52.143819810922480))", + 0, 0, 0.0); +} + +int test_main(int, char* []) +{ + test_all > >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_areal_areal_linear.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_areal_areal_linear.cpp new file mode 100644 index 000000000..c83c794c0 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_areal_areal_linear.cpp @@ -0,0 +1,391 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit test + +// Copyright (c) 2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_intersection_linear_linear_areal +#endif + +#ifdef BOOST_GEOMETRY_TEST_DEBUG +#define BOOST_GEOMETRY_DEBUG_TURNS +#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER +#endif + +#include + +#include + +#include +#include +#include +#include +#include + +#include "test_intersection_linear_linear.hpp" + +typedef bg::model::point point_type; +typedef bg::model::multi_linestring + < + bg::model::linestring + > multi_linestring_type; + +typedef bg::model::ring open_ring_type; +typedef bg::model::polygon open_polygon_type; +typedef bg::model::multi_polygon open_multipolygon_type; + +typedef bg::model::ring closed_ring_type; +typedef bg::model::polygon closed_polygon_type; +typedef bg::model::multi_polygon closed_multipolygon_type; + + +template +< + typename OpenAreal1, + typename OpenAreal2, + typename ClosedAreal1, + typename ClosedAreal2, + typename MultiLinestring +> +struct test_intersection_aal +{ + static inline void apply(std::string const& case_id, + OpenAreal1 const& open_areal1, + OpenAreal2 const& open_areal2, + MultiLinestring const& expected1, + MultiLinestring const& expected2) + { + typedef test_intersection_of_geometries + < + OpenAreal1, OpenAreal2, MultiLinestring + > tester; + + tester::apply(open_areal1, open_areal2, expected1, expected2, case_id); + + ClosedAreal1 closed_areal1; + ClosedAreal2 closed_areal2; + bg::convert(open_areal1, closed_areal1); + bg::convert(open_areal2, closed_areal2); + + typedef test_intersection_of_geometries + < + ClosedAreal1, ClosedAreal2, MultiLinestring + > tester_of_closed; + + std::string case_id_closed = case_id + "-closed"; + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "testing closed areal geometries..." << std::endl; +#endif + tester_of_closed::apply(closed_areal1, closed_areal2, + expected1, expected2, case_id_closed); + } + + static inline void apply(std::string const& case_id, + OpenAreal1 const& open_areal1, + OpenAreal2 const& open_areal2, + MultiLinestring const& expected) + { + apply(case_id, open_areal1, open_areal2, expected, expected); + } +}; + + +BOOST_AUTO_TEST_CASE( test_intersection_ring_ring_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** RING / RING / LINEAR INTERSECTION ***" << std::endl; + std::cout << std::endl; +#endif + typedef open_ring_type OG; + typedef closed_ring_type CG; + typedef multi_linestring_type ML; + + typedef test_intersection_aal tester; + + tester::apply + ("r-r-01", + from_wkt("POLYGON((0 0,0 2,2 2,2 0))"), + from_wkt("POLYGON((2 1,2 4,4 4,4 0,1 0))"), + from_wkt("MULTILINESTRING((2 1,2 2),(2 0,1 0),(2 1,2 1))"), + from_wkt("MULTILINESTRING((2 2,2 1),(2 0,1 0),(2 1,2 1))") + ); + + tester::apply + ("r-r-02", + from_wkt("POLYGON(())"), + from_wkt("POLYGON((2 1,2 4,4 4,4 0,1 0))"), + from_wkt("MULTILINESTRING()") + ); + + tester::apply + ("r-r-03", + from_wkt("POLYGON((2 1,2 4,4 4,4 0,1 0))"), + from_wkt("POLYGON(())"), + from_wkt("MULTILINESTRING()") + ); + + tester::apply + ("r-r-04", + from_wkt("POLYGON(())"), + from_wkt("POLYGON(())"), + from_wkt("MULTILINESTRING()") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_ring_polygon_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** RING / POLYGON / LINEAR INTERSECTION ***" << std::endl; + std::cout << std::endl; +#endif + typedef open_ring_type OG1; + typedef open_polygon_type OG2; + typedef closed_ring_type CG1; + typedef closed_polygon_type CG2; + typedef multi_linestring_type ML; + + typedef test_intersection_aal tester; + + tester::apply + ("r-pg-01", + from_wkt("POLYGON((0 0,0 2,2 2,2 0))"), + from_wkt("POLYGON((2 1,2 4,4 4,4 0,1 0))"), + from_wkt("MULTILINESTRING((2 1,2 2),(2 0,1 0),(2 1,2 1))"), + from_wkt("MULTILINESTRING((2 2,2 1),(2 0,1 0),(2 1,2 1))") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_ring_multipolygon_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** RING / MULTIPOLYGON / LINEAR INTERSECTION ***" + << std::endl; + std::cout << std::endl; +#endif + typedef open_ring_type OG1; + typedef open_multipolygon_type OG2; + typedef closed_ring_type CG1; + typedef closed_multipolygon_type CG2; + typedef multi_linestring_type ML; + + typedef test_intersection_aal tester; + + tester::apply + ("r-mpg-01", + from_wkt("POLYGON((0 0,0 2,2 2,2 0))"), + from_wkt("MULTIPOLYGON(((2 1,2 4,4 4,4 0,1 0)))"), + from_wkt("MULTILINESTRING((2 1,2 2),(2 0,1 0),(2 1,2 1))"), + from_wkt("MULTILINESTRING((2 2,2 1),(2 0,1 0),(2 1,2 1))") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_polygon_polygon_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** POLYGON / POLYGON / LINEAR INTERSECTION ***" << std::endl; + std::cout << std::endl; +#endif + typedef open_polygon_type OG; + typedef closed_polygon_type CG; + typedef multi_linestring_type ML; + + typedef test_intersection_aal tester; + + tester::apply + ("pg-pg-01", + from_wkt("POLYGON((0 0,0 2,2 2,2 0))"), + from_wkt("POLYGON((2 1,2 4,4 4,4 0,1 0))"), + from_wkt("MULTILINESTRING((2 1,2 2),(2 0,1 0),(2 1,2 1))"), + from_wkt("MULTILINESTRING((2 2,2 1),(2 0,1 0),(2 1,2 1))") + ); + + tester::apply + ("pg-pg-02", + from_wkt("POLYGON((0 0,0 10,10 10,10 0),(2 2,7 2,7 7,2 7))"), + from_wkt("POLYGON((2 2,2 7,7 7,7 2))"), + from_wkt("MULTILINESTRING((2 2,2 2),(2 2,2 7,7 7,7 2,2 2),(2 2,2 2))"), + from_wkt("MULTILINESTRING((2 2,2 2),(2 2,7 2,7 7,2 7,2 2),(2 2,2 2))") + ); + + tester::apply + ("pg-pg-03", + from_wkt("POLYGON((0 0,0 10,10 10,10 0),(2 2,7 2,7 7,2 7))"), + from_wkt("POLYGON((2 3,2 6,6 6,6 3))"), + from_wkt("MULTILINESTRING((2 3,2 6),(2 3,2 3))") + ); + + tester::apply + ("pg-pg-04", + from_wkt("POLYGON((0 0,0 10,10 10,10 0),(2 2,7 2,7 7,2 7))"), + from_wkt("POLYGON((2 3,2 7,6 7,6 3))"), + from_wkt("MULTILINESTRING((2 3,2 7,6 7),(2 3,2 3))") + ); + + tester::apply + ("pg-pg-05", + from_wkt("POLYGON((0 0,0 10,10 10,10 0),(2 2,7 2,7 7,2 7))"), + from_wkt("POLYGON((2 3,2 7,7 7,7 3))"), + from_wkt("MULTILINESTRING((2 3,2 7,7 7,7 3),(2 3,2 3))") + ); + + tester::apply + ("pg-pg-06", + from_wkt("POLYGON((0 0,0 10,10 10,10 0),(2 2,7 2,7 7,2 7))"), + from_wkt("POLYGON((2 3,2 7,7 7,7 3))"), + from_wkt("MULTILINESTRING((2 3,2 7,7 7,7 3),(2 3,2 3))") + ); + + tester::apply + ("pg-pg-07", + from_wkt("POLYGON((0 0,0 10,10 10,10 0),(2 2,7 2,7 7,2 7))"), + from_wkt("POLYGON((2 5,5 7,7 5,5 2))"), + from_wkt("MULTILINESTRING((2 5,2 5),(5 7,5 7),(7 5,7 5),(5 2,5 2))") + ); + + tester::apply + ("pg-pg-08", + from_wkt("POLYGON((0 0,0 10,10 10,10 0),(2 2,7 2,7 7,2 7))"), + from_wkt("POLYGON((2 5,4 7,6 7,7 5,5 2))"), + from_wkt("MULTILINESTRING((2 5,2 5),(4 7,6 7),(7 5,7 5),(5 2,5 2))") + ); + + tester::apply + ("pg-pg-09", + from_wkt("POLYGON(())"), + from_wkt("POLYGON((2 1,2 4,4 4,4 0,1 0))"), + from_wkt("MULTILINESTRING()") + ); + + tester::apply + ("pg-pg-10", + from_wkt("POLYGON((2 1,2 4,4 4,4 0,1 0))"), + from_wkt("POLYGON(())"), + from_wkt("MULTILINESTRING()") + ); + + tester::apply + ("pg-pg-11", + from_wkt("POLYGON(())"), + from_wkt("POLYGON(())"), + from_wkt("MULTILINESTRING()") + ); + + tester::apply + ("pg-pg-12", + from_wkt("POLYGON((),())"), + from_wkt("POLYGON((),(),())"), + from_wkt("MULTILINESTRING()") + ); + + tester::apply + ("pg-pg-13", + from_wkt("POLYGON((2 1,2 4,4 4,4 0,1 0),())"), + from_wkt("POLYGON(())"), + from_wkt("MULTILINESTRING()") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_polygon_multipolygon_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** POLYGON / MULTIPOLYGON / LINEAR INTERSECTION ***" + << std::endl; + std::cout << std::endl; +#endif + typedef open_polygon_type OG1; + typedef open_multipolygon_type OG2; + typedef closed_polygon_type CG1; + typedef closed_multipolygon_type CG2; + typedef multi_linestring_type ML; + + typedef test_intersection_aal tester; + + tester::apply + ("pg-mpg-01", + from_wkt("POLYGON((0 0,0 2,2 2,2 0))"), + from_wkt("MULTIPOLYGON(((2 1,2 4,4 4,4 0,1 0)))"), + from_wkt("MULTILINESTRING((2 1,2 2),(2 0,1 0),(2 1,2 1))"), + from_wkt("MULTILINESTRING((2 2,2 1),(2 0,1 0),(2 1,2 1))") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_multipolygon_multipolygon_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTIPOLYGON / MULTIPOLYGON / LINEAR INTERSECTION ***" + << std::endl; + std::cout << std::endl; +#endif + typedef open_multipolygon_type OG; + typedef closed_multipolygon_type CG; + typedef multi_linestring_type ML; + + typedef test_intersection_aal tester; + + tester::apply + ("mpg-mpg-01", + from_wkt("MULTIPOLYGON(((0 0,0 2,2 2,2 0)))"), + from_wkt("MULTIPOLYGON(((2 1,2 4,4 4,4 0,1 0)))"), + from_wkt("MULTILINESTRING((2 1,2 2),(2 0,1 0),(2 1,2 1))"), + from_wkt("MULTILINESTRING((2 2,2 1),(2 0,1 0),(2 1,2 1))") + ); + + tester::apply + ("mpg-mpg-02", + from_wkt("MULTIPOLYGON(((0 0,0 10,10 10,10 0),(2 2,8 2,8 8,2 8)))"), + from_wkt("MULTIPOLYGON(((2 4,2 6,8 6,8 4)))"), + from_wkt("MULTILINESTRING((2 4,2 4),(2 4,2 6),(8 6,8 4))") + ); + + tester::apply + ("mpg-mpg-03", + from_wkt("MULTIPOLYGON()"), + from_wkt("MULTIPOLYGON(((2 1,2 4,4 4,4 0,1 0)))"), + from_wkt("MULTILINESTRING()") + ); + + tester::apply + ("mpg-mpg-04", + from_wkt("MULTIPOLYGON(((2 1,2 4,4 4,4 0,1 0)))"), + from_wkt("MULTIPOLYGON()"), + from_wkt("MULTILINESTRING()") + ); + + tester::apply + ("mpg-mpg-05", + from_wkt("MULTIPOLYGON()"), + from_wkt("MULTIPOLYGON()"), + from_wkt("MULTILINESTRING()") + ); + + tester::apply + ("mpg-mpg-06", + from_wkt("MULTIPOLYGON((()),((),()))"), + from_wkt("MULTIPOLYGON()"), + from_wkt("MULTILINESTRING()") + ); + + tester::apply + ("mpg-mpg-07", + from_wkt("MULTIPOLYGON(((2 1,2 4,4 4,4 0,1 0),(),()))"), + from_wkt("MULTIPOLYGON()"), + from_wkt("MULTILINESTRING()") + ); +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_linear_linear.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_linear_linear.cpp new file mode 100644 index 000000000..5224f10f4 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_linear_linear.cpp @@ -0,0 +1,1617 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_intersection_linear_linear +#endif + +#ifdef BOOST_GEOMETRY_TEST_DEBUG +#define BOOST_GEOMETRY_DEBUG_TURNS +#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER +#endif + +#include + +#include "test_intersection_linear_linear.hpp" + +#include +#include +#include + +typedef bg::model::point point_type; +typedef bg::model::segment segment_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_linestring multi_linestring_type; + + + +//=========================================================================== +//=========================================================================== +//=========================================================================== + + +BOOST_AUTO_TEST_CASE( test_intersection_linestring_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** LINESTRING / LINESTRING INTERSECTION ***" << std::endl; + std::cout << std::endl; +#endif + + typedef linestring_type L; + typedef multi_linestring_type ML; + + typedef test_intersection_of_geometries tester; + + tester::apply + (from_wkt("LINESTRING(0 0,1 1,2 1,3 2)"), + from_wkt("LINESTRING(0 2,1 1,2 1,3 0)"), + from_wkt("MULTILINESTRING((1 1,2 1))"), + "lli00"); + + tester::apply + (from_wkt("LINESTRING(0 0,5 0)"), + from_wkt("LINESTRING(3 0,4 0)"), + from_wkt("MULTILINESTRING((3 0,4 0))"), + "lli01"); + + tester::apply + (from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("LINESTRING(3 0,6 0)"), + from_wkt("MULTILINESTRING((3 0,4 0))"), + "lli01-2"); + + tester::apply + (from_wkt("LINESTRING(0 0,6 0)"), + from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("MULTILINESTRING((0 0,4 0))"), + "lli01-4"); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("LINESTRING(0 0,1 1,2 0,3 1,4 0,5 0,6 1,7 -1,8 0)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((4 0,5 0))"), +#else + from_wkt("MULTILINESTRING((0 0),(2 0),(4 0,5 0),(6.5 0),(8 0))"), +#endif + "lli01-6"); + + tester::apply + (from_wkt("LINESTRING(-20 0,20 0)"), + from_wkt("LINESTRING(0 0,1 1,2 0,3 1,4 0,5 0,6 1,7 -1,8 0)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((4 0,5 0))"), +#else + from_wkt("MULTILINESTRING((0 0),(2 0),(4 0,5 0),(6.5 0),(8 0))"), +#endif + "lli01-7"); + + tester::apply + (from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("LINESTRING(2 0,4 0)"), + from_wkt("MULTILINESTRING((2 0,4 0))"), + "lli01-8"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("LINESTRING(4 0,5 0)"), + from_wkt("MULTILINESTRING()"), + "lli01-10"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("LINESTRING(2 0,5 0)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING()"), +#else + from_wkt("MULTILINESTRING((2 0))"), +#endif + "lli01-11"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,4 0)"), + from_wkt("LINESTRING(3 0,5 0)"), + from_wkt("MULTILINESTRING((3 0,4 0))"), + "lli01-11a"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,4 0)"), + from_wkt("LINESTRING(3 0,4 0,5 0)"), + from_wkt("MULTILINESTRING((3 0,4 0))"), + "lli01-11b"); + + tester::apply + (from_wkt("LINESTRING(0 0,5 0,10 0)"), + from_wkt("LINESTRING(2 0,6 0,8 0)"), + from_wkt("MULTILINESTRING((2 0,5 0,8 0))"), + from_wkt("MULTILINESTRING((2 0,6 0,8 0))"), + "lli01-11c"); + + tester::apply + (from_wkt("LINESTRING(0 0,6 0)"), + from_wkt("LINESTRING(2 0,4 0,5 0)"), + from_wkt("MULTILINESTRING((2 0,5 0))"), + from_wkt("MULTILINESTRING((2 0,4 0,5 0))"), + "lli01-12"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,5 5,10 5,15 0)"), + from_wkt("LINESTRING(-1 6,0 5,15 5)"), + from_wkt("MULTILINESTRING((5 5,10 5))"), + "lli02"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,20 0))"), + "lli03"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,5 5,10 5,15 0,20 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,20 0))"), + "lli04"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,25 1)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((0 0,1 0)(15 0,20 0))"), + "lli05"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,30 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,20 0,30 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,30 0))"), + "lli05-1"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,20 0,30 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,30 0))"), + "lli06"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0)"), + from_wkt("LINESTRING(-1 0,25 0,30 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,20 0,30 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,25 0,30 0))"), + "lli07"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0)"), + from_wkt("LINESTRING(-1 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,20 0,30 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,19 0,30 0))"), + "lli08"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,30 0,31 1)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,20 0,30 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,30 0))"), + "lli09"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,30 0,31 1)"), + from_wkt("LINESTRING(-1 -1,0 0,1 0,2 1,3 0,30 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,20 0,30 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(15 0,30 0))"), + "lli10"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,20 0,\ + 30 0,31 1)"), + from_wkt("LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)"), + from_wkt("MULTILINESTRING((0 0,1 0,2 0),(3 0,4 0),\ + (15 0,20 0,30 0))"), + from_wkt("MULTILINESTRING((0 0,1 0,2 0),(3 0,4 0),\ + (15 0,30 0))"), + "lli11"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)"), + from_wkt("LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)"), + from_wkt("MULTILINESTRING((0 0,1 0,2 0),\ + (3 0,4 0),(15 0,30 0))"), + "lli11-1"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0,3 1)"), + from_wkt("LINESTRING(0 0,2 0,3 1)"), + from_wkt("MULTILINESTRING((0 0,2 0,3 1))"), + "lli12"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0,3 1)"), + from_wkt("LINESTRING(3 1,2 0,0 0)"), + from_wkt("MULTILINESTRING((0 0,2 0,3 1))"), + from_wkt("MULTILINESTRING((3 1,2 0,0 0))"), + "lli12-1"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 5,4 0)"), + from_wkt("LINESTRING(1 0,2 1,3 5,4 0,5 10)"), + from_wkt("MULTILINESTRING((1 0,2 1,3 5,4 0))"), + "lli13"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)"), + from_wkt("LINESTRING(0 0,2 0,2.5 0,3 1)"), + from_wkt("MULTILINESTRING((0 0,1 0,2 0,2.5 0,3 1))"), + from_wkt("MULTILINESTRING((0 0,2 0,2.5 0,3 1))"), + "lli14"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 5,4 0)"), + from_wkt("LINESTRING(1 0,2 1,3 5)"), + from_wkt("MULTILINESTRING((1 0,2 1,3 5))"), + "lli15"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 2)"), + from_wkt("LINESTRING(0.5 0,1 0,3 2,4 5)"), + from_wkt("MULTILINESTRING((0.5 0,1 0,2 1,3 2))"), + from_wkt("MULTILINESTRING((0.5 0,1 0,3 2))"), + "lli16"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 2)"), + from_wkt("LINESTRING(4 5,3 2,1 0,0.5 0)"), + from_wkt("MULTILINESTRING((0.5 0,1 0,2 1,3 2))"), + from_wkt("MULTILINESTRING((0.5 0,1 0,3 2))"), + "lli16-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1,30 1)"), + from_wkt("LINESTRING(1 1,2 0,3 1,20 1,25 1)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((20 1,25 1))"), +#else + from_wkt("MULTILINESTRING((2 0),(20 1,25 1))"), +#endif + "lli17"); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1,21 0,30 0)"), + from_wkt("LINESTRING(1 1,2 0,3 1,20 1,25 0)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING()"), +#else + from_wkt("MULTILINESTRING((2 0),(20 1),(25 0))"), +#endif + "lli18"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 1)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,5 0))"), +#else + from_wkt("MULTILINESTRING((1 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,5 0),(4 0))"), +#endif + "lli19"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(5 1,4 0,4 1,20 1,5 0,1 0)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,5 0))"), +#else + from_wkt("MULTILINESTRING((1 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,5 0),(4 0))"), +#endif + "lli19-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,5 0))"), +#else + from_wkt("MULTILINESTRING((1 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,5 0),(4 0))"), +#endif + "lli19a"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(4 0,4 1,20 1,5 0,1 0)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,5 0))"), +#else + from_wkt("MULTILINESTRING((1 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,5 0),(4 0))"), +#endif + "lli19a-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)"), + from_wkt("MULTILINESTRING((1 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,5 0),(4 0,5 0))"), + "lli19b"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0,6 1)"), + from_wkt("MULTILINESTRING((1 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,5 0),(4 0,5 0))"), + "lli19c"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,3 0)"), + from_wkt("MULTILINESTRING((1 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,5 0),(4 0,3 0))"), + "lli19d"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,3 0,3 1)"), + from_wkt("MULTILINESTRING((1 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,5 0),(4 0,3 0))"), + "lli19e"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0,5 1)"), + from_wkt("MULTILINESTRING((1 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,5 0),(4 0,5 0))"), + "lli19f"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(5 1,5 0,4 0,4 1,20 1,5 0,1 0)"), + from_wkt("MULTILINESTRING((1 0,5 0))"), + from_wkt("MULTILINESTRING((5 0,4 0),(5 0,1 0))"), + "lli19f-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,5 0,5 1)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,5 0))"), +#else + from_wkt("MULTILINESTRING((1 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,5 0),(5 0))"), +#endif + "lli19g"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(5 1,5 0,4 1,20 1,5 0,1 0)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,5 0))"), +#else + from_wkt("MULTILINESTRING((1 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,5 0),(5 0))"), +#endif + "lli19g-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0,30 30,10 30,10 -10,15 0,40 0)"), + from_wkt("LINESTRING(5 5,10 0,10 30,20 0,25 0,25 25,50 0,35 0)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((20 0,25 0),(10 30,10 0),\ + (35 0,40 0),(20 0,25 0))"), + from_wkt("MULTILINESTRING((20 0,25 0),(10 0,10 30),\ + (40 0,35 0))"), +#else + from_wkt("MULTILINESTRING((10 0),(20 0,25 0),(10 30,10 0),\ + (30 20),(35 0,40 0),(20 0,25 0))"), + from_wkt("MULTILINESTRING((10 0),(20 0,25 0),(10 0,10 30),\ + (30 20),(40 0,35 0))"), +#endif + "lli20"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0,30 30,10 30,10 -10,15 0,40 0)"), + from_wkt("LINESTRING(5 5,10 0,10 30,20 0,25 0,25 25,50 0,15 0)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((15 0,30 0),(10 30,10 0),\ + (15 0,40 0))"), + from_wkt("MULTILINESTRING((10 0,10 30),(20 0,25 0),(40 0,15 0))"), +#else + from_wkt("MULTILINESTRING((10 0),(15 0,30 0),(10 30,10 0),\ + (30 20),(15 0,40 0))"), + from_wkt("MULTILINESTRING((10 0),(10 0,10 30),(20 0,25 0),\ + (30 20),(40 0,15 0))"), +#endif + "lli20a"); + + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("LINESTRING(2 2,5 -1,15 2,18 0,20 0)"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((18 0,19 0,20 0))"), + from_wkt("MULTILINESTRING((18 0,20 0))"), +#else + from_wkt("MULTILINESTRING((4 0),(8.33333333333333333 0),\ + (18 0,19 0,20 0))"), + from_wkt("MULTILINESTRING((4 0),(8.33333333333333333 0),\ + (18 0,20 0))"), +#endif + "lli21" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0)"), + from_wkt("LINESTRING(1 0,4 0,2 1,5 1,4 0,8 0)"), + from_wkt("MULTILINESTRING((1 0,4 0),(4 0,8 0))"), + "lli22" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0)"), + from_wkt("LINESTRING(4 0,5 0,5 1,1 1,1 0,4 0)"), + from_wkt("MULTILINESTRING((1 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,4 0),(4 0,5 0))"), + "lli23" + ); + + // the following two tests have been discussed with by Adam + tester::apply + (from_wkt("LINESTRING(1 0,1 1,2 1)"), + from_wkt("LINESTRING(2 1,1 1,1 0)"), + from_wkt("MULTILINESTRING((1 0,1 1,2 1))"), + "lli24" + ); + + tester::apply + (from_wkt("LINESTRING(1 0,1 1,2 1)"), + from_wkt("LINESTRING(1 2,1 1,1 0)"), + from_wkt("MULTILINESTRING((1 0,1 1))"), + "lli25" + ); +} + + + + +BOOST_AUTO_TEST_CASE( test_intersection_linestring_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** LINESTRING / MULTILINESTRING INTERSECTION ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef linestring_type L; + typedef multi_linestring_type ML; + + typedef test_intersection_of_geometries tester; + + // the inertsection code automatically reverses the order of the + // geometries according to the geometry IDs. + // all calls below are actually reversed, and internally the + // intersection of the linestring with the multi-linestring is + // computed. + + // disjoint linestrings + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 2,4 3),(1 1,2 2,5 3))"), + from_wkt("MULTILINESTRING()"), + "lmli01" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,4 0))"), + from_wkt("MULTILINESTRING((2 0,4 0))"), + "lmli02" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,5 0))"), + from_wkt("MULTILINESTRING((2 0,5 0))"), + "lmli03" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0))"), + from_wkt("MULTILINESTRING((2 0,4 0))"), + "lmli04" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,101 0)"), + from_wkt("MULTILINESTRING((-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((1 0,101 0))"), + "lmli07" + ); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,101 0)"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,101 0))"), + "lmli07a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,101 0)"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,101 0))"), + "lmli07b" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,101 0)"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((1 0,101 0))"), + "lmli08" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 0.5,3 0,101 0)"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((3 0,101 0))"), +#else + from_wkt("MULTILINESTRING((1 0),(2 0.5),(3 0,101 0))"), +#endif + "lmli09" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,1.5 0,2 0.5,3 0,101 0)"), + from_wkt("MULTILINESTRING((0 1,1 1,1 0,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,1.5 0),(3 0,101 0))"), +#else + from_wkt("MULTILINESTRING((1 0),(2 0.5),(1 0,1.5 0),(3 0,101 0))"), +#endif + "lmli10" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (1 1,2 0,18 0,19 1),(2 1,3 0,17 0,18 1),\ + (3 1,4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), + "lmli12" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((1 0,19 0,20 1),\ + (2 0,18 0,19 1),(3 0,17 0,18 1),\ + (4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), + "lmli13" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), + "lmli14" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,6 0))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), + "lmli15" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), + "lmli15a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,5 0,6 0))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), + "lmli16" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,5 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), + "lmli16a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,19 0))"), +#else + from_wkt("MULTILINESTRING((1 0,19 0),(25 0))"), +#endif + "lmli17" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0,26 2))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,19 0))"), +#else + from_wkt("MULTILINESTRING((1 0,19 0),(25 0))"), +#endif + "lmli17a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), + "lmli18" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((1 0,18 0,19 0))"), + "lmli18a" + ); +} + + + + + + +#ifndef BOOST_GEOMETRY_TEST_NO_DEGENERATE +BOOST_AUTO_TEST_CASE( test_intersection_l_ml_degenerate ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** LINESTRING / MULTILINESTRING INTERSECTION" + << " (DEGENERATE) ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef linestring_type L; + typedef multi_linestring_type ML; + + typedef test_intersection_of_geometries tester; + + // the following test cases concern linestrings with duplicate + // points and possibly linestrings with zero length. + + // no unique: (3 0) appears twice + tester::apply + (from_wkt("LINESTRING(0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0)"), + from_wkt("MULTILINESTRING((-10 0,-9 0),(0 10,5 0,20 0,20 0,30 10),\ + (1 1,1 1,2 2,2 2),(1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0),(0 0,0 0,0 10,0 10),\ + (4 0,4 10,4 10))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((5 0,18 0,19 0,20 0))"), +#else + from_wkt("MULTILINESTRING((0 0),(1 0),(2 0),(3 0),(4 0),\ + (5 0,18 0,19 0,20 0))"), +#endif + "lmli20a" + ); + + // no unique: (3 0) appears twice + tester::apply + (from_wkt("LINESTRING(0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0)"), + from_wkt("MULTILINESTRING((-10 0,-9 0),(0 10,5 0,20 0,20 0,30 10),\ + (1 1,1 1,2 2,2 2),(1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0),(0 0,0 0,0 10,0 10),\ + (4 0,4 0,4 10,4 10))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((5 0,18 0,19 0,20 0))"), +#else + from_wkt("MULTILINESTRING((0 0),(1 0),(2 0),(3 0),(4 0),\ + (5 0,18 0,19 0,20 0))"), +#endif + "lmli20b" + ); + + // no unique: (3 0) appears twice + tester::apply + (from_wkt("LINESTRING(0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0)"), + from_wkt("MULTILINESTRING((-10 0,-9 0),(0 10,5 0,20 0,20 0,30 10),\ + (1 1,1 1,2 2,2 2),(1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0),(0 0,0 0,0 10,0 10),\ + (30 0,30 0,30 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((5 0,18 0,19 0,20 0))"), +#else + from_wkt("MULTILINESTRING((0 0),(1 0),(2 0),(3 0),\ + (5 0,18 0,19 0,20 0),(30 0))"), +#endif + "lmli20c" + ); + + // no unique: (3 0) appears twice + tester::apply + (from_wkt("LINESTRING(0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0)"), + from_wkt("MULTILINESTRING((-10 0,-9 0),(0 10,5 0,20 0,20 0,30 10),\ + (1 1,1 1,2 2,2 2),(1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0),(0 0,0 0,0 10,0 10),\ + (30 0,30 0,31 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((5 0,18 0,19 0,20 0))"), +#else + from_wkt("MULTILINESTRING((0 0),(1 0),(2 0),(3 0),\ + (5 0,18 0,19 0,20 0),(30 0))"), +#endif + "lmli20d" + ); +} +#endif // BOOST_GEOMETRY_TEST_NO_DEGENERATE + + + + +BOOST_AUTO_TEST_CASE( test_intersection_multilinestring_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTILINESTRING / LINESTRING INTERSECTION ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef linestring_type L; + typedef multi_linestring_type ML; + + typedef test_intersection_of_geometries tester; + + // the intersection code automatically reverses the order of the + // geometries according to the geometry IDs. + // all calls below are actually reversed, and internally the + // intersection of the linestring with the multi-linestring is + // computed. + + // disjoint linestrings + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("LINESTRING(1 1,2 2,4 3)"), + from_wkt("MULTILINESTRING()"), + "mlli01" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("LINESTRING(1 1,2 0,4 0)"), + from_wkt("MULTILINESTRING((2 0,4 0))"), + "mlli02" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("LINESTRING(-1 -1,1 0,101 0,200 -1)"), + from_wkt("MULTILINESTRING((1 0,101 0))"), + "mlli03" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("LINESTRING(0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1)"), + from_wkt("MULTILINESTRING((1 0,19 0),(18 0,2 0),\ + (3 0,17 0),(16 0,4 0))"), + "mlli04" + ); +} + + + + + + +BOOST_AUTO_TEST_CASE( test_intersection_multilinestring_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTILINESTRING / MULTILINESTRING INTERSECTION ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef multi_linestring_type ML; + + typedef test_intersection_of_geometries tester; + + // disjoint linestrings + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 2,4 3),(1 1,2 2,5 3))"), + from_wkt("MULTILINESTRING()"), + "mlmli01" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,4 0))"), + from_wkt("MULTILINESTRING((2 0,4 0),(2 0,4 0))"), + from_wkt("MULTILINESTRING((2 0,4 0),(3 0,4 0))"), + "mlmli02" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,5 0))"), + from_wkt("MULTILINESTRING((2 0,5 0),(2 0,5 0))"), + from_wkt("MULTILINESTRING((2 0,4 0),(3 0,5 0))"), + "mlmli03" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0))"), + from_wkt("MULTILINESTRING((2 0,4 0),(2 0,4 0))"), + from_wkt("MULTILINESTRING((2 0,4 0))"), + "mlmli04" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0),\ + (10 10,20 10,30 20))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (10 20,15 10,25 10,30 15))"), + from_wkt("MULTILINESTRING((2 0,4 0),(2 0,4 0),(15 10,20 10))"), + from_wkt("MULTILINESTRING((2 0,4 0),(15 10,20 10))"), + "mlmli05" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 10),(1 0,7 0),\ + (10 10,20 10,30 20))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (-1 -1,0 0,9 0,11 10,12 10,13 3,14 4,15 5),\ + (10 20,15 10,25 10,30 15))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((0 0,9 0),(13 3,15 5),\ + (1 0,7 0),(11 10,12 10),(15 10,20 10))"), + from_wkt("MULTILINESTRING((2 0,4 0),(0 0,9 0),(13 3,14 4,15 5),\ + (11 10,12 10),(15 10,20 10))"), +#else + from_wkt("MULTILINESTRING((0 0,9 0),(13 3,15 5),(20 10),\ + (1 0,7 0),(11 10,12 10),(15 10,20 10))"), + from_wkt("MULTILINESTRING((2 0,4 0),(0 0,9 0),(13 3,14 4,15 5),\ + (11 10,12 10),(15 10,20 10))"), +#endif + "mlmli06" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((1 0,101 0))"), + "mlmli07" + ); + + tester::apply + (from_wkt("MULTILINESTRING((-1 1,0 0,101 0))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((0 0,50 0),(20 0,101 0))"), + "mlmli07a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((0 0,50 0),(20 0,101 0))"), + "mlmli07b" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0),\ + (-1 -1,1 0,101 0,200 -1))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,101 0))"), +#else + from_wkt("MULTILINESTRING((1 0,101 0))"), + from_wkt("MULTILINESTRING((2 0),(1 0,101 0))"), +#endif + "mlmli08" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 0,2 0.5,3 0,101 0))"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((3 0,101 0))"), +#else + from_wkt("MULTILINESTRING((1 0),(2 0.5),(3 0,101 0))"), +#endif + "mlmli09" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 0,1.5 0,2 0.5,3 0,101 0))"), + from_wkt("MULTILINESTRING((0 1,1 1,1 0,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,1.5 0),(3 0,101 0))"), +#else + from_wkt("MULTILINESTRING((1 0,1.5 0),(2 0.5),(3 0,101 0))"), + from_wkt("MULTILINESTRING((1 0),(1 0,1.5 0),(2 0.5),(3 0,101 0))"), +#endif + "mlmli10" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 1,100 1,101 0),\ + (0 0,101 0))"), + from_wkt("MULTILINESTRING((1 0,1 1,2 1,3 0,4 0,5 1,6 1,\ + 7 0,8 0,9 1,10 1,11 0,12 0,13 1,14 1,15 0),\ + (-1 -1,1 0,101 0,200 -1))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 1,2 1),(5 1,6 1),(9 1,10 1),\ + (13 1,14 1),(1 0,101 0))"), + from_wkt("MULTILINESTRING((1 1,2 1),(5 1,6 1),(9 1,10 1),\ + (13 1,14 1),(3 0,4 0),(7 0,8 0),(11 0,12 0),\ + (1 0,101 0))"), +#else + from_wkt("MULTILINESTRING((1 1,2 1),(5 1,6 1),(9 1,10 1),\ + (13 1,14 1),(101 0),(1 0),(1 0,101 0))"), + from_wkt("MULTILINESTRING((1 0),(1 1,2 1),(5 1,6 1),(9 1,10 1),\ + (13 1,14 1),(3 0,4 0),(7 0,8 0),(11 0,12 0),(15 0),\ + (1 0,101 0))"), +#endif + "mlmli11" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (1 1,2 0,18 0,19 1),(2 1,3 0,17 0,18 1),\ + (3 1,4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), + from_wkt("MULTILINESTRING((1 0,19 0),(2 0,18 0),(3 0,17 0),\ + (4 0,16 0))"), + "mlmli12" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((1 0,19 0,20 1),\ + (2 0,18 0,19 1),(3 0,17 0,18 1),\ + (4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), + from_wkt("MULTILINESTRING((1 0,19 0),(2 0,18 0),(3 0,17 0),\ + (4 0,16 0))"), + "mlmli13" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), + from_wkt("MULTILINESTRING((1 0,19 0),(18 0,2 0),\ + (3 0,17 0),(16 0,4 0))"), + "mlmli14" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,6 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,19 0))"), +#else + from_wkt("MULTILINESTRING((1 0,19 0))"), + from_wkt("MULTILINESTRING((1 0,19 0),(6 0))"), +#endif + "mlmli15" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,4 2,2 2))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,19 0))"), +#else + from_wkt("MULTILINESTRING((1 0,19 0))"), + from_wkt("MULTILINESTRING((1 0,19 0),(6 0))"), +#endif + "mlmli15a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,5 0,6 0))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), + from_wkt("MULTILINESTRING((1 0,19 0),(5 0,6 0))"), + "mlmli16" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,5 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), + from_wkt("MULTILINESTRING((1 0,19 0),(6 0,5 0))"), + "mlmli16a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,19 0))"), +#else + from_wkt("MULTILINESTRING((1 0,19 0),(25 0))"), + from_wkt("MULTILINESTRING((1 0,19 0),(4 0),(25 0))"), +#endif + "mlmli17" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0,26 2))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,19 0))"), +#else + from_wkt("MULTILINESTRING((1 0,19 0),(25 0))"), + from_wkt("MULTILINESTRING((1 0,19 0),(4 0),(25 0))"), +#endif + "mlmli17a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,19 0))"), +#else + from_wkt("MULTILINESTRING((1 0,19 0))"), + from_wkt("MULTILINESTRING((1 0,19 0),(4 0),\ + (8.3333333333333333333 0),(18 0))"), +#endif + "mlmli18" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,18 0,19 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,18 0,19 0))"), + from_wkt("MULTILINESTRING((1 0,19 0))"), +#else + from_wkt("MULTILINESTRING((1 0,18 0,19 0))"), + from_wkt("MULTILINESTRING((1 0,19 0),(4 0),\ + (8.3333333333333333333 0),(18 0))"), +#endif + "mlmli18a" + ); +} + + + + + + +#ifndef BOOST_GEOMETRY_TEST_NO_DEGENERATE +BOOST_AUTO_TEST_CASE( test_intersection_ml_ml_degenerate ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTILINESTRING / MULTILINESTRING INTERSECTION" + << " (DEGENERATE) ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef multi_linestring_type ML; + + typedef test_intersection_of_geometries tester; + + // the following test cases concern linestrings with duplicate + // points and possibly linestrings with zero length. + + // no unique: (3 0) appears twice + tester::apply + (from_wkt("MULTILINESTRING((5 5,5 5),(0 0,18 0,18 0,\ + 19 0,19 0,19 0,30 0),(2 0,2 0),(4 10,4 10))"), + from_wkt("MULTILINESTRING((-10 0,-9 0),(0 10,5 0,20 0,20 0,30 10),\ + (1 1,2 2),(1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0),(0 0,0 10),\ + (4 0,4 10),(5 5,5 5))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((5 0,18 0,19 0,20 0))"), + from_wkt("MULTILINESTRING((5 0,20 0))"), +#else + from_wkt("MULTILINESTRING((5 5),(0 0),(1 0),(2 0),(3 0),\ + (4 0),(5 0,18 0,19 0,20 0),(2 0),(4 10))"), + from_wkt("MULTILINESTRING((5 0,20 0),(1 0),(2 0),(2 0),(3 0),\ + (0 0),(4 0),(4 10),(5 5))"), +#endif + "mlmli20a" + ); + + // no unique: (3 0) appears three times + tester::apply + (from_wkt("MULTILINESTRING((5 5,5 5),(0 0,0 0,18 0,18 0,\ + 19 0,19 0,19 0,30 0,30 0),(2 0,2 0),(4 10,4 10))"), + from_wkt("MULTILINESTRING((-10 0,-9 0),(0 10,5 0,20 0,20 0,30 10),\ + (1 1,1 1,2 2,2 2),(1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0,3 0),(0 0,0 0,0 10,0 10),\ + (4 0,4 10,4 10),(5 5,5 5))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((5 0,18 0,19 0,20 0))"), + from_wkt("MULTILINESTRING((5 0,20 0))"), +#else + from_wkt("MULTILINESTRING((5 5),(0 0),(1 0),(2 0),(3 0),(4 0),\ + (5 0,18 0,19 0,20 0),(2 0),(4 10))"), + from_wkt("MULTILINESTRING((5 0,20 0),(1 0),(2 0),(2 0),\ + (3 0),(0 0),(4 0),(4 10),(5 5))"), +#endif + "mlmli20aa" + ); + + // no unique: (3 0) appears twice + tester::apply + (from_wkt("MULTILINESTRING((5 5,5 5),(0 0,0 0,18 0,18 0,\ + 19 0,19 0,19 0,30 0,30 0))"), + from_wkt("MULTILINESTRING((-10 0,-9 0),(0 10,5 0,20 0,20 0,30 10),\ + (1 1,1 1,2 2,2 2),(1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0),(0 0,0 0,0 10,0 10),\ + (4 0,4 0,4 10,4 10),(0 5,15 5))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((5 0,18 0,19 0,20 0))"), + from_wkt("MULTILINESTRING((5 0,20 0))"), +#else + from_wkt("MULTILINESTRING((5 5),(0 0),(1 0),(2 0),(3 0),(4 0),\ + (5 0,18 0,19 0,20 0))"), + from_wkt("MULTILINESTRING((5 0,20 0),(1 0),(2 0),(3 0),\ + (0 0),(4 0),(5 5))"), +#endif + "mlmli20b" + ); + + // no unique: (3 0) and (30 0) appear twice + tester::apply + (from_wkt("MULTILINESTRING((0 0,0 0,18 0,18 0,\ + 19 0,19 0,19 0,30 0,30 0))"), + from_wkt("MULTILINESTRING((-10 0,-9 0),(0 10,5 0,20 0,20 0,30 10),\ + (1 1,1 1,2 2,2 2),(1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0),(0 0,0 0,0 10,0 10),\ + (30 0,30 0,30 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((5 0,18 0,19 0,20 0))"), + from_wkt("MULTILINESTRING((5 0,20 0))"), +#else + from_wkt("MULTILINESTRING((0 0),(1 0),(2 0),(3 0),\ + (5 0,18 0,19 0,20 0),(30 0))"), + from_wkt("MULTILINESTRING((5 0,20 0),(1 0),(2 0),(3 0),\ + (0 0),(30 0))"), +#endif + "mlmli20c" + ); + + // no unique: (3 0) appears twice + tester::apply + (from_wkt("MULTILINESTRING((0 0,0 0,18 0,18 0,\ + 19 0,19 0,19 0,30 0,30 0))"), + from_wkt("MULTILINESTRING((-10 0,-9 0),(0 10,5 0,20 0,20 0,30 10),\ + (1 1,1 1,2 2,2 2),(1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0),(0 0,0 0,0 10,0 10),\ + (30 0,30 0,31 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((5 0,18 0,19 0,20 0))"), + from_wkt("MULTILINESTRING((5 0,20 0))"), +#else + from_wkt("MULTILINESTRING((0 0),(1 0),(2 0),(3 0),\ + (5 0,18 0,19 0,20 0),(30 0))"), + from_wkt("MULTILINESTRING((5 0,20 0),(1 0),(2 0),(3 0),\ + (0 0),(30 0))"), +#endif + "mlmli20d" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,0 0,18 0,18 0,\ + 19 0,19 0,19 0,30 0,30 0))"), + from_wkt("MULTILINESTRING((0 10,5 0,20 0,20 0,30 0),\ + (1 10,1 10,1 0,1 0,1 -10),\ + (2 0,2 0),(3 0,3 0,3 0),(0 0,0 0,0 10,0 10),\ + (30 0,30 0,31 0,31 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((5 0,18 0,19 0,30 0))"), + from_wkt("MULTILINESTRING((5 0,20 0,30 0))"), +#else + from_wkt("MULTILINESTRING((0 0),(1 0),(2 0),(3 0),\ + (5 0,18 0,19 0,30 0),(30 0))"), + from_wkt("MULTILINESTRING((5 0,20 0,30 0),(1 0),(2 0),(3 0),\ + (0 0),(30 0))"), +#endif + "mlmli20e" + ); + + tester::apply + (from_wkt("MULTILINESTRING((1 5, -4.3 -.1), (0 6, 8.6 6, 189.7654 5, 1 3, 6 3, 3 5, 6 2.232432, 0 4), (-6 5, 1 2.232432), (3 -1032.34324, 9 0, 189.7654 1, -1.4 3, 3 189.7654, +.3 10.0002, 1 5, 6 3, 5 1, 9 1, 10.0002 -1032.34324, -0.7654 0, 5 3, 3 4), (2.232432 2.232432, 8.6 +.4, 0.0 2.232432, 4 0, -8.8 10.0002), (1 0, 6 6, 7 2, -0 8.4), (-0.7654 3, +.6 8, 4 -1032.34324, 1 6, 0 4), (0 7, 2 1, 8 -7, 7 -.7, -1032.34324 9), (5 0, 10.0002 4, 8 7, 3 3, -8.1 5))"), + from_wkt("MULTILINESTRING((5 10.0002, 2 7, -0.7654 0, 5 3), (0 -0.7654, 4 10.0002, 4 +.1, -.8 3, -.1 8, 10.0002 2, +.9 -1032.34324))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((-0.7654 8.88178e-16,-0.7654 0,5 3))"), +#else + from_wkt("MULTILINESTRING((-0.756651 3.30964),(1.60494 6),\ + (2.51371 6),(3.26673 6),(4 6),(8.18862 3.07616),\ + (4 3.03179),(1.40063 3.00424),(1.39905 3),\ + (4 3),(5 3),(4 4.33333),(4 4.07748),\ + (4.41962 2.698),(4 2.82162),(1.59592 3.52985),\ + (0.729883 3.78498),(-0.532243 2.83823),\ + (0.235887 2.53454),(7.08745 -329.0674155),\ + (9.98265 0.00543606),(8.49103 2.89652),\ + (4.87386 2.93436),(4 2.9435),(1.38821 2.97083)\ + (0.412281 2.98104),(-0.789427 2.99361),\ + (0.641699 7.5594),(1.18124 4.9275),\ + (1.99437 4.60225),(4 3.8),(9.09826 -100.515944),\ + (5.06428 -559.024344),\ + (4 3.5),(3.06464 1.99294),(4 1.72377),\ + (4 1.38014),(2.50083 1.69957),(1.03214 2.01251),\ + (0.72677 2.07758),(0.10749 2.20953),\ + (0.0954852 2.17914),(0.92255 1.71755),\ + (1.70073 1.28324),(3.43534 0.441146),\ + (2.09493 1.48836),(1.12031 2.2498),\ + (0.358522 2.84496),(-0.705343 3.67612),\ + (2.06005 1.27206),(2.3516 1.62191),(4 3.6),\ + (5.09496 4.91395),(6.47672 4.09311),(4 4.74286),\ + (2.54193 6.07595),(1.87562 6.68515),\ + (1.43457 7.08839),(0.502294 7.64221),\ + (0.601362 7.58336),(0.614728 3.49349),\ + (0.619143 2.1426),(0.623165 0.911787),\ + (0.623783 0.722855),(3.16036 -775.427199),\ + (3.23365 -767.0972558),(1.01466 0.926246),\ + (1.01183 1.90535),(1.01168 1.95744),\ + (1.00439 4.47984),(0.91526 4.25422),\ + (1.36441 2.90677),(1.8713 1.38609),\ + (1.87531 1.37408),(0.0484053 -0.635122),\ + (8.5655 2.85228),(5.26567 4.81254),(4 3.8),\ + (1.4995 3.27036),(0.591231 3.43401),\ + (-0.706503 3.66784),\ + (-0.7654 8.88178e-16,-0.7654 0,5 3))"), + from_wkt("MULTILINESTRING((1.87562 6.68515),(1.60494 6),\ + (1.18124 4.9275),(1.00439 4.47984),(0.91526 4.25422),\ + (0.729883 3.78498),(0.614728 3.49349),\ + (0.591231 3.43401),(0.412281 2.98104),\ + (0.358522 2.84496),(0.235887 2.53454),\ + (0.10749 2.20953),(0.0954852 2.17914),\ + (5 3),(0.0484053 -0.635122),(0.535994 0.677175),\ + (0.623165 0.911787),(0.92255 1.71755),\ + (1.01168 1.95744),(1.03214 2.01251),\ + (1.12031 2.2498),(1.36441 2.90677),\ + (1.38821 2.97083),(1.39905 3),(1.40063 3.00424),\ + (1.4995 3.27036),(1.59592 3.52985),\ + (1.99437 4.60225),(2.51371 6),(2.54193 6.07595),\ + (4 6),(4 4.74286),(4 4.33333),(4 4.07748),(4 3.8),\ + (4 3.8),(4 3.6),(4 3.5),(4 3.03179),(4 3),\ + (4 2.9435),(4 2.82162),(4 2.47965),(4 1.72377),\ + (4 1.38014),(3.43534 0.441146),(2.06005 1.27206),\ + (1.88383 1.37852),(1.8713 1.38609),\ + (1.01183 1.90535),(0.72677 2.07758),\ + (0.619143 2.1426),(-0.532243 2.83823),\ + (-0.789427 2.99361),(-0.756651 3.30964),\ + (-0.706503 3.66784),(-0.705343 3.67612),\ + (0.502294 7.64221),(0.601362 7.58336),\ + (0.641699 7.5594),(1.43457 7.08839),\ + (3.26673 6),(5.09496 4.91395),(5.26567 4.81254),\ + (6.47672 4.09311),(8.18862 3.07616),\ + (8.49103 2.89652),(8.5655 2.85228),\ + (9.98265 0.00543606),(9.09826 -100.515944),\ + (7.08745 -329.0674155),(5.06428 -559.024344),\ + (3.23365 -767.0972558),(3.16036 -775.427199),\ + (-0.7654 8.88178e-16,-0.7654 0,5 3))"), +#endif + "mlmli21", + 1e-4 + ); +} +#endif // BOOST_GEOMETRY_TEST_NO_DEGENERATE + + + + +BOOST_AUTO_TEST_CASE( test_intersection_ml_ml_spikes ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTILINESTRING / MULTILINESTRING INTERSECTION" + << " (WITH SPIKES) ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef multi_linestring_type ML; + + typedef test_intersection_of_geometries tester; + + // the following test cases concern linestrings with spikes + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,9 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,9 0))"), + from_wkt("MULTILINESTRING((1 0,9 0,5 0))"), + "mlmli-spikes-01" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((9 0,1 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,9 0))"), + from_wkt("MULTILINESTRING((9 0,1 0,5 0))"), + "mlmli-spikes-02" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,9 0,2 0,8 0,3 0,7 0,4 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,9 0))"), + from_wkt("MULTILINESTRING((1 0,9 0,2 0,8 0,3 0,7 0,4 0,5 0))"), + "mlmli-spikes-03" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,3 0,2 0,4 0,3 0,5 0,4 0,6 0,\ + 5 0,7 0,6 0,8 0,7 0,9 0))"), + from_wkt("MULTILINESTRING((1 0,9 0))"), + from_wkt("MULTILINESTRING((1 0,3 0,2 0,4 0,3 0,5 0,4 0,6 0,\ + 5 0,7 0,6 0,8 0,7 0,9 0))"), + "mlmli-spikes-04" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(7 0,8 0,7 0),\ + (9 1,9 0,9 2))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,6 0),(7 0,8 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(7 0,8 0,7 0))"), +#else + from_wkt("MULTILINESTRING((1 0,6 0),(7 0,8 0),(9 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(7 0,8 0,7 0),(9 0))"), +#endif + "mlmli-spikes-05" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(7 0,8 0,7 0),\ + (9 0,9 2,9 1))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,6 0),(7 0,8 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(7 0,8 0,7 0))"), +#else + from_wkt("MULTILINESTRING((1 0,6 0),(7 0,8 0),(9 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(7 0,8 0,7 0),(9 0))"), +#endif + "mlmli-spikes-05a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(9 0,6 0,8 0),\ + (11 0,8 0,12 0))"), + from_wkt("MULTILINESTRING((1 0,6 0),(6 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(9 0,6 0,8 0),\ + (10 0,8 0,10 0))"), + "mlmli-spikes-06" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((-1 0,0 0,-2 0),(11 0,10 0,12 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING()"), +#else + from_wkt("MULTILINESTRING((0 0),(10 0))"), +#endif + "mlmli-spikes-07" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,-2 -2),(11 1,10 0,12 2))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING()"), +#else + from_wkt("MULTILINESTRING((0 0),(10 0))"), +#endif + "mlmli-spikes-07a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(11 0,10 0,12 0),\ + (7 5,7 0,8 0,6.5 0,8.5 0,8.5 5))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING((1 0,6 0),(6.5 0,8.5 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(7 0,8 0,6.5 0,8.5 0))"), +#else + from_wkt("MULTILINESTRING((1 0,6 0),(6.5 0,8.5 0),(10 0))"), + from_wkt("MULTILINESTRING((1 0,6 0,5 0),(7 0,8 0,6.5 0,8.5 0),(10 0))"), +#endif + "mlmli-spikes-08" + ); + + // now the first geometry has a spike + tester::apply + (from_wkt("MULTILINESTRING((0 0,7 0,4 0,10 0))"), + from_wkt("MULTILINESTRING((1 0,8 0))"), + from_wkt("MULTILINESTRING((1 0,7 0,4 0,8 0))"), + from_wkt("MULTILINESTRING((1 0,8 0))"), + "mlmli-spikes-09" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,7 0,4 0,10 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(9 0,10 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(9 0,10 0))"), + "mlmli-spikes-09a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,7 0,4 0,10 0))"), + from_wkt("MULTILINESTRING((0 0,5 0),(9 0,10 0))"), + from_wkt("MULTILINESTRING((0 0,5 0),(5 0,4 0,5 0),(9 0,10 0))"), + from_wkt("MULTILINESTRING((0 0,5 0),(9 0,10 0))"), + "mlmli-spikes-09b" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,7 0,4 0,10 0))"), + from_wkt("MULTILINESTRING((0 0,5 0),(6 0,10 0))"), + from_wkt("MULTILINESTRING((0 0,5 0),(6 0,7 0,6 0),(5 0,4 0,5 0),\ + (6 0,10 0))"), + from_wkt("MULTILINESTRING((0 0,5 0),(6 0,10 0))"), + "mlmli-spikes-09c" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,8 0))"), + from_wkt("MULTILINESTRING((1 0,8 0),(8 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,8 0))"), + "mlmli-spikes-10" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,8 0,4 0),(2 0,9 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,9 0),(9 0,5 0))"), + from_wkt("MULTILINESTRING((1 0,8 0,4 0),(2 0,9 0,5 0))"), + "mlmli-spikes-11" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,5 0))"), + from_wkt("MULTILINESTRING((11 1,10 0,12 2))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING()"), +#else + from_wkt("MULTILINESTRING((10 0))"), +#endif + "mlmli-spikes-12" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,5 0))"), + from_wkt("MULTILINESTRING((11 -1,10 0,12 -2))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING()"), +#else + from_wkt("MULTILINESTRING((10 0))"), +#endif + "mlmli-spikes-12a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,5 0))"), + from_wkt("MULTILINESTRING((11 0,10 0,12 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING()"), +#else + from_wkt("MULTILINESTRING((10 0))"), +#endif + "mlmli-spikes-13" + ); + + // the following three tests have been discussed with Adam + tester::apply + (from_wkt("MULTILINESTRING((1 0,1 1,2 1))"), + from_wkt("MULTILINESTRING((1 2,1 1,1 2))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING()"), +#else + from_wkt("MULTILINESTRING((1 1))"), +#endif + "mlmli-spikes-14" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 0,0 0))"), + from_wkt("MULTILINESTRING((2 0,1 0,2 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING()"), +#else + from_wkt("MULTILINESTRING((1 0))"), +#endif + "mlmli-spikes-15" + ); + + tester::apply + (from_wkt("MULTILINESTRING((1 0,1 1,2 1))"), + from_wkt("MULTILINESTRING((2 0,1 1,2 0))"), +#ifdef BOOST_GEOMETRY_INTERSECTION_DO_NOT_INCLUDE_ISOLATED_POINTS + from_wkt("MULTILINESTRING()"), +#else + from_wkt("MULTILINESTRING((1 1))"), +#endif + "mlmli-spikes-16" + ); + + tester::apply + (from_wkt("MULTILINESTRING((1 0,1 1,2 1))"), + from_wkt("MULTILINESTRING((2 1,1 1,2 1))"), + from_wkt("MULTILINESTRING((1 1,2 1))"), + from_wkt("MULTILINESTRING((2 1,1 1,2 1))"), + "mlmli-spikes-17" + ); + + // test cases sent by Adam on the mailing list (equal slikes) + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 1,0 0))"), + from_wkt("MULTILINESTRING((0 0,1 1,0 0))"), + from_wkt("MULTILINESTRING((0 0,1 1,0 0))"), + "mlmli-spikes-18" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 1,0 0))"), + from_wkt("MULTILINESTRING((1 1,0 0,1 1))"), + from_wkt("MULTILINESTRING((0 0,1 1,0 0))"), + from_wkt("MULTILINESTRING((1 1,0 0,1 1))"), + "mlmli-spikes-19" + ); +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_multi.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_multi.cpp new file mode 100644 index 000000000..7bc1d4615 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_multi.cpp @@ -0,0 +1,515 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2016. +// Modifications copyright (c) 2016, 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) + +#include +#include + +#include "test_intersection.hpp" +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#define TEST_INTERSECTION(caseid, clips, points, area) \ + (test_one) \ + ( #caseid, caseid[0], caseid[1], clips, points, area) + +#define TEST_INTERSECTION_REV(caseid, clips, points, area) \ + (test_one) \ + ( #caseid "_rev", caseid[1], caseid[0], clips, points, area) + +#define TEST_INTERSECTION_IGNORE(caseid, clips, points, area) \ + { ut_settings ignore_validity; ignore_validity.test_validity = false; \ + (test_one) \ + ( #caseid, caseid[0], caseid[1], clips, points, area, ignore_validity); } + +template +void test_areal() +{ + test_one("simplex_multi", + case_multi_simplex[0], case_multi_simplex[1], + 2, 12, 6.42); + + test_one("case_multi_no_ip", + case_multi_no_ip[0], case_multi_no_ip[1], + 2, 8, 8.5); + test_one("case_multi_2", + case_multi_2[0], case_multi_2[1], + 3, 12, 5.9); + + test_one("simplex_multi_mp_p", + case_multi_simplex[0], case_single_simplex, + 2, 12, 6.42); + + test_one("simplex_multi_r_mp", + case_single_simplex, case_multi_simplex[0], + 2, 12, 6.42); + test_one("simplex_multi_mp_r", + case_multi_simplex[0], case_single_simplex, + 2, 12, 6.42); + + test_one("case_58_multi_a", + case_58_multi[0], case_58_multi[3], + 3, 12, 0.666666667); + test_one("case_58_multi_b", + case_58_multi[1], case_58_multi[2], + 1, 19, 11.16666666667); + test_one("case_58_multi_b4", + case_58_multi[4], case_58_multi[2], + 1, 13, 12.66666666); + test_one("case_58_multi_b5", + case_58_multi[5], case_58_multi[2], + 1, 13, 13.25); + test_one("case_58_multi_b6", + case_58_multi[6], case_58_multi[2], + 1, 13, 13.25); + test_one("case_58_multi_b7", + case_58_multi[7], case_58_multi[2], + 1, 16, 12.5); + + // Constructed cases for multi/touch/equal/etc + test_one("case_61_multi", + case_61_multi[0], case_61_multi[1], + 0, 0, 0.0); + test_one("case_62_multi", + case_62_multi[0], case_62_multi[1], + 1, 5, 1.0); + test_one("case_63_multi", + case_63_multi[0], case_63_multi[1], + 1, 5, 1.0); + test_one("case_64_multi", + case_64_multi[0], case_64_multi[1], + 1, 5, 1.0); + test_one("case_65_multi", + case_65_multi[0], case_65_multi[1], + 1, 5, 1.0); + test_one("case_65_multi_inv_a", + case_65_multi[0], case_65_multi[3], + 0, 0, 0.0); + test_one("case_65_multi_inv_b", + case_65_multi[1], case_65_multi[2], + 2, 10, 3.0); + test_one("case_72_multi", + case_72_multi[0], case_72_multi[1], + 3, 14, 2.85); + test_one("case_72_multi_inv_b", + case_72_multi[1], case_72_multi[2], + 3, 16, 6.15); + test_one("case_77_multi", + case_77_multi[0], case_77_multi[1], + 5, 27, 9.0); + test_one("case_78_multi", + case_78_multi[0], case_78_multi[1], + 1, 16, 22.0); + test_one("case_101_multi", + case_101_multi[0], case_101_multi[1], + 4, 22, 4.75); + test_one("case_102_multi", + case_102_multi[0], case_102_multi[1], + 3, 26, 19.75); + test_one("case_102_multi_inv_b", + case_102_multi[1], case_102_multi[2], + 6, 25, 3.75); + test_one("case_107_multi", + case_107_multi[0], case_107_multi[1], + 2, 10, 1.5); + test_one("case_107_multi_inv_b", + case_107_multi[1], case_107_multi[2], + 3, 13, 3.0); + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + { + // Rescaling misses one intersection + test_one("case_108_multi", + case_108_multi[0], case_108_multi[1], + 7, -1, 7.5); + } +#endif + + TEST_INTERSECTION(case_123_multi, 3, 13, 1.875); + TEST_INTERSECTION(case_124_multi, 2, 13, 2.0625); + TEST_INTERSECTION(case_125_multi, 3, 17, 2.1); + TEST_INTERSECTION(case_126_multi, 5, 27, 9.0); + TEST_INTERSECTION(case_127_multi, 3, 19, 24.0); + TEST_INTERSECTION(case_128_multi, 2, 26, 75.5); + TEST_INTERSECTION(case_129_multi, 1, 20, 20.5); + TEST_INTERSECTION(case_130_multi, 2, 30, 39.0); + + TEST_INTERSECTION(case_133_multi, 2, 23, 40.625); + TEST_INTERSECTION(case_134_multi, 1, 23, 42.0); + TEST_INTERSECTION(case_135_multi, 1, 12, 7.0); + TEST_INTERSECTION(case_136_multi, 1, 12, 6.5); + TEST_INTERSECTION(case_137_multi, 1, 12, 6.5); + + TEST_INTERSECTION(case_138_multi, 2, 23, 40.4); + TEST_INTERSECTION(case_139_multi, 2, 23, 40.546875); + TEST_INTERSECTION(case_140_multi, 2, 23, 40.546875); + TEST_INTERSECTION(case_141_multi, 3, -1, 74.5); + + TEST_INTERSECTION(case_recursive_boxes_1, 10, 89, 47.0); + + test_one("case_recursive_boxes_2", + case_recursive_boxes_2[0], case_recursive_boxes_2[1], + 1, 50, 90.0); // Area from SQL Server + test_one("case_recursive_boxes_3", + case_recursive_boxes_3[0], case_recursive_boxes_3[1], + 19, 84, 12.5); // Area from SQL Server + + TEST_INTERSECTION_IGNORE(case_recursive_boxes_4, 13, 158, 67.0); + + // Fixed by replacing handle_tangencies in less_by_segment_ratio sort order + // Should contain 6 output polygons + test_one("case_recursive_boxes_6", + case_recursive_boxes_6[0], case_recursive_boxes_6[1], + 6, 42, 19.0); + + test_one("case_recursive_boxes_7", + case_recursive_boxes_7[0], case_recursive_boxes_7[1], + 2, 9, 1.5); + + test_one("case_recursive_boxes_8", + case_recursive_boxes_8[0], case_recursive_boxes_8[1], + 3, 19, 3.75); + + test_one("case_recursive_boxes_9", + case_recursive_boxes_9[0], case_recursive_boxes_9[1], + 5, 27, 4.25); + test_one("case_recursive_boxes_10", + case_recursive_boxes_10[0], case_recursive_boxes_10[1], + 2, 8, 0.75); + test_one("case_recursive_boxes_11", + case_recursive_boxes_11[0], case_recursive_boxes_11[1], + 2, 8, 1.0); + test_one("case_recursive_boxes_12", + case_recursive_boxes_12[0], case_recursive_boxes_12[1], + 1, 4, 0.5); + test_one("case_recursive_boxes_13", + case_recursive_boxes_13[0], case_recursive_boxes_13[1], + 0, 0, 0.0); + test_one("case_recursive_boxes_14", + case_recursive_boxes_14[0], case_recursive_boxes_14[1], + 0, 0, 0.0); + test_one("case_recursive_boxes_15", + case_recursive_boxes_15[0], case_recursive_boxes_15[1], + 1, 4, 0.5); + test_one("case_recursive_boxes_16", + case_recursive_boxes_16[0], case_recursive_boxes_16[1], + 9, 43, 10.0); + test_one("case_recursive_boxes_17", + case_recursive_boxes_17[0], case_recursive_boxes_17[1], + 7, -1, 7.75); + test_one("case_recursive_boxes_18", + case_recursive_boxes_18[0], case_recursive_boxes_18[1], + 0, 0, 0.0); + test_one("case_recursive_boxes_19", + case_recursive_boxes_19[0], case_recursive_boxes_19[1], + 0, 0, 0.0); + test_one("case_recursive_boxes_20", + case_recursive_boxes_20[0], case_recursive_boxes_20[1], + 2, 0, 1.0); + test_one("case_recursive_boxes_21", + case_recursive_boxes_21[0], case_recursive_boxes_21[1], + 1, 0, 0.5); + test_one("case_recursive_boxes_22", + case_recursive_boxes_22[0], case_recursive_boxes_22[1], + 0, 0, 0.0); + test_one("case_recursive_boxes_23", + case_recursive_boxes_23[0], case_recursive_boxes_23[1], + 1, 0, 0.5); + test_one("case_recursive_boxes_24", + case_recursive_boxes_24[0], case_recursive_boxes_24[1], + 1, 0, 0.5); + test_one("case_recursive_boxes_25", + case_recursive_boxes_25[0], case_recursive_boxes_25[1], + 1, 0, 0.5); + test_one("case_recursive_boxes_26", + case_recursive_boxes_26[0], case_recursive_boxes_26[1], + 1, 0, 2.5); + test_one("case_recursive_boxes_27", + case_recursive_boxes_27[0], case_recursive_boxes_27[1], + 1, 0, 0.5); + test_one("case_recursive_boxes_28", + case_recursive_boxes_28[0], case_recursive_boxes_28[1], + 2, 0, 1.0); + test_one("case_recursive_boxes_29", + case_recursive_boxes_29[0], case_recursive_boxes_29[1], + 5, 0, 3.75); + test_one("case_recursive_boxes_30", + case_recursive_boxes_30[0], case_recursive_boxes_30[1], + 4, 0, 6.0); + test_one("case_recursive_boxes_31", + case_recursive_boxes_31[0], case_recursive_boxes_31[1], + 2, 0, 2.5); + test_one("case_recursive_boxes_32", + case_recursive_boxes_32[0], case_recursive_boxes_32[1], + 2, 0, 1.75); + test_one("case_recursive_boxes_33", + case_recursive_boxes_33[0], case_recursive_boxes_33[1], + 3, 0, 2.0); + test_one("case_recursive_boxes_34", + case_recursive_boxes_34[0], case_recursive_boxes_34[1], + 2, 0, 17.25); + test_one("case_recursive_boxes_35", + case_recursive_boxes_35[0], case_recursive_boxes_35[1], + 2, 0, 20.0); + test_one("case_recursive_boxes_36", + case_recursive_boxes_36[0], case_recursive_boxes_36[1], + 1, 0, 0.5); + test_one("case_recursive_boxes_37", + case_recursive_boxes_37[0], case_recursive_boxes_37[1], + 2, 0, 1.0); + + TEST_INTERSECTION(case_recursive_boxes_39, 3, 0, 3.0); + TEST_INTERSECTION(case_recursive_boxes_40, 1, 0, 1.0); + TEST_INTERSECTION(case_recursive_boxes_41, 1, 0, 23.5); + TEST_INTERSECTION(case_recursive_boxes_42, 1, 29, 95.0); + TEST_INTERSECTION(case_recursive_boxes_43, 2, 0, 22.5); + TEST_INTERSECTION(case_recursive_boxes_44, 2, 0, 3.0); + TEST_INTERSECTION(case_recursive_boxes_45, 7, 0, 12.0); + TEST_INTERSECTION(case_recursive_boxes_46, 6, -1, 7.0); + TEST_INTERSECTION(case_recursive_boxes_47, 1, 5, 1.0); + TEST_INTERSECTION(case_recursive_boxes_48, 1, 5, 1.0); + TEST_INTERSECTION(case_recursive_boxes_49, 7, 57, 20.0); + TEST_INTERSECTION(case_recursive_boxes_50, 9, 62, 26.0); + TEST_INTERSECTION(case_recursive_boxes_51, 14, 74, 19.0); + TEST_INTERSECTION(case_recursive_boxes_52, 8, -1, 22.0); + TEST_INTERSECTION(case_recursive_boxes_53, 1, -1, 19.75); + TEST_INTERSECTION(case_recursive_boxes_54, 3, -1, 10.0); + TEST_INTERSECTION(case_recursive_boxes_55, 5, -1, 2.25); + TEST_INTERSECTION(case_recursive_boxes_56, 1, -1, 0.5); + TEST_INTERSECTION(case_recursive_boxes_57, 10, -1, 9.5); + TEST_INTERSECTION(case_recursive_boxes_58, 1, -1, 0.25); + TEST_INTERSECTION(case_recursive_boxes_59, 8, -1, 8.25); + TEST_INTERSECTION(case_recursive_boxes_60, 8, -1, 10.0); + TEST_INTERSECTION(case_recursive_boxes_61, 2, -1, 20.0); + TEST_INTERSECTION(case_recursive_boxes_62, 9, -1, 10.5); + TEST_INTERSECTION(case_recursive_boxes_63, 11, -1, 5.75); + TEST_INTERSECTION(case_recursive_boxes_64, 5, -1, 17.25); + TEST_INTERSECTION(case_recursive_boxes_65, 3, -1, 17.25); + TEST_INTERSECTION(case_recursive_boxes_66, 4, -1, 16.0); + TEST_INTERSECTION(case_recursive_boxes_67, 5, -1, 2.5); + TEST_INTERSECTION(case_recursive_boxes_68, 8, -1, 9.5); + TEST_INTERSECTION(case_recursive_boxes_69, 6, -1, 3.25); + TEST_INTERSECTION(case_recursive_boxes_70, 6, -1, 18.5); + TEST_INTERSECTION(case_recursive_boxes_71, 3, -1, 1.75); + TEST_INTERSECTION(case_recursive_boxes_72, 8, -1, 4.5); + TEST_INTERSECTION(case_recursive_boxes_73, 3, -1, 18.5); + TEST_INTERSECTION(case_recursive_boxes_74, 3, -1, 20.25); + TEST_INTERSECTION(case_recursive_boxes_75, 5, -1, 16.75); + TEST_INTERSECTION(case_recursive_boxes_76, 2, -1, 18.25); + TEST_INTERSECTION(case_recursive_boxes_77, 5, -1, 3.5); + TEST_INTERSECTION(case_recursive_boxes_78, 9, -1, 8.0); + TEST_INTERSECTION(case_recursive_boxes_79, 5, -1, 9.0); + TEST_INTERSECTION(case_recursive_boxes_80, 1, -1, 0.25); + TEST_INTERSECTION(case_recursive_boxes_81, 5, -1, 3.75); + TEST_INTERSECTION(case_recursive_boxes_82, 5, -1, 8.5); + TEST_INTERSECTION(case_recursive_boxes_83, 5, -1, 10.25); + TEST_INTERSECTION(case_recursive_boxes_84, 1, -1, 0.5); +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + TEST_INTERSECTION(case_recursive_boxes_85, 1, -1, 0.25); +#endif + TEST_INTERSECTION(case_recursive_boxes_86, 0, -1, 0.0); + TEST_INTERSECTION(case_recursive_boxes_87, 0, -1, 0.0); + TEST_INTERSECTION(case_recursive_boxes_88, 4, -1, 3.5); + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) + TEST_INTERSECTION(case_precision_m1, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_m2, 2, -1, 15.25); + TEST_INTERSECTION_REV(case_precision_m1, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_m2, 2, -1, 15.25); +#else + // Validity: false positives (very small triangles looking like a line) + TEST_INTERSECTION_IGNORE(case_precision_m1, 1, -1, 14.0); + TEST_INTERSECTION_IGNORE(case_precision_m2, 2, -1, 15.25); +#endif + + test_one("ggl_list_20120915_h2_a", + ggl_list_20120915_h2[0], ggl_list_20120915_h2[1], + 2, 10, 6.0); // Area from SQL Server + test_one("ggl_list_20120915_h2_b", + ggl_list_20120915_h2[0], ggl_list_20120915_h2[2], + 2, 10, 6.0); // Area from SQL Server + + test_one("ticket_9081", + ticket_9081[0], ticket_9081[1], + 2, 10, 0.0019812556); + + // Should generate output, even for + test_one("mail_2019_01_21_johan", + mail_2019_01_21_johan[2], mail_2019_01_21_johan[3], + 2, -1, 0.0005889587); + + // Very small slice is generated. + // qcc-arm reports 1.7791215549400884e-14 + // With rescaling, generates very small triangle + test_one("ticket_11018", + ticket_11018[0], ticket_11018[1], + BG_IF_RESCALED(1, 0), 0, + 1.0e-8, ut_settings(-1) + ); + + TEST_INTERSECTION(ticket_12503, 2, 13, 17.375); + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // Result is wrong with rescaling + TEST_INTERSECTION(issue_630_a, 1, -1, 0.1770); +#endif +#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // Two cases produce either too large, or no output if Kramer rule is used + TEST_INTERSECTION(issue_630_b, 1, -1, BG_IF_KRAMER(0.1714, 0.1713911)); + TEST_INTERSECTION(issue_630_c, 1, -1, 0.1770); +#endif + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // Result is missing with rescaling + TEST_INTERSECTION(issue_643, 1, -1, 3.4615); +#endif + + test_one("mysql_23023665_7", + mysql_23023665_7[0], mysql_23023665_7[1], + 2, 11, 9.80505786783); + + TEST_INTERSECTION(mysql_23023665_12, 2, 0, 11.812440191387557); + TEST_INTERSECTION(mysql_regression_1_65_2017_08_31, 2, -1, 29.9022122); +} + +template +void test_areal_clip() +{ + static std::string const clip = "POLYGON((1 1,4 4))"; + test_one("simplex_multi_mp_b", clip, case_multi_simplex[0], + 2, 11, 6.791666); + test_one("simplex_multi_b_mp", case_multi_simplex[0], clip, + 2, 11, 6.791666); +} + +template +void test_linear() +{ + typedef typename bg::point_type::type point; + test_one("case_multi_ml_ml_1", + "MULTILINESTRING((0 0,1 1))", "MULTILINESTRING((0 1,1 0))", + 1, 1, 0.0); + test_one("case_multi_ml_ml_2", + "MULTILINESTRING((0 0,1 1),(0.5 0,1.5 1))", "MULTILINESTRING((0 1,1 0),(0.5 1,1.5 0))", + 4, 4, 0.0); + + test_one("case_multi_l_ml", + "LINESTRING(0 0,1 1)", "MULTILINESTRING((0 1,1 0),(0.5 1,1.5 0))", + 2, 2, 0.0); + test_one("case_multi_ml_l", + "MULTILINESTRING((0 1,1 0),(0.5 1,1.5 0))", "LINESTRING(0 0,1 1)", + 2, 2, 0.0); + + test_one("case_multi_ml_b", + "MULTILINESTRING((0 0,3 3)(1 0,4 3))", "POLYGON((1 1,3 2))", + 2, 4, 2.0 * std::sqrt(2.0)); + test_one("case_multi_b_ml", + "POLYGON((1 1,3 2))", "MULTILINESTRING((0 0,3 3)(1 0,4 3))", + 2, 4, 2.0 * std::sqrt(2.0)); +} + +template +void test_point_output() +{ + typedef bg::model::box

box; + typedef bg::model::linestring

linestring; + typedef bg::model::polygon

polygon; + typedef bg::model::multi_polygon multi_polygon; + + test_point_output(case_multi_simplex[0], case_multi_simplex[1], 10); + test_point_output("linestring(4 0,0 4)", case_multi_simplex[0], 4); + test_point_output("box(3 0,4 6)", case_multi_simplex[0], 8); +} + +template +void test_areal_linear() +{ + typedef typename boost::range_value::type Polygon; + typedef typename boost::range_value::type LineString; + typedef typename bg::point_type::type Point; + typedef bg::model::ring Ring; + + test_one_lp("case_mp_ls_1", case_multi_simplex[0], "LINESTRING(2 0,2 5)", 2, 4, 3.70); + test_one_lp("case_p_mls_1", case_single_simplex, "MULTILINESTRING((2 0,2 5),(3 0,3 5))", 2, 4, 7.5); + test_one_lp("case_mp_mls_1", case_multi_simplex[0], "MULTILINESTRING((2 0,2 5),(3 0,3 5))", 4, 8, 6.8333333); + test_one_lp("case_r_mls_1", case_single_simplex, "MULTILINESTRING((2 0,2 5),(3 0,3 5))", 2, 4, 7.5); +} + +template +void test_all() +{ + typedef bg::model::ring

ring; + typedef bg::model::polygon

polygon; + typedef bg::model::multi_polygon multi_polygon; + test_areal(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + + typedef bg::model::ring ring_ccw; + typedef bg::model::polygon polygon_ccw; + typedef bg::model::multi_polygon multi_polygon_ccw; + test_areal(); + + typedef bg::model::ring ring_open; + typedef bg::model::polygon polygon_open; + typedef bg::model::multi_polygon multi_polygon_open; + test_areal(); + + typedef bg::model::ring ring_open_ccw; + typedef bg::model::polygon polygon_open_ccw; + typedef bg::model::multi_polygon multi_polygon_open_ccw; + test_areal(); + + typedef bg::model::box

box; + test_areal_clip(); + test_areal_clip(); + + typedef bg::model::linestring

linestring; + typedef bg::model::multi_linestring multi_linestring; + + test_linear(); + test_areal_linear(); +#endif + + test_point_output

(); + // linear + +} + + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + test_all >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_all >(); + +#if defined(HAVE_TTMATH) + std::cout << "Testing TTMATH" << std::endl; + test_all >(); +#endif + +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_pl_a.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_pl_a.cpp new file mode 100644 index 000000000..0fef842c5 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_pl_a.cpp @@ -0,0 +1,190 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2020, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_intersection_pointlike_areal +#endif + +#include +#include + +#include + +#include "../test_set_ops_pointlike.hpp" + +#include +#include +#include +#include +#include + +typedef bg::model::point Pt; +typedef bg::model::polygon Po; +typedef bg::model::ring R; +typedef bg::model::multi_point MPt; +typedef bg::model::multi_polygon MPo; + +BOOST_AUTO_TEST_CASE( test_intersection_point_ring ) +{ + typedef test_set_op_of_pointlike_geometries + < + Pt, R, MPt, bg::overlay_intersection + > tester; + + tester::apply( + "pt-r-01", + from_wkt("POINT(0 0)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply( + "pt-r-02", + from_wkt("POINT(1 1)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))"), + from_wkt("MULTIPOINT(1 1)") + ); + + tester::apply( + "pt-r-03", + from_wkt("POINT(6 6)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))"), + from_wkt("MULTIPOINT()") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_point_polygon ) +{ + typedef test_set_op_of_pointlike_geometries + < + Pt, Po, MPt, bg::overlay_intersection + > tester; + + tester::apply( + "pt-po-01", + from_wkt("POINT(0 0)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 3 1, 3 3, 1 3, 0 0))"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply( + "pt-po-02", + from_wkt("POINT(1 1)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 3 1, 3 3, 1 3, 0 0))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply( + "pt-po-03", + from_wkt("POINT(3 3)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 3 1, 3 3, 1 3, 0 0))"), + from_wkt("MULTIPOINT(3 3)") + ); + + tester::apply( + "pt-po-04", + from_wkt("POINT(4 4)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 3 1, 3 3, 1 3, 0 0))"), + from_wkt("MULTIPOINT(4 4)") + ); + + tester::apply( + "pt-po-05", + from_wkt("POINT(6 6)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 3 1, 3 3, 1 3, 0 0))"), + from_wkt("MULTIPOINT()") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_point_multipolygon ) +{ + typedef test_set_op_of_pointlike_geometries + < + Pt, MPo, MPt, bg::overlay_intersection + > tester; + + tester::apply( + "pt-mpo-01", + from_wkt("POINT(0 0)"), + from_wkt("MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0)),((0 0, 1 2, 2 2, 2 1, 0 0)))"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply( + "pt-mpo-02", + from_wkt("POINT(1 1)"), + from_wkt("MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0)),((0 0, 1 2, 2 2, 2 1, 0 0)))"), + from_wkt("MULTIPOINT(1 1)") + ); + + tester::apply( + "pt-mpo-03", + from_wkt("POINT(2 2)"), + from_wkt("MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0)),((0 0, 1 2, 2 2, 2 1, 0 0)))"), + from_wkt("MULTIPOINT(2 2)") + ); + + tester::apply( + "pt-mpo-04", + from_wkt("POINT(3 3)"), + from_wkt("MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0)),((0 0, 1 2, 2 2, 2 1, 0 0)))"), + from_wkt("MULTIPOINT()") + ); +} + +BOOST_AUTO_TEST_CASE( test_intersection_multipoint_ring ) +{ + typedef test_set_op_of_pointlike_geometries + < + MPt, R, MPt, bg::overlay_intersection + > tester; + + tester::apply( + "mpt-r-01", + from_wkt("MULTIPOINT(0 0, 1 1, 6 6)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))"), + from_wkt("MULTIPOINT(0 0, 1 1)") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_multipoint_polygon ) +{ + typedef test_set_op_of_pointlike_geometries + < + MPt, Po, MPt, bg::overlay_intersection + > tester; + + tester::apply( + "mpt-po-01", + from_wkt("MULTIPOINT(0 0, 1 1, 3 3, 4 4, 6 6)"), + from_wkt("POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 3 1, 3 3, 1 3, 0 0))"), + from_wkt("MULTIPOINT(0 0, 3 3, 4 4)") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_multipoint_multipolygon ) +{ + typedef test_set_op_of_pointlike_geometries + < + MPt, MPo, MPt, bg::overlay_intersection + > tester; + + tester::apply( + "mpt-mpo-01", + from_wkt("MULTIPOINT(0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6)"), + from_wkt("MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0)),((0 0, 1 2, 2 2, 2 1, 0 0)))"), + // NOTE: This is caused by the fact that intersection(MPt, MPt) + // used internally does not filter duplicates out. + from_wkt("MULTIPOINT(0 0, 0 0, 1 1, 2 2, 4 4, 5 5)") + ); +} \ No newline at end of file diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_pl_l.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_pl_l.cpp new file mode 100644 index 000000000..fd4575f0b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_pl_l.cpp @@ -0,0 +1,702 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_intersection_pointlike_linear +#endif + +#include +#include + +#include + +#include "../test_set_ops_pointlike.hpp" + +#include +#include +#include +#include +#include + +typedef bg::model::point point_type; +typedef bg::model::segment segment_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_point multi_point_type; +typedef bg::model::multi_linestring multi_linestring_type; + + +//=========================================================================== +//=========================================================================== +//=========================================================================== + + +BOOST_AUTO_TEST_CASE( test_intersection_point_segment ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** POINT / SEGMENT INTERSECTION ***" << std::endl; + std::cout << std::endl; +#endif + + typedef point_type P; + typedef segment_type S; + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + P, S, MP, bg::overlay_intersection + > tester; + + tester::apply + ("psi01", + from_wkt

("POINT(0 0)"), + from_wkt("SEGMENT(1 1,2 2)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("psi02", + from_wkt

("POINT(0 0)"), + from_wkt("SEGMENT(0 0,1 1)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("psi03", + from_wkt

("POINT(1 1)"), + from_wkt("SEGMENT(0 0,2 2)"), + from_wkt("MULTIPOINT(1 1)") + ); + + tester::apply + ("psi04", + from_wkt

("POINT(3 3)"), + from_wkt("SEGMENT(0 0,2 2)"), + from_wkt("MULTIPOINT()") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_point_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** POINT / LINESTRING INTERSECTION ***" << std::endl; + std::cout << std::endl; +#endif + + typedef point_type P; + typedef linestring_type L; + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + P, L, MP, bg::overlay_intersection + > tester; + + tester::apply + ("pli01", + from_wkt

("POINT(0 0)"), + from_wkt("LINESTRING(1 1,2 2)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pli02", + from_wkt

("POINT(0 0)"), + from_wkt("LINESTRING(0 0,1 1)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("pli03", + from_wkt

("POINT(1 1)"), + from_wkt("LINESTRING(0 0,2 2)"), + from_wkt("MULTIPOINT(1 1)") + ); + + tester::apply + ("pli04", + from_wkt

("POINT(3 3)"), + from_wkt("LINESTRING(0 0,2 2)"), + from_wkt("MULTIPOINT()") + ); + + // linestrings with more than two points + tester::apply + ("pli05", + from_wkt

("POINT(1 1)"), + from_wkt("LINESTRING(0 0,1 1,2 2)"), + from_wkt("MULTIPOINT(1 1)") + ); + + tester::apply + ("pli06", + from_wkt

("POINT(2 2)"), + from_wkt("LINESTRING(0 0,1 1,4 4)"), + from_wkt("MULTIPOINT(2 2)") + ); + + tester::apply + ("pli07", + from_wkt

("POINT(10 10)"), + from_wkt("LINESTRING(0 0,1 1,4 4)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pli08", + from_wkt

("POINT(0 1)"), + from_wkt("LINESTRING(0 0,1 1,4 4)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pli09", + from_wkt

("POINT(4 4)"), + from_wkt("LINESTRING(0 0,1 1,4 4)"), + from_wkt("MULTIPOINT(4 4)") + ); + + tester::apply + ("pli10", + from_wkt

("POINT(0 0)"), + from_wkt("LINESTRING(0 0,1 1,4 4)"), + from_wkt("MULTIPOINT(0 0)") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_point_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** POINT / MULTILINESTRING INTERSECTION ***" << std::endl; + std::cout << std::endl; +#endif + + typedef point_type P; + typedef multi_linestring_type ML; + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + P, ML, MP, bg::overlay_intersection + > tester; + + tester::apply + ("pmli01", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((1 1,2 2))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pmli02", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((0 0,1 1))"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("pmli03", + from_wkt

("POINT(1 1)"), + from_wkt("MULTILINESTRING((0 0,2 2))"), + from_wkt("MULTIPOINT(1 1)") + ); + + tester::apply + ("pmli04", + from_wkt

("POINT(3 3)"), + from_wkt("MULTILINESTRING((0 0,2 2))"), + from_wkt("MULTIPOINT()") + ); + + // linestrings with more than two points + tester::apply + ("pmli05", + from_wkt

("POINT(1 1)"), + from_wkt("MULTILINESTRING((0 0,1 1,2 2))"), + from_wkt("MULTIPOINT(1 1)") + ); + + tester::apply + ("pmli06", + from_wkt

("POINT(2 2)"), + from_wkt("MULTILINESTRING((0 0,1 1,4 4))"), + from_wkt("MULTIPOINT(2 2)") + ); + + tester::apply + ("pmli07", + from_wkt

("POINT(10 10)"), + from_wkt("MULTILINESTRING((0 0,1 1,4 4))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pmli08", + from_wkt

("POINT(0 1)"), + from_wkt("MULTILINESTRING((0 0,1 1,4 4))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pmli09", + from_wkt

("POINT(4 4)"), + from_wkt("MULTILINESTRING((0 0,1 1,4 4))"), + from_wkt("MULTIPOINT(4 4)") + ); + + tester::apply + ("pmli10", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((0 0,1 1,4 4))"), + from_wkt("MULTIPOINT(0 0)") + ); + + // multilinestrings with more than one linestring + tester::apply + ("pmli11", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((-10,-10),(0 0,1 1,4 4))"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("pmli12", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((-10 0,0 0,10 0),(0 0,1 1,4 4))"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("pmli13", + from_wkt

("POINT(0 0)"), + from_wkt("MULTILINESTRING((-10 0,10 0),(0 0,1 1,4 4))"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("pmli14", + from_wkt

("POINT(-20 0)"), + from_wkt("MULTILINESTRING((-10 0,10 0),(0 0,1 1,4 4))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pmli15", + from_wkt

("POINT(0 1)"), + from_wkt("MULTILINESTRING((-10 0,10 0),(0 0,1 1,4 4))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("pmli16", + from_wkt

("POINT(1 0)"), + from_wkt("MULTILINESTRING((-10 0,10 0),(-1 0,2 0,20 0))"), + from_wkt("MULTIPOINT(1 0)") + ); + + tester::apply + ("pmli17", + from_wkt

("POINT(1 0)"), + from_wkt("MULTILINESTRING((-10 0,10 0),(0 -1,0 2,0 4))"), + from_wkt("MULTIPOINT(1 0)") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_multipoint_segment ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTIPOINT / SEGMENT INTERSECTION ***" << std::endl; + std::cout << std::endl; +#endif + + typedef multi_point_type MP; + typedef segment_type S; + + typedef test_set_op_of_pointlike_geometries + < + MP, S, MP, bg::overlay_intersection + > tester; + + tester::apply + ("mpsi01", + from_wkt("MULTIPOINT(0 0)"), + from_wkt("SEGMENT(1 1,2 2)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpsi02", + from_wkt("MULTIPOINT(0 0)"), + from_wkt("SEGMENT(0 0,1 1)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("mpsi03", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt("SEGMENT(1 1,2 2)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpsi04", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt("SEGMENT(0 0,1 1)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpsi05", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt("SEGMENT(1 1,2 2)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpsf06", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt("SEGMENT(1 0,2 0)"), + from_wkt("MULTIPOINT(1 0)") + ); + + tester::apply + ("mpsi07", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(0 0,1 0)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpsi07a", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(0 0,3 0)"), + from_wkt("MULTIPOINT(0 0,0 0,2 0)") + ); + + tester::apply + ("mpsi08", + from_wkt("MULTIPOINT()"), + from_wkt("SEGMENT(0 0,1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpsi09", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(-1 0,1 0)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpsi10", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(1 0,3 0)"), + from_wkt("MULTIPOINT(2 0)") + ); + + tester::apply + ("mpsi11", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(-1 0,3 0)"), + from_wkt("MULTIPOINT(0 0,0 0,2 0)") + ); + + tester::apply + ("mpsi12", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(3 0,3 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpsi12a", + from_wkt("MULTIPOINT(0 0,2 0,0 0)"), + from_wkt("SEGMENT(3 0,3 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpsi12b", + from_wkt("MULTIPOINT(0 0,2 0,0 0,2 0)"), + from_wkt("SEGMENT(3 0,3 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpsi12c", + from_wkt("MULTIPOINT(0 0,2 0,0 0,2 0,0 0)"), + from_wkt("SEGMENT(3 0,3 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpsi13", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(2 0,2 0)"), + from_wkt("MULTIPOINT(2 0)") + ); + + tester::apply + ("mpsi14", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("SEGMENT(0 0,0 0)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpsi15", + from_wkt("MULTIPOINT()"), + from_wkt("SEGMENT(0 0,1 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpsi16", + from_wkt("MULTIPOINT(0 0,2 0,0 0,2 0,0 0)"), + from_wkt("SEGMENT(-1 0,10 0)"), + from_wkt("MULTIPOINT(0 0,0 0,0 0,2 0,2 0)") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_multipoint_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTIPOINT / LINESTRING INTERSECTION ***" << std::endl; + std::cout << std::endl; +#endif + + typedef multi_point_type MP; + typedef linestring_type L; + + typedef test_set_op_of_pointlike_geometries + < + MP, L, MP, bg::overlay_intersection + > tester; + + tester::apply + ("mpli01", + from_wkt("MULTIPOINT(0 0)"), + from_wkt("LINESTRING(1 1,2 2,3 3,4 4,5 5)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpli02", + from_wkt("MULTIPOINT(0 0)"), + from_wkt("LINESTRING(0 0,1 1)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("mpli03", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt("LINESTRING(1 1,2 2)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpli04", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt("LINESTRING(0 0,1 1)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpli05", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt("LINESTRING(1 1,2 2)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpli06", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt("LINESTRING(1 0,2 0)"), + from_wkt("MULTIPOINT(1 0)") + ); + + tester::apply + ("mpli07", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(0 0,1 0)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpli08", + from_wkt("MULTIPOINT()"), + from_wkt("LINESTRING(0 0,1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpli09", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(-1 0,1 0)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpli10", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(1 0,3 0)"), + from_wkt("MULTIPOINT(2 0)") + ); + + tester::apply + ("mpli10a", + from_wkt("MULTIPOINT(2 0,0 0,2 0,0 0,2 0)"), + from_wkt("LINESTRING(1 0,3 0)"), + from_wkt("MULTIPOINT(2 0,2 0,2 0)") + ); + + tester::apply + ("mpli11", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(-1 0,3 0)"), + from_wkt("MULTIPOINT(2 0,0 0,0 0)") + ); + + tester::apply + ("mpli12", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(3 0,3 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpli13", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(2 0,2 0)"), + from_wkt("MULTIPOINT(2 0)") + ); + + tester::apply + ("mpli14", + from_wkt("MULTIPOINT(0 0,0 0,2 0)"), + from_wkt("LINESTRING(0 0,0 0)"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); + + tester::apply + ("mpli15", + from_wkt("MULTIPOINT()"), + from_wkt("LINESTRING(0 0,1 0,2 0,3 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpli16", + from_wkt("MULTIPOINT()"), + from_wkt("LINESTRING()"), + from_wkt("MULTIPOINT()") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_multipoint_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTIPOINT / MULTILINESTRING INTERSECTION ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef multi_point_type MP; + typedef multi_linestring_type ML; + + typedef test_set_op_of_pointlike_geometries + < + MP, ML, MP, bg::overlay_intersection + > tester; + + tester::apply + ("mpmli01", + from_wkt("MULTIPOINT(0 0,1 0,2 0)"), + from_wkt("MULTILINESTRING((1 0,1 1,1 1,4 4))"), + from_wkt("MULTIPOINT(1 0)") + ); + + tester::apply + ("mpmli02", + from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"), + from_wkt("MULTILINESTRING((1 0,1 1,1 1,4 4))"), + from_wkt("MULTIPOINT(2 2,2 2,3 3,1 1,1 1,1 0,1 0)") + ); + + tester::apply + ("mpmli03", + from_wkt("MULTIPOINT(5 5,3 3,0 0,0 0,5 5,1 1,1 1,1 0,1 0)"), + from_wkt("MULTILINESTRING((1 0,1 1,1 1,4 4))"), + from_wkt("MULTIPOINT(1 0,1 0,3 3,1 1,1 1)") + ); + + tester::apply + ("mpmli04", + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTILINESTRING((1 0,0 0,1 1,0 0))"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,1 1)") + ); + + tester::apply + ("mpmli05", + from_wkt("MULTIPOINT(0 0,1 0,2 0,5 0)"), + from_wkt("MULTILINESTRING((0 1,0 0,1 2,1 0),\ + (0 1,2 0,0 10,2 0,2 10,5 10,5 0,5 10))"), + from_wkt("MULTIPOINT(0 0,1 0,2 0,5 0)") + ); + + tester::apply + ("mpmli06", + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTILINESTRING(())"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpmli07", + from_wkt("MULTIPOINT()"), + from_wkt("MULTILINESTRING(())"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpmli08", + from_wkt("MULTIPOINT()"), + from_wkt("MULTILINESTRING((0 0,1 0),(9 0,10 0))"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpmli09", + from_wkt("MULTIPOINT(0 0,1 1,0 0,0 0,0 0,0 0,0 0,0 0,\ + 0 0,0 0,0 0,0 0,0 0)"), + from_wkt("MULTILINESTRING((0 0,0 1),(0 0,2 0),(0 0,0 3),\ + (0 0,4 0),(0 0,0 5),(0 0,6 0),(0 0,7 0),(0 0,8 0))"), + from_wkt("MULTIPOINT(0 0,0 0,0 0,0 0,0 0,0 0,0 0,\ + 0 0,0 0,0 0,0 0,0 0)") + ); + + tester::apply + ("mpmli09a", + from_wkt("MULTIPOINT(0 0,1 1,0 0)"), + from_wkt("MULTILINESTRING((0 0,0 1),(0 0,2 0),(0 0,0 3),\ + (0 0,4 0),(0 0,0 5),(0 0,6 0),(0 0,7 0),(0 0,8 0))"), + from_wkt("MULTIPOINT(0 0,0 0)") + ); +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_pl_pl.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_pl_pl.cpp new file mode 100644 index 000000000..e564040e4 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_pl_pl.cpp @@ -0,0 +1,201 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_intersection_pointlike_pointlike +#endif + +#ifdef BOOST_GEOMETRY_TEST_DEBUG +#define BOOST_GEOMETRY_DEBUG_TURNS +#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER +#endif + +#include + +#include "../test_set_ops_pointlike.hpp" + +#include + +typedef bg::model::point point_type; +typedef bg::model::multi_point multi_point_type; + + + +//=========================================================================== +//=========================================================================== +//=========================================================================== + + +BOOST_AUTO_TEST_CASE( test_intersection_point_point ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** POINT / POINT INTERSECTION ***" << std::endl; + std::cout << std::endl; +#endif + + typedef point_type P; + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + P, P, MP, bg::overlay_intersection + > tester; + + tester::apply + ("ppi01", + from_wkt

("POINT(0 0)"), + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("ppi02", + from_wkt

("POINT(0 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_multipoint_point ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTIPOINT / POINT INTERSECTION ***" << std::endl; + std::cout << std::endl; +#endif + + typedef point_type P; + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + MP, P, MP, bg::overlay_intersection + > tester; + + tester::apply + ("mppi01", + from_wkt("MULTIPOINT(0 0)"), + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mppi02", + from_wkt("MULTIPOINT(0 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("mppi03", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mppi04", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("mppi05", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mppi06", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt

("POINT(1 0)"), + from_wkt("MULTIPOINT(1 0)") + ); + + tester::apply + ("mppi07", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("mppi08", + from_wkt("MULTIPOINT()"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT()") + ); +} + + +BOOST_AUTO_TEST_CASE( test_intersection_multipoint_multipoint ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTIPOINT / MULTIPOINT INTERSECTION ***" << std::endl; + std::cout << std::endl; +#endif + + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + MP, MP, MP, bg::overlay_intersection + > tester; + + tester::apply + ("mpmpi01", + from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"), + from_wkt("MULTIPOINT(1 0,1 1,1 1,1 1)"), + from_wkt("MULTIPOINT(1 0,1 1,1 1,1 1)") + ); + + tester::apply + ("mpmp02", + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)") + ); + + tester::apply + ("mpmpi03", + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpmpi04", + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpmpi05", + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpmpi06", + from_wkt("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0)"), + from_wkt("MULTIPOINT(0 1,0 2,1 0,0 0,2 0)"), + from_wkt("MULTIPOINT(1 0,0 0,2 0)") + ); +} + diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_segment.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_segment.cpp new file mode 100644 index 000000000..664d37c9b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_segment.cpp @@ -0,0 +1,134 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +static std::ostream & operator<<(std::ostream &s, const bg::intersection_result& r) +{ + switch(r) + { + case bg::is_intersect_no : s << "is_intersect_no"; break; + case bg::is_intersect : s << "is_intersect"; break; + case bg::is_parallel : s << "is_parallel"; break; + case bg::is_collinear_no : s << "is_collinear_no"; break; + case bg::is_collinear_one : s << "is_collinear_one"; break; + case bg::is_collinear_connect : s << "is_collinear_connect"; break; + case bg::is_collinear_overlap : s << "is_collinear_overlap"; break; + case bg::is_collinear_overlap_opposite : s << "is_collinear_overlap_opposite"; break; + case bg::is_collinear_connect_opposite : s << "is_collinear_connect_opposite"; break; + + // detailed connection results: + case bg::is_intersect_connect_s1p1 : s << "is_intersect_connect_s1p1"; break; + case bg::is_intersect_connect_s1p2 : s << "is_intersect_connect_s1p2"; break; + case bg::is_intersect_connect_s2p1 : s << "is_intersect_connect_s2p1"; break; + case bg::is_intersect_connect_s2p2 : s << "is_intersect_connect_s2p2"; break; + } + return s; +} + +static std::string as_string(const bg::intersection_result& r) +{ + std::stringstream out; + out << r; + return out.str(); +} + +typedef bg::model::point P; +typedef bg::const_segment

S; + + +static void test_intersection(double s1x1, double s1y1, double s1x2, double s1y2, + double s2x1, double s2y1, double s2x2, double s2y2, + // Expected results + bg::intersection_result expected_result, + int exptected_count, const P& exp_p1, const P& exp_p2) +{ + S s1(P(s1x1, s1y1), P(s1x2, s1y2)); + S s2(P(s2x1, s2y1), P(s2x2, s2y2)); + std::vector

ip; + double ra, rb; + bg::intersection_result r = bg::intersection_s(s1, s2, ra, rb, ip); + r = bg::intersection_connect_result(r, ra, rb); + + BOOST_CHECK_EQUAL(ip.size(), exptected_count); + BOOST_CHECK_EQUAL(as_string(expected_result), as_string(r)); + + if (ip.size() == 2 && ip[0] != exp_p1) + { + // Swap results, second point is not as expected, swap results, order is not prescribed, + // it might be OK. + std::reverse(ip.begin(), ip.end()); + } + + if (ip.size() >= 1) + { + BOOST_CHECK_EQUAL(ip[0], exp_p1); + } + if (ip.size() >= 2) + { + BOOST_CHECK_EQUAL(ip[1], exp_p2); + } + + + /* + std::cout << exptected_count << " " << r; + if (exptected_count >= 1) std::cout << " " << ip[0]; + if (exptected_count >= 2) std::cout << " " << ip[1]; + std::cout << std::endl; + */ +} + +//BOOST_AUTO_TEST_CASE( test1 ) +int test_main( int , char* [] ) +{ + // Identical cases + test_intersection(0,0, 1,1, 0,0, 1,1, bg::is_collinear_overlap, 2, P(0,0), P(1,1)); + test_intersection(1,1, 0,0, 0,0, 1,1, bg::is_collinear_overlap_opposite, 2, P(1,1), P(0,0)); + test_intersection(0,1, 0,2, 0,1, 0,2, bg::is_collinear_overlap, 2, P(0,1), P(0,2)); // Vertical + test_intersection(0,2, 0,1, 0,1, 0,2, bg::is_collinear_overlap_opposite, 2, P(0,2), P(0,1)); // Vertical + // Overlap cases + test_intersection(0,0, 1,1, -0.5,-0.5, 2,2, bg::is_collinear_overlap, 2, P(0,0), P(1,1)); + test_intersection(0,0, 1,1, 0.5,0.5, 1.5,1.5, bg::is_collinear_overlap, 2, P(0.5,0.5), P(1,1)); + test_intersection(0,0, 0,1, 0,-10, 0,10, bg::is_collinear_overlap, 2, P(0,0), P(0,1)); // Vertical + test_intersection(0,0, 0,1, 0,10, 0,-10, bg::is_collinear_overlap_opposite, 2, P(0,0), P(0,1)); // Vertical + test_intersection(0,0, 1,1, 1,1, 2,2, bg::is_collinear_connect, 1, P(1,1), P(0,0)); // Single point + // Colinear, non overlap cases + test_intersection(0,0, 1,1, 1.5,1.5, 2.5,2.5, bg::is_collinear_no, 0, P(0,0), P(0,0)); + test_intersection(0,0, 0,1, 0,5, 0,6, bg::is_collinear_no, 0, P(0,0), P(0,0)); // Vertical + // Parallel cases + test_intersection(0,0, 1,1, 1,0, 2,1, bg::is_parallel, 0, P(0,0), P(0,1)); + // Intersect cases + test_intersection(0,2, 4,2, 3,0, 3,4, bg::is_intersect, 1, P(3,2), P(0,0)); + // Non intersect cases + + // Single point cases + test_intersection(0,0, 0,0, 1,1, 2,2, bg::is_collinear_no, 0, P(1,1), P(0,0)); // Colinear/no + test_intersection(2,2, 2,2, 1,1, 3,3, bg::is_collinear_one, 1, P(2,2.01), P(0,0)); // On segment + test_intersection(1,1, 3,3, 2,2, 2,2, bg::is_collinear_one, 1, P(2,2), P(0,0)); // On segment + test_intersection(1,1, 3,3, 1,1, 1,1, bg::is_collinear_one, 1, P(1,1), P(0,0)); // On segment, start + test_intersection(1,1, 3,3, 3,3, 3,3, bg::is_collinear_one, 1, P(3,3), P(0,0)); // On segment, end + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_tupled.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_tupled.cpp new file mode 100644 index 000000000..43283dddf --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/intersection_tupled.cpp @@ -0,0 +1,365 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2020, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +typedef bg::model::point Pt; +typedef bg::model::linestring Ls; +typedef bg::model::polygon Po; +typedef bg::model::ring R; +typedef bg::model::multi_point MPt; +typedef bg::model::multi_linestring MLs; +typedef bg::model::multi_polygon MPo; + +#ifdef BOOST_GEOMETRY_CXX11_TUPLE + +#include + +#endif + +template +inline void check(std::string const& wkt1, + std::string const& wkt2, + G const& g, + std::string const& expected) +{ + G expect; + bg::read_wkt(expected, expect); + bg::correct(expect); + if (! boost::empty(g) || ! boost::empty(expect)) + { + BOOST_CHECK_MESSAGE( + // Commented out becasue the output in reversed case may be slightly different + // e.g. different number of duplicated points in MultiPoint + //boost::size(g) == boost::size(expect) && + bg::equals(g, expect), + wkt1 << " x " << wkt2 << " -> " << bg::wkt(g) + << " different than expected: " << expected + ); + } +} + +inline void check(std::string const& wkt1, + std::string const& wkt2, + boost::tuple const& tup, + std::string const& out_p_str, + std::string const& out_l_str, + std::string const& out_a_str) +{ + check(wkt1, wkt2, boost::get<0>(tup), out_p_str); + check(wkt1, wkt2, boost::get<1>(tup), out_l_str); + check(wkt1, wkt2, boost::get<2>(tup), out_a_str); +} + +inline void check(std::string const& wkt1, + std::string const& wkt2, + std::pair const& pair, + std::string const& out_p_str, + std::string const& out_l_str, + std::string const& ) +{ + check(wkt1, wkt2, pair.first, out_p_str); + check(wkt1, wkt2, pair.second, out_l_str); +} + +#ifdef BOOST_GEOMETRY_CXX11_TUPLE + +inline void check(std::string const& wkt1, + std::string const& wkt2, + std::tuple const& tup, + std::string const& out_p_str, + std::string const& out_l_str, + std::string const& out_a_str) +{ + check(wkt1, wkt2, std::get<0>(tup), out_p_str); + check(wkt1, wkt2, std::get<1>(tup), out_l_str); + check(wkt1, wkt2, std::get<2>(tup), out_a_str); +} + +#endif + +template +inline void test_one(std::string const& in1_str, + std::string const& in2_str, + std::string const& out_p_str = "MULTIPOINT()", + std::string const& out_l_str = "MULTILINESTRING()", + std::string const& out_a_str = "MULTIPOLYGON()") +{ + In1 in1; + bg::read_wkt(in1_str, in1); + bg::correct(in1); + + In2 in2; + bg::read_wkt(in2_str, in2); + bg::correct(in2); + + { + Tup result; + bg::intersection(in1, in2, result); + check(in1_str, in2_str, result, out_p_str, out_l_str, out_a_str); + } + { + Tup result; + bg::intersection(in2, in1, result); + check(in1_str, in2_str, result, out_p_str, out_l_str, out_a_str); + } +} + +template +inline void test_pp() +{ + test_one( + "POINT(0 0)", + "POINT(0 0)", + "MULTIPOINT(0 0)"); + + test_one( + "POINT(0 0)", + "MULTIPOINT(0 0, 1 1)", + "MULTIPOINT(0 0)"); + + test_one( + "MULTIPOINT(0 0, 1 1, 2 2)", + "MULTIPOINT(1 1, 2 2, 3 3)", + "MULTIPOINT(1 1, 2 2)"); +} + +template +inline void test_pl() +{ + test_one( + "POINT(0 0)", + "LINESTRING(0 0, 1 1)", + "MULTIPOINT(0 0)"); + + test_one( + "POINT(1 1)", + "MULTILINESTRING((0 0, 1 1),(1 1, 2 2),(4 4, 5 5))", + "MULTIPOINT(1 1)"); + + test_one( + "MULTIPOINT(0 0, 1 1, 2 2, 3 3)", + "LINESTRING(0 0, 1 1)", + "MULTIPOINT(0 0, 1 1)"); + + test_one( + "MULTIPOINT(0 0, 1 1, 2 2, 3 3)", + "MULTILINESTRING((0 0, 1 1),(1 1, 2 2),(4 4, 5 5))", + "MULTIPOINT(0 0, 1 1, 2 2)"); +} + +template +inline void test_pa() +{ + test_one( + "POINT(0 0)", + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))", + "MULTIPOINT(0 0)"); + + test_one( + "POINT(0 0)", + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))", + "MULTIPOINT(0 0)"); + + test_one( + "POINT(0 0)", + "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0)),((0 0, 1 2, 2 2, 2 1, 0 0)))", + "MULTIPOINT(0 0)"); + + test_one( + "MULTIPOINT(0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6)", + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))", + "MULTIPOINT(0 0, 1 1, 2 2, 3 3, 4 4, 5 5)"); + + test_one( + "MULTIPOINT(0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6)", + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))", + "MULTIPOINT(0 0, 4 4, 5 5)"); + + test_one( + "MULTIPOINT(0 0, 0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6)", + "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0)),((0 0, 1 2, 2 2, 2 1, 0 0)))", + "MULTIPOINT(0 0, 0 0, 1 1, 2 2, 4 4, 5 5)"); // one (0 0) could be filtered out +} + +template +inline void test_ll() +{ + test_one( + "LINESTRING(0 0, 1 0, 2 1, 3 0)", + "LINESTRING(0 0, 1 0, 3 0, 4 0)", + "MULTIPOINT(3 0)", + "MULTILINESTRING((0 0, 1 0))"); + + test_one( + "LINESTRING(0 0, 1 0, 2 1, 3 0)", + "MULTILINESTRING((0 0, 1 0, 3 0),(2 1, 2 2))", + "MULTIPOINT(3 0, 2 1)", + "MULTILINESTRING((0 0, 1 0))"); + + test_one( + "MULTILINESTRING((0 0, 1 0, 2 1),(2 1, 3 0))", + "MULTILINESTRING((0 0, 1 0, 3 0),(2 1, 2 2))", + "MULTIPOINT(3 0, 2 1, 2 1)", // (2 1) could be filtered out + "MULTILINESTRING((0 0, 1 0))"); + + + test_one( + "LINESTRING(0 0, 0 5, 5 5, 5 0, 0 0)", + "LINESTRING(0 0, 0 1, 6 1, 5 2, 5 5, 5 6, 4 5, 4 7, 7 7, 7 0, 0 0)", + "MULTIPOINT(4 5, 5 1, 0 0)", // (0 0) could be filtered out + "MULTILINESTRING((0 0, 0 1), (5 5, 5 2), (5 0, 0 0))"); + + test_one( + "MULTILINESTRING((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))", + "MULTILINESTRING((0 0, 1 4, 5 4, 5 1, 4 1, 0 0),(0 0, 2 1, 2 2, 1 2, 0 0))", + // all (0 0) could be filtered out + "MULTIPOINT(0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0)", + "MULTILINESTRING((5 4,5 1),(0 0,4 1),(4 4,1 4,0 0))"); +} + +template +inline void test_la() +{ + test_one( + "LINESTRING(0 2, -4 1, 0 0, 5 0, 9 1, 5 2, 9 3, 5 5, 4 9, 4 5, 3 3, 2 5, 2 9, 0 5)", + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))", + "MULTIPOINT(0 2, 5 2, 5 5, 0 5)", + "MULTILINESTRING((0 0, 5 0),(4 5, 3 3, 2 5))"); + + test_one( + "LINESTRING(1 4, -4 1, 0 0, 5 0, 9 1, 5 2, 9 3, 5 5, 4 9, 4 5, 3 3, 2 5, 2 9, 0 5)", + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))", + "MULTIPOINT(5 2, 5 5, 0 5)", + "MULTILINESTRING((1 4, 0 3.4)(0 0, 5 0),(4 5, 3.5 4),(2.5 4, 2 5))"); + + test_one( + "MULTILINESTRING((0 2, -4 1, 0 0, 5 0, 9 1, 5 2, 9 3, 5 5, 4 9), (4 9, 4 5, 3 3, 2 5, 2 9, 0 5))", + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))", + "MULTIPOINT(0 2, 5 2, 5 5, 0 5)", + "MULTILINESTRING((0 0, 5 0),(4 5, 3 3, 2 5))"); + + test_one( + "MULTILINESTRING((1 4, -4 1, 0 0, 5 0, 9 1, 5 2, 9 3, 5 5, 4 9), (4 9, 4 5, 3 3, 2 5, 2 9, 0 5))", + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))", + "MULTIPOINT(5 2, 5 5, 0 5)", + "MULTILINESTRING((1 4, 0 3.4)(0 0, 5 0),(4 5, 3.5 4),(2.5 4, 2 5))"); + + test_one( + "MULTILINESTRING((1 4, -4 1, 0 0, 5 0, 9 1, 5 2, 9 3, 5 5, 4 9), (4 9, 4 5, 4 4, 2 2, 2 5, 1 9, 0 5))", + "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0)),((0 0, 1 2, 2 2, 2 1, 0 0)))", + "MULTIPOINT(5 2, 5 5, 2 2, 0 5)", + "MULTILINESTRING((1 4, 0 3.4)(0 0, 5 0),(4 5, 4 4),(2 4, 2 5))"); + + + test_one( + "LINESTRING(0 0, 0 5, 5 5, 5 0, 0 0)", + "POLYGON((0 0, 0 1, 6 1, 5 2, 5 5, 5 6, 4 5, 4 7, 7 7, 7 0, 0 0))", + "MULTIPOINT(4 5)", + "MULTILINESTRING((0 0, 0 1), (5 5, 5 2), (5 1, 5 0, 0 0))"); + + test_one( + "MULTILINESTRING((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))", + "POLYGON((0 0, 1 4, 5 4, 5 1, 4 1, 0 0),(0 0, 2 1, 2 2, 1 2, 0 0))", + "MULTIPOINT(0 0)", // (0 0) could be filtered out + "MULTILINESTRING((5 4, 5 1),(0 0, 4 1, 4 4, 1 4, 0 0))"); +} + +template +inline void test_aa() +{ + test_one( + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))", + "POLYGON((0 0, 0 1, 6 1, 5 2, 5 5, 5 6, 4 5, 4 7, 7 7, 7 0, 0 0))", + "MULTIPOINT(4 5)", + "MULTILINESTRING((5 2, 5 5))", + "MULTIPOLYGON(((0 0, 0 1, 5 1, 5 0, 0 0)))"); + + test_one( + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))", + "MULTIPOLYGON(((0 0, 0 1, 6 1, 6 0, 0 0))," + "((6 1, 5 2, 5 5, 5 6, 4 5, 4 7, 7 7, 7 1, 6 1)))", + "MULTIPOINT(4 5)", + "MULTILINESTRING((5 2, 5 5))", + "MULTIPOLYGON(((0 0, 0 1, 5 1, 5 0, 0 0)))"); + + test_one( + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))", + "POLYGON((0 0, 1 4, 5 4, 5 1, 4 1, 0 0),(0 0, 2 1, 2 2, 1 2, 0 0))", + // all (0 0) could be filtered out + "MULTIPOINT(0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0)", + "MULTILINESTRING((0 0, 1 4, 4 4),(0 0, 4 1))", + "MULTIPOLYGON(((4 1, 4 4, 5 4, 5 1, 4 1)))"); + + test_one( + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))", + "MULTIPOLYGON(((0 0, 1 4, 5 4, 5 1, 4 1, 0 0),(0 0, 2 1, 2 2, 1 2, 0 0))," + "((5 0, 5 1, 6 1, 6 4, 5 4, 3 6, 2 5, 2 7, 7 7, 7 0 5 0)))", + // all (0 0) and (5 0) could be filtered out + "MULTIPOINT(2 5, 5 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0)", + "MULTILINESTRING((0 0, 1 4, 4 4),(0 0, 4 1),(5 1, 5 0))", + "MULTIPOLYGON(((4 1, 4 4, 5 4, 5 1, 4 1)),((5 4, 4 5, 5 5, 5 4)))"); + + test_one( + "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0),(0 0, 4 1, 4 4, 1 4, 0 0))," + "((2 6, 2 8, 8 8, 8 5, 7 5, 7 6, 2 6)))", + "MULTIPOLYGON(((0 0, 1 4, 5 4, 5 1, 4 1, 0 0),(0 0, 2 1, 2 2, 1 2, 0 0))," + "((5 0, 5 1, 6 1, 6 4, 5 4, 3 6, 2 5, 2 7, 7 7, 7 0 5 0)))", + // all (0 0) and (5 0) could be filtered out + "MULTIPOINT(2 5, 5 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0)", + "MULTILINESTRING((0 0, 1 4, 4 4),(0 0, 4 1),(5 1, 5 0),(7 5, 7 6))", + "MULTIPOLYGON(((4 1, 4 4, 5 4, 5 1, 4 1))," + "((5 4, 4 5, 5 5, 5 4))," + "((2 6, 2 7, 7 7, 7 6, 2 6)))"); +} + +template +inline void test_pair() +{ + test_pp(); + test_pl(); + test_pa(); + test_ll(); + test_la(); +} + +template +inline void test_tuple() +{ + test_pp(); + test_pl(); + test_pa(); + test_ll(); + test_la(); + test_aa(); +} + +int test_main(int, char* []) +{ + test_pair >(); + test_tuple >(); + +#ifdef BOOST_GEOMETRY_CXX11_TUPLE + test_tuple >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/intersection/test_intersection.hpp b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/test_intersection.hpp new file mode 100644 index 000000000..836851009 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/test_intersection.hpp @@ -0,0 +1,390 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2016, 2017. +// Modifications copyright (c) 2016-2017, 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) + +#ifndef BOOST_GEOMETRY_TEST_INTERSECTION_HPP +#define BOOST_GEOMETRY_TEST_INTERSECTION_HPP + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + + +#if defined(TEST_WITH_SVG) +# include +#endif + +#include +#include +#include "../setop_output_type.hpp" + +struct ut_settings +{ + double percentage; + bool test_validity; + bool debug; + + explicit ut_settings(double p = 0.0001, bool tv = true) + : percentage(p) + , test_validity(tv) + , debug(false) + {} + +}; + +template +void check_result(IntersectionOutput const& intersection_output, + std::string const& caseid, + G1 const& g1, G2 const& g2, + std::size_t expected_count, std::size_t expected_holes_count, + int expected_point_count, double expected_length_or_area, + ut_settings const& settings) +{ + typedef typename boost::range_value::type OutputType; + bool const is_line = bg::geometry_id::type::value == 2; + + typename bg::default_area_result::type length_or_area = 0; + int n = 0; + std::size_t nholes = 0; + for (typename IntersectionOutput::const_iterator it = intersection_output.begin(); + it != intersection_output.end(); + ++it) + { + if (expected_point_count > 0) + { + // here n should rather be of type std::size_t, but expected_point_count + // is set to -1 in some test cases so type int was left for now + n += static_cast(bg::num_points(*it, true)); + } + + if (expected_holes_count > 0) + { + nholes += bg::num_interior_rings(*it); + } + + // instead of specialization we check it run-time here + length_or_area += is_line + ? bg::length(*it) + : bg::area(*it); + + if (settings.debug) + { + std::cout << std::setprecision(20) << bg::wkt(*it) << std::endl; + } + } + +#if ! defined(BOOST_GEOMETRY_TEST_ALWAYS_CHECK_VALIDITY) + if (settings.test_validity) +#endif + { + std::string message; + bool const valid = check_validity + ::apply(intersection_output, caseid, g1, g2, message); + + BOOST_CHECK_MESSAGE(valid, + "intersection: " << caseid << " not valid: " << message + << " type: " << (type_for_assert_message())); + } + +#if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST) +#if defined(BOOST_GEOMETRY_USE_RESCALING) + // Without rescaling, point count might easily differ (which is no problem) + if (expected_point_count > 0) + { + BOOST_CHECK_MESSAGE(bg::math::abs(n - expected_point_count) < 3, + "intersection: " << caseid + << " #points expected: " << expected_point_count + << " detected: " << n + << " type: " << (type_for_assert_message()) + ); + } +#endif + + if (expected_count > 0) + { + BOOST_CHECK_MESSAGE(intersection_output.size() == expected_count, + "intersection: " << caseid + << " #outputs expected: " << expected_count + << " detected: " << intersection_output.size() + << " type: " << (type_for_assert_message()) + ); + } + + if (expected_holes_count > 0) + { + + BOOST_CHECK_MESSAGE(nholes == expected_holes_count, + "intersection: " << caseid + << " #holes expected: " << expected_holes_count + << " detected: " << nholes + << " type: " << (type_for_assert_message()) + ); + } + + double const detected_length_or_area = boost::numeric_cast(length_or_area); + if (settings.percentage > 0.0) + { + if (expected_length_or_area > 0) + { + BOOST_CHECK_CLOSE(detected_length_or_area, expected_length_or_area, settings.percentage); + } + else + { + // Compare 0 with 0 or a very small detected area + BOOST_CHECK_LE(detected_length_or_area, settings.percentage); + } + } + else + { + // In some cases (geos_2) the intersection is either 0, or a tiny rectangle, + // depending on compiler/settings. That cannot be tested by CLOSE + BOOST_CHECK_LE(detected_length_or_area, expected_length_or_area); + } +#endif + +} + + +template +typename bg::default_area_result::type test_intersection(std::string const& caseid, + G1 const& g1, G2 const& g2, + std::size_t expected_count = 0, std::size_t expected_holes_count = 0, + int expected_point_count = 0, double expected_length_or_area = 0, + ut_settings const& settings = ut_settings()) +{ + if (settings.debug) + { + std::cout << std::endl << "case " << caseid << std::endl; + } + + typedef typename setop_output_type::type result_type; + + typedef typename bg::point_type::type point_type; + boost::ignore_unused(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + if (! settings.debug) + { + // Check _inserter behaviour with stratey + typedef typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy_type; + result_type clip; + bg::detail::intersection::intersection_insert(g1, g2, std::back_inserter(clip), strategy_type()); + } +#endif + + typename bg::default_area_result::type length_or_area = 0; + + // Check normal behaviour + result_type intersection_output; + bg::intersection(g1, g2, intersection_output); + + check_result(intersection_output, caseid, g1, g2, expected_count, + expected_holes_count, expected_point_count, expected_length_or_area, + settings); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + // Check variant behaviour + intersection_output.clear(); + bg::intersection(boost::variant(g1), g2, intersection_output); + + check_result(intersection_output, caseid, g1, g2, expected_count, + expected_holes_count, expected_point_count, expected_length_or_area, + settings); + + intersection_output.clear(); + bg::intersection(g1, boost::variant(g2), intersection_output); + + check_result(intersection_output, caseid, g1, g2, expected_count, + expected_holes_count, expected_point_count, expected_length_or_area, + settings); + + intersection_output.clear(); + bg::intersection(boost::variant(g1), boost::variant(g2), intersection_output); + + check_result(intersection_output, caseid, g1, g2, expected_count, + expected_holes_count, expected_point_count, expected_length_or_area, + settings); +#endif + +#if defined(TEST_WITH_SVG) + { + bool const is_line = bg::geometry_id::type::value == 2; + typedef typename bg::coordinate_type::type coordinate_type; + + bool const ccw = + bg::point_order::value == bg::counterclockwise + || bg::point_order::value == bg::counterclockwise; + bool const open = + bg::closure::value == bg::open + || bg::closure::value == bg::open; + + std::ostringstream filename; + filename << "intersection_" + << caseid << "_" + << string_from_type::name() + << string_from_type::name() + << (ccw ? "_ccw" : "") + << (open ? "_open" : "") +#if defined(BOOST_GEOMETRY_USE_RESCALING) + << "_rescaled" +#endif + << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 500, 500); + + mapper.add(g1); + mapper.add(g2); + + mapper.map(g1, is_line + ? "opacity:0.6;stroke:rgb(0,255,0);stroke-width:5" + : "fill-opacity:0.5;fill:rgb(153,204,0);" + "stroke:rgb(153,204,0);stroke-width:3"); + mapper.map(g2, "fill-opacity:0.3;fill:rgb(51,51,153);" + "stroke:rgb(51,51,153);stroke-width:3"); + + for (typename result_type::const_iterator it = intersection_output.begin(); + it != intersection_output.end(); ++it) + { + mapper.map(*it, "fill-opacity:0.2;stroke-opacity:0.4;fill:rgb(255,0,0);" + "stroke:rgb(255,0,255);stroke-width:8"); + } + } +#endif + + + if (settings.debug) + { + std::cout << "end case " << caseid << std::endl; + } + + return length_or_area; +} + +template +typename bg::default_area_result::type test_intersection(std::string const& caseid, + G1 const& g1, G2 const& g2, + std::size_t expected_count = 0, int expected_point_count = 0, + double expected_length_or_area = 0, + ut_settings const& settings = ut_settings()) +{ + return test_intersection( + caseid, g1, g2, expected_count, 0, expected_point_count, + expected_length_or_area, settings + ); +} + +template +typename bg::default_area_result::type test_one(std::string const& caseid, + std::string const& wkt1, std::string const& wkt2, + std::size_t expected_count = 0, std::size_t expected_holes_count = 0, + int expected_point_count = 0, double expected_length_or_area = 0, + ut_settings const& settings = ut_settings()) +{ + G1 g1; + bg::read_wkt(wkt1, g1); + + G2 g2; + bg::read_wkt(wkt2, g2); + + // Reverse if necessary + bg::correct(g1); + bg::correct(g2); + + return test_intersection(caseid, g1, g2, + expected_count, expected_holes_count, expected_point_count, + expected_length_or_area, settings); +} + +template +typename bg::default_area_result::type test_one(std::string const& caseid, + std::string const& wkt1, std::string const& wkt2, + std::size_t expected_count = 0, int expected_point_count = 0, + double expected_length_or_area = 0, + ut_settings const& settings = ut_settings()) +{ + return test_one(caseid, wkt1, wkt2, + expected_count, 0, expected_point_count, + expected_length_or_area, + settings); +} + +template +void test_one_lp(std::string const& caseid, + std::string const& wkt_areal, std::string const& wkt_linear, + std::size_t expected_count = 0, int expected_point_count = 0, + double expected_length = 0, + ut_settings const& settings = ut_settings()) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << caseid << " -- start" << std::endl; +#endif + Areal areal; + bg::read_wkt(wkt_areal, areal); + bg::correct(areal); + + Linear linear; + bg::read_wkt(wkt_linear, linear); + + test_intersection(caseid, areal, linear, + expected_count, expected_point_count, + expected_length, settings); + + // A linestring reversed should deliver exactly the same. + bg::reverse(linear); + + test_intersection(caseid + "_rev", areal, linear, + expected_count, expected_point_count, + expected_length, settings); +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << caseid << " -- end" << std::endl; +#endif +} + +template +void test_point_output(std::string const& wkt1, std::string const& wkt2, unsigned int expected_count) +{ + Geometry1 g1; + bg::read_wkt(wkt1, g1); + bg::correct(g1); + + Geometry2 g2; + bg::read_wkt(wkt2, g2); + bg::correct(g2); + + bg::model::multi_point::type> points; + bg::intersection(g1, g2, points); + BOOST_CHECK_EQUAL(points.size(), expected_count); +} + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/intersection/test_intersection_linear_linear.hpp b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/test_intersection_linear_linear.hpp new file mode 100644 index 000000000..f916b023c --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/intersection/test_intersection_linear_linear.hpp @@ -0,0 +1,260 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#ifndef BOOST_GEOMETRY_TEST_INTERSECTION_LINEAR_LINEAR_HPP +#define BOOST_GEOMETRY_TEST_INTERSECTION_LINEAR_LINEAR_HPP + +#include + +#include + +#include +#include "../test_set_ops_linear_linear.hpp" +#include +#include + + +//================================================================== +//================================================================== +// intersection of (linear) geometries +//================================================================== +//================================================================== + +template +inline void check_result(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_output, + MultiLineString const& mls_int1, + MultiLineString const& mls_int2, + std::string const& case_id, + double tolerance) +{ + BOOST_CHECK_MESSAGE( equals::apply(mls_int1, mls_output, tolerance) + || equals::apply(mls_int2, mls_output, tolerance), + "case id: " << case_id + << ", intersection L/L: " << bg::wkt(geometry1) + << " " << bg::wkt(geometry2) + << " -> Expected: " << bg::wkt(mls_int1) + << " or: " << bg::wkt(mls_int2) + << " computed: " << bg::wkt(mls_output) ); +} + +template +< + typename Geometry1, typename Geometry2, + typename MultiLineString +> +class test_intersection_of_geometries +{ +private: + static inline void base_test(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_int1, + MultiLineString const& mls_int2, + std::string const& case_id, + double tolerance, + bool test_vector_and_deque = false) + { + static bool vector_deque_already_tested = false; + + typedef typename boost::range_value::type LineString; + typedef std::vector linestring_vector; + typedef std::deque linestring_deque; + + MultiLineString mls_output; + + linestring_vector ls_vector_output; + linestring_deque ls_deque_output; + + // Check normal behaviour + bg::intersection(geometry1, geometry2, mls_output); + + check_result(geometry1, geometry2, mls_output, mls_int1, mls_int2, case_id, tolerance); + + // Check strategy passed explicitly + typedef typename bg::strategy::relate::services::default_strategy + < + Geometry1, Geometry2 + >::type strategy_type; + bg::clear(mls_output); + bg::intersection(geometry1, geometry2, mls_output, strategy_type()); + + check_result(geometry1, geometry2, mls_output, mls_int1, mls_int2, case_id, tolerance); + + set_operation_output("intersection", case_id, + geometry1, geometry2, mls_output); +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Geometry #1: " << bg::wkt(geometry1) << std::endl; + std::cout << "Geometry #2: " << bg::wkt(geometry2) << std::endl; + std::cout << "intersection : " << bg::wkt(mls_output) << std::endl; + std::cout << "expected intersection : " << bg::wkt(mls_int1) + << " or: " << bg::wkt(mls_int2) << std::endl; + std::cout << std::endl; + std::cout << "************************************" << std::endl; + std::cout << std::endl; + std::cout << std::endl; +#endif + + if ( !vector_deque_already_tested && test_vector_and_deque ) + { + vector_deque_already_tested = true; +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "Testing with vector and deque as output container..." + << std::endl; +#endif + bg::intersection(geometry1, geometry2, ls_vector_output); + bg::intersection(geometry1, geometry2, ls_deque_output); + + BOOST_CHECK(multilinestring_equals + < + false + >::apply(mls_int1, ls_vector_output, tolerance)); + + BOOST_CHECK(multilinestring_equals + < + false + >::apply(mls_int1, ls_deque_output, tolerance)); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Done!" << std::endl << std::endl; +#endif + } + + // check the intersection where the order of the two + // geometries is reversed + bg::clear(mls_output); + bg::intersection(geometry2, geometry1, mls_output); + + check_result(geometry1, geometry2, mls_output, mls_int1, mls_int2, case_id, tolerance); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Geometry #1: " << bg::wkt(geometry2) << std::endl; + std::cout << "Geometry #2: " << bg::wkt(geometry1) << std::endl; + std::cout << "intersection : " << bg::wkt(mls_output) << std::endl; + std::cout << "expected intersection : " << bg::wkt(mls_int1) + << " or: " << bg::wkt(mls_int2) << std::endl; + std::cout << std::endl; + std::cout << "************************************" << std::endl; + std::cout << std::endl; + std::cout << std::endl; +#endif + } + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + static inline void base_test_all(Geometry1 const& geometry1, + Geometry2 const& geometry2) + { + typedef typename bg::point_type::type Point; + typedef bg::model::multi_point multi_point; + + MultiLineString mls12_output, mls21_output; + multi_point mp12_output, mp21_output; + + bg::intersection(geometry1, geometry2, mls12_output); + bg::intersection(geometry1, geometry2, mp12_output); + bg::intersection(geometry2, geometry1, mls21_output); + bg::intersection(geometry2, geometry1, mp21_output); + + std::cout << "************************************" << std::endl; + std::cout << "Geometry #1: " << bg::wkt(geometry1) << std::endl; + std::cout << "Geometry #2: " << bg::wkt(geometry2) << std::endl; + std::cout << "intersection(1,2) [MLS]: " << bg::wkt(mls12_output) + << std::endl; + std::cout << "intersection(2,1) [MLS]: " << bg::wkt(mls21_output) + << std::endl; + std::cout << std::endl; + std::cout << "intersection(1,2) [MP]: " << bg::wkt(mp12_output) + << std::endl; + std::cout << "intersection(2,1) [MP]: " << bg::wkt(mp21_output) + << std::endl; + std::cout << std::endl; + std::cout << "************************************" << std::endl; + std::cout << std::endl; + std::cout << std::endl; + } +#else + static inline void base_test_all(Geometry1 const&, Geometry2 const&) + { + } +#endif + + +public: + static inline void apply(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_int1, + MultiLineString const& mls_int2, + std::string const& case_id, + double tolerance + = std::numeric_limits::epsilon()) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "test case: " << case_id << std::endl; + std::stringstream sstr; + sstr << "svgs/" << case_id << ".svg"; +#ifdef TEST_WITH_SVG + to_svg(geometry1, geometry2, sstr.str()); +#endif +#endif + + Geometry1 rg1(geometry1); + bg::reverse(rg1); + + Geometry2 rg2(geometry2); + bg::reverse(rg2); + + typedef typename bg::tag_cast + < + Geometry1, bg::linear_tag + >::type tag1_type; + + typedef typename bg::tag_cast + < + Geometry2, bg::linear_tag + >::type tag2_type; + + bool const are_linear + = boost::is_same::value + && boost::is_same::value; + + test_get_turns_ll_invariance::apply(geometry1, geometry2); +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl + << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" + << std::endl << std::endl; +#endif + test_get_turns_ll_invariance::apply(rg1, geometry2); + + base_test(geometry1, geometry2, mls_int1, mls_int2, case_id, tolerance); + // base_test(rg1, rg2, mls_int1, mls_int2); + base_test_all(geometry1, geometry2); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << std::endl; +#endif + } + + + + static inline void apply(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_int, + std::string const& case_id, + double tolerance + = std::numeric_limits::epsilon()) + { + apply(geometry1, geometry2, mls_int, mls_int, case_id, tolerance); + } +}; + + +#endif // BOOST_GEOMETRY_TEST_INTERSECTION_LINEAR_LINEAR_HPP diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/set_ops_ll.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/set_ops_ll.cpp new file mode 100644 index 000000000..c3311a054 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/set_ops_ll.cpp @@ -0,0 +1,17 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_set_ops_linear_linear +#endif + +#include "intersection_linear_linear.cpp" +#include "union_linear_linear.cpp" +#include "difference_linear_linear.cpp" +#include "sym_difference_linear_linear.cpp" diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/set_ops_pp.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/set_ops_pp.cpp new file mode 100644 index 000000000..725737e1b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/set_ops_pp.cpp @@ -0,0 +1,16 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_set_ops_pointlike_pointlike +#endif + +#include "intersection_pl_pl.cpp" +#include "union_pl_pl.cpp" +#include "difference_pl_pl.cpp" diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/setop_output_type.hpp b/src/boost/libs/geometry/test/algorithms/set_operations/setop_output_type.hpp new file mode 100644 index 000000000..2233cb255 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/setop_output_type.hpp @@ -0,0 +1,43 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2016, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_TEST_SETOP_OUTPUT_TYPE_HPP +#define BOOST_GEOMETRY_TEST_SETOP_OUTPUT_TYPE_HPP + +#include + +#include +#include + +#include + +template ::type> +struct setop_output_type +{ + typedef std::vector type; +}; + +template +struct setop_output_type +{ + typedef bg::model::multi_polygon type; +}; + +template +struct setop_output_type +{ + typedef bg::model::multi_linestring type; +}; + +template +struct setop_output_type +{ + typedef bg::model::multi_point type; +}; + +#endif // BOOST_GEOMETRY_TEST_SETOP_OUTPUT_TYPE_HPP diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/Jamfile b/src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/Jamfile new file mode 100644 index 000000000..72bbeeab2 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/Jamfile @@ -0,0 +1,21 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015. +# Modifications copyright (c) 2014-2015, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-sym_difference + : + [ run sym_difference_areal_areal.cpp : : : : algorithms_sym_difference_areal_areal ] + [ run sym_difference_linear_linear.cpp : : : : algorithms_sym_difference_linear_linear ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/sym_difference_areal_areal.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/sym_difference_areal_areal.cpp new file mode 100644 index 000000000..b0b386c1f --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/sym_difference_areal_areal.cpp @@ -0,0 +1,140 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2015 Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_sym_difference_areal_areal +#endif + +#ifdef BOOST_GEOMETRY_TEST_DEBUG +#define BOOST_GEOMETRY_DEBUG_TURNS +#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER +#endif + +#include + +#include +#include +#include + +#include "../difference/test_difference.hpp" +#include + +typedef bg::model::point point_type; +typedef bg::model::ring ring_type; // ccw, closed +typedef bg::model::polygon polygon_type; // ccw, closed +typedef bg::model::multi_polygon multi_polygon_type; + +double const default_tolerance = 0.0001; + +template +< + typename Areal1, typename Areal2, typename PolygonOut +> +struct test_sym_difference_of_areal_geometries +{ + static inline void apply(std::string const& case_id, + Areal1 const& areal1, + Areal2 const& areal2, + int expected_polygon_count, + int expected_point_count, + double expected_area, + double tolerance = default_tolerance) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + bg::model::multi_polygon sdf; + + bg::sym_difference(areal1, areal2, sdf); + + std::cout << "Case ID: " << case_id << std::endl; + std::cout << "Geometry #1: " << bg::wkt(areal1) << std::endl; + std::cout << "Geometry #2: " << bg::wkt(areal2) << std::endl; + std::cout << "Sym diff: " << bg::wkt(sdf) << std::endl; + std::cout << "Polygon count: expected: " + << expected_polygon_count + << "; detected: " << sdf.size() << std::endl; + std::cout << "Point count: expected: " + << expected_point_count + << "; detected: " << bg::num_points(sdf) << std::endl; + std::cout << "Area: expected: " + << expected_area + << "; detected: " << bg::area(sdf) << std::endl; +#endif + ut_settings settings; + settings.percentage = tolerance; + + test_difference + < + PolygonOut + >(case_id, areal1, areal2, + expected_polygon_count, expected_point_count, expected_area, + true, settings); + } +}; + + +//=========================================================================== +//=========================================================================== +//=========================================================================== + + +BOOST_AUTO_TEST_CASE( test_sym_difference_ring_ring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** RING / RING SYMMETRIC DIFFERENCE ***" << std::endl; + std::cout << std::endl; +#endif + + typedef ring_type R; + typedef polygon_type PG; + + typedef test_sym_difference_of_areal_geometries tester; + + tester::apply("r-r-sdf00", + from_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0))"), + from_wkt("POLYGON((10 0,10 20,20 20,20 0,10 0))"), + 1, + 8, + 300); + + tester::apply("r-r-sdf01", + from_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0))"), + from_wkt("POLYGON((9 0,9 20,20 20,20 0,9 0))"), + 2, + 12, + 300); +} + + +BOOST_AUTO_TEST_CASE( test_sym_difference_polygon_multipolygon ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** POLYGON / MULTIPOLYGON SYMMETRIC DIFFERENCE ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef polygon_type PG; + typedef multi_polygon_type MPG; + + typedef test_sym_difference_of_areal_geometries tester; + + tester::apply + ("pg-mpg-sdf00", + from_wkt("POLYGON((10 0,10 10,20 10,20 0,10 0))"), + from_wkt("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),\ + ((20 0,20 10,30 10,30 0,20 0)))"), + 1, + 6, + 300); +} + diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/sym_difference_linear_linear.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/sym_difference_linear_linear.cpp new file mode 100644 index 000000000..93ff46e1a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/sym_difference_linear_linear.cpp @@ -0,0 +1,989 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2015 Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_sym_difference_linear_linear +#endif + +#ifdef BOOST_GEOMETRY_TEST_DEBUG +#define BOOST_GEOMETRY_DEBUG_TURNS +#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER +#endif + +#include + +#include "test_sym_difference_linear_linear.hpp" + +#include +#include +#include + +typedef bg::model::point point_type; +typedef bg::model::segment segment_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_linestring multi_linestring_type; + + + +//=========================================================================== +//=========================================================================== +//=========================================================================== + + +BOOST_AUTO_TEST_CASE( test_sym_difference_linestring_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** LINESTRING / LINESTRING SYMMETRIC DIFFERENCE ***" << std::endl; + std::cout << std::endl; +#endif + + typedef linestring_type L; + typedef multi_linestring_type ML; + + typedef test_sym_difference_of_geometries tester; + + tester::apply + (from_wkt("LINESTRING(0 0,1 1,2 1,3 2)"), + from_wkt("LINESTRING(0 2,1 1,2 1,3 0)"), + from_wkt("MULTILINESTRING((0 0,1 1),(2 1,3 2),\ + (0 2,1 1),(2 1,3 0))"), + "llsdf00"); + + tester::apply + (from_wkt("LINESTRING(0 0,5 0)"), + from_wkt("LINESTRING(3 0,4 0)"), + from_wkt("MULTILINESTRING((0 0,3 0),(4 0,5 0))"), + "llsdf01"); + + tester::apply + (from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("LINESTRING(3 0,6 0)"), + from_wkt("MULTILINESTRING((0 0,3 0),(4 0,6 0))"), + "llsdf01-1"); + + tester::apply + (from_wkt("LINESTRING(0 0,6 0)"), + from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("MULTILINESTRING((4 0,6 0))"), + "llsdf01-2"); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("LINESTRING(0 0,1 1,2 0,3 1,4 0,5 0,6 1,7 -1,8 0)"), + from_wkt("MULTILINESTRING((0 0,4 0),(5 0,20 0),\ + (0 0,1 1,2 0,3 1,4 0),(5 0,6 1,7 -1,8 0))"), + "llsdf01-3"); + + tester::apply + (from_wkt("LINESTRING(-20 0,20 0)"), + from_wkt("LINESTRING(0 0,1 1,2 0,3 1,4 0,5 0,6 1,7 -1,8 0)"), + from_wkt("MULTILINESTRING((-20 0,4 0),(5 0,20 0),\ + (0 0,1 1,2 0,3 1,4 0),(5 0,6 1,7 -1,8 0))"), + "llsdf01-4"); + + tester::apply + (from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("LINESTRING(2 0,4 0)"), + from_wkt("MULTILINESTRING((0 0,2 0))"), + "llsdf01-5"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("LINESTRING(4 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,5 0))"), + "llsdf01-6"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("LINESTRING(2 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,2 0),(2 0,5 0))"), + "llsdf01-7"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,4 0)"), + from_wkt("LINESTRING(3 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,1 0,3 0),(4 0,5 0))"), + "llsdf01-8"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,4 0)"), + from_wkt("LINESTRING(3 0,4 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,1 0,3 0),(4 0,5 0))"), + "llsdf01-9"); + + tester::apply + (from_wkt("LINESTRING(0 0,6 0)"), + from_wkt("LINESTRING(2 0,4 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,2 0),(5 0,6 0))"), + "llsdf01-10"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,5 5,10 5,15 0)"), + from_wkt("LINESTRING(-1 6,0 5,15 5)"), + from_wkt("MULTILINESTRING((0 0,1 0,5 5),(10 5,15 0),\ + (-1 6,0 5,5 5),(10 5,15 5))"), + "llsdf02"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (-1 0,0 0),(1 0,15 0),(20 0,30 0))"), + "llsdf03"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,5 5,10 5,15 0,20 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((1 0,5 5,10 5,15 0),\ + (-1 0,0 0),(1 0,15 0),(20 0,30 0))"), + "llsdf04"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,25 1)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (20 0,25 1),(-1 0,0 0),(1 0,15 0),(20 0,30 0))"), + "llsdf05"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,30 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (-1 0,0 0),(1 0,15 0))"), + "llsdf05-1"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (30 0,31 0),(-1 0,0 0),(1 0,15 0))"), + "llsdf06"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0)"), + from_wkt("LINESTRING(-1 0,25 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (30 0,31 0),(-1 0,0 0),(1 0,15 0))"), + "llsdf07"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0)"), + from_wkt("LINESTRING(-1 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (30 0,31 0),(-1 0,0 0),(1 0,15 0))"), + "llsdf08"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,30 0,31 1)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (30 0,31 1),(-1 0,0 0),(1 0,15 0))"), + "llsdf09"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,30 0,31 1)"), + from_wkt("LINESTRING(-1 -1,0 0,1 0,2 1,3 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(1 0,5 5,10 5,15 0),\ + (30 0,31 1),(-1 -1,0 0),(1 0,2 1,3 0,15 0))"), + "llsdf10"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,20 0,\ + 30 0,31 1)"), + from_wkt("LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(2 0,3 0),\ + (4 0,5 5,10 5,15 0),(30 0,31 1),(-1 -1,0 0),\ + (2 0,2.5 1,3 0),(4 0,15 0))"), + "llsdf11"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)"), + from_wkt("LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0),(2 0,3 0),\ + (4 0,5 5,10 5,15 0),(30 0,31 0),(-1 -1,0 0),\ + (2 0,2.5 1,3 0),(4 0,15 0))"), + "llsdf11-1"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0,3 1)"), + from_wkt("LINESTRING(0 0,2 0,3 1)"), + from_wkt("MULTILINESTRING()"), + "llsdf12"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0,3 1)"), + from_wkt("LINESTRING(3 1,2 0,0 0)"), + from_wkt("MULTILINESTRING()"), + "llsdf12-1"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 5,4 0)"), + from_wkt("LINESTRING(1 0,2 1,3 5,4 0,5 10)"), + from_wkt("MULTILINESTRING((0 0,1 0),(4 0,5 10))"), + "llsdf13"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)"), + from_wkt("LINESTRING(0 0,2 0,2.5 0,3 1)"), + from_wkt("MULTILINESTRING()"), + "llsdf14"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 5,4 0)"), + from_wkt("LINESTRING(1 0,2 1,3 5)"), + from_wkt("MULTILINESTRING((0 0,1 0),(3 5,4 0))"), + "llsdf15"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 2)"), + from_wkt("LINESTRING(0.5 0,1 0,3 2,4 5)"), + from_wkt("MULTILINESTRING((0 0,0.5 0),(3 2,4 5))"), + "llsdf16"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 2)"), + from_wkt("LINESTRING(4 5,3 2,1 0,0.5 0)"), + from_wkt("MULTILINESTRING((0 0,0.5 0),(4 5,3 2))"), + "llsdf16-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1,30 1)"), + from_wkt("LINESTRING(1 1,2 0,3 1,20 1,25 1)"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(25 1,30 1),\ + (1 1,2 0,3 1,20 1))"), + "llsdf17"); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1,21 0,30 0)"), + from_wkt("LINESTRING(1 1,2 0,3 1,20 1,25 0)"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1,21 0,30 0),\ + (1 1,2 0,3 1,20 1,25 0))"), + "llsdf18"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 1)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0),\ + (5 0,20 1,4 1,4 0,5 1))"), + "llsdf19"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(5 1,4 0,4 1,20 1,5 0,1 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0),\ + (5 1,4 0,4 1,20 1,5 0))"), + "llsdf19-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0),\ + (5 0,20 1,4 1,4 0))"), + "llsdf19a"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(4 0,4 1,20 1,5 0,1 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0),\ + (4 0,4 1,20 1,5 0))"), + "llsdf19a-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0),\ + (5 0,20 1,4 1,4 0))"), + "llsdf19b"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0,6 1)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0),\ + (5 0,20 1,4 1,4 0),(5 0,6 1))"), + "llsdf19c"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,3 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0),\ + (5 0,20 1,4 1,4 0))"), + "llsdf19d"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,3 0,3 1)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0),\ + (5 0,20 1,4 1,4 0),(3 0,3 1))"), + "llsdf19e"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0,5 1)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0),\ + (5 0,20 1,4 1,4 0),(5 0,5 1))"), + "llsdf19f"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(5 1,5 0,4 0,4 1,20 1,5 0,1 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0),\ + (5 1,5 0),(4 0,4 1,20 1,5 0))"), + "llsdf19f-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,5 0,5 1)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0),\ + (5 0,20 1,4 1,5 0,5 1))"), + "llsdf19g"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(5 1,5 0,4 1,20 1,5 0,1 0)"), + from_wkt("MULTILINESTRING((0 0,1 0),(5 0,30 0),\ + (5 1,5 0,4 1,20 1,5 0))"), + "llsdf19g-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0,30 30,10 30,10 -10,15 0,40 0)"), + from_wkt("LINESTRING(5 5,10 0,10 30,20 0,25 0,25 25,50 0,35 0)"), + from_wkt("MULTILINESTRING((0 0,20 0),(25 0,30 0,30 30,10 30),\ + (10 0,10 -10,15 0,20 0),(25 0,35 0),\ + (5 5,10 0),(10 30,20 0),(25 0,25 25,50 0,40 0))"), + "llsdf20"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0,30 30,10 30,10 -10,15 0,40 0)"), + from_wkt("LINESTRING(5 5,10 0,10 30,20 0,25 0,25 25,50 0,15 0)"), + from_wkt("MULTILINESTRING((0 0,15 0),(30 0,30 30,10 30),\ + (10 0,10 -10,15 0),(5 5,10 0),(10 30,20 0),\ + (25 0,25 25,50 0,40 0))"), + "llsdf20a"); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("LINESTRING(2 2,5 -1,15 2,18 0,20 0)"), + from_wkt("MULTILINESTRING((0 0,18 0),(20 0,30 0),\ + (2 2,5 -1,15 2,18 0))"), + "llsdf21" + ); + + tester::apply + (from_wkt("LINESTRING(0 -3,5 4,6 6,-3 2,-3 0,-3 -10,9 -2,\ + 9 5,5 -5,-4 -8,9 0)"), + from_wkt("LINESTRING(-3 6,-3 0,-3 5,2 -3,-6 10,5 0,\ + 2 8,-6 1,10 -6)"), + from_wkt("MULTILINESTRING((0 -3,5 4,6 6,-3 2),\ + (-3 0,-3 -10,9 -2,9 5,5 -5,-4 -8,9 0),(-3 6,-3 2),\ + (-3 2,-3 5,2 -3,-6 10,5 0,2 8,-6 1,10 -6))"), + "llsdf22" + ); +} + + + +BOOST_AUTO_TEST_CASE( test_sym_difference_linestring_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** LINESTRING / MULTILINESTRING SYMMETRIC DIFFERENCE ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef linestring_type L; + typedef multi_linestring_type ML; + + typedef test_sym_difference_of_geometries tester; + + // disjoint linestrings + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 2,4 3),(1 1,2 2,5 3))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),\ + (1 1,2 2,4 3),(1 1,2 2,5 3))"), + "lmlsdf01" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,4 0))"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,10 0,20 1),\ + (1 1,2 0),(1 1,3 0))"), + "lmlsdf02" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,5 0))"), + from_wkt("MULTILINESTRING((0 0,2 0),(5 0,10 0,20 1),\ + (1 1,2 0),(1 1,3 0))"), + "lmlsdf03" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0))"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,10 0,20 1),\ + (1 1,2 0))"), + "lmlsdf04" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,101 0)"), + from_wkt("MULTILINESTRING((-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(-1 -1,1 0),(101 0,200 -1))"), + "lmlsdf07" + ); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,101 0)"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((-1 1,0 0),(-1 -1,0 0),\ + (19 -1,20 0),(101 0,200 -1))"), + "lmlsdf07a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,101 0)"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((-1 -1,0 0),(19 -1,20 0),\ + (101 0,200 -1))"), + "lmlsdf07b" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,101 0)"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(0 1,1 1,2 0),\ + (-1 -1,1 0),(101 0,200 -1))"), + "lmlsdf08" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 0.5,3 0,101 0)"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0,2 0.5,3 0),\ + (0 1,1 1,2 0.5),(-1 -1,1 0,3 0),(101 0,200 -1))"), + "lmlsdf09" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,1.5 0,2 0.5,3 0,101 0)"), + from_wkt("MULTILINESTRING((0 1,1 1,1 0,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(1.5 0,2 0.5,3 0),\ + (0 1,1 1,1 0,2 0.5),(-1 -1,1 0),(1.5 0,3 0),\ + (101 0,200 -1))"), + "lmlsdf10" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (1 1,2 0,18 0,19 1),(2 1,3 0,17 0,18 1),\ + (3 1,4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (0 1,1 0),(19 0,20 1),(1 1,2 0),(18 0,19 1),\ + (2 1,3 0),(17 0,18 1),(3 1,4 0),(16 0,17 1))"), + "lmlsdf12" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((1 0,19 0,20 1),\ + (2 0,18 0,19 1),(3 0,17 0,18 1),\ + (4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (19 0,20 1),(18 0,19 1),(17 0,18 1),(16 0,17 1))"), + "lmlsdf13" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((1 0,19 0),(2 0,18 0),(3 0,17 0),\ + (4 0,16 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "lmlsdf13a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (0 1,1 0),(19 0,20 1,19 1,18 0),(2 0,1 1,2 1,3 0),\ + (17 0,18 1,17 1,16 0),(4 0,3 1))"), + "lmlsdf14" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,6 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (0 1,1 0),(19 0,20 1),(2 2,4 2,6 0))"), + "lmlsdf15" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (0 1,1 0),(19 0,20 1),(6 0,4 2,2 2))"), + "lmlsdf15a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,5 0,6 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (0 1,1 0),(19 0,20 1),(2 2,4 2,5 0))"), + "lmlsdf16" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,5 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (0 1,1 0),(19 0,20 1),(5 0,4 2,2 2))"), + "lmlsdf16a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0),\ + (0 1,1 0),(19 0,20 1),(2 2,4 0,5 2,20 2,25 0))"), + "lmlsdf17" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0,26 2))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0),\ + (0 1,1 0),(19 0,20 1),(2 2,4 0,5 2,20 2,25 0,26 2))"), + "lmlsdf17a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0),\ + (0 1,1 0),(19 0,20 1),(2 2,5 -1,15 2,18 0))"), + "lmlsdf18" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0),\ + (0 1,1 0),(19 0,20 1),(2 2,5 -1,15 2,18 0))"), + "lmlsdf18a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0,20 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(20 0,30 0),\ + (0 1,1 0),(19 0,20 1),(2 2,5 -1,15 2,18 0))"), + "lmlsdf18b" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,25 0,26 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,25 0),(26 0,30 0),\ + (0 1,1 0),(19 0,20 1),(2 2,5 -1,15 2,25 0))"), + "lmlsdf18c" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,25 0,21 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,21 0),(25 0,30 0),\ + (0 1,1 0),(19 0,20 1),(2 2,5 -1,15 2,25 0))"), + "lmlsdf18d" + ); + +#ifdef BOOST_GEOMETRY_TEST_FAILURES + tester::apply + (from_wkt("LINESTRING(1 5,4 2,1 -1.1,1 6,1 189.7654,2 5,-0.7654 3)"), + from_wkt("MULTILINESTRING((2 5,-0.7654 2),\ + (-1032.34324 4,1 5,9 7,3 9,0.2 5,1 -0.3),\ + (1 0.9,1 6,1 -0.6,2.232432 -0.7654,0.9 3,1 5,\ + -0.7654 9,3 0.1,9 0,-6 8,-0.7 8,0 1,-1032.34324 0))"), + from_wkt("MULTILINESTRING((2 5,-0.7654 2),\ + (-1032.34324 4,1 5,9 7,3 9,0.2 5,1 -0.3),\ + (1 -0.6,2.232432 -0.7654,0.9 3,1 5,-0.7654 9,\ + 3 0.1,9 0,-6 8,-0.7 8,0 1,-1032.34324 0),\ + (1 5,4 2,1 -1.1,1 -0.6),\ + (1 6,1 189.7654,2 5,-0.7654 3))"), + "lmlsdf19", + 1e-10 + ); +#endif +} + + + + +BOOST_AUTO_TEST_CASE( test_sym_difference_multilinestring_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTILINESTRING / LINESTRING SYMMETRIC DIFFERENCE ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef linestring_type L; + typedef multi_linestring_type ML; + + typedef test_sym_difference_of_geometries tester; + + // disjoint linestrings + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("LINESTRING(1 1,2 2,4 3)"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0),\ + (1 1,2 2,4 3))"), + "mllsdf01" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("LINESTRING(1 1,2 0,4 0)"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,10 0,20 1),\ + (1 0,2 0),(4 0,7 0),(1 1,2 0))"), + "mllsdf02" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("LINESTRING(-1 -1,1 0,101 0,200 -1)"), + from_wkt("MULTILINESTRING((0 0,1 0),(-1 -1,1 0),(101 0,200 -1))"), + "mllsdf03" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("LINESTRING(0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1)"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (0 1,1 0),(19 0,20 1,19 1,18 0),(2 0,1 1,2 1,3 0),\ + (17 0,18 1,17 1,16 0),(4 0,3 1))"), + "mllsdf04" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 -3,5 4,6 6,-3 2,-3 0,\ + -3 -10,9 -2,9 5,5 -5,-4 -8,9 0),\ + (-7 9,-4 -9,-5 -10,5 3),\ + (-8 -3,-6 6,-9 0,-4 -3,-1 -10),\ + (0 1,7 -1,-2 3,-7 1),\ + (-5 -9,-4 -10,7 -10,0 -6,1 6,2 -1,1 5,-5 -5))"), + from_wkt("LINESTRING(-3 6,-3 0,-3 5,2 -3,-6 10,5 0,2 8,\ + -6 1,10 -6)"), + from_wkt("MULTILINESTRING((0 -3,5 4,6 6,-3 2),\ + (-3 0,-3 -10,9 -2,9 5,5 -5,-4 -8,9 0),\ + (-7 9,-4 -9,-5 -10,5 3),\ + (-8 -3,-6 6,-9 0,-4 -3,-1 -10),\ + (0 1,7 -1,-2 3,-7 1),\ + (-5 -9,-4 -10,7 -10,0 -6,1 6,2 -1,1 5,-5 -5),\ + (-3 6,-3 2),(-3 2,-3 5,2 -3,-6 10,5 0,2 8,-6 1,10 -6))"), + "mllsdf05" + ); +} + + + + + + +BOOST_AUTO_TEST_CASE( test_sym_difference_multilinestring_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTILINESTRING / MULTILINESTRING SYMMETRIC DIFFERENCE ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef multi_linestring_type ML; + + typedef test_sym_difference_of_geometries tester; + + // disjoint linestrings + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 2,4 3),(1 1,2 2,5 3))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0),\ + (1 1,2 2,4 3),(1 1,2 2,5 3))"), + "mlmlsdf01" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,4 0))"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,10 0,20 1),\ + (1 0,2 0),(4 0,7 0),(1 1,2 0),(1 1,3 0))"), + "mlmlsdf02" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,5 0))"), + from_wkt("MULTILINESTRING((0 0,2 0),(5 0,10 0,20 1),\ + (1 0,2 0),(5 0,7 0),(1 1,2 0),(1 1,3 0))"), + "mlmlsdf03" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0))"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,10 0,20 1),\ + (1 0,2 0),(4 0,7 0),(1 1,2 0))"), + "mlmlsdf04" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0),\ + (10 10,20 10,30 20))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (10 20,15 10,25 10,30 15))"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,10 0,20 1),\ + (1 0,2 0),(4 0,7 0),(10 10,15 10),(20 10,30 20),\ + (1 1,2 0),(10 20,15 10),(20 10,25 10,30 15))"), + "mlmlsdf05" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0),\ + (10 10,20 10,30 20))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (-1 -1,0 0,9 0,11 10,12 10,13 0.3,14 0.4,15 0.5),\ + (10 20,15 10,25 10,30 15))"), + from_wkt("MULTILINESTRING((9 0,10 0,13 0.3),(15 0.5,20 1),\ + (10 10,11 10),(12 10,15 10),(20 10,30 20),\ + (1 1,2 0),(-1 -1,0 0),(9 0,11 10),(12 10,13 0.3),\ + (10 20,15 10),(20 10,25 10,30 15))"), + "mlmlsdf06", + 4.0 * std::numeric_limits::epsilon() + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 10),(1 0,7 0),\ + (10 10,20 10,30 20))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (-1 -1,0 0,9 0,11 10,12 10,13 3,14 4,15 5),\ + (10 20,15 10,25 10,30 15))"), + from_wkt("MULTILINESTRING((9 0,10 0,13 3),(15 5,20 10),\ + (10 10,11 10),(12 10,15 10),(20 10,30 20),\ + (1 1,2 0),(-1 -1,0 0),(9 0,11 10),(12 10,13 3),\ + (10 20,15 10),(20 10,25 10,30 15))"), + "mlmlsdf06a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(-1 -1,1 0),\ + (101 0,200 -1))"), + "mlmlsdf07" + ); + + tester::apply + (from_wkt("MULTILINESTRING((-1 1,0 0,101 0))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((-1 1,0 0),(-1 -1,0 0),\ + (19 -1,20 0),(101 0,200 -1))"), + "mlmlsdf07a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((-1 -1,0 0),(19 -1,20 0),\ + (101 0,200 -1))"), + "mlmlsdf07b" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(0 1,1 1,2 0),\ + (-1 -1,1 0),(101 0,200 -1))"), + "mlmlsdf08" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 0,2 0.5,3 0,101 0))"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0,2 0.5,3 0),(0 1,1 1,2 0.5),\ + (-1 -1,1 0,3 0),(101 0,200 -1))"), + "mlmlsdf09" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 0,1.5 0,2 0.5,3 0,101 0))"), + from_wkt("MULTILINESTRING((0 1,1 1,1 0,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(1.5 0,2 0.5,3 0),\ + (0 1,1 1,1 0,2 0.5),(-1 -1,1 0),(1.5 0,3 0),\ + (101 0,200 -1))"), + "mlmlsdf10" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 1,100 1,101 0),\ + (0 0,101 0))"), + from_wkt("MULTILINESTRING((1 0,1 1,2 1,3 0,4 0,5 1,6 1,\ + 7 0,8 0,9 1,10 1,11 0,12 0,13 1,14 1,15 0),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 1),(2 1,5 1),(6 1,9 1),\ + (10 1,13 1),(14 1,100 1,101 0),(0 0,1 0),\ + (1 0,1 1),(2 1,3 0),(4 0,5 1),(6 1,7 0),\ + (8 0,9 1),(10 1,11 0),(12 0,13 1),(14 1,15 0),\ + (-1 -1,1 0),(101 0,200 -1))"), + "mlmlsdf11" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (1 1,2 0,18 0,19 1),(2 1,3 0,17 0,18 1),\ + (3 1,4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (0 1,1 0),(19 0,20 1),(1 1,2 0),(18 0,19 1),\ + (2 1,3 0),(17 0,18 1),(3 1,4 0),(16 0,17 1))"), + "mlmlsdf12" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((1 0,19 0,20 1),\ + (2 0,18 0,19 1),(3 0,17 0,18 1),\ + (4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (19 0,20 1),(18 0,19 1),(17 0,18 1),(16 0,17 1))"), + "mlmlsdf13" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((1 0,19 0),(2 0,18 0),(3 0,17 0),\ + (4 0,16 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0))"), + "mlmlsdf13a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (0 1,1 0),(19 0,20 1,19 1,18 0),(2 0,1 1,2 1,3 0),\ + (17 0,18 1,17 1,16 0),(4 0,3 1))"), + "mlmlsdf14" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,6 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (0 1,1 0),(19 0,20 1),(2 2,4 2,6 0))"), + "mlmlsdf15" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (0 1,1 0),(19 0,20 1),(6 0,4 2,2 2))"), + "mlmlsdf15a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,5 0,6 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (0 1,1 0),(19 0,20 1),(2 2,4 2,5 0))"), + "mlmlsdf16" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,5 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,20 0),\ + (0 1,1 0),(19 0,20 1),(5 0,4 2,2 2))"), + "mlmlsdf16a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0),\ + (0 1,1 0),(19 0,20 1),(2 2,4 0,5 2,20 2,25 0))"), + "mlmlsdf17" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0,26 2))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0),\ + (0 1,1 0),(19 0,20 1),(2 2,4 0,5 2,20 2,25 0,26 2))"), + "mlmlsdf17a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0),\ + (0 1,1 0),(19 0,20 1),(2 2,5 -1,15 2,18 0))"), + "mlmlsdf18" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,18 0,19 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 0,1 0),(19 0,30 0),\ + (0 1,1 0),(19 0,20 1),(2 2,5 -1,15 2,18 0))"), + "mlmlsdf18a" + ); +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/test_sym_difference_linear_linear.hpp b/src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/test_sym_difference_linear_linear.hpp new file mode 100644 index 000000000..843345247 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/sym_difference/test_sym_difference_linear_linear.hpp @@ -0,0 +1,196 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#ifndef BOOST_GEOMETRY_TEST_SYM_DIFFERENCE_LINEAR_LINEAR_HPP +#define BOOST_GEOMETRY_TEST_SYM_DIFFERENCE_LINEAR_LINEAR_HPP + +#include + +#include +#include "../test_set_ops_linear_linear.hpp" +#include +#include + + +//================================================================== +//================================================================== +// symmetric difference of (linear) geometries +//================================================================== +//================================================================== + +template +inline void check_result(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_output, + MultiLineString const& mls_sym_diff, + std::string const& case_id, + double tolerance) +{ + BOOST_CHECK_MESSAGE( equals::apply(mls_sym_diff, mls_output, tolerance), + "case id: " << case_id + << ", sym diff L/L: " << bg::wkt(geometry1) + << " " << bg::wkt(geometry2) + << " -> Expected: " << bg::wkt(mls_sym_diff) + << " computed: " << bg::wkt(mls_output) ); +} + +template +< + typename Geometry1, typename Geometry2, + typename MultiLineString +> +class test_sym_difference_of_geometries +{ +private: + static inline void base_test(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_sym_diff, + std::string const& case_id, + double tolerance, + bool test_vector_and_deque = false) + { + static bool vector_deque_already_tested = false; + + typedef typename boost::range_value::type LineString; + typedef std::vector linestring_vector; + typedef std::deque linestring_deque; + + MultiLineString mls_output; + + linestring_vector ls_vector_output; + linestring_deque ls_deque_output; + + // Check strategy passed explicitly + typedef typename bg::strategy::relate::services::default_strategy + < + Geometry1, Geometry2 + >::type strategy_type; + bg::sym_difference(geometry1, geometry2, mls_output, strategy_type()); + + check_result(geometry1, geometry2, mls_output, mls_sym_diff, case_id, tolerance); + + // Check normal behaviour + bg::clear(mls_output); + bg::sym_difference(geometry1, geometry2, mls_output); + + check_result(geometry1, geometry2, mls_output, mls_sym_diff, case_id, tolerance); + + set_operation_output("sym_difference", case_id, + geometry1, geometry2, mls_output); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Geometry #1: " << bg::wkt(geometry1) << std::endl; + std::cout << "Geometry #2: " << bg::wkt(geometry2) << std::endl; + std::cout << "sym_difference : " << bg::wkt(mls_output) << std::endl; + std::cout << "expected sym_difference : " << bg::wkt(mls_sym_diff) + << std::endl; + std::cout << std::endl; + std::cout << "************************************" << std::endl; + std::cout << std::endl; + std::cout << std::endl; +#endif + + if ( !vector_deque_already_tested && test_vector_and_deque ) + { + vector_deque_already_tested = true; +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "Testing with vector and deque as output container..." + << std::endl; +#endif + bg::sym_difference(geometry1, geometry2, ls_vector_output); + bg::sym_difference(geometry1, geometry2, ls_deque_output); + + BOOST_CHECK(multilinestring_equals + < + false + >::apply(mls_sym_diff, ls_vector_output, tolerance)); + + BOOST_CHECK(multilinestring_equals + < + false + >::apply(mls_sym_diff, ls_deque_output, tolerance)); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Done!" << std::endl << std::endl; +#endif + } + + // check the symmetric difference where the order of the two + // geometries is reversed + bg::clear(mls_output); + bg::sym_difference(geometry2, geometry1, mls_output); + + BOOST_CHECK_MESSAGE( equals::apply(mls_sym_diff, mls_output, tolerance), + "case id: " << case_id + << ", sym diff L/L: " << bg::wkt(geometry2) + << " " << bg::wkt(geometry1) + << " -> Expected: " << bg::wkt(mls_sym_diff) + << " computed: " << bg::wkt(mls_output) ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Geometry #1: " << bg::wkt(geometry2) << std::endl; + std::cout << "Geometry #2: " << bg::wkt(geometry1) << std::endl; + std::cout << "sym_difference : " << bg::wkt(mls_output) << std::endl; + std::cout << "expected sym_difference : " << bg::wkt(mls_sym_diff) + << std::endl; + std::cout << std::endl; + std::cout << "************************************" << std::endl; + std::cout << std::endl; + std::cout << std::endl; +#endif + } + + +public: + static inline void apply(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_sym_diff, + std::string const& case_id, + double tolerance + = std::numeric_limits::epsilon()) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "test case: " << case_id << std::endl; + std::stringstream sstr; + sstr << "svgs/" << case_id << ".svg"; +#ifdef TEST_WITH_SVG + to_svg(geometry1, geometry2, sstr.str()); +#endif +#endif + + Geometry1 rg1(geometry1); + bg::reverse(rg1); + + Geometry2 rg2(geometry2); + bg::reverse(rg2); + + test_get_turns_ll_invariance<>::apply(geometry1, geometry2); +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl + << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" + << std::endl << std::endl; +#endif + test_get_turns_ll_invariance<>::apply(rg1, geometry2); + + base_test(geometry1, geometry2, mls_sym_diff, case_id, tolerance, true); + // base_test(geometry1, rg2, mls_sym_diff); + // base_test(rg1, geometry2, mls_sym_diff); + base_test(rg1, rg2, mls_sym_diff, case_id, tolerance); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << std::endl; +#endif + } +}; + + +#endif // BOOST_GEOMETRY_TEST_SYM_DIFFERENCE_LINEAR_LINEAR_HPP diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/test_get_turns_ll_invariance.hpp b/src/boost/libs/geometry/test/algorithms/set_operations/test_get_turns_ll_invariance.hpp new file mode 100644 index 000000000..22b01cab2 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/test_get_turns_ll_invariance.hpp @@ -0,0 +1,189 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014, 2019, 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_TEST_GET_TURNS_LL_INVARIANCE_HPP +#define BOOST_GEOMETRY_TEST_GET_TURNS_LL_INVARIANCE_HPP + +#include + +#include + +#include + +#include + +#include +#include +#include +#include + +#include + + +namespace bg = ::boost::geometry; +namespace bg_detail = ::boost::geometry::detail; +namespace bg_turns = bg_detail::turns; + +template +< + bool Enable = true, + bool EnableRemoveDuplicateTurns = true, + bool EnableDegenerateTurns = true +> +class test_get_turns_ll_invariance +{ +private: + struct assign_policy + { + static bool const include_no_turn = false; + static bool const include_degenerate = EnableDegenerateTurns; + static bool const include_opposite = false; + + template + < + typename Info, + typename Point1, + typename Point2, + typename IntersectionInfo + > + static inline void apply(Info& , Point1 const& , Point2 const& , + IntersectionInfo const&) + { + } + }; + + + + template + < + typename Turns, + typename LinearGeometry1, + typename LinearGeometry2 + > + static inline void compute_turns(Turns& turns, + LinearGeometry1 const& linear1, + LinearGeometry2 const& linear2) + { + turns.clear(); + bg_detail::relate::turns::get_turns + < + LinearGeometry1, + LinearGeometry2, + bg_detail::get_turns::get_turn_info_type + < + LinearGeometry1, + LinearGeometry2, + assign_policy + > + >::apply(turns, linear1, linear2); + } + + + +public: + template + static inline void apply(Linear1 const& lineargeometry1, + Linear2 const& lineargeometry2) + { + typedef typename bg::strategy::relate::services::default_strategy + < + Linear1, Linear2 + >::type strategy_type; + + typedef typename bg_detail::relate::turns::get_turns + < + Linear1, Linear2 + >::template turn_info_type::type turn_info; + + typedef std::vector turns_container; + + typedef bg_turns::filter_continue_turns + < + turns_container, true + > filter_continue_turns; + + typedef bg_turns::remove_duplicate_turns + < + turns_container, EnableRemoveDuplicateTurns + > remove_duplicate_turns; + + turns_container turns; + + Linear1 linear1(lineargeometry1); + Linear2 linear2(lineargeometry2); + + Linear2 linear2_reverse(linear2); + boost::geometry::reverse(linear2_reverse); + + turns_container turns_all, rturns_all; + compute_turns(turns_all, linear1, linear2); + compute_turns(rturns_all, linear1, linear2_reverse); + + turns_container turns_wo_cont(turns_all); + turns_container rturns_wo_cont(rturns_all); + + filter_continue_turns::apply(turns_wo_cont); + filter_continue_turns::apply(rturns_wo_cont); + + std::sort(boost::begin(turns_all), boost::end(turns_all), + bg_turns::less_seg_fraction_other_op<>()); + + std::sort(boost::begin(turns_wo_cont), boost::end(turns_wo_cont), + bg_turns::less_seg_fraction_other_op<>()); + + std::sort(boost::begin(rturns_all), boost::end(rturns_all), + bg_turns::less_seg_fraction_other_op >()); + + std::sort(boost::begin(rturns_wo_cont), boost::end(rturns_wo_cont), + bg_turns::less_seg_fraction_other_op >()); + + remove_duplicate_turns::apply(turns_all); + remove_duplicate_turns::apply(turns_wo_cont); + remove_duplicate_turns::apply(rturns_all); + remove_duplicate_turns::apply(rturns_wo_cont); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "### ORIGINAL TURNS ###" << std::endl; + bg_turns::print_turns(linear1, linear2, turns_all); + std::cout << std::endl << std::endl; + std::cout << "### ORIGINAL REVERSE TURNS ###" << std::endl; + bg_turns::print_turns(linear1, linear2_reverse, rturns_all); + std::cout << std::endl << std::endl; + std::cout << "### TURNS W/O CONTINUE TURNS ###" << std::endl; + bg_turns::print_turns(linear1, linear2, turns_wo_cont); + std::cout << std::endl << std::endl; + std::cout << "### REVERSE TURNS W/O CONTINUE TURNS ###" << std::endl; + bg_turns::print_turns(linear1, linear2_reverse, rturns_wo_cont); + std::cout << std::endl << std::endl; +#endif + + BOOST_CHECK_MESSAGE(boost::size(turns_wo_cont) == boost::size(rturns_wo_cont), + "Incompatible turns count: " << boost::size(turns_wo_cont) << + " and " << boost::size(rturns_wo_cont) << + " for L1: " << bg::wkt(lineargeometry1) << + ", L2: " << bg::wkt(lineargeometry2)); + } +}; + +template +class test_get_turns_ll_invariance +< + false, EnableRemoveDuplicateTurns, EnableDegenerateTurns +> +{ +public: + template + static inline void apply(Linear1 const&, Linear2 const&) + { + } +}; + +#endif // BOOST_GEOMETRY_TEST_GET_TURNS_LL_INVARIANCE_HPP diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/test_set_ops_linear_linear.hpp b/src/boost/libs/geometry/test/algorithms/set_operations/test_set_ops_linear_linear.hpp new file mode 100644 index 000000000..a8749b42b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/test_set_ops_linear_linear.hpp @@ -0,0 +1,381 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#ifndef BOOST_GEOMETRY_TEST_SET_OPS_LINEAR_LINEAR_HPP +#define BOOST_GEOMETRY_TEST_SET_OPS_LINEAR_LINEAR_HPP + + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "test_get_turns_ll_invariance.hpp" + +namespace bg = ::boost::geometry; + + + +template +struct ls_less +{ + typedef typename boost::range_iterator::type Iterator1; + typedef typename boost::range_iterator::type Iterator2; + + typedef bg::less::type> point_less; + + bool operator()(Linestring1 const& linestring1, + Linestring2 const& linestring2) const + { + if (boost::size(linestring1) != boost::size(linestring2)) + { + return boost::size(linestring1) < boost::size(linestring2); + } + + Iterator1 it1 = boost::begin(linestring1); + Iterator2 it2 = boost::begin(linestring2); + point_less less; + for (; it1 != boost::end(linestring1); ++it1, ++it2) + { + if (less(*it1, *it2)) + { + return true; + } + if (less(*it2, *it1)) + { + return false; + } + } + return false; + } +}; + + +template +struct ls_equal +{ + bool operator()(Linestring1 const& linestring1, + Linestring2 const& linestring2) const + { + ls_less less; + + return ! less(linestring1, linestring2) + && ! less(linestring2, linestring1); + } +}; + + +template +class pt_equal +{ +private: + double m_tolerence; + + template + static inline T const& get_max(T const& a, T const& b, T const& c) + { + return (std::max)((std::max)(a, b), c); + } + + template + static inline bool check_close(T const& a, T const& b, T const& tol) + { + return (a == b) + || (std::abs(a - b) <= tol * get_max(std::abs(a), std::abs(b), 1.0)); + } + +public: + pt_equal(double tolerence) : m_tolerence(tolerence) {} + + bool operator()(Point1 const& point1, Point2 const& point2) const + { + // allow for some tolerence in testing equality of points + return check_close(bg::get<0>(point1), bg::get<0>(point2), m_tolerence) + && check_close(bg::get<1>(point1), bg::get<1>(point2), m_tolerence); + } +}; + + +template +struct multilinestring_equals +{ + template + struct unique + { + typedef typename boost::range_value::type Linestring; + typedef typename bg::point_type::type point_type; + typedef ls_equal linestring_equal; + typedef pt_equal point_equal; + + template + void apply_to_range(Range& range, EqualTo const& equal_to) + { + range.erase(std::unique(boost::begin(range), boost::end(range), + equal_to), + boost::end(range)); + } + + void operator()(MultiLinestring& mls, double tolerance) + { + for (typename boost::range_iterator::type it + = boost::begin(mls); it != boost::end(mls); ++it) + { + apply_to_range(*it, point_equal(tolerance)); + } + apply_to_range(mls, linestring_equal()); + } + }; + + template + struct unique + { + void operator()(MultiLinestring&, double) + { + } + }; + + template + static inline + bool apply(MultiLinestring1 const& multilinestring1, + MultiLinestring2 const& multilinestring2, + double tolerance) + { + typedef typename boost::range_iterator + < + MultiLinestring1 const + >::type ls1_iterator; + + typedef typename boost::range_iterator + < + MultiLinestring2 const + >::type ls2_iterator; + + typedef typename boost::range_value::type Linestring1; + + typedef typename boost::range_value::type Linestring2; + + typedef typename boost::range_iterator + < + Linestring1 const + >::type point1_iterator; + + typedef typename boost::range_iterator + < + Linestring2 const + >::type point2_iterator; + + typedef ls_less linestring_less; + + typedef pt_equal + < + typename boost::range_value + < + typename boost::range_value::type + >::type, + typename boost::range_value + < + typename boost::range_value::type + >::type + > point_equal; + + + MultiLinestring1 mls1 = multilinestring1; + MultiLinestring2 mls2 = multilinestring2; + + std::sort(boost::begin(mls1), boost::end(mls1), linestring_less()); + std::sort(boost::begin(mls2), boost::end(mls2), linestring_less()); + + unique()(mls1, tolerance); + unique()(mls2, tolerance); + + if (boost::size(mls1) != boost::size(mls2)) + { + return false; + } + + ls1_iterator it1 = boost::begin(mls1); + ls2_iterator it2 = boost::begin(mls2); + for (; it1 != boost::end(mls1); ++it1, ++it2) + { + if (boost::size(*it1) != boost::size(*it2)) + { + return false; + } + point1_iterator pit1 = boost::begin(*it1); + point2_iterator pit2 = boost::begin(*it2); + for (; pit1 != boost::end(*it1); ++pit1, ++pit2) + { + if (! point_equal(tolerance)(*pit1, *pit2)) + { + return false; + } + } + } + return true; + } +}; + + + + +class equals +{ +private: + template + static inline OutputIterator + isolated_point_to_segment(Linestring const& linestring, OutputIterator oit) + { + BOOST_ASSERT( boost::size(linestring) == 1 ); + + *oit++ = *boost::begin(linestring); + *oit++ = *boost::begin(linestring); + return oit; + } + + + template + static inline OutputIterator + convert_isolated_points_to_segments(MultiLinestring const& multilinestring, + OutputIterator oit) + { + BOOST_AUTO_TPL(it, boost::begin(multilinestring)); + + for (; it != boost::end(multilinestring); ++it) + { + if (boost::size(*it) == 1) + { + typename boost::range_value::type linestring; + isolated_point_to_segment(*it, std::back_inserter(linestring)); + *oit++ = linestring; + } + else + { + *oit++ = *it; + } + } + return oit; + } + + + template + static inline bool apply_base(MultiLinestring1 const& multilinestring1, + MultiLinestring2 const& multilinestring2, + double tolerance) + { + typedef multilinestring_equals mls_equals; + + if (mls_equals::apply(multilinestring1, multilinestring2, tolerance)) + { + return true; + } + + MultiLinestring1 reverse_multilinestring1 = multilinestring1; + bg::reverse(reverse_multilinestring1); + if (mls_equals::apply(reverse_multilinestring1, + multilinestring2, + tolerance)) + { + return true; + } + + MultiLinestring2 reverse_multilinestring2 = multilinestring2; + bg::reverse(reverse_multilinestring2); + if (mls_equals::apply(multilinestring1, + reverse_multilinestring2, + tolerance)) + { + return true; + } + + return mls_equals::apply(reverse_multilinestring1, + reverse_multilinestring2, + tolerance); + } + + + +public: + template + static inline bool apply(MultiLinestring1 const& multilinestring1, + MultiLinestring2 const& multilinestring2, + double tolerance) + { +#ifndef BOOST_GEOMETRY_ALLOW_ONE_POINT_LINESTRINGS + MultiLinestring1 converted_multilinestring1; + convert_isolated_points_to_segments + (multilinestring1, std::back_inserter(converted_multilinestring1)); + MultiLinestring2 converted_multilinestring2; + convert_isolated_points_to_segments + (multilinestring2, std::back_inserter(converted_multilinestring2)); + return apply_base(converted_multilinestring1, + converted_multilinestring2, tolerance); +#else + return apply_base(multilinestring1, multilinestring2, tolerance); +#endif + } +}; + + + + +template +void set_operation_output(std::string const& set_op_id, + std::string const& caseid, + G1 const& g1, G2 const& g2, + Output const& output) +{ + boost::ignore_unused(set_op_id, caseid, g1, g2, output); + +#if defined(TEST_WITH_SVG) + typedef typename bg::coordinate_type::type coordinate_type; + typedef typename bg::point_type::type point_type; + + std::ostringstream filename; + filename << "svgs/" << set_op_id << "_" << caseid << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 500, 500); + + mapper.add(g1); + mapper.add(g2); + + mapper.map(g2, "stroke-opacity:1;stroke:rgb(153,204,0);stroke-width:4"); + mapper.map(g1, "stroke-opacity:1;stroke:rgb(51,51,153);stroke-width:2"); + + BOOST_AUTO_TPL(it, output.begin()); + for (; it != output.end(); ++it) + { + if ( boost::size(*it) == 2 + && bg::equals(*boost::begin(*it), *++boost::begin(*it)) ) + { + // draw isolated points (generated by the intersection operation) + mapper.map(*boost::begin(*it), + "fill:rgb(255,0,255);stroke:rgb(0,0,0);stroke-width:1", + 4); + } + else + { + mapper.map(*it, + "stroke-opacity:0.4;stroke:rgb(255,0,255);stroke-width:8"); + } + } +#endif +} + + +#endif // BOOST_GEOMETRY_TEST_SET_OPS_LINEAR_LINEAR_HPP diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/test_set_ops_pointlike.hpp b/src/boost/libs/geometry/test/algorithms/set_operations/test_set_ops_pointlike.hpp new file mode 100644 index 000000000..6908aa552 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/test_set_ops_pointlike.hpp @@ -0,0 +1,352 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2020, 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_TEST_SET_OPS_POINTLIKE_HPP +#define BOOST_GEOMETRY_TEST_SET_OPS_POINTLIKE_HPP + + +#include + +namespace bg = ::boost::geometry; + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + + +//================================================================== +//================================================================== +// svg output +//================================================================== +//================================================================== + +template +void set_operation_output(std::string const& set_op_id, + std::string const& caseid, + G1 const& g1, G2 const& g2, + Output const& output) +{ + boost::ignore_unused(set_op_id, caseid, g1, g2, output); + +#if defined(TEST_WITH_SVG) + typedef typename bg::coordinate_type::type coordinate_type; + typedef typename bg::point_type::type point_type; + + std::ostringstream filename; + filename << "svgs/" << set_op_id << "_" << caseid << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 500, 500); + + mapper.add(g1); + mapper.add(g2); + + mapper.map(g2, "stroke-opacity:1;stroke:rgb(153,204,0);stroke-width:4"); + mapper.map(g1, "stroke-opacity:1;stroke:rgb(51,51,153);stroke-width:2"); + + BOOST_AUTO_TPL(it, output.begin()); + for (; it != output.end(); ++it) + { + mapper.map(*it, + "fill:rgb(255,0,255);stroke:rgb(0,0,0);stroke-width:1", + 4); + } +#endif +} + + +//================================================================== +//================================================================== +// testing equality of multi-points +//================================================================== +//================================================================== + + +struct equals +{ + template + static inline bool apply(MultiPoint1 const& multipoint1, + MultiPoint2 const& multipoint2) + { + MultiPoint1 mp1(multipoint1); + MultiPoint2 mp2(multipoint2); + + std::sort(mp1.begin(), mp1.end(), + bg::less::type>()); + std::sort(mp2.begin(), mp2.end(), + bg::less::type>()); + + if ( boost::size(mp1) != boost::size(mp2) ) + { + return false; + } + + BOOST_AUTO_TPL(it1, boost::begin(mp1)); + BOOST_AUTO_TPL(it2, boost::begin(mp2)); + for (; it1 != boost::end(mp1); ++it1, ++it2) + { + if ( !bg::equals(*it1, *it2) ) + { + return false; + } + } + return true; + } +}; + + + +//================================================================== +//================================================================== +// struct for calling the appropriate set op function +//================================================================== +//================================================================== + +template struct set_op; + + +template<> +struct set_op +{ + static inline std::string name() { return "difference"; } + + template + static inline void apply(Geometry1 const& g1, + Geometry2 const& g2, + GeometryOut& gout) + { + bg::difference(g1, g2, gout); + } +}; + + +template<> +struct set_op +{ + static inline std::string name() { return "union"; } + + template + static inline void apply(Geometry1 const& g1, + Geometry2 const& g2, + GeometryOut& gout) + { + bg::union_(g1, g2, gout); + } +}; + + +template<> +struct set_op +{ + static inline std::string name() { return "intersection"; } + + template + static inline void apply(Geometry1 const& g1, + Geometry2 const& g2, + GeometryOut& gout) + { + bg::intersection(g1, g2, gout); + } +}; + + +template +< + typename Geometry, + typename Tag = typename bg::tag::type +> struct geometry_info +{}; + +template +struct geometry_info +{ + static std::size_t const topological_dimension = 0; + + static inline char const* name() { return "Pt"; } +}; + +template +struct geometry_info +{ + static std::size_t const topological_dimension = 0; + + static inline char const* name() { return "MPt"; } +}; + +template +struct geometry_info +{ + static std::size_t const topological_dimension = 1; + + static inline char const* name() { return "L"; } +}; + +template +struct geometry_info +{ + static std::size_t const topological_dimension = 1; + + static inline char const* name() { return "ML"; } +}; + +template +struct geometry_info +{ + static std::size_t const topological_dimension = 1; + + static inline char const* name() { return "S"; } +}; + +template +struct geometry_info +{ + static std::size_t const topological_dimension = 2; + + static inline char const* name() { return "R"; } +}; + +template +struct geometry_info +{ + static std::size_t const topological_dimension = 2; + + static inline char const* name() { return "Po"; } +}; + +template +struct geometry_info +{ + static std::size_t const topological_dimension = 2; + + static inline char const* name() { return "MPo"; } +}; + +//================================================================== +//================================================================== +// test the set operation of (point-like) geometries +//================================================================== +//================================================================== + + +template +< + typename Geometry1, + typename Geometry2, + typename MultiPoint, + bg::overlay_type OverlayType +> +class test_set_op_of_pointlike_geometries +{ +private: + template + struct base_test + { + template + static inline void apply(std::string const& case_id, + G1 const& geometry1, + G2 const& geometry2, + MP const& mp_expected) + { + MultiPoint mp_output; + + set_op::apply(geometry1, geometry2, mp_output); + + std::string op_name = set_op::name(); + + BOOST_CHECK_MESSAGE(equals::apply(mp_expected, mp_output), + "case ID: " << case_id << ", " + << op_name << " " + << geometry_info::name() << "/" + << geometry_info::name() << ": " + << bg::wkt(geometry1) + << " " << bg::wkt(geometry2) + << " -> Expected: " << bg::wkt(mp_expected) + << " computed: " << bg::wkt(mp_output) ); + + set_operation_output(op_name, case_id, + geometry1, geometry2, mp_output); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Geometry #1: " << bg::wkt(geometry1) << std::endl; + std::cout << "Geometry #2: " << bg::wkt(geometry2) << std::endl; + std::cout << "expected " << op_name << " : " + << bg::wkt(mp_expected) << std::endl; + std::cout << op_name << " : " << bg::wkt(mp_output) << std::endl; + std::cout << std::endl; + std::cout << "************************************" << std::endl; + std::cout << std::endl; + std::cout << std::endl; +#endif + } + }; + + template + struct base_test + { + template + static inline void apply(std::string const&, G1 const&, G2 const&, + MP const&) + { + } + }; + +public: + static inline void apply(std::string const& case_id, + Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiPoint const& mp_expected12, + MultiPoint const& mp_expected21) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "test case: " << case_id << std::endl; +#endif + + base_test::apply(case_id, geometry1, geometry2, mp_expected12); + // try the same set operation with the arguments' order + // reversed only if the two geometries are of the same + // topological dimension + base_test + < + (geometry_info::topological_dimension + == geometry_info::topological_dimension) + >::apply(case_id, geometry2, geometry1, mp_expected21); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << std::endl; +#endif + } + + static inline void apply(std::string const& case_id, + Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiPoint const& mp_expected) + { + apply(case_id, geometry1, geometry2, mp_expected, mp_expected); + } +}; + + +#endif // BOOST_GEOMETRY_TEST_SET_OPS_POINTLIKE_HPP diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/union/Jamfile b/src/boost/libs/geometry/test/algorithms/set_operations/union/Jamfile new file mode 100644 index 000000000..e351a870d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/union/Jamfile @@ -0,0 +1,27 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2017, 2018. +# Modifications copyright (c) 2014-2018, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-union + : + [ run union.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE + : algorithms_union ] + [ run union_aa_geo.cpp : : : : algorithms_union_aa_geo ] + [ run union_aa_sph.cpp : : : : algorithms_union_aa_sph ] + [ run union_linear_linear.cpp : : : : algorithms_union_linear_linear ] + [ run union_multi.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE + : algorithms_union_multi ] + [ run union_pl_pl.cpp : : : : algorithms_union_pl_pl ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/union/test_union.hpp b/src/boost/libs/geometry/test/algorithms/set_operations/union/test_union.hpp new file mode 100644 index 000000000..d92fff221 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/union/test_union.hpp @@ -0,0 +1,282 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2015, 2016, 2017. +// Modifications copyright (c) 2015-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 +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_GEOMETRY_TEST_UNION_HPP +#define BOOST_GEOMETRY_TEST_UNION_HPP + +#include + +#include +#include +#include "../setop_output_type.hpp" + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + + +#if defined(TEST_WITH_SVG) +# include +#endif + +struct ut_settings +{ + double percentage; + bool test_validity; + + ut_settings() + : percentage(0.001) + , test_validity(true) + {} + +}; + +#if defined(BOOST_GEOMETRY_TEST_CHECK_VALID_INPUT) +template +inline void check_input_validity(std::string const& caseid, int case_index, + Geometry const& geometry) +{ + std::string message; + if (!bg::is_valid(geometry, message)) + { + std::cout << caseid << " Input [" + << case_index << "] not valid" << std::endl + << " (" << message << ")" << std::endl; + } +} +#endif + + + +template +inline std::size_t num_points(Range const& rng, bool add_for_open = false) +{ + std::size_t result = 0; + for (typename boost::range_iterator::type it = boost::begin(rng); + it != boost::end(rng); ++it) + { + result += bg::num_points(*it, add_for_open); + } + return result; +} + +template +void test_union(std::string const& caseid, G1 const& g1, G2 const& g2, + int expected_count, int expected_hole_count, + int expected_point_count, double expected_area, + ut_settings const& settings) +{ + typedef typename bg::coordinate_type::type coordinate_type; + boost::ignore_unused(); + boost::ignore_unused(expected_point_count); + + // Declare output (vector of rings or multi_polygon) + typedef typename setop_output_type::type result_type; + result_type clip; + +#if defined(BOOST_GEOMETRY_DEBUG_ROBUSTNESS) + std::cout << "*** UNION " << caseid << std::endl; +#endif + +#if defined(BOOST_GEOMETRY_TEST_CHECK_VALID_INPUT) + check_input_validity(caseid, 0, g1); + check_input_validity(caseid, 1, g2); +#endif + + // Check normal behaviour + bg::union_(g1, g2, clip); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + { + // Check strategy passed explicitly + result_type clip_s; + typedef typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy_type; + bg::union_(g1, g2, clip_s, strategy_type()); + BOOST_CHECK_EQUAL(num_points(clip), num_points(clip_s)); + } +#endif + +#if ! defined(BOOST_GEOMETRY_TEST_ALWAYS_CHECK_VALIDITY) + if (settings.test_validity) +#endif + { + std::string message; + bool const valid = check_validity::apply(clip, caseid, g1, g2, message); + BOOST_CHECK_MESSAGE(valid, + "union: " << caseid << " not valid: " << message + << " type: " << (type_for_assert_message())); + } + + typename bg::default_area_result::type area = 0; + std::size_t n = 0; + std::size_t holes = 0; + for (typename result_type::iterator it = clip.begin(); + it != clip.end(); ++it) + { + area += bg::area(*it); + holes += bg::num_interior_rings(*it); + n += bg::num_points(*it, true); + } + + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + { + // Test inserter functionality + // Test if inserter returns output-iterator (using Boost.Range copy) + result_type inserted, array_with_one_empty_geometry; + array_with_one_empty_geometry.push_back(OutputType()); + boost::copy(array_with_one_empty_geometry, bg::detail::union_::union_insert(g1, g2, std::back_inserter(inserted))); + + typename bg::default_area_result::type area_inserted = 0; + int index = 0; + for (typename result_type::iterator it = inserted.begin(); + it != inserted.end(); + ++it, ++index) + { + // Skip the empty polygon created above to avoid the empty_input_exception + if (! bg::is_empty(*it)) + { + area_inserted += bg::area(*it); + } + } + BOOST_CHECK_EQUAL(boost::size(clip), boost::size(inserted) - 1); + BOOST_CHECK_CLOSE(area_inserted, expected_area, settings.percentage); + } +#endif + + + +#if defined(BOOST_GEOMETRY_DEBUG_ROBUSTNESS) + std::cout << "*** case: " << caseid + << " area: " << area + << " points: " << n + << " polygons: " << boost::size(clip) + << " holes: " << holes + << std::endl; +#endif + + BOOST_CHECK_MESSAGE(expected_count < 0 || int(clip.size()) == expected_count, + "union: " << caseid + << " #clips expected: " << expected_count + << " detected: " << clip.size() + << " type: " << (type_for_assert_message()) + ); + + BOOST_CHECK_MESSAGE(expected_hole_count < 0 || int(holes) == expected_hole_count, + "union: " << caseid + << " #holes expected: " << expected_hole_count + << " detected: " << holes + << " type: " << (type_for_assert_message()) + ); + +#if defined(BOOST_GEOMETRY_USE_RESCALING) + // Without rescaling, point count might easily differ (which is no problem) + BOOST_CHECK_MESSAGE(expected_point_count < 0 || std::abs(int(n) - expected_point_count) < 3, + "union: " << caseid + << " #points expected: " << expected_point_count + << " detected: " << n + << " type: " << (type_for_assert_message()) + ); +#endif + + BOOST_CHECK_CLOSE(area, expected_area, settings.percentage); + +#if defined(TEST_WITH_SVG) + { + bool const ccw = + bg::point_order::value == bg::counterclockwise + || bg::point_order::value == bg::counterclockwise; + bool const open = + bg::closure::value == bg::open + || bg::closure::value == bg::open; + + std::ostringstream filename; + filename << "union_" + << caseid << "_" + << string_from_type::name() + << (ccw ? "_ccw" : "") + << (open ? "_open" : "") +#if defined(BOOST_GEOMETRY_USE_RESCALING) + << "_rescaled" +#endif + << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper + < + typename bg::point_type::type + > mapper(svg, 500, 500); + mapper.add(g1); + mapper.add(g2); + + mapper.map(g1, "fill-opacity:0.5;fill:rgb(153,204,0);" + "stroke:rgb(153,204,0);stroke-width:3"); + mapper.map(g2, "fill-opacity:0.3;fill:rgb(51,51,153);" + "stroke:rgb(51,51,153);stroke-width:3"); + //mapper.map(g1, "opacity:0.6;fill:rgb(0,0,255);stroke:rgb(0,0,0);stroke-width:1"); + //mapper.map(g2, "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:1"); + + for (typename result_type::const_iterator it = clip.begin(); + it != clip.end(); ++it) + { + mapper.map(*it, "fill-opacity:0.2;stroke-opacity:0.4;fill:rgb(255,0,0);" + "stroke:rgb(255,0,255);stroke-width:8"); + //mapper.map(*it, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:5"); + } + } +#endif +} + +template +void test_one(std::string const& caseid, + std::string const& wkt1, std::string const& wkt2, + int expected_count, int expected_hole_count, + int expected_point_count, double expected_area, + ut_settings const& settings = ut_settings()) +{ + G1 g1; + bg::read_wkt(wkt1, g1); + + G2 g2; + bg::read_wkt(wkt2, g2); + + // Reverse/close if necessary (e.g. G1/G2 are ccw and/or open) + bg::correct(g1); + bg::correct(g2); + + test_union(caseid, g1, g2, + expected_count, expected_hole_count, expected_point_count, + expected_area, settings); +} + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/union/test_union_linear_linear.hpp b/src/boost/libs/geometry/test/algorithms/set_operations/union/test_union_linear_linear.hpp new file mode 100644 index 000000000..e4357b603 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/union/test_union_linear_linear.hpp @@ -0,0 +1,203 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#ifndef BOOST_GEOMETRY_TEST_UNION_LINEAR_LINEAR_HPP +#define BOOST_GEOMETRY_TEST_UNION_LINEAR_LINEAR_HPP + +#include + +#include +#include "../test_set_ops_linear_linear.hpp" +#include +#include + + +//================================================================== +//================================================================== +// union of (linear) geometries +//================================================================== +//================================================================== + +template +inline void check_result(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_output, + MultiLineString const& mls_union, + std::string const& case_id, + double tolerance) +{ + BOOST_CHECK_MESSAGE( equals::apply(mls_union, mls_output, tolerance), + "case id: " << case_id + << ", union L/L: " << bg::wkt(geometry1) + << " " << bg::wkt(geometry2) + << " -> Expected: " << bg::wkt(mls_union) + << " computed: " << bg::wkt(mls_output) ); +} + +template +< + typename Geometry1, typename Geometry2, + typename MultiLineString +> +class test_union_of_geometries +{ +private: + static inline void base_test(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_union1, + MultiLineString const& mls_union2, + std::string const& case_id, + double tolerance, + bool test_vector_and_deque = false) + { + static bool vector_deque_already_tested = false; + + typedef typename boost::range_value::type LineString; + typedef std::vector linestring_vector; + typedef std::deque linestring_deque; + + MultiLineString mls_output; + + linestring_vector ls_vector_output; + linestring_deque ls_deque_output; + + // Check strategy passed explicitly + typedef typename bg::strategy::relate::services::default_strategy + < + Geometry1, Geometry2 + >::type strategy_type; + bg::union_(geometry1, geometry2, mls_output, strategy_type()); + + check_result(geometry1, geometry2, mls_output, mls_union1, case_id, tolerance); + + // Check normal behaviour + bg::clear(mls_output); + bg::union_(geometry1, geometry2, mls_output); + + check_result(geometry1, geometry2, mls_output, mls_union1, case_id, tolerance); + + set_operation_output("union", case_id, + geometry1, geometry2, mls_output); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Geometry #1: " << bg::wkt(geometry1) << std::endl; + std::cout << "Geometry #2: " << bg::wkt(geometry2) << std::endl; + std::cout << "union : " << bg::wkt(mls_output) << std::endl; + std::cout << "expected union : " << bg::wkt(mls_union1) + << std::endl; + std::cout << std::endl; + std::cout << "************************************" << std::endl; + std::cout << std::endl; + std::cout << std::endl; +#endif + + if ( !vector_deque_already_tested && test_vector_and_deque ) + { + vector_deque_already_tested = true; +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "Testing with vector and deque as output container..." + << std::endl; +#endif + bg::union_(geometry1, geometry2, ls_vector_output); + bg::union_(geometry1, geometry2, ls_deque_output); + + BOOST_CHECK(multilinestring_equals + < + false + >::apply(mls_union1, ls_vector_output, tolerance)); + + BOOST_CHECK(multilinestring_equals + < + false + >::apply(mls_union1, ls_deque_output, tolerance)); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Done!" << std::endl << std::endl; +#endif + } + + // check the union where the order of the two + // geometries is reversed + bg::clear(mls_output); + bg::union_(geometry2, geometry1, mls_output); + + check_result(geometry1, geometry2, mls_output, mls_union2, case_id, tolerance); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Geometry #1: " << bg::wkt(geometry2) << std::endl; + std::cout << "Geometry #2: " << bg::wkt(geometry1) << std::endl; + std::cout << "union : " << bg::wkt(mls_output) << std::endl; + std::cout << "expected union : " << bg::wkt(mls_union2) + << std::endl; + std::cout << std::endl; + std::cout << "************************************" << std::endl; + std::cout << std::endl; + std::cout << std::endl; +#endif + } + + +public: + static inline void apply(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_union1, + MultiLineString const& mls_union2, + std::string const& case_id, + double tolerance + = std::numeric_limits::epsilon()) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "test case: " << case_id << std::endl; + std::stringstream sstr; + sstr << "svgs/" << case_id << ".svg"; + to_svg(geometry1, geometry2, sstr.str()); +#endif + + Geometry1 rg1(geometry1); + bg::reverse(rg1); + + Geometry2 rg2(geometry2); + bg::reverse(rg2); + + test_get_turns_ll_invariance<>::apply(geometry1, geometry2); +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl + << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" + << std::endl << std::endl; +#endif + test_get_turns_ll_invariance<>::apply(rg1, geometry2); + + base_test(geometry1, geometry2, mls_union1, mls_union2, + case_id, tolerance, true); + // base_test(geometry1, rg2, mls_sym_diff); + // base_test(rg1, geometry2, mls_sym_diff); + base_test(rg1, rg2, mls_union1, mls_union2, case_id, tolerance); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << std::endl; +#endif + } + + + static inline void apply(Geometry1 const& geometry1, + Geometry2 const& geometry2, + MultiLineString const& mls_union, + std::string const& case_id, + double tolerance + = std::numeric_limits::epsilon()) + { + apply(geometry1, geometry2, mls_union, mls_union, case_id, tolerance); + } +}; + + +#endif // BOOST_GEOMETRY_TEST_UNION1_HPP diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/union/union.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/union/union.cpp new file mode 100644 index 000000000..4dea6f98d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/union/union.cpp @@ -0,0 +1,644 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2016 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2016 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2016 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2016,2017. +// Modifications copyright (c) 2016-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. + +// 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) + +#include +#include + +#include "test_union.hpp" +#include + +#include +#include + + +#define TEST_UNION(caseid, clips, holes, points, area) \ + (test_one) \ + ( #caseid, caseid[0], caseid[1], clips, holes, points, area) + +#define TEST_UNION_REV(caseid, clips, holes, points, area) \ + (test_one) \ + ( #caseid "_rev", caseid[1], caseid[0], clips, holes, points, area) + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) \ + && defined(BOOST_GEOMETRY_USE_KRAMER_RULE) \ + && ! defined(BOOST_GEOMETRY_TEST_FAILURES) +// These testcases are failing for non-rescaled Kramer rule +#define BOOST_GEOMETRY_EXCLUDE +#endif + + +template +void test_areal() +{ + typedef typename bg::coordinate_type::type ct; + + test_one("simplex_normal", + simplex_normal[0], simplex_normal[1], + 1, 0, 13, 11.526367); + + test_one("simplex_with_empty_1", + simplex_normal[0], polygon_empty, + 1, 0, 4, 8.0); + test_one("simplex_with_empty_2", + polygon_empty, simplex_normal[0], + 1, 0, 4, 8.0); + + test_one("star_ring", example_star, example_ring, + 1, 0, 23, 5.67017141); + + // This sample was selected because of the border case, and ttmath generates one point more. + test_one("star_poly", example_star, example_polygon, + 1, 1, + if_typed_tt(28, 27), 5.647949); + + // Pseudo-box as Polygon + // (note, internally, the intersection points is different, so yes, + // it has to be tested) + test_one("box_poly3", "POLYGON((1.5 1.5 , 1.5 2.5 , 4.5 2.5 , 4.5 1.5 , 1.5 1.5))", + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,5.3 2.5,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))", + 1, 1, 15, 5.93625); + + test_one("first_within_second", + first_within_second[0], first_within_second[1], + 1, 0, 5, 25.0); + + test_one("second_within_first", + first_within_second[1], first_within_second[0], + 1, 0, 5, 25.0); + + test_one("first_within_hole_of_second", + first_within_hole_of_second[0], first_within_hole_of_second[1], + 2, 1, 15, 17.0); + + test_one("new_hole", + new_hole[0], new_hole[1], + 1, 1, 14, 23.0); + + test_one("side_side", + side_side[0], side_side[1], 1, 0, 7, 2.0); + + test_one("identical", + identical[0], identical[1], 1, 0, 5, 1.0); + + test_one("disjoint", + disjoint[0], disjoint[1], 2, 0, 10, 2.0); + + test_one("intersect_holes_intersect", + intersect_holes_intersect[0], intersect_holes_intersect[1], + 1, 1, 14, 39.75); + + test_one("intersect_holes_intersect_and_disjoint", + intersect_holes_intersect_and_disjoint[0], intersect_holes_intersect_and_disjoint[1], + 1, 1, 14, 39.75); + + test_one("intersect_holes_intersect_and_touch", + intersect_holes_intersect_and_touch[0], intersect_holes_intersect_and_touch[1], + 1, 1, 14, 39.75); + + test_one("intersect_holes_new_ring", + intersect_holes_new_ring[0], intersect_holes_new_ring[1], + 1, 2, 15, 253.8961); + + test_one("intersect_holes_disjoint", + intersect_holes_disjoint[0], + intersect_holes_disjoint[1], + 1, 0, 9, 40.0); + + test_one("within_holes_disjoint", + within_holes_disjoint[0], within_holes_disjoint[1], + 1, 0, 5, 49.0); + + test_one("winded", + winded[0], winded[1], + 1, 5, 30, 114.0); + + test_one("two_bends", + two_bends[0], two_bends[1], + 1, 0, 7, 40.0); + + test_one("star_comb_15", + star_comb_15[0], star_comb_15[1], + 1, 27, 204, 898.09693338); + + test_one("equal_holes_disjoint", + equal_holes_disjoint[0], equal_holes_disjoint[1], + 1, 1, 10, 81 - 3 * 7); + + test_one("only_hole_intersections1", + only_hole_intersections[0], only_hole_intersections[1], + 1, 2, 13, 190.9090909); + test_one("only_hole_intersections2", + only_hole_intersections[0], only_hole_intersections[2], + 1, 2, 13, 190.9090909); + + test_one("intersect_exterior_and_interiors_winded", + intersect_exterior_and_interiors_winded[0], intersect_exterior_and_interiors_winded[1], + 1, 1, 26, 66.5333333); + + test_one("crossed", + crossed[0], crossed[1], + 1, 3, 17, 23.5); // Area from SQL Server - was somehow wrong before + + test_one("fitting", + fitting[0], fitting[1], + 1, 0, 5, 25); + + test_one("distance_zero", + distance_zero[0], distance_zero[1], + 1, 0, 8, 9.0098387); + + test_one("wrapped_a", + wrapped[0], wrapped[1], + 1, 1, 16, 16); + test_one("wrapped_b", + wrapped[0], wrapped[2], + 1, 1, 16, 16); + + test_one("9", + case_9[0], case_9[1], 2, 0, 8, 11); + test_one("22", + case_22[0], case_22[1], 2, 0, 8, 9.5); + test_one("25", + case_25[0], case_25[1], 2, 0, 8, 7); + test_one("26", + case_26[0], case_26[1], 2, 0, 9, 7.5); + test_one("31", + case_31[0], case_31[1], 2, 0, 8, 4.5); + test_one("32", + case_32[0], case_32[1], 2, 0, 8, 4.5); + test_one("33", + case_33[0], case_33[1], 2, 0, 8, 4.5); + test_one("36", + case_36[0], case_36[1], 1, 1, 10, 14.375); + test_one("40", + case_40[0], case_40[1], 2, 0, 18, 11); + + // Test rings which should be generated by assemble + test_one("53_iet", + case_53[0], case_53[2], 1, 1, 16, 16); + test_one("58_iet", + case_58[0], case_58[2], 1, 3, 20, 12.16666); + + test_one("59_iet", + case_59[0], case_59[2], 1, 1, 14, 17.20833); + + test_one("80", + case_80[0], case_80[1], 2, 2, 18, 129.0); + + test_one("81", + case_81[0], case_81[1], 1, 2, 15, 163.5); + + test_one("82", + case_82[0], case_82[1], 1, 1, 21, 19.75); + + test_one("83", + case_83[0], case_83[1], 1, 0, 7, 20.0); + + test_one("90", + case_90[0], case_90[1], 1, 2, 17, 221.3688); + + test_one("91", + case_91[0], case_91[1], 1, 1, 9, 147.5); + + test_one("92", + case_92[0], case_92[1], 2, 0, 9, 175.0); + + test_one("93", + case_93[0], case_93[1], 1, 2, 12, 172.9167); + + test_one("94", + case_94[0], case_94[1], 2, 0, 12, 170.0); + + // Has two separate but touching interior rings + test_one("95", + case_95[0], case_95[1], 1, 2, 15, 1320.0); + + test_one("96", + case_96[0], case_96[1], 1, 1, 10, 1500.0); + + test_one("97", + case_97[0], case_97[1], 1, 0, 10, 286.799); + + test_one("98", + case_98[0], case_98[1], 1, 1, 14, 653.067); + + test_one("99", + case_99[0], case_99[1], 1, 0, 5, 1600.0); + + test_one("100", + case_100[0], case_100[1], 1, 1, 13, 19.125); + + test_one("101", + case_101[0], case_101[1], 1, 0, 9, 21.0); + + test_one("102", + case_102[0], case_102[1], 1, 1, 17, 8.75); + + test_one("103", + case_103[0], case_103[1], + 1, 0, 5, 1.0); + test_one("104", + case_104[0], case_104[1], + 1, 0, 5, 100.0); + + test_one("105", + case_105[0], case_105[1], 1, 0, 5, 100); + + test_one("108", + case_108[0], case_108[1], 1, 0, 13, 5.0); + + TEST_UNION(case_precision_1, 1, 0, -1, 22.0); + TEST_UNION(case_precision_2, 1, 0, -1, 22.0); + TEST_UNION(case_precision_3, 1, 0, -1, 22.0); + TEST_UNION(case_precision_4, 1, 0, -1, 22.0); + TEST_UNION(case_precision_5, 1, 0, -1, 22.0); + TEST_UNION(case_precision_6, 1, 0, -1, 71.0); + TEST_UNION(case_precision_7, 1, 0, -1, 22.0); + TEST_UNION(case_precision_8, 1, 1, -1, 73.0); + TEST_UNION(case_precision_9, 1, 1, -1, 73.0); + TEST_UNION(case_precision_10, 1, 1, -1, 73.0); + TEST_UNION(case_precision_11, 1, 1, -1, 73.0); + TEST_UNION(case_precision_12, 1, 0, -1, 14.0); + TEST_UNION(case_precision_13, 1, 0, -1, 14.0); + TEST_UNION(case_precision_14, 1, 0, -1, 22.0); + TEST_UNION(case_precision_15, 1, 1, -1, 73.0); + TEST_UNION(case_precision_16, 1, 1, -1, 73.0); + TEST_UNION(case_precision_17, 1, 1, -1, 73.0); + TEST_UNION(case_precision_18, 1, 1, -1, 73.0); + TEST_UNION(case_precision_19, 1, 1, -1, 73.0); +#if ! defined(BOOST_GEOMETRY_EXCLUDE) + TEST_UNION(case_precision_20, 1, 0, -1, 22.0); +#endif + TEST_UNION(case_precision_21, 1, 0, -1, 22.0); + TEST_UNION(case_precision_22, 1, 1, -1, 73.0); + TEST_UNION(case_precision_23, 1, 1, -1, 73.0); + TEST_UNION(case_precision_24, 1, 0, -1, 22.0); + TEST_UNION(case_precision_25, 1, 0, -1, 22.0); + TEST_UNION(case_precision_26, 1, 1, -1, 73.0); + + TEST_UNION_REV(case_precision_1, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_2, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_3, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_4, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_5, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_6, 1, 0, -1, 71.0); + TEST_UNION_REV(case_precision_7, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_8, 1, 1, -1, 73.0); + TEST_UNION_REV(case_precision_9, 1, 1, -1, 73.0); + TEST_UNION_REV(case_precision_10, 1, 1, -1, 73.0); + TEST_UNION_REV(case_precision_11, 1, 1, -1, 73.0); + TEST_UNION_REV(case_precision_12, 1, 0, -1, 14.0); + TEST_UNION_REV(case_precision_13, 1, 0, -1, 14.0); + TEST_UNION_REV(case_precision_14, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_15, 1, 1, -1, 73.0); + TEST_UNION_REV(case_precision_16, 1, 1, -1, 73.0); + TEST_UNION_REV(case_precision_17, 1, 1, -1, 73.0); + TEST_UNION_REV(case_precision_18, 1, 1, -1, 73.0); + TEST_UNION_REV(case_precision_19, 1, 1, -1, 73.0); +#if ! defined(BOOST_GEOMETRY_EXCLUDE) + TEST_UNION_REV(case_precision_20, 1, 0, -1, 22.0); +#endif + TEST_UNION_REV(case_precision_21, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_22, 1, 1, -1, 73.0); + TEST_UNION_REV(case_precision_23, 1, 1, -1, 73.0); + TEST_UNION_REV(case_precision_24, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_25, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_26, 1, 1, -1, 73.0); + + /* + test_one(102, + simplex_normal[0], simplex_reversed[1], + 1, 0, 7, X); + + test_one(103, + simplex_reversed[0], simplex_normal[1], + 1, 0, 7, 24.0); + + test_one(104, + simplex_reversed[0], simplex_reversed[1], + 1, 0, 7, 24.0); + + test_one(100, + star_15, comb_15, + 1, 10, 7, 24.0); + */ + + // test some other input/output types + + // 1 input Ring + test_one("identical_pr", identical[0], identical[1], 1, 0, 5, 1.0); + test_one("identical_rp", identical[0], identical[1], 1, 0, 5, 1.0); + + // 2 input rings + test_one("identical_rr", identical[0], identical[1], 1, 0, 5, 1.0); + + // output is also Ring + test_one("identical_rrr", identical[0], identical[1], 1, 0, 5, 1.0); + + // "new hole", tested with Ring -> the newly formed hole will be omitted + test_one("new_hole_discarded", new_hole[0], new_hole[1], 1, 0, 9, 24.0); + + test_one("ggl_list_20110306_javier", + ggl_list_20110306_javier[0], ggl_list_20110306_javier[1], + 1, 1, 16, 80456.4904910401); + + test_one("ggl_list_20110307_javier", + ggl_list_20110307_javier[0], ggl_list_20110307_javier[1], + 1, 1, 13, 20016.4); + + test_one("ggl_list_20110627_phillip", + ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1], + 1, 0, 8, 14729.07145); + + test_one("ggl_list_20110716_enrico", + ggl_list_20110716_enrico[0], ggl_list_20110716_enrico[1], + 1, 1, 15, 129904.197692871); + +#if ! defined(BOOST_GEOMETRY_EXCLUDE) + test_one("ggl_list_20110820_christophe", + ggl_list_20110820_christophe[0], ggl_list_20110820_christophe[1], + -1, // Either 1 or 2, depending if the intersection/turn point (eps.region) is missed + 0, + if_typed_tt(9, 8), + 67.3550722317627); +#endif + + { + ut_settings settings; + settings.percentage = 0.1; + settings.test_validity = BG_IF_RESCALED(true, false); + + test_one("isovist", + isovist1[0], isovist1[1], + 1, + 0, + -1, + 313.36036462, settings); + + // SQL Server gives: 313.360374193241 + // PostGIS gives: 313.360364623393 + } + + TEST_UNION(ggl_list_20190307_matthieu_1, 1, 1, -1, 0.83773); + TEST_UNION(ggl_list_20190307_matthieu_2, 1, 0, -1, 16.0); + + // Ticket 5103 https://svn.boost.org/trac/boost/ticket/5103 + // This ticket was actually reported for Boost.Polygon + // We check it for Boost.Geometry as well. + // SQL Server gives: 2515271331437.69 + // PostGIS gives: 2515271327070.52 + // Boost.Geometry gives: 2515271327070.5237746891 (ttmath) + // 2515271327070.5156 (double) + // 2515271320603.0000 (int) + // Note the int-test was tested outside of this unit test. + // It is in two points 0.37 off (logical for an int). + // Because of the width of the polygon (400000 meter) + // this causes a substantial difference. + + test_one("ticket_5103", + ticket_5103[0], ticket_5103[1], + 1, 0, 25, 2515271327070.5); + + TEST_UNION(ticket_8310a, 1, 0, 5, 10.5000019595); + TEST_UNION(ticket_8310b, 1, 0, 5, 10.5000019595); + TEST_UNION(ticket_8310c, 1, 0, 5, 10.5000019595); + TEST_UNION_REV(ticket_8310a, 1, 0, 5, 10.5000019595); + TEST_UNION_REV(ticket_8310b, 1, 0, 5, 10.5000019595); + TEST_UNION_REV(ticket_8310c, 1, 0, 5, 10.5000019595); + + test_one("ticket_9081_15", + ticket_9081_15[0], ticket_9081_15[1], + 1, 0, -1, 0.0403425433); + + { + ut_settings settings; + settings.test_validity = BG_IF_RESCALED(true, false); + test_one("ticket_9563", ticket_9563[0], ticket_9563[1], + 1, 0, 13, 150.0, settings); + } + + // Float result is OK but a bit larger + test_one("ticket_9756", ticket_9756[0], ticket_9756[1], + 1, 0, 10, if_typed(1291.5469, 1289.08374)); + + // Can generate one polygon, or two splitted, both is OK +#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) + TEST_UNION(ticket_10108_a, 2, 0, 8, 0.0435229); + TEST_UNION(ticket_10108_b, 1, 0, 10, 2424.3449); +#else + TEST_UNION(ticket_10108_a, BG_IF_RESCALED(2, 1), 0, 8, 0.0435229); + TEST_UNION(ticket_10108_b, BG_IF_RESCALED(1, 2), 0, 10, 2424.3449); +#endif + + test_one("ticket_10866", ticket_10866[0], ticket_10866[1], + 1, 0, 14, if_typed(332752493.0, 332760303.5)); + + test_one("ticket_11725", ticket_11725[0], ticket_11725[1], + 1, 1, 10, 7.5); + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // With rescaling an extra overlapping polygon is generated + TEST_UNION(issue_548, 1, 0, -1, 617382720000); +#endif + + TEST_UNION(issue_566_a, 1, 0, -1, 214.3728); + TEST_UNION(issue_566_b, 1, 0, -1, 214.3728); + TEST_UNION_REV(issue_566_a, 1, 0, -1, 214.3728); + TEST_UNION_REV(issue_566_b, 1, 0, -1, 214.3728); + + if (! BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + { + ut_settings ignore_validity; + ignore_validity.test_validity = false; + ignore_validity.percentage = 0.01; + test_one("geos_1", geos_1[0], geos_1[1], + 1, 0, -1, 3461.3203125, + ignore_validity); + } + test_one("geos_2", geos_2[0], geos_2[1], + 1, 0, -1, 350.55102539); + test_one("geos_3", geos_3[0], geos_3[1], + 1, 0, -1, 29391548.4998779); + test_one("geos_4", geos_4[0], geos_4[1], + 1, 0, -1, 2304.4163115); + + // Robustness issues, followed out buffer-robustness-tests, test them also reverse + { + // Area can vary depending on joining point of nearly parallel lines + ut_settings settings; + settings.percentage = 0.01; + test_one("buffer_rt_a", buffer_rt_a[0], buffer_rt_a[1], + 1, 0, -1, 19.28, settings); + test_one("buffer_rt_a_rev", buffer_rt_a[1], buffer_rt_a[0], + 1, 0, -1, 19.28, settings); + } +#if ! defined(BOOST_GEOMETRY_EXCLUDE) + test_one("buffer_rt_f", buffer_rt_f[0], buffer_rt_f[1], + 1, 0, -1, 4.60853); + test_one("buffer_rt_f_rev", buffer_rt_f[1], buffer_rt_f[0], + 1, 0, -1, 4.60853); +#endif + test_one("buffer_rt_g", buffer_rt_g[0], buffer_rt_g[1], + 1, 0, -1, 16.571); + test_one("buffer_rt_g_rev", buffer_rt_g[1], buffer_rt_g[0], + 1, 0, -1, 16.571); +#if ! defined(BOOST_GEOMETRY_EXCLUDE) + test_one("buffer_rt_i", buffer_rt_i[0], buffer_rt_i[1], + 1, 0, -1, 13.6569); +#endif + test_one("buffer_rt_i_rev", buffer_rt_i[1], buffer_rt_i[0], + 1, 0, -1, 13.6569); + + test_one("buffer_rt_j", buffer_rt_j[0], buffer_rt_j[1], + 1, 0, -1, 16.5711); + test_one("buffer_rt_j_rev", buffer_rt_j[1], buffer_rt_j[0], + 1, 0, -1, 16.5711); + + test_one("buffer_rt_l", buffer_rt_l[0], buffer_rt_l[1], + 1, 0, -1, 19.3995); + test_one("buffer_rt_l_rev", buffer_rt_l[1], buffer_rt_l[0], + 1, 0, -1, 19.3995); + + test_one("buffer_rt_m1", buffer_rt_m1[0], buffer_rt_m1[1], + 1, 0, 9, 19.4852); + test_one("buffer_rt_m1_rev", buffer_rt_m1[1], buffer_rt_m1[0], + 1, 0, 9, 19.4852); + + test_one("buffer_rt_m2", buffer_rt_m2[0], buffer_rt_m2[1], + 1, 0, -1, 21.4853); + test_one("buffer_rt_m2_rev", buffer_rt_m2[1], buffer_rt_m2[0], + 1, 0, 15, 21.4853); + + test_one("buffer_rt_q", buffer_rt_q[0], buffer_rt_q[1], + 1, 0, -1, 18.5710); + test_one("buffer_rt_q_rev", buffer_rt_q[1], buffer_rt_q[0], + 1, 0, -1, 18.5710); +#if ! defined(BOOST_GEOMETRY_EXCLUDE) + test_one("buffer_rt_r", buffer_rt_r[0], buffer_rt_r[1], + 1, 0, -1, 21.07612); + test_one("buffer_rt_r_rev", buffer_rt_r[1], buffer_rt_r[0], + 1, 0, -1, 21.07612); +#endif + test_one("buffer_rt_t", buffer_rt_t[0], buffer_rt_t[1], + 1, 0, -1, 15.6569); + test_one("buffer_rt_t_rev", buffer_rt_t[1], buffer_rt_t[0], + 1, 0, -1, 15.6569); + + test_one("buffer_mp1", buffer_mp1[0], buffer_mp1[1], + 1, 0, if_typed_tt(93, 91), 22.815); + + test_one("buffer_mp2", buffer_mp2[0], buffer_mp2[1], + 1, BG_IF_RESCALED(1, (if_typed(1, 0))), 217, 36.752837); + + test_one("mysql_21964079_1", + mysql_21964079_1[0], mysql_21964079_1[1], + 2, 1, -1, 234.5); + test_one("mysql_21964079_2", + mysql_21964079_2[0], mysql_21964079_2[1], + 2, 1, -1, 112.0); + + test_one("mysql_23023665_1", + mysql_23023665_1[0], mysql_23023665_1[1], + 2, 1, -1, 92.0 + 142.5); + test_one("mysql_23023665_2", + mysql_23023665_2[0], mysql_23023665_2[1], + 2, 1, -1, 96.0 + 16.0); + test_one("mysql_23023665_3", + mysql_23023665_3[0], mysql_23023665_3[1], + 2, 1, -1, 225.0 + 66.0); + test_one("mysql_21964049", + mysql_21964049[0], mysql_21964049[1], + 1, 1, -1, 220.5); +} + +template +void test_all() +{ + typedef bg::model::polygon

polygon; + typedef bg::model::ring

ring; + typedef bg::model::box

box; + + test_areal(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + // Open + test_areal, bg::model::polygon >(); + + // Counter clockwise + test_areal, bg::model::polygon >(); + + // Counter clockwise and open + test_areal, bg::model::polygon >(); +#endif + + test_one("box_ring", example_box, example_ring, + 1, 1, 15, 6.38875); + + test_one("box_poly", example_box, example_polygon, + 1, 3, 23, 6.30983); + + + test_one("box_poly1", example_box, + "POLYGON((3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2))", + 1, 1, 15, 6.38875); + test_one("box_poly2", example_box, + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,5.3 2.5,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))", + 1, 1, 15, 5.93625); + + // 3: see areal + + test_one("box_poly4", example_box, + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 2.5,4.5 1.2,4.9 0.8,2.9 0.7,2 1.3))", + 1, 1, 15, 4.651245); + + test_one("box_poly5", example_box, + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 2.5,4.5 2.3,5.0 2.3,5.0 2.1,4.5 2.1,4.5 1.9,4.0 1.9,4.5 1.2,4.9 0.8,2.9 0.7,2 1.3))", + 1, 1, 21, 4.7191); + + test_one("box_poly6", example_box, + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 1.2,2.9 0.7,2 1.3))", + 1, 1, 15, 4.2174); + + test_one("box_poly7", example_box, + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.0 3.0,5.0 2.0,2.9 0.7,2 1.3))", + 1, 1, 17, 4.270554); + + test_one("box_poly8", "box(0 0, 3 3)", + "POLYGON((2 2, 1 4, 2 4, 3 3, 2 2))", + 1, 0, 8, 10.25); +} + + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + test_all >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + std::cout << "Testing TTMATH" << std::endl; + test_all >(); +#endif +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/union/union_aa_geo.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/union/union_aa_geo.cpp new file mode 100644 index 000000000..00587e91c --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/union/union_aa_geo.cpp @@ -0,0 +1,135 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// Copyright (c) 2017, 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) + +#include +#include + +#include "test_union.hpp" + +#include + + +struct exterior_points_counter +{ + exterior_points_counter() : count(0) {} + + template + void operator()(Polygon const& poly) + { + count += boost::size(bg::exterior_ring(poly)); + } + + std::size_t count; +}; + +struct interiors_counter + : exterior_points_counter +{ + template + void operator()(Polygon const& poly) + { + count += boost::size(bg::interior_rings(poly)); + } +}; + +void test_geographic_one(std::string const& wkt1, std::string const& wkt2, + std::size_t count, std::size_t exterior_points_count, std::size_t interiors_count, + double expected_area) +{ + typedef bg::model::point > point; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multipolygon; + + bg::srs::spheroid sph(6378137.0000000000, 6356752.3142451793); + + bg::strategy::intersection::geographic_segments<> is(sph); + bg::strategy::area::geographic<> as(sph); + + polygon p1, p2; + + boost::geometry::read_wkt(wkt1, p1); + boost::geometry::read_wkt(wkt2, p2); + + multipolygon result; + + enum test_mode { expect_valid, expect_empty, expect_exception }; + +#if defined(BOOST_GEOMETRY_UNION_THROW_INVALID_OUTPUT_EXCEPTION) + test_mode mode = expected_area >= 0 ? expect_valid : expect_exception; +#elif defined(BOOST_GEOMETRY_UNION_RETURN_INVALID) + test_mode mode = expect_valid; +#else + // default + test_mode mode = expected_area >= 0 ? expect_valid : expect_empty; +#endif + + if (mode == expect_exception) + { + BOOST_CHECK_THROW(boost::geometry::union_(p1, p2, result, is), + bg::invalid_output_exception); + } + else + { + + boost::geometry::union_(p1, p2, result, is); + + double result_area = bg::area(result, as); + + std::size_t result_count = boost::size(result); + std::size_t result_exterior_points = std::for_each(boost::begin(result), + boost::end(result), + exterior_points_counter()).count; + std::size_t result_interiors = std::for_each(boost::begin(result), + boost::end(result), + interiors_counter()).count; + if (mode == expect_valid) + { + BOOST_CHECK_EQUAL(result_count, count); + BOOST_CHECK_EQUAL(result_exterior_points, exterior_points_count); + BOOST_CHECK_EQUAL(result_interiors, interiors_count); + BOOST_CHECK_CLOSE(result_area, expected_area, 0.001); + } + else + { + BOOST_CHECK_EQUAL(result_count, 0u); + BOOST_CHECK_EQUAL(result_area, 0.0); + } + } +} + + +void test_geographic() +{ + // input ok and the result is ok + test_geographic_one("POLYGON((16 15,-132 10,-56 89,67 5,16 15))", + "POLYGON((101 49,12 40,-164 10,117 0,101 49))", + 1, 9, 0, 144265751613509.06); + + // input ok but the result is too big + test_geographic_one("POLYGON((16 -15,-132 -22,-56 89,67 -29,16 -15))", + "POLYGON((101 49,12 40,-164 -21,117 -61,101 49))", + 1, 9, 0, -163427005620080.0); + + // the second polygon is reversed i.e. it covers more than half of the globe + // so the result is also too big + test_geographic_one("POLYGON((16 -15,-132 -22,-56 89,67 -29,16 -15))", + "POLYGON((101 49,117 -61,-164 -21,12 40,101 49))", + 1, 7, 0, -125258931656228.08); +} + + +int test_main(int, char* []) +{ + test_geographic(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/union/union_aa_sph.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/union/union_aa_sph.cpp new file mode 100644 index 000000000..cbb8f28d6 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/union/union_aa_sph.cpp @@ -0,0 +1,106 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// Copyright (c) 2017-2019, 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) + +#include +#include + +#include "test_union.hpp" + + +struct exterior_points_counter +{ + exterior_points_counter() : count(0) {} + + template + void operator()(Polygon const& poly) + { + count += boost::size(bg::exterior_ring(poly)); + } + + std::size_t count; +}; + +struct interiors_counter + : exterior_points_counter +{ + template + void operator()(Polygon const& poly) + { + count += boost::size(bg::interior_rings(poly)); + } +}; + +void test_spherical_one(std::string const& wkt1, std::string const& wkt2, + std::size_t count, std::size_t exterior_points_count, std::size_t interiors_count, + double expected_area) +{ + typedef bg::model::point > point; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multipolygon; + + polygon p1, p2; + + boost::geometry::read_wkt(wkt1, p1); + boost::geometry::read_wkt(wkt2, p2); + + multipolygon result; + + boost::geometry::union_(p1, p2, result); + + double result_area = bg::area(result); + + std::size_t result_count = boost::size(result); + std::size_t result_exterior_points = std::for_each(boost::begin(result), + boost::end(result), + exterior_points_counter()).count; + std::size_t result_interiors = std::for_each(boost::begin(result), + boost::end(result), + interiors_counter()).count; + if (expected_area >= 0) + { + BOOST_CHECK_EQUAL(result_count, count); + BOOST_CHECK_EQUAL(result_exterior_points, exterior_points_count); + BOOST_CHECK_EQUAL(result_interiors, interiors_count); + BOOST_CHECK_CLOSE(result_area, expected_area, 0.001); + } + else + { + BOOST_CHECK_EQUAL(result_count, 0u); + BOOST_CHECK_EQUAL(result_area, 0.0); + } +} + + +void test_spherical() +{ + // https://github.com/boostorg/geometry/issues/475 + test_spherical_one("POLYGON((-78.4072265625001 43.06652924482626,-78.4072265625 43.06740063068311,-78.4063141178686 43.06653210403569,-78.4072265625001 43.06652924482626))", + "POLYGON((-78.55968743491499 43.06594969590624,-78.55036227331367 43.07380195109801,-78.53503704605811 43.08248347074284,-78.51769210872999 43.08880392487917,-78.49899564953199 43.09251971058174,-78.47966844278045 43.09348761253013,-78.46045580120891 43.09167037120638,-78.44209853911326 43.08713812460473,-78.42530412309867 43.08006566649393,-78.41071917768537 43.07072563376782,-78.40631359930124 43.06653210565861,-78.55968743491499 43.06594969590624))", + 1, 12, 0, 0.00000064324358632259458); + test_spherical_one("POLYGON((-121.5731370931394 37.95996093777254,-121.5731374919342 37.9599609375,-121.5774655572748 37.96661505459264,-121.5814229252572 37.9775390625,-121.5814227715605 37.97753906261685,-121.5824154607857 37.98027887997713,-121.5839036001453 37.9944445317401,-121.5835741960922 37.99673349281881,-121.4641571044922 37.9967043028667,-121.4641571044935 37.97756945550759,-121.4641571044935 37.95998526681451,-121.4641571044935 37.92462240375453,-121.4758884395752 37.92196920341666,-121.493771910322 37.92080607027856,-121.5115987448441 37.92242636171255,-121.5286857982694 37.92676802819236,-121.5443780170238 37.93366470898578,-121.5580733707665 37.94285205174562,-121.5692458339493 37.95397776814401,-121.5731370931394 37.95996093777254))", + "POLYGON((-121.6413116455078 37.9967043028667,-121.5810851310329 37.99673411655077,-121.5697730327269 37.99673629028738,-121.5608282121158 37.99281120211074,-121.5471234211378 37.98362406015312,-121.5359500167068 37.97249627286875,-121.527736882307 37.95985622934639,-121.5227984361816 37.94619029268395,-121.5213227340147 37.93202401606796,-121.5233645060913 37.91790188887406,-121.5288433558941 37.90436639967157,-121.537547143277 37.89193722240091,-121.5491403777151 37.8810913202222,-121.5572385386645 37.87598800167662,-121.5490395877234 37.86781333310999,-121.5420190642174 37.85699822330511,-121.6413116455078 37.85696553311346,-121.6413116455089 37.8645849275209,-121.6413116455089 37.874858067486,-121.6413116455089 37.89983322075715,-121.6413116455089 37.95996381547175,-121.6413116455089 37.97754168382039,-121.6413116455089 37.97754250238781,-121.6413116455078 37.9967043028667))", + 1, 24, 0, 0.0000047757848548868592); + test_spherical_one("POLYGON((-121.3246465532687 35.88962804614829,-121.2883758544922 35.88960686771812,-121.2883758544928 35.85058599290677,-121.290026580334 35.8505859375,-121.3246465532687 35.88962804614829))", + "POLYGON((-121.2883758544928 35.85055605452366,-121.29 35.850556,-121.3056335092293 35.8681640625,-121.2883758544928 35.86816464188531,-121.2883758544928 35.85055605452366))", + 1, 8, 0, 0.00000018266345129866598); + test_spherical_one("POLYGON((-120.4666783969804 37.2997584488572,-120.466678397 37.3000076100001,-120.466678399 37.3166742810001,-120.450011727 37.3166742830001,-120.4500117249686 37.2997528818001,-120.4666783969804 37.2997584488572))", + "POLYGON((-120.466678399 37.3166742810001,-120.466678396991 37.29975844885721,-120.566678432986 37.29974277357464,-120.477336505269 37.35026345984599,-120.471699839074 37.3480665431537,-120.466678402489 37.345749649536,-120.466269200472 37.345560843499,-120.461071086478 37.3427585963354,-120.456130850491 37.3396734837438,-120.45147257817 37.3363205671631,-120.447118969699 37.3327162133727,-120.443091229047 37.3288780141012,-120.439408960746 37.3248246996654,-120.4360900747 37.3205760470716,-120.4334972505575 37.31667428399087,-120.4333450539725 37.31644525379688,-120.433150699472 37.3161527830495,-120.43060510448 37.3115764824821,-120.428465631443 37.306869462763,-120.426742635401 37.3020546745901,-120.4261294725058 37.29974083085035,-120.4333450519679 37.29974497771207,-120.4500117249686 37.2997528818001,-120.450011727 37.3166742830001,-120.466678399 37.3166742810001))", + 1, 20, 0, 0.00000096333365336696321); +} + + +int test_main(int, char* []) +{ + test_spherical(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/union/union_linear_linear.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/union/union_linear_linear.cpp new file mode 100644 index 000000000..4ef79e6cc --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/union/union_linear_linear.cpp @@ -0,0 +1,1075 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_union_linear_linear +#endif + +#ifdef BOOST_GEOMETRY_TEST_DEBUG +#define BOOST_GEOMETRY_DEBUG_TURNS +#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER +#endif + +#include + +#include "test_union_linear_linear.hpp" + +#include +#include +#include + +typedef bg::model::point point_type; +typedef bg::model::segment segment_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_linestring multi_linestring_type; + + + +//=========================================================================== +//=========================================================================== +//=========================================================================== + + +BOOST_AUTO_TEST_CASE( test_union_linestring_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** LINESTRING / LINESTRING UNION ***" << std::endl; + std::cout << std::endl; +#endif + + typedef linestring_type L; + typedef multi_linestring_type ML; + + typedef test_union_of_geometries tester; + + tester::apply + (from_wkt("LINESTRING(0 0,1 1,2 1,3 2)"), + from_wkt("LINESTRING(0 2,1 1,2 1,3 0)"), + from_wkt("MULTILINESTRING((0 0,1 1,2 1,3 2),\ + (0 2,1 1),(2 1,3 0))"), + from_wkt("MULTILINESTRING((0 2,1 1,2 1,3 0),\ + (0 0,1 1),(2 1,3 2))"), + "llu00"); + + tester::apply + (from_wkt("LINESTRING(0 0,5 0)"), + from_wkt("LINESTRING(3 0,4 0)"), + from_wkt("MULTILINESTRING((0 0,5 0))"), + from_wkt("MULTILINESTRING((3 0,4 0),(0 0,3 0),(4 0,5 0))"), + "llu01"); + + tester::apply + (from_wkt("LINESTRING(3 0,4 0)"), + from_wkt("LINESTRING(0 0,5 0)"), + from_wkt("MULTILINESTRING((3 0,4 0),(0 0,3 0),(4 0,5 0))"), + from_wkt("MULTILINESTRING((0 0,5 0))"), + "llu01-1"); + + tester::apply + (from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("LINESTRING(3 0,6 0)"), + from_wkt("MULTILINESTRING((0 0,4 0),(4 0,6 0))"), + from_wkt("MULTILINESTRING((3 0,6 0),(0 0,3 0))"), + "llu01-2"); + + tester::apply + (from_wkt("LINESTRING(3 0,6 0)"), + from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("MULTILINESTRING((3 0,6 0),(0 0,3 0))"), + from_wkt("MULTILINESTRING((0 0,4 0),(4 0,6 0))"), + "llu01-3"); + + tester::apply + (from_wkt("LINESTRING(0 0,6 0)"), + from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("MULTILINESTRING((0 0,6 0))"), + from_wkt("MULTILINESTRING((0 0,4 0),(4 0,6 0))"), + "llu01-4"); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("LINESTRING(0 0,1 1,2 0,3 1,4 0,5 0,6 1,7 -1,8 0)"), + from_wkt("MULTILINESTRING((0 0,20 0),\ + (0 0,1 1,2 0,3 1,4 0),\ + (5 0,6 1,7 -1,8 0))"), + from_wkt("MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 0,6 1,7 -1,8 0),\ + (0 0,4 0),(5 0,20 0))"), + "llu01-6"); + + tester::apply + (from_wkt("LINESTRING(-20 0,20 0)"), + from_wkt("LINESTRING(0 0,1 1,2 0,3 1,4 0,5 0,6 1,7 -1,8 0)"), + from_wkt("MULTILINESTRING((-20 0,20 0),\ + (0 0,1 1,2 0,3 1,4 0),\ + (5 0,6 1,7 -1,8 0))"), + from_wkt("MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 0,6 1,7 -1,8 0),\ + (-20 0,4 0),(5 0,20 0))"), + "llu01-7"); + + tester::apply + (from_wkt("LINESTRING(0 0,4 0)"), + from_wkt("LINESTRING(2 0,4 0)"), + from_wkt("MULTILINESTRING((0 0,4 0))"), + from_wkt("MULTILINESTRING((2 0,4 0),(0 0,2 0))"), + "llu01-8"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("LINESTRING(4 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,2 0),(4 0,5 0))"), + "llu01-10"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0)"), + from_wkt("LINESTRING(2 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,2 0),(2 0,5 0))"), + "llu01-11"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,4 0)"), + from_wkt("LINESTRING(3 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,1 0,4 0),(4 0,5 0))"), + from_wkt("MULTILINESTRING((3 0,5 0),(0 0,1 0,3 0))"), + "llu01-11a"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,4 0)"), + from_wkt("LINESTRING(3 0,4 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,1 0,4 0),(4 0,5 0))"), + from_wkt("MULTILINESTRING((3 0,4 0,5 0),(0 0,1 0,3 0))"), + "llu01-11b"); + + tester::apply + (from_wkt("LINESTRING(0 0,6 0)"), + from_wkt("LINESTRING(2 0,4 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,6 0))"), + from_wkt("MULTILINESTRING((2 0,4 0,5 0),(0 0,2 0),(5 0,6 0))"), + "llu01-12"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,5 5,10 5,15 0)"), + from_wkt("LINESTRING(-1 6,0 5,15 5)"), + from_wkt("MULTILINESTRING((0 0,1 0,5 5,10 5,15 0),\ + (-1 6,0 5,5 5),(10 5,15 5))"), + from_wkt("MULTILINESTRING((-1 6,0 5,15 5),\ + (0 0,1 0,5 5),(10 5,15 0))"), + "llu02"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0,1 0,5 5,10 5,15 0,20 0),\ + (-1 0,0 0),(1 0,15 0),(20 0,30 0))"), + from_wkt("MULTILINESTRING((-1 0,30 0),(-1 1,0 0),\ + (1 0,5 5,10 5,15 0))"), + "llu03"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,5 5,10 5,15 0,20 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((0 0,1 0,5 5,10 5,15 0,20 0),\ + (-1 0,0 0),(1 0,15 0),(20 0,30 0))"), + from_wkt("MULTILINESTRING((-1 0,30 0),(1 0,5 5,10 5,15 0))"), + "llu04"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,25 1)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0,1 0,5 5,10 5,15 0,20 0,25 1),\ + (-1 0,0 0),(1 0,15 0),(20 0,30 0))"), + from_wkt("MULTILINESTRING((-1 0,30 0),(-1 1,0 0),\ + (1 0,5 5,10 5,15 0),(20 0,25 1))"), + "llu05"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,30 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0,1 0,5 5,10 5,15 0,20 0,30 0),\ + (-1 0,0 0),(1 0,15 0))"), + from_wkt("MULTILINESTRING((-1 0,30 0),(-1 1,0 0),\ + (1 0,5 5,10 5,15 0))"), + "llu05-1"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0),\ + (-1 0,0 0),(1 0,15 0))"), + from_wkt("MULTILINESTRING((-1 0,30 0),(-1 1,0 0),\ + (1 0,5 5,10 5,15 0),(30 0,31 0))"), + "llu06"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0)"), + from_wkt("LINESTRING(-1 0,25 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0),\ + (-1 0,0 0),(1 0,15 0))"), + from_wkt("MULTILINESTRING((-1 0,25 0,30 0),(-1 1,0 0),\ + (1 0,5 5,10 5,15 0),(30 0,31 0))"), + "llu07"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0)"), + from_wkt("LINESTRING(-1 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0,1 0,5 5,10 5,15 0,20 0,31 0),\ + (-1 0,0 0),(1 0,15 0))"), + from_wkt("MULTILINESTRING((-1 0,19 0,30 0),(-1 1,0 0),\ + (1 0,5 5,10 5,15 0),(30 0,31 0))"), + "llu08"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,30 0,31 1)"), + from_wkt("LINESTRING(-1 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0,1 0,5 5,10 5,15 0,20 0,\ + 30 0,31 1),(-1 0,0 0),(1 0,15 0))"), + from_wkt("MULTILINESTRING((-1 0,30 0),(-1 1,0 0),\ + (1 0,5 5,10 5,15 0),(30 0,31 1))"), + "llu09"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,5 5,10 5,15 0,20 0,30 0,31 1)"), + from_wkt("LINESTRING(-1 -1,0 0,1 0,2 1,3 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0,1 0,5 5,10 5,15 0,20 0,\ + 30 0,31 1),(-1 -1,0 0),(1 0,2 1,3 0,15 0))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,1 0,2 1,3 0,30 0),\ + (-1 1,0 0),(1 0,5 5,10 5,15 0),(30 0,31 1))"), + "llu10"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,20 0,\ + 30 0,31 1)"), + from_wkt("LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0,1 0,4 0,5 5,10 5,15 0,20 0,\ + 30 0,31 1),(-1 -1,0 0),(2 0,2.5 1,3 0),(4 0,15 0))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0),\ + (-1 1,0 0),(2 0,3 0),(4 0,5 5,10 5,15 0),(30 0,31 1))"), + "llu11"); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)"), + from_wkt("LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)"), + from_wkt("MULTILINESTRING((-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0),\ + (-1 -1,0 0),(2 0,2.5 1,3 0),(4 0,15 0))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0),\ + (-1 1,0 0),(2 0,3 0),(4 0,5 5,10 5,15 0),(30 0,31 0))"), + "llu11-1"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0,3 1)"), + from_wkt("LINESTRING(0 0,2 0,3 1)"), + from_wkt("MULTILINESTRING((0 0,2 0,3 1))"), + "llu12"); + + tester::apply + (from_wkt("LINESTRING(0 0,2 0,3 1)"), + from_wkt("LINESTRING(3 1,2 0,0 0)"), + from_wkt("MULTILINESTRING((0 0,2 0,3 1))"), + from_wkt("MULTILINESTRING((3 1,2 0,0 0))"), + "llu12-1"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 5,4 0)"), + from_wkt("LINESTRING(1 0,2 1,3 5,4 0,5 10)"), + from_wkt("MULTILINESTRING((0 0,1 0,2 1,3 5,4 0),(4 0,5 10))"), + from_wkt("MULTILINESTRING((1 0,2 1,3 5,4 0,5 10),(0 0,1 0))"), + "llu13"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)"), + from_wkt("LINESTRING(0 0,2 0,2.5 0,3 1)"), + from_wkt("MULTILINESTRING((0 0,1 0,2 0,2.5 0,3 1))"), + from_wkt("MULTILINESTRING((0 0,2 0,2.5 0,3 1))"), + "llu14"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 5,4 0)"), + from_wkt("LINESTRING(1 0,2 1,3 5)"), + from_wkt("MULTILINESTRING((0 0,1 0,2 1,3 5,4 0))"), + from_wkt("MULTILINESTRING((1 0,2 1,3 5),(0 0,1 0),(3 5,4 0))"), + "llu15"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 2)"), + from_wkt("LINESTRING(0.5 0,1 0,3 2,4 5)"), + from_wkt("MULTILINESTRING((0 0,1 0,2 1,3 2),(3 2,4 5))"), + from_wkt("MULTILINESTRING((0.5 0,1 0,3 2,4 5),(0 0,0.5 0))"), + "llu16"); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 1,3 2)"), + from_wkt("LINESTRING(4 5,3 2,1 0,0.5 0)"), + from_wkt("MULTILINESTRING((0 0,1 0,2 1,3 2),(4 5,3 2))"), + from_wkt("MULTILINESTRING((4 5,3 2,1 0,0.5 0),(0 0,0.5 0))"), + "llu16-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1,30 1)"), + from_wkt("LINESTRING(1 1,2 0,3 1,20 1,25 1)"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1,30 1),(1 1,2 0,3 1,20 1))"), + from_wkt("MULTILINESTRING((1 1,2 0,3 1,20 1,25 1),\ + (0 0,10 0,20 1),(25 1,30 1))"), + "llu17"); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1,21 0,30 0)"), + from_wkt("LINESTRING(1 1,2 0,3 1,20 1,25 0)"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1,21 0,30 0),\ + (1 1,2 0,3 1,20 1,25 0))"), + "llu18"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 1)"), + from_wkt("MULTILINESTRING((0 0,30 0),(5 0,20 1,4 1,4 0,5 1))"), + from_wkt("MULTILINESTRING((1 0,5 0,20 1,4 1,4 0,5 1),\ + (0 0,1 0),(5 0,30 0))"), + "llu19"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(5 1,4 0,4 1,20 1,5 0,1 0)"), + from_wkt("MULTILINESTRING((0 0,30 0),(5 1,4 0,4 1,20 1,5 0))"), + from_wkt("MULTILINESTRING((5 1,4 0,4 1,20 1,5 0,1 0),\ + (0 0,1 0),(5 0,30 0))"), + "llu19-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0)"), + from_wkt("MULTILINESTRING((0 0,30 0),(5 0,20 1,4 1,4 0))"), + from_wkt("MULTILINESTRING((1 0,5 0,20 1,4 1,4 0),(0 0,1 0),\ + (5 0,30 0))"), + "llu19a"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(4 0,4 1,20 1,5 0,1 0)"), + from_wkt("MULTILINESTRING((0 0,30 0),(4 0,4 1,20 1,5 0))"), + from_wkt("MULTILINESTRING((4 0,4 1,20 1,5 0,1 0),(0 0,1 0),\ + (5 0,30 0))"), + "llu19a-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)"), + from_wkt("MULTILINESTRING((0 0,30 0),(5 0,20 1,4 1,4 0))"), + from_wkt("MULTILINESTRING((1 0,5 0,20 1,4 1,4 0,5 0),\ + (0 0,1 0),(5 0,30 0))"), + "llu19b"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0,6 1)"), + from_wkt("MULTILINESTRING((0 0,30 0),(5 0,20 1,4 1,4 0),(5 0,6 1))"), + from_wkt("MULTILINESTRING((1 0,5 0,20 1,4 1,4 0,5 0,6 1),\ + (0 0,1 0),(5 0,30 0))"), + "llu19c"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,3 0)"), + from_wkt("MULTILINESTRING((0 0,30 0),(5 0,20 1,4 1,4 0))"), + from_wkt("MULTILINESTRING((1 0,5 0,20 1,4 1,4 0,3 0),\ + (0 0,1 0),(5 0,30 0))"), + "llu19d"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,3 0,3 1)"), + from_wkt("MULTILINESTRING((0 0,30 0),(5 0,20 1,4 1,4 0),(3 0,3 1))"), + from_wkt("MULTILINESTRING((1 0,5 0,20 1,4 1,4 0,3 0,3 1),\ + (0 0,1 0),(5 0,30 0))"), + "llu19e"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0,5 1)"), + from_wkt("MULTILINESTRING((0 0,30 0),(5 0,20 1,4 1,4 0),(5 0,5 1))"), + from_wkt("MULTILINESTRING((1 0,5 0,20 1,4 1,4 0,5 0,5 1),\ + (0 0,1 0),(5 0,30 0))"), + "llu19f"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(5 1,5 0,4 0,4 1,20 1,5 0,1 0)"), + from_wkt("MULTILINESTRING((0 0,30 0),(5 1,5 0),\ + (4 0,4 1,20 1,5 0))"), + from_wkt("MULTILINESTRING((5 1,5 0,4 0,4 1,20 1,5 0,1 0),\ + (0 0,1 0),(5 0,30 0))"), + "llu19f-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(1 0,5 0,20 1,4 1,5 0,5 1)"), + from_wkt("MULTILINESTRING((0 0,30 0),(5 0,20 1,4 1,5 0,5 1))"), + from_wkt("MULTILINESTRING((1 0,5 0,20 1,4 1,5 0,5 1),\ + (0 0,1 0),(5 0,30 0))"), + "llu19g"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("LINESTRING(5 1,5 0,4 1,20 1,5 0,1 0)"), + from_wkt("MULTILINESTRING((0 0,30 0),(5 1,5 0,4 1,20 1,5 0))"), + from_wkt("MULTILINESTRING((5 1,5 0,4 1,20 1,5 0,1 0),\ + (0 0,1 0),(5 0,30 0))"), + "llu19g-r"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0,30 30,10 30,10 -10,15 0,40 0)"), + from_wkt("LINESTRING(5 5,10 0,10 30,20 0,25 0,25 25,50 0,35 0)"), + from_wkt("MULTILINESTRING((0 0,30 0,30 30,10 30,10 -10,15 0,40 0),\ + (5 5,10 0),(10 30,20 0),(25 0,25 25,50 0,40 0))"), + from_wkt("MULTILINESTRING((5 5,10 0,10 30,20 0,25 0,25 25,50 0,35 0),\ + (0 0,20 0),(25 0,30 0,30 30,10 30),\ + (10 0,10 -10,15 0,20 0),(25 0,35 0))"), + "llu20"); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0,30 30,10 30,10 -10,15 0,40 0)"), + from_wkt("LINESTRING(5 5,10 0,10 30,20 0,25 0,25 25,50 0,15 0)"), + from_wkt("MULTILINESTRING((0 0,30 0,30 30,10 30,10 -10,15 0,40 0),\ + (5 5,10 0),(10 30,20 0),(25 0,25 25,50 0,40 0))"), + from_wkt("MULTILINESTRING((5 5,10 0,10 30,20 0,25 0,25 25,50 0,15 0),\ + (0 0,15 0),(30 0,30 30,10 30),(10 0,10 -10,15 0))"), + "llu20a"); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("LINESTRING(2 2,5 -1,15 2,18 0,20 0)"), + from_wkt("MULTILINESTRING((0 0,18 0,19 0,30 0),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((2 2,5 -1,15 2,18 0,20 0),\ + (0 0,18 0),(20 0,30 0))"), + "llu21" + ); + + tester::apply + (from_wkt("LINESTRING(2 2,5 -1,15 2,18 0,20 0)"), + from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((2 2,5 -1,15 2,18 0,20 0),\ + (0 0,18 0),(20 0,30 0))"), + from_wkt("MULTILINESTRING((0 0,18 0,19 0,30 0),\ + (2 2,5 -1,15 2,18 0))"), + "llu21a" + ); + + tester::apply + (from_wkt("LINESTRING(-2 -2,-4 0,1 -8,-2 6,8 5,-7 -8,3 0,\ + 4 -1,-7 10,-4 10)"), + from_wkt("LINESTRING(-5 -4,3 0,4 -1,7 -4,2 -1,-4 -1,-2 6)"), + from_wkt("MULTILINESTRING((-2 -2,-4 0,1 -8,-2 6,8 5,-7 -8,3 0,\ + 4 -1,-7 10,-4 10),(-5 -4,3 0),\ + (4 -1,7 -4,2 -1,-4 -1,-2 6))"), + from_wkt("MULTILINESTRING((-5 -4,3 0,4 -1,7 -4,2 -1,-4 -1,-2 6),\ + (-2 -2,-4 0,1 -8,-2 6,8 5,-7 -8,3 0),\ + (3 0,-7 10,-4 10))"), + "llu22" + ); +} + + + +BOOST_AUTO_TEST_CASE( test_union_linestring_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** LINESTRING / MULTILINESTRING UNION ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef linestring_type L; + typedef multi_linestring_type ML; + + typedef test_union_of_geometries tester; + + // disjoint linestrings + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 2,4 3),(1 1,2 2,5 3))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 1,2 2,4 3),\ + (1 1,2 2,5 3))"), + "lmlu01" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,4 0))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 1,2 0),(1 1,3 0))"), + "lmlu02" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,5 0))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 1,2 0),(1 1,3 0))"), + "lmlu03" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,10 0,20 1)"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 1,2 0))"), + "lmlu04" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,101 0)"), + from_wkt("MULTILINESTRING((-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,101 0),(-1 -1,1 0),(101 0,200 -1))"), + "lmlu07" + ); + + tester::apply + (from_wkt("LINESTRING(-1 1,0 0,101 0)"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((-1 1,0 0,101 0),(-1 -1,0 0),\ + (19 -1,20 0),(101 0,200 -1))"), + "lmlu07a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,101 0)"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,101 0),(-1 -1,0 0),\ + (19 -1,20 0),(101 0,200 -1))"), + "lmlu07b" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,101 0)"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,101 0),(0 1,1 1,2 0),\ + (-1 -1,1 0),(101 0,200 -1))"), + "lmlu08" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,2 0.5,3 0,101 0)"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0,2 0.5,3 0,101 0),\ + (0 1,1 1,2 0.5),(-1 -1,1 0,3 0),(101 0,200 -1))"), + "lmlu09" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,1 0,1.5 0,2 0.5,3 0,101 0)"), + from_wkt("MULTILINESTRING((0 1,1 1,1 0,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0,1.5 0,2 0.5,3 0,101 0),\ + (0 1,1 1,1 0,2 0.5),(-1 -1,1 0),(1.5 0,3 0),\ + (101 0,200 -1))"), + "lmlu10" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (1 1,2 0,18 0,19 1),(2 1,3 0,17 0,18 1),\ + (3 1,4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((0 0,20 0),(0 1,1 0),(19 0,20 1),\ + (1 1,2 0),(18 0,19 1),(2 1,3 0),(17 0,18 1),\ + (3 1,4 0),(16 0,17 1))"), + "lmlu12" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((1 0,19 0,20 1),\ + (2 0,18 0,19 1),(3 0,17 0,18 1),\ + (4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((0 0,20 0),(19 0,20 1),(18 0,19 1),\ + (17 0,18 1),(16 0,17 1))"), + "lmlu13" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1))"), + from_wkt("MULTILINESTRING((0 0,20 0),(0 1,1 0),\ + (19 0,20 1,19 1,18 0),(2 0,1 1,2 1,3 0),\ + (17 0,18 1,17 1,16 0),(4 0,3 1))"), + "lmlu14" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,6 0))"), + from_wkt("MULTILINESTRING((0 0,20 0),(0 1,1 0),(19 0,20 1),\ + (2 2,4 2,6 0))"), + "lmlu15" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 0,20 0),(0 1,1 0),(19 0,20 1),\ + (6 0,4 2,2 2))"), + "lmlu15a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,5 0,6 0))"), + from_wkt("MULTILINESTRING((0 0,20 0),(0 1,1 0),(19 0,20 1),\ + (2 2,4 2,5 0))"), + "lmlu16" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,20 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,5 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 0,20 0),(0 1,1 0),(19 0,20 1),\ + (5 0,4 2,2 2))"), + "lmlu16a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0))"), + from_wkt("MULTILINESTRING((0 0,30 0),(0 1,1 0),(19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0))"), + "lmlu17" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0,26 2))"), + from_wkt("MULTILINESTRING((0 0,30 0),(0 1,1 0),(19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0,26 2))"), + "lmlu17a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 0,30 0),(0 1,1 0),(19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + "lmlu18" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 0,18 0,19 0,30 0),(0 1,1 0),\ + (19 0,20 1),(2 2,5 -1,15 2,18 0))"), + "lmlu18a" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0,20 0))"), + from_wkt("MULTILINESTRING((0 0,18 0,19 0,30 0),(0 1,1 0),\ + (19 0,20 1),(2 2,5 -1,15 2,18 0))"), + "lmlu18b" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,25 0,26 0))"), + from_wkt("MULTILINESTRING((0 0,18 0,19 0,30 0),(0 1,1 0),\ + (19 0,20 1),(2 2,5 -1,15 2,25 0))"), + "lmlu18c" + ); + + tester::apply + (from_wkt("LINESTRING(0 0,18 0,19 0,30 0)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,25 0,21 0))"), + from_wkt("MULTILINESTRING((0 0,18 0,19 0,30 0),(0 1,1 0),\ + (19 0,20 1),(2 2,5 -1,15 2,25 0))"), + "lmlu18d" + ); +} + + + +BOOST_AUTO_TEST_CASE( test_union_multilinestring_linestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTILINESTRING / LINESTRING UNION ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef linestring_type L; + typedef multi_linestring_type ML; + + typedef test_union_of_geometries tester; + + // disjoint linestrings + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("LINESTRING(1 1,2 2,4 3)"), + from_wkt("MULTILINESTRING((1 1,2 2,4 3),(0 0,10 0,20 1),(1 0,7 0))"), + "mllu01" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("LINESTRING(1 1,2 0,4 0)"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(0 0,2 0),(4 0,10 0,20 1),\ + (1 0,2 0),(4 0,7 0))"), + "mllu02" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("LINESTRING(-1 -1,1 0,101 0,200 -1)"), + from_wkt("MULTILINESTRING((-1 -1,1 0,101 0,200 -1),(0 0,1 0))"), + "mllu03" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("LINESTRING(0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1)"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1),\ + (0 0,1 0),(19 0,20 0))"), + "mllu04" + ); +} + + + + + + + +BOOST_AUTO_TEST_CASE( test_union_multilinestring_multilinestring ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTILINESTRING / MULTILINESTRING UNION ***" + << std::endl; + std::cout << std::endl; +#endif + + typedef multi_linestring_type ML; + + typedef test_union_of_geometries tester; + + // disjoint linestrings + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 2,4 3),(1 1,2 2,5 3))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0),\ + (1 1,2 2,4 3),(1 1,2 2,5 3))"), + "mlmlu01" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,4 0))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0),\ + (1 1,2 0),(1 1,3 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,4 0),\ + (0 0,2 0),(4 0,10 0,20 1),(1 0,2 0),(4 0,7 0))"), + "mlmlu02" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,5 0))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0),\ + (1 1,2 0),(1 1,3 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(1 1,3 0,5 0),\ + (0 0,2 0),(5 0,10 0,20 1),(1 0,2 0),(5 0,7 0))"), + "mlmlu03" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0),\ + (1 1,2 0))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),(0 0,2 0),\ + (4 0,10 0,20 1),(1 0,2 0),(4 0,7 0))"), + "mlmlu04" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0),\ + (10 10,20 10,30 20))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (10 20,15 10,25 10,30 15))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 1),(1 0,7 0),\ + (10 10,20 10,30 20),(1 1,2 0),(10 20,15 10),\ + (20 10,25 10,30 15))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (10 20,15 10,25 10,30 15),(0 0,2 0),(4 0,10 0,20 1),\ + (1 0,2 0),(4 0,7 0),(10 10,15 10),(20 10,30 20))"), + "mlmlu05" + ); + + + tester::apply + (from_wkt("MULTILINESTRING((0 0,10 0,20 10),(1 0,7 0),\ + (10 10,20 10,30 20))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (-1 -1,0 0,9 0,11 10,12 10,13 3,14 4,15 5),\ + (10 20,15 10,25 10,30 15))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 10),(1 0,7 0),\ + (10 10,20 10,30 20),(1 1,2 0),\ + (-1 -1,0 0),(9 0,11 10),(12 10,13 3),(10 20,15 10),\ + (20 10,25 10,30 15))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (-1 -1,0 0,9 0,11 10,12 10,13 3,14 4,15 5),\ + (10 20,15 10,25 10,30 15),(9 0,10 0,13 3),\ + (15 5,20 10),(10 10,11 10),(12 10,15 10),(20 10,30 20))"), + "mlmlu06" + ); + + tester::apply + (from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (-1 -1,0 0,9 0,11 10,12 10,13 3,14 4,15 5),\ + (10 20,15 10,25 10,30 15))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 10),(1 0,7 0),\ + (10 10,20 10,30 20))"), + from_wkt("MULTILINESTRING((1 1,2 0,4 0),\ + (-1 -1,0 0,9 0,11 10,12 10,13 3,14 4,15 5),\ + (10 20,15 10,25 10,30 15),(9 0,10 0,13 3),\ + (15 5,20 10),(10 10,11 10),(12 10,15 10),\ + (20 10,30 20))"), + from_wkt("MULTILINESTRING((0 0,10 0,20 10),(1 0,7 0),\ + (10 10,20 10,30 20),(1 1,2 0),(-1 -1,0 0), \ + (9 0,11 10),(12 10,13 3),(10 20,15 10),\ + (20 10,25 10,30 15))"), + "mlmlu06a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,101 0),(-1 -1,1 0),(101 0,200 -1))"), + from_wkt("MULTILINESTRING((-1 -1,1 0,101 0,200 -1),(0 0,1 0))"), + "mlmlu07" + ); + + tester::apply + (from_wkt("MULTILINESTRING((-1 1,0 0,101 0))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((-1 1,0 0,101 0),(-1 -1,0 0),\ + (19 -1,20 0),(101 0,200 -1))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1),(-1 1,0 0))"), + "mlmlu07a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,101 0),(-1 -1,0 0),\ + (19 -1,20 0),(101 0,200 -1))"), + from_wkt("MULTILINESTRING((-1 -1,0 0,50 0),\ + (19 -1,20 0,101 0,200 -1))"), + "mlmlu07b" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,101 0))"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,101 0),(0 1,1 1,2 0),\ + (-1 -1,1 0),(101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0),\ + (-1 -1,1 0,101 0,200 -1),(0 0,1 0))"), + "mlmlu08" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 0,2 0.5,3 0,101 0))"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0,2 0.5,3 0,101 0),\ + (0 1,1 1,2 0.5),(-1 -1,1 0,3 0),(101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 1,1 1,2 0.5),\ + (-1 -1,1 0,101 0,200 -1),(0 0,1 0,2 0.5,3 0))"), + "mlmlu09" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 0,1.5 0,2 0.5,3 0,101 0))"), + from_wkt("MULTILINESTRING((0 1,1 1,1 0,2 0.5),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 0,1.5 0,2 0.5,3 0,101 0),\ + (0 1,1 1,1 0,2 0.5),(-1 -1,1 0),(1.5 0,3 0),\ + (101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 1,1 1,1 0,2 0.5),\ + (-1 -1,1 0,101 0,200 -1),(0 0,1 0),(1.5 0,2 0.5,3 0))"), + "mlmlu10" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,1 1,100 1,101 0),\ + (0 0,101 0))"), + from_wkt("MULTILINESTRING((1 0,1 1,2 1,3 0,4 0,5 1,6 1,\ + 7 0,8 0,9 1,10 1,11 0,12 0,13 1,14 1,15 0),\ + (-1 -1,1 0,101 0,200 -1))"), + from_wkt("MULTILINESTRING((0 0,1 1,100 1,101 0),\ + (0 0,101 0),(1 0,1 1),(2 1,3 0),(4 0,5 1),(6 1,7 0),\ + (8 0,9 1),(10 1,11 0),(12 0,13 1),(14 1,15 0),\ + (-1 -1,1 0),(101 0,200 -1))"), + from_wkt("MULTILINESTRING((1 0,1 1,2 1,3 0,4 0,5 1,6 1,\ + 7 0,8 0,9 1,10 1,11 0,12 0,13 1,14 1,15 0),\ + (-1 -1,1 0,101 0,200 -1),(0 0,1 1),(2 1,5 1),\ + (6 1,9 1),(10 1,13 1),(14 1,100 1,101 0),(0 0,1 0))"), + "mlmlu11" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (1 1,2 0,18 0,19 1),(2 1,3 0,17 0,18 1),\ + (3 1,4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((0 0,20 0),(0 1,1 0),(19 0,20 1),\ + (1 1,2 0),(18 0,19 1),(2 1,3 0),(17 0,18 1),\ + (3 1,4 0),(16 0,17 1))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (1 1,2 0,18 0,19 1),(2 1,3 0,17 0,18 1),\ + (3 1,4 0,16 0,17 1),(0 0,1 0),(19 0,20 0))"), + "mlmlu12" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((1 0,19 0,20 1),\ + (2 0,18 0,19 1),(3 0,17 0,18 1),\ + (4 0,16 0,17 1))"), + from_wkt("MULTILINESTRING((0 0,20 0),(19 0,20 1),(18 0,19 1),\ + (17 0,18 1),(16 0,17 1))"), + from_wkt("MULTILINESTRING((1 0,19 0,20 1),\ + (2 0,18 0,19 1),(3 0,17 0,18 1),\ + (4 0,16 0,17 1),(0 0,1 0),(19 0,20 0))"), + "mlmlu13" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1))"), + from_wkt("MULTILINESTRING((0 0,20 0),(0 1,1 0),\ + (19 0,20 1,19 1,18 0),(2 0,1 1,2 1,3 0),\ + (17 0,18 1,17 1,16 0),(4 0,3 1))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1,19 1,18 0,2 0,\ + 1 1,2 1,3 0,17 0,18 1,17 1,16 0,4 0,3 1),\ + (0 0,1 0),(19 0,20 0))"), + "mlmlu14" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,6 0))"), + from_wkt("MULTILINESTRING((0 0,20 0),(0 1,1 0),(19 0,20 1),\ + (2 2,4 2,6 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,6 0),(0 0,1 0),(19 0,20 0))"), + "mlmlu15" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 0,20 0),(0 1,1 0),(19 0,20 1),\ + (6 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,4 2,2 2),(0 0,1 0),(19 0,20 0))"), + "mlmlu15a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,5 0,6 0))"), + from_wkt("MULTILINESTRING((0 0,20 0),(0 1,1 0),(19 0,20 1),\ + (2 2,4 2,5 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 2,5 0,6 0),(0 0,1 0),(19 0,20 0))"), + "mlmlu16" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,20 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,5 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 0,20 0),(0 1,1 0),(19 0,20 1),\ + (5 0,4 2,2 2))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (6 0,5 0,4 2,2 2),(0 0,1 0),(19 0,20 0))"), + "mlmlu16a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0))"), + from_wkt("MULTILINESTRING((0 0,30 0),(0 1,1 0),(19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0),(0 0,1 0),(19 0,30 0))"), + "mlmlu17" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0,26 2))"), + from_wkt("MULTILINESTRING((0 0,30 0),(0 1,1 0),(19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0,26 2))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,4 0,5 2,20 2,25 0,26 2),(0 0,1 0),(19 0,30 0))"), + "mlmlu17a" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 0,30 0),(0 1,1 0),(19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0),(0 0,1 0),(19 0,30 0))"), + "mlmlu18" + ); + + tester::apply + (from_wkt("MULTILINESTRING((0 0,18 0,19 0,30 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 0,18 0,19 0,30 0),(0 1,1 0),\ + (19 0,20 1),(2 2,5 -1,15 2,18 0))"), + from_wkt("MULTILINESTRING((0 1,1 0,19 0,20 1),\ + (2 2,5 -1,15 2,18 0),(0 0,1 0),(19 0,30 0))"), + "mlmlu18a" + ); +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/union/union_multi.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/union/union_multi.cpp new file mode 100644 index 000000000..c76bbcd5e --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/union/union_multi.cpp @@ -0,0 +1,499 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2016. +// Modifications copyright (c) 2016, 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) + +#include +#include + +#include "test_union.hpp" +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include + + +#define TEST_UNION(caseid, clips, holes, points, area) \ + (test_one) \ + ( #caseid, caseid[0], caseid[1], clips, holes, points, area) + +#define TEST_UNION_IGNORE(caseid, clips, holes, points, area) \ + { ut_settings ignore_validity; ignore_validity.test_validity = false; \ + test_one \ + (#caseid, caseid[0], caseid[1], \ + clips, holes, points, area, ignore_validity); } + + +template +void test_areal() +{ + test_one("simplex_multi", + case_multi_simplex[0], case_multi_simplex[1], + 1, 0, 20, 14.58); + + test_one("simplex_multi_p_mp", + case_single_simplex, case_multi_simplex[0], + 1, 0, 20, 14.58); + test_one("simplex_multi_mp_p", + case_multi_simplex[0], case_single_simplex, + 1, 0, 20, 14.58); + + test_one("simplex_multi_r_mp", + case_single_simplex, case_multi_simplex[0], + 1, 0, 20, 14.58); + test_one("simplex_multi_mp_r", + case_multi_simplex[0], case_single_simplex, + 1, 0, 20, 14.58); + + + // Normal test cases + test_one("case_multi_no_ip", + case_multi_no_ip[0], case_multi_no_ip[1], + 4, 0, 16, 66.5); + test_one("case_multi_2", + case_multi_2[0], case_multi_2[1], + 3, 0, 16, 59.1); + + test_one("case_58_multi_a", + case_58_multi[0], case_58_multi[3], + 2, 0, 21, 19.83333333); + test_one("case_58_multi_b", + case_58_multi[1], case_58_multi[2], + 1, 3, 17, 48.333333); + + // Constructed cases for multi/touch/equal/etc + test_one("case_61_multi", + case_61_multi[0], case_61_multi[1], + 1, 0, 11, 4.0); + test_one("case_62_multi", + case_62_multi[0], case_62_multi[1], + 2, 0, 10, 2.0); + test_one("case_63_multi", + case_63_multi[0], case_63_multi[1], + 2, 0, 10, 2.0); + test_one("case_64_multi", + case_64_multi[0], case_64_multi[1], + 1, 0, 9, 3.0); + test_one("case_65_multi", + case_65_multi[0], case_65_multi[1], + 3, 0, 15, 4.0); + test_one("case_66_multi", + case_66_multi[0], case_66_multi[1], + 3, 0, 23, 7.0); + test_one("case_72_multi", + case_72_multi[0], case_72_multi[1], + 1, 0, 13, 10.65); + test_one("case_75_multi", + case_75_multi[0], case_75_multi[1], + 5, 0, 25, 5.0); + test_one("case_76_multi", + case_76_multi[0], case_76_multi[1], + 5, 0, 31, 8.0); + test_one("case_89_multi", + case_89_multi[0], case_89_multi[1], + 1, 0, 13, 6); + test_one("case_101_multi", + case_101_multi[0], case_101_multi[1], + 1, 3, 32, 22.25); + test_one("case_103_multi", + case_103_multi[0], case_103_multi[1], + 1, 0, 7, 25); + test_one("case_104_multi", + case_104_multi[0], case_104_multi[1], + 1, 0, 8, 25); + test_one("case_105_multi", + case_105_multi[0], case_105_multi[1], + 1, 0, 5, 25); + test_one("case_106_multi", + case_106_multi[0], case_106_multi[1], + 1, 0, 5, 25); + test_one("case_107_multi", + case_107_multi[0], case_107_multi[1], + 1, 0, 15, 6.75); + test_one("case_108_multi", + case_108_multi[0], case_108_multi[1], + 1, 1, 20, 22.75); + + TEST_UNION(case_109_multi, 1, 2, 14, 1400); + + // Should have 9 holes, they are all separate and touching + test_one("case_110_multi", + case_110_multi[0], case_110_multi[1], + 1, 9, 45, 1250); + + test_one("case_111_multi", + case_111_multi[0], case_111_multi[1], + 2, 0, 10, 16); + test_one("case_112_multi", + case_112_multi[0], case_112_multi[1], + 2, 0, 16, 48); + test_one("case_113_multi", + case_113_multi[0], case_113_multi[1], + 2, 0, 13, 162.5); + test_one("case_114_multi", + case_114_multi[0], case_114_multi[1], + 1, 1, 13, 187.5); + test_one("case_115_multi", + case_115_multi[0], case_115_multi[1], + 1, 1, 18, 26.7036); + test_one("case_116_multi", + case_116_multi[0], case_116_multi[1], + 1, 2, 27, 51); + test_one("case_117_multi", + case_117_multi[0], case_117_multi[1], + 2, 0, 18, 22); + test_one("case_118_multi", + case_118_multi[0], case_118_multi[1], + 3, 0, 27, 46); + test_one("case_119_multi", + case_119_multi[0], case_119_multi[1], + 2, 0, 26, 44); + test_one("case_120_multi", + case_120_multi[0], case_120_multi[1], + 1, 1, 17, 35); + test_one("case_121_multi", + case_121_multi[0], case_121_multi[1], + 1, 1, 14, 25.5); + test_one("case_122_multi", + case_122_multi[0], case_122_multi[1], + 1, 1, 14, 29.5); + + TEST_UNION(case_123_multi, 1, 0, 11, 2.75); + TEST_UNION(case_124_multi, 1, 0, 9, 2.75); + TEST_UNION(case_125_multi, 1, 0, 9, 2.75); + TEST_UNION(case_126_multi, 1, 2, 27, 52.0); + + TEST_UNION(case_131_multi, 1, 2, 15, 14.0); + + // SQL Server returns: MULTIPOLYGON (((4 4, 5.5 4.5, 6 6, 4.5 5.5, 4 4)), ((2 2, 3.5 2.5, 4 4, 2.5 3.5, 2 2)), ((0 0, 8 0, 8 8, 0 8, 0 0), (2 2, 2 4, 4 4, 4 6, 6 6, 6 4, 4 4, 4 2, 2 2))) + // Which is one self-connected hole with two island polygons in both parts, basically identical to what Boost.Geometry delivers + + // PostGIS returns: MULTIPOLYGON(((0 0,0 8,8 8,8 0,0 0),(4 6,4 4,6 4,6 6,4 6)),((2 2,2.5 3.5,4 4,3.5 2.5,2 2),(4 4,2 4,2 2,4 2,4 4)),((4 4,4.5 5.5,6 6,5.5 4.5,4 4))) + // Which seems wrong because the second hole is part of a smaller polygon (?) + // ("POSTGIS="2.1.7 r13414" GEOS="3.5.0dev-CAPI-1.9.0 r4057") + TEST_UNION(case_132_multi, 3, 2, 26, 60.0); + + TEST_UNION(case_133_multi, 2, 1, -1, 64.625); + TEST_UNION(case_134_multi, 1, 2, -1, 66.0); + TEST_UNION(case_135_multi, 1, 2, -1, 22.0); + TEST_UNION(case_136_multi, 1, 2, -1, 22.0); + TEST_UNION(case_137_multi, 1, 2, -1, 22.0); + TEST_UNION(case_138_multi, 2, 1, -1, 65.225); + TEST_UNION(case_139_multi, 2, 1, -1, 64.953); + TEST_UNION(case_140_multi, 2, 1, -1, 64.953); + TEST_UNION(case_141_multi, 1, 0, -1, 100.0); + + test_one("case_recursive_boxes_1", + case_recursive_boxes_1[0], case_recursive_boxes_1[1], + 1, 1, 16, 97.0); + test_one("case_recursive_boxes_2", + case_recursive_boxes_2[0], case_recursive_boxes_2[1], + 1, 0, 5, 100.0); // Area from SQL Server + test_one("case_recursive_boxes_3", + case_recursive_boxes_3[0], case_recursive_boxes_3[1], + 17, 6, 154, 56.5); // Area from SQL Server + + test_one("case_recursive_boxes_4", + case_recursive_boxes_4[0], case_recursive_boxes_4[1], + 1, 2, 26, 96.75); + + TEST_UNION(case_recursive_boxes_5, 3, 10, 98, 70.0); + + test_one("case_recursive_boxes_6", + case_recursive_boxes_6[0], case_recursive_boxes_6[1], + 1, 3, 17, 24.0); + + test_one("case_recursive_boxes_7", + case_recursive_boxes_7[0], case_recursive_boxes_7[1], + 2, 0, 20, 7.0); + + test_one("case_recursive_boxes_8", + case_recursive_boxes_8[0], case_recursive_boxes_8[1], + 1, 0, 13, 12.0); + + test_one("case_recursive_boxes_9", + case_recursive_boxes_9[0], case_recursive_boxes_9[1], + 1, 1, 11, 8.25); + + test_one("case_recursive_boxes_10", + case_recursive_boxes_10[0], case_recursive_boxes_10[1], + 1, 0, -1, 2.75); + test_one("case_recursive_boxes_11", + case_recursive_boxes_11[0], case_recursive_boxes_11[1], + 1, 0, -1, 8.0); + test_one("case_recursive_boxes_12", + case_recursive_boxes_12[0], case_recursive_boxes_12[1], + 6, 0, -1, 6.0); + test_one("case_recursive_boxes_13", + case_recursive_boxes_13[0], case_recursive_boxes_13[1], + 3, 0, -1, 10.25); + + test_one("case_recursive_boxes_14", + case_recursive_boxes_14[0], case_recursive_boxes_14[1], + 5, 0, -1, 4.5); + + // 12, 13, 14 with invalid input. To make then valid it is necessary + // to break regions at self-intersection points (postponed) + + TEST_UNION_IGNORE(case_recursive_boxes_12_invalid, 5, 0, -1, 6.0); + TEST_UNION_IGNORE(case_recursive_boxes_13_invalid, 2, 0, -1, 10.25); + TEST_UNION_IGNORE(case_recursive_boxes_14_invalid, 4, 0, -1, 4.5); + + test_one("case_recursive_boxes_15", + case_recursive_boxes_15[0], case_recursive_boxes_15[1], + 3, 0, -1, 6.0); + test_one("case_recursive_boxes_16", + case_recursive_boxes_16[0], case_recursive_boxes_16[1], + 1, 4, -1, 22.0); + test_one("case_recursive_boxes_17", + case_recursive_boxes_17[0], case_recursive_boxes_17[1], + 5, 2, -1, 21.0); + test_one("case_recursive_boxes_18", + case_recursive_boxes_18[0], case_recursive_boxes_18[1], + 3, 0, -1, 2.5); + test_one("case_recursive_boxes_19", + case_recursive_boxes_19[0], case_recursive_boxes_19[1], + 3, 0, -1, 2.5); + test_one("case_recursive_boxes_20", + case_recursive_boxes_20[0], case_recursive_boxes_20[1], + 2, 0, -1, 2.0); + test_one("case_recursive_boxes_21", + case_recursive_boxes_21[0], case_recursive_boxes_21[1], + 1, 0, -1, 2.5); + test_one("case_recursive_boxes_22", + case_recursive_boxes_22[0], case_recursive_boxes_22[1], + 2, 0, -1, 3.25); + test_one("case_recursive_boxes_23", + case_recursive_boxes_23[0], case_recursive_boxes_23[1], + 3, 0, -1, 1.75); + test_one("case_recursive_boxes_24", + case_recursive_boxes_24[0], case_recursive_boxes_24[1], + 5, 0, -1, 5.0); + test_one("case_recursive_boxes_25", + case_recursive_boxes_25[0], case_recursive_boxes_25[1], + 2, 0, -1, 5.5); + test_one("case_recursive_boxes_26", + case_recursive_boxes_26[0], case_recursive_boxes_26[1], + 3, 0, -1, 6.0); + test_one("case_recursive_boxes_27", + case_recursive_boxes_27[0], case_recursive_boxes_27[1], + 4, 0, -1, 4.5); + test_one("case_recursive_boxes_28", + case_recursive_boxes_28[0], case_recursive_boxes_28[1], + 2, 0, -1, 6.5); + test_one("case_recursive_boxes_29", + case_recursive_boxes_29[0], case_recursive_boxes_29[1], + 2, 2, -1, 15.5); + test_one("case_recursive_boxes_30", + case_recursive_boxes_30[0], case_recursive_boxes_30[1], + 1, 3, -1, 17.5); + test_one("case_recursive_boxes_31", + case_recursive_boxes_31[0], case_recursive_boxes_31[1], + 3, 0, -1, 5.0); + test_one("case_recursive_boxes_32", + case_recursive_boxes_32[0], case_recursive_boxes_32[1], + 2, 0, -1, 5.75); + test_one("case_recursive_boxes_33", + case_recursive_boxes_33[0], case_recursive_boxes_33[1], + 1, 1, -1, 11.0); + test_one("case_recursive_boxes_34", + case_recursive_boxes_34[0], case_recursive_boxes_34[1], + 1, 0, -1, 25.0); + test_one("case_recursive_boxes_35", + case_recursive_boxes_35[0], case_recursive_boxes_35[1], + 1, 1, -1, 24.5); + test_one("case_recursive_boxes_36", + case_recursive_boxes_36[0], case_recursive_boxes_36[1], + 3, 0, -1, 3.0); + test_one("case_recursive_boxes_37", + case_recursive_boxes_37[0], case_recursive_boxes_37[1], + 2, 1, -1, 7.75); + test_one("case_recursive_boxes_38", + case_recursive_boxes_38[0], case_recursive_boxes_38[1], + 2, 1, -1, 14.0); + + TEST_UNION(case_recursive_boxes_46, 1, 4, 51, 33.0); + TEST_UNION(case_recursive_boxes_47, 1, 0, -1, 22.0); + TEST_UNION(case_recursive_boxes_48, 1, 1, -1, 10.0); + TEST_UNION(case_recursive_boxes_49, 1, 3, -1, 59.0); + TEST_UNION(case_recursive_boxes_50, 7, 4, -1, 68.0); + TEST_UNION(case_recursive_boxes_51, 2, 6, -1, 75.0); + TEST_UNION(case_recursive_boxes_52, 2, 6, -1, 77.0); + TEST_UNION(case_recursive_boxes_53, 1, 1, -1, 24.75); + TEST_UNION(case_recursive_boxes_54, 1, 2, -1, 22.5); + TEST_UNION(case_recursive_boxes_55, 3, 1, -1, 15.5); + TEST_UNION(case_recursive_boxes_56, 5, 1, -1, 7.75); + TEST_UNION(case_recursive_boxes_57, 3, 4, -1, 19.75); + TEST_UNION(case_recursive_boxes_58, 6, 1, -1, 6.25); + TEST_UNION(case_recursive_boxes_59, 1, 3, -1, 21.75); + TEST_UNION(case_recursive_boxes_60, 3, 0, -1, 20.5); + TEST_UNION(case_recursive_boxes_61, 1, 1, -1, 23.5); + TEST_UNION(case_recursive_boxes_62, 2, 3, -1, 21.25); + TEST_UNION(case_recursive_boxes_63, 2, 3, -1, 44.0); + TEST_UNION(case_recursive_boxes_64, 1, 2, -1, 24.5); + TEST_UNION(case_recursive_boxes_65, 1, 1, -1, 24.5); + TEST_UNION(case_recursive_boxes_66, 1, 1, -1, 24.75); + TEST_UNION(case_recursive_boxes_67, 4, 0, -1, 14.75); + TEST_UNION(case_recursive_boxes_68, 1, 4, -1, 22.5); + TEST_UNION(case_recursive_boxes_69, 4, 0, -1, 16.25); + TEST_UNION(case_recursive_boxes_70, 1, 0, -1, 25.0); + TEST_UNION(case_recursive_boxes_71, 4, 2, -1, 15.75); + TEST_UNION(case_recursive_boxes_72, 10, 0, -1, 15.0); + TEST_UNION(case_recursive_boxes_73, 1, 2, -1, 24.25); + TEST_UNION(case_recursive_boxes_74, 1, 1, -1, 24.75); + TEST_UNION(case_recursive_boxes_75, 1, 2, -1, 23.25); + TEST_UNION(case_recursive_boxes_76, 1, 0, -1, 24.5); + TEST_UNION(case_recursive_boxes_77, 8, 1, -1, 13.5); + TEST_UNION(case_recursive_boxes_78, 2, 5, -1, 18.0); + TEST_UNION(case_recursive_boxes_79, 1, 2, -1, 14.75); + + // No hole should be generated (but rescaling generates one hole) + TEST_UNION(case_recursive_boxes_80, 2, BG_IF_RESCALED(1, 0), -1, 1.5); + + TEST_UNION(case_recursive_boxes_81, 5, 0, -1, 15.5); + TEST_UNION(case_recursive_boxes_82, 2, 2, -1, 20.25); + TEST_UNION(case_recursive_boxes_83, 3, 1, -1, 20.75); + TEST_UNION(case_recursive_boxes_84, 4, 1, -1, 17.5); + TEST_UNION(case_recursive_boxes_85, 9, 0, -1, 8.0); + TEST_UNION(case_recursive_boxes_86, 3, 0, -1, 3.0); + TEST_UNION(case_recursive_boxes_87, 8, 0, -1, 4.5); + TEST_UNION(case_recursive_boxes_88, 5, 1, -1, 15.0); + + test_one("ggl_list_20120915_h2_a", + ggl_list_20120915_h2[0], ggl_list_20120915_h2[1], + 1, 0, 12, 23.0); // Area from SQL Server + test_one("ggl_list_20120915_h2_b", + ggl_list_20120915_h2[0], ggl_list_20120915_h2[2], + 1, 0, 12, 23.0); // Area from SQL Server + + test_one("ggl_list_20140212_sybren", + ggl_list_20140212_sybren[0], ggl_list_20140212_sybren[1], + 2, 0, 16, 0.002471626); + + { + // Generates either 4 or 3 output polygons + // With rescaling the result is invalid. + ut_settings settings; + settings.test_validity = BG_IF_RESCALED(false, true); + test_one("ticket_9081", + ticket_9081[0], ticket_9081[1], + BG_IF_RESCALED(4, 3), 0, 31, 0.2187385, + settings); + } + + test_one("ticket_10803", + ticket_10803[0], ticket_10803[1], + 1, 0, 9, 2663736.07038); + test_one("ticket_11984", + ticket_11984[0], ticket_11984[1], + 1, 2, 134, 60071.08077); + test_one("ticket_12118", + ticket_12118[0], ticket_12118[1], + 1, -1, 27, 2221.38713); + +#if defined(BOOST_GEOMETRY_TEST_FAILURES) || ! defined(BOOST_GEOMETRY_USE_RESCALING) + // No output if rescaling is done + test_one("ticket_12125", + ticket_12125[0], ticket_12125[1], + 1, 0, -1, 575.831180350007); +#endif + + TEST_UNION(ticket_12503, 42, 1, -1, 945.625); + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // Failure with rescaling + TEST_UNION(issue_630_a, 1, 0, -1, 2.200326); +#endif + TEST_UNION(issue_630_b, 1, 0, -1, 1.675976); +#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // Failure with Kramer rule + TEST_UNION(issue_630_c, 1, 0, -1, 1.670367); +#endif + +#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // With rescaling the small polygon is added on top of the outer polygon + TEST_UNION(issue_643, 1, 0, -1, 80.0); +#endif + +#if defined(BOOST_GEOMETRY_USE_KRAMER_RULE) + // Two polygons, should ideally be merged + TEST_UNION(mail_2019_01_21_johan, 2, 0, -1, 0.00058896); +#else + // Correct: one polygon + TEST_UNION(mail_2019_01_21_johan, 1, 0, -1, 0.00058896); +#endif + + TEST_UNION(mysql_23023665_7, 1, 1, -1, 99.19494); + TEST_UNION(mysql_23023665_8, 1, 2, -1, 1400.0); + + test_one("mysql_23023665_9", + mysql_23023665_9[0], mysql_23023665_9[1], + 1, 9, -1, 1250.0); + + TEST_UNION(mysql_regression_1_65_2017_08_31, 3, 0, -1, 181.966397646608); +} + +// Test cases (generic) +template +void test_all() +{ + + typedef bg::model::ring ring; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + test_areal(); +} + +// Test cases for integer coordinates / ccw / open +template +void test_specific() +{ + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + + ut_settings settings; + settings.test_validity = true; + + test_one("ticket_10803", + ticket_10803[0], ticket_10803[1], + 1, 0, 9, 2664270, settings); +} + + +int test_main(int, char* []) +{ + BoostGeometryWriteTestConfiguration(); + test_all, true, true>(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_all, false, false>(); + + test_specific, false, false>(); + + test_all, true, true>(); + +#if defined(HAVE_TTMATH) + std::cout << "Testing TTMATH" << std::endl; + test_all >(); +#endif + +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/set_operations/union/union_pl_pl.cpp b/src/boost/libs/geometry/test/algorithms/set_operations/union/union_pl_pl.cpp new file mode 100644 index 000000000..030a62784 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/set_operations/union/union_pl_pl.cpp @@ -0,0 +1,202 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2014-2015, Oracle and/or its affiliates. + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +#include + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_union_pointlike_pointlike +#endif + +#ifdef BOOST_GEOMETRY_TEST_DEBUG +#define BOOST_GEOMETRY_DEBUG_TURNS +#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER +#endif + +#include + +#include "../test_set_ops_pointlike.hpp" + +#include + +typedef bg::model::point point_type; +typedef bg::model::multi_point multi_point_type; + + + +//=========================================================================== +//=========================================================================== +//=========================================================================== + + +BOOST_AUTO_TEST_CASE( test_union_point_point ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** POINT / POINT UNION ***" << std::endl; + std::cout << std::endl; +#endif + + typedef point_type P; + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + P, P, MP, bg::overlay_union + > tester; + + tester::apply + ("ppu01", + from_wkt

("POINT(0 0)"), + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT(0 0,1 1)") + ); + + tester::apply + ("ppu02", + from_wkt

("POINT(0 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); +} + + +BOOST_AUTO_TEST_CASE( test_union_multipoint_point ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTIPOINT / POINT UNION ***" << std::endl; + std::cout << std::endl; +#endif + + typedef point_type P; + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + MP, P, MP, bg::overlay_union + > tester; + + tester::apply + ("mppu01", + from_wkt("MULTIPOINT(0 0)"), + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT(0 0,1 1)") + ); + + tester::apply + ("mppu02", + from_wkt("MULTIPOINT(0 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("mppu03", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT(0 0,0 0,1 1)") + ); + + tester::apply + ("mppu04", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("mppu05", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT(0 0,0 0,1 0,1 1)") + ); + + tester::apply + ("mppu06", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt

("POINT(1 0)"), + from_wkt("MULTIPOINT(0 0,0 0,1 0)") + ); + + tester::apply + ("mppu07", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0,1 0)") + ); + + tester::apply + ("mppu08", + from_wkt("MULTIPOINT()"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); +} + + +BOOST_AUTO_TEST_CASE( test_union_multipoint_multipoint ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; + std::cout << "*** MULTIPOINT / MULTIPOINT UNION ***" << std::endl; + std::cout << std::endl; +#endif + + typedef multi_point_type MP; + + typedef test_set_op_of_pointlike_geometries + < + MP, MP, MP, bg::overlay_union + > tester; + + tester::apply + ("mpmpu01", + from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"), + from_wkt("MULTIPOINT(1 0,1 1,1 1,1 1)"), + from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"), + from_wkt("MULTIPOINT(1 0,1 1,1 1,1 1,2 2,3 3,0 0,0 0,2 2)") + ); + + tester::apply + ("mpmpu02", + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)") + ); + + tester::apply + ("mpmpu03", + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)") + ); + + tester::apply + ("mpmpu04", + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)") + ); + + tester::apply + ("mpmpu05", + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpmpu06", + from_wkt("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0)"), + from_wkt("MULTIPOINT(0 1,0 2,1 0,0 0,2 0)"), + from_wkt("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0,0 1,0 2)"), + from_wkt("MULTIPOINT(0 1,0 2,1 0,0 0,2 0,3 0)") + ); +} diff --git a/src/boost/libs/geometry/test/algorithms/similarity/Jamfile b/src/boost/libs/geometry/test/algorithms/similarity/Jamfile new file mode 100644 index 000000000..f8452b1a4 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/similarity/Jamfile @@ -0,0 +1,15 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2018 Yaghyavardhan Singh Khangarot, Hyderabad, India. +# +# Contributed and/or modified by Yaghyavardhan Singh Khangarot, as part of Google Summer of Code 2018 program. +# +# 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) + +test-suite boost-geometry-algorithms-similarity + : + [ run discrete_frechet_distance.cpp : : : : algorithms_discrete_frechet_distance ] + [ run discrete_hausdorff_distance.cpp : : : : algorithms_discrete_hausdorff_distance ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/similarity/discrete_frechet_distance.cpp b/src/boost/libs/geometry/test/algorithms/similarity/discrete_frechet_distance.cpp new file mode 100644 index 000000000..35e552585 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/similarity/discrete_frechet_distance.cpp @@ -0,0 +1,95 @@ +// Boost.Geometry + +// Copyright (c) 2018 Yaghyavardhan Singh Khangarot, Hyderabad, India. + +// Contributed and/or modified by Yaghyavardhan Singh Khangarot, as part of Google Summer of Code 2018 program. + +// 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) + +#include + +#include +#include +#include + +#include "test_frechet_distance.hpp" + + template +void test_all_cartesian() +{ + typedef bg::model::linestring

linestring_2d; +#ifdef BOOST_GEOMETRY_TEST_DEBUG + typedef typename coordinate_system

::type CordType; + std::cout << typeid(CordType).name() << std::endl; +#endif + + test_geometry("LINESTRING(3 0,2 1,3 2)","LINESTRING(0 0,3 4,4 3)", 3); + test_geometry("LINESTRING(3 0,2 1,3 2)","LINESTRING(0 0,3 4,4 3)",bg::strategy::distance::pythagoras<>(), 3); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)","LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)","LINESTRING(1 1, 0 1, 0 0, 1 0, 1 1)",sqrt(2.0)); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 0)","LINESTRING(0 0, 1 0, 1 1, 0 0)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 0)","LINESTRING(1 1, 0 0, 1 0, 1 1)",sqrt(2.0)); + test_geometry("LINESTRING(0 0, 1 0)","LINESTRING(0 0, 1 0)",0); + test_geometry("LINESTRING(0 0,3 4,4 3)","LINESTRING(4 3,3 4,0 0)",5); + + +} + + template +void test_all_geographic() +{ + typedef bg::model::linestring

linestring_2d; + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + typedef typename coordinate_system

::type CordType; + std::cout << typeid(CordType).name() << std::endl; +#endif + + test_geometry("LINESTRING(3 0,2 1,3 2)","LINESTRING(0 0,3 4,4 3)", 333958); + test_geometry("LINESTRING(3 0,2 1,3 2)","LINESTRING(0 0,3 4,4 3)",bg::strategy::distance::geographic(), 333958.472379679); + test_geometry("LINESTRING(3 0,2 1,3 2)","LINESTRING(0 0,3 4,4 3)",bg::strategy::distance::geographic(), 333958.472379679); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)","LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)","LINESTRING(1 1, 0 1, 0 0, 1 0, 1 1)",156898); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 0)","LINESTRING(0 0, 1 0, 1 1, 0 0)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 0)","LINESTRING(1 1, 0 0, 1 0, 1 1)",156898); + test_geometry("LINESTRING(0 0, 1 0)","LINESTRING(0 0, 1 0)",0); + test_geometry("LINESTRING(0 0,3 4,4 3)","LINESTRING(4 3,3 4,0 0)",555093); + +} + + template +void test_all_spherical_equ() +{ + typedef bg::model::linestring

linestring_2d; + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + typedef typename coordinate_system

::type CordType; + std::cout << typeid(CordType).name() << std::endl; +#endif + + test_geometry("LINESTRING(3 0,2 1,3 2)","LINESTRING(0 0,3 4,4 3)", 0.05235987); + test_geometry("LINESTRING(3 0,2 1,3 2)","LINESTRING(0 0,3 4,4 3)",bg::strategy::distance::haversine(), 0.05235987); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)","LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)","LINESTRING(1 1, 0 1, 0 0, 1 0, 1 1)",0.02468205); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 0)","LINESTRING(0 0, 1 0, 1 1, 0 0)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 0)","LINESTRING(1 1, 0 0, 1 0, 1 1)",0.02468205); + test_geometry("LINESTRING(0 0, 1 0)","LINESTRING(0 0, 1 0)",0); + test_geometry("LINESTRING(0 0,3 4,4 3)","LINESTRING(4 3,3 4,0 0)",0.0872409); + +} + +int test_main(int, char* []) +{ + //Cartesian Coordinate System + test_all_cartesian >(); + + //Geographic Coordinate System + test_all_geographic > >(); + + //Spherical_Equatorial Coordinate System + test_all_spherical_equ > >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/similarity/discrete_hausdorff_distance.cpp b/src/boost/libs/geometry/test/algorithms/similarity/discrete_hausdorff_distance.cpp new file mode 100644 index 000000000..d5d98cdcb --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/similarity/discrete_hausdorff_distance.cpp @@ -0,0 +1,118 @@ +// Boost.Geometry + +// Copyright (c) 2018 Yaghyavardhan Singh Khangarot, Hyderabad, India. + +// Contributed and/or modified by Yaghyavardhan Singh Khangarot, +// as part of Google Summer of Code 2018 program. + +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 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) + +#include + +#include +#include +#include +#include +#include + +#include "test_hausdorff_distance.hpp" + + template +void test_all_cartesian() +{ + typedef bg::model::linestring

linestring_2d; + typedef bg::model::multi_linestring mlinestring_t; + typedef bg::model::multi_point

mpoint_t; + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + typedef typename coordinate_system

::type CordType; + std::cout << typeid(CordType).name() << std::endl; +#endif + + test_geometry("POINT(3 1)","MULTIPOINT(0 0,3 4,4 3)", sqrt(5.0)); + test_geometry("LINESTRING(3 0,2 1,3 2)","LINESTRING(0 0,3 4,4 3)", 3); + test_geometry("MULTIPOINT(3 0,2 1,3 2)","MULTIPOINT(0 0,3 4,4 3)", 3); + test_geometry("LINESTRING(1 1,2 2,4 3)","MULTILINESTRING((0 0,3 4,4 3),(1 1,2 2,4 3))", sqrt(5.0)); + test_geometry("MULTILINESTRING((3 0,2 1,3 2),(0 0,3 4,4 3))","MULTILINESTRING((0 0,3 4,4 3),(3 0,2 1,3 2))", 3); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)","LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)","LINESTRING(1 1, 0 1, 0 0, 1 0, 1 1)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 0)","LINESTRING(0 0, 1 0, 1 1, 0 0)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 0)","LINESTRING(1 1, 0 0, 1 0, 1 1)",0); + test_geometry("LINESTRING(0 0, 1 0)","LINESTRING(0 0, 1 0)",0); + test_geometry("LINESTRING(0 0,3 4,4 3)","LINESTRING(4 3,3 4,0 0)",0); +} + + template +void test_all_geographic() +{ + typedef bg::model::linestring

linestring_2d; + typedef bg::model::multi_linestring mlinestring_t; + typedef bg::model::multi_point

mpoint_t; +#ifdef BOOST_GEOMETRY_TEST_DEBUG + typedef typename coordinate_system

::type CordType; + std::cout << typeid(CordType).name() << std::endl; +#endif + + test_geometry("POINT(3 1)","MULTIPOINT(0 0,3 4,4 3)", 247552); + test_geometry("LINESTRING(3 0,2 1,3 2)","LINESTRING(0 0,3 4,4 3)", 333958); + test_geometry("MULTIPOINT(3 0,2 1,3 2)","MULTIPOINT(0 0,3 4,4 3)", 333958); + test_geometry("LINESTRING(1 1,2 2,4 3)","MULTILINESTRING((0 0,3 4,4 3),(1 1,2 2,4 3))", 247518); + test_geometry("LINESTRING(3 0,2 1,3 2)","LINESTRING(0 0,3 4,4 3)",bg::strategy::distance::geographic(), 333958.472379679); + test_geometry("LINESTRING(3 0,2 1,3 2)","LINESTRING(0 0,3 4,4 3)",bg::strategy::distance::geographic(), 333958.472379679); + test_geometry("MULTILINESTRING((3 0,2 1,3 2),(0 0,3 4,4 3))","MULTILINESTRING((0 0,3 4,4 3),(3 0,2 1,3 2))",333958); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)","LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)","LINESTRING(1 1, 0 1, 0 0, 1 0, 1 1)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 0)","LINESTRING(0 0, 1 0, 1 1, 0 0)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 0)","LINESTRING(1 1, 0 0, 1 0, 1 1)",0); + test_geometry("LINESTRING(0 0, 1 0)","LINESTRING(0 0, 1 0)",0); + test_geometry("LINESTRING(0 0,3 4,4 3)","LINESTRING(4 3,3 4,0 0)",0); +} + + template +void test_all_spherical_equ() +{ + typedef bg::model::linestring

linestring_2d; + typedef bg::model::multi_linestring mlinestring_t; + typedef bg::model::multi_point

mpoint_t; + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + typedef typename coordinate_system

::type CordType; + std::cout << typeid(CordType).name() << std::endl; +#endif + + test_geometry("POINT(3 1)","MULTIPOINT(0 0,3 4,4 3)", 0.03902); + test_geometry("LINESTRING(3 0,2 1,3 2)","LINESTRING(0 0,3 4,4 3)", 0.05236); + test_geometry("MULTIPOINT(3 0,2 1,3 2)","MULTIPOINT(0 0,3 4,4 3)", 0.05236); + test_geometry("LINESTRING(1 1,2 2,4 3)","MULTILINESTRING((0 0,3 4,4 3),(1 1,2 2,4 3))", 0.03900); + test_geometry("MULTILINESTRING((3 0,2 1,3 2),(0 0,3 4,4 3))","MULTILINESTRING((0 0,3 4,4 3),(3 0,2 1,3 2))",0.05236); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)","LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 1, 0 0)","LINESTRING(1 1, 0 1, 0 0, 1 0, 1 1)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 0)","LINESTRING(0 0, 1 0, 1 1, 0 0)",0); + test_geometry("LINESTRING(0 0, 1 0, 1 1, 0 0)","LINESTRING(1 1, 0 0, 1 0, 1 1)",0); + test_geometry("LINESTRING(0 0, 1 0)","LINESTRING(0 0, 1 0)",0); + test_geometry("LINESTRING(0 0,3 4,4 3)","LINESTRING(4 3,3 4,0 0)",0); +} + +int test_main(int, char* []) +{ + //Cartesian Coordinate System + test_all_cartesian >(); + test_all_cartesian >(); + test_all_cartesian >(); + + //Geographic Coordinate System + test_all_geographic > >(); + test_all_geographic > >(); + + //Spherical_Equatorial Coordinate System + test_all_spherical_equ > >(); + test_all_spherical_equ > >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/similarity/test_frechet_distance.hpp b/src/boost/libs/geometry/test/algorithms/similarity/test_frechet_distance.hpp new file mode 100644 index 000000000..cca028525 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/similarity/test_frechet_distance.hpp @@ -0,0 +1,144 @@ +// Boost.Geometry + +// Copyright (c) 2018 Yaghyavardhan Singh Khangarot, Hyderabad, India. + +// Contributed and/or modified by Yaghyavardhan Singh Khangarot, as part of Google Summer of Code 2018 program. + +// 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) + +#ifndef BOOST_GEOMETRY_TEST_FRECHET_DISTANCE_HPP +#define BOOST_GEOMETRY_TEST_FRECHET_DISTANCE_HPP + +#include +#include +#include +#include +#include + +template +void test_frechet_distance(Geometry1 const& geometry1,Geometry2 const& geometry2, + typename bg::distance_result + < + typename bg::point_type::type, + typename bg::point_type::type + >::type expected_frechet_distance ) +{ + using namespace bg; + typedef typename distance_result + < + typename point_type::type, + typename point_type::type + >::type result_type; + result_type h_distance = bg::discrete_frechet_distance(geometry1,geometry2); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::ostringstream out; + out << typeid(typename bg::coordinate_type::type).name() + << std::endl + << typeid(typename bg::coordinate_type::type).name() + << std::endl + << typeid(h_distance).name() + << std::endl + << "frechet_distance : " << bg::discrete_frechet_distance(geometry1,geometry2) + << std::endl; + std::cout << out.str(); +#endif + + BOOST_CHECK_CLOSE(h_distance, expected_frechet_distance, 0.001); +} + + + +template +void test_geometry(std::string const& wkt1,std::string const& wkt2, + typename bg::distance_result + < + typename bg::point_type::type, + typename bg::point_type::type + >::type expected_frechet_distance) +{ + Geometry1 geometry1; + bg::read_wkt(wkt1, geometry1); + Geometry2 geometry2; + bg::read_wkt(wkt2, geometry2); + test_frechet_distance(geometry1,geometry2,expected_frechet_distance); +#if defined(BOOST_GEOMETRY_TEST_DEBUG) + test_frechet_distance(boost::variant(geometry1),boost::variant(geometry2), expected_frechet_distance); +#endif +} + +template +void test_frechet_distance(Geometry1 const& geometry1,Geometry2 const& geometry2,Strategy strategy, + typename bg::distance_result + < + typename bg::point_type::type, + typename bg::point_type::type, + Strategy + >::type expected_frechet_distance ) +{ + using namespace bg; + typedef typename distance_result + < + typename point_type::type, + typename point_type::type, + Strategy + >::type result_type; + result_type h_distance = bg::discrete_frechet_distance(geometry1,geometry2,strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::ostringstream out; + out << typeid(typename bg::coordinate_type::type).name() + << std::endl + << typeid(typename bg::coordinate_type::type).name() + << std::endl + << typeid(h_distance).name() + << std::endl + << "frechet_distance : " << bg::discrete_frechet_distance(geometry1,geometry2,strategy) + << std::endl; + std::cout << out.str(); +#endif + + BOOST_CHECK_CLOSE(h_distance, expected_frechet_distance, 0.001); +} + + + +template +void test_geometry(std::string const& wkt1,std::string const& wkt2,Strategy strategy, + typename bg::distance_result + < + typename bg::point_type::type, + typename bg::point_type::type, + Strategy + >::type expected_frechet_distance) +{ + Geometry1 geometry1; + bg::read_wkt(wkt1, geometry1); + Geometry2 geometry2; + bg::read_wkt(wkt2, geometry2); + test_frechet_distance(geometry1,geometry2,strategy,expected_frechet_distance); +#if defined(BOOST_GEOMETRY_TEST_DEBUG) + test_frechet_distance(boost::variant(geometry1),boost::variant(geometry2),strategy, expected_frechet_distance); +#endif +} + + +template +void test_empty_input(Geometry1 const& geometry1,Geometry2 const& geometry2) +{ + try + { + bg::discrete_frechet_distance(geometry1,geometry2); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "A empty_input_exception should have been thrown" ); +} + + +#endif + diff --git a/src/boost/libs/geometry/test/algorithms/similarity/test_hausdorff_distance.hpp b/src/boost/libs/geometry/test/algorithms/similarity/test_hausdorff_distance.hpp new file mode 100644 index 000000000..8b96f6109 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/similarity/test_hausdorff_distance.hpp @@ -0,0 +1,138 @@ +// Boost.Geometry + +// Copyright (c) 2018 Yaghyavardhan Singh Khangarot, Hyderabad, India. +// Contributed and/or modified by Yaghyavardhan Singh Khangarot, +// as part of Google Summer of Code 2018 program. + +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, 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) + +#ifndef BOOST_GEOMETRY_TEST_HAUSDORFF_DISTANCE_HPP +#define BOOST_GEOMETRY_TEST_HAUSDORFF_DISTANCE_HPP + +#include +#include +#include +#include +#include + +template +void test_hausdorff_distance(Geometry1 const& geometry1, Geometry2 const& geometry2, + Expected const& expected_hausdorff_distance) +{ + typedef typename bg::distance_result + < + typename bg::point_type::type, + typename bg::point_type::type + >::type result_type; + + result_type h_distance = bg::discrete_hausdorff_distance(geometry1, geometry2); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::ostringstream out; + out << typeid(typename bg::coordinate_type::type).name() + << std::endl + << typeid(typename bg::coordinate_type::type).name() + << std::endl + << typeid(h_distance).name() + << std::endl + << "hausdorff_distance : " << h_distance + << std::endl; + std::cout << out.str(); +#endif + + BOOST_CHECK_CLOSE(h_distance, result_type(expected_hausdorff_distance), 0.01); +} + + + +template +void test_geometry(std::string const& wkt1, std::string const& wkt2, + Expected const& expected_hausdorff_distance) +{ + Geometry1 geometry1; + bg::read_wkt(wkt1, geometry1); + Geometry2 geometry2; + bg::read_wkt(wkt2, geometry2); + + test_hausdorff_distance(geometry1, geometry2, expected_hausdorff_distance); + +#if defined(BOOST_GEOMETRY_TEST_DEBUG) + test_hausdorff_distance(boost::variant(geometry1), + boost::variant(geometry2), + expected_hausdorff_distance); +#endif +} + +template +void test_hausdorff_distance(Geometry1 const& geometry1, Geometry2 const& geometry2, + Strategy strategy, Expected const& expected_hausdorff_distance) +{ + typedef typename bg::distance_result + < + typename bg::point_type::type, + typename bg::point_type::type, + Strategy + >::type result_type; + + result_type h_distance = bg::discrete_hausdorff_distance(geometry1, geometry2, strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::ostringstream out; + out << typeid(typename bg::coordinate_type::type).name() + << std::endl + << typeid(typename bg::coordinate_type::type).name() + << std::endl + << typeid(h_distance).name() + << std::endl + << "hausdorff_distance : " << h_distance + << std::endl; + std::cout << out.str(); +#endif + + BOOST_CHECK_CLOSE(h_distance, result_type(expected_hausdorff_distance), 0.01); +} + + + +template +void test_geometry(std::string const& wkt1, std::string const& wkt2, + Strategy strategy, Expected const& expected_hausdorff_distance) +{ + Geometry1 geometry1; + bg::read_wkt(wkt1, geometry1); + Geometry2 geometry2; + bg::read_wkt(wkt2, geometry2); + + test_hausdorff_distance(geometry1, geometry2, strategy, expected_hausdorff_distance); + +#if defined(BOOST_GEOMETRY_TEST_DEBUG) + test_hausdorff_distance(boost::variant(geometry1), + boost::variant(geometry2), + strategy, expected_hausdorff_distance); +#endif +} + + +template +void test_empty_input(Geometry1 const& geometry1, Geometry2 const& geometry2) +{ + try + { + bg::discrete_hausdorff_distance(geometry1, geometry2); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "A empty_input_exception should have been thrown"); +} + + +#endif + diff --git a/src/boost/libs/geometry/test/algorithms/simplify.cpp b/src/boost/libs/geometry/test/algorithms/simplify.cpp new file mode 100644 index 000000000..81c7be5da --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/simplify.cpp @@ -0,0 +1,311 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include + + +#include +#include +#include + +#include +#include + +// #define TEST_PULL89 +#ifdef TEST_PULL89 +#include +#endif + + +#ifdef TEST_PULL89 +template +void test_with_ax(std::string const& wkt, + std::string const& expected, + T const& adt, + T const& xdt) +{ + typedef typename bg::point_type::type point_type; + typedef bg::strategy::distance::detail::projected_point_ax<> ax_type; + typedef typename bg::strategy::distance::services::return_type + < + bg::strategy::distance::detail::projected_point_ax<>, + point_type, + point_type + >::type return_type; + + typedef bg::strategy::distance::detail::projected_point_ax_less + < + return_type + > comparator_type; + + typedef bg::strategy::simplify::detail::douglas_peucker + < + point_type, + bg::strategy::distance::detail::projected_point_ax<>, + comparator_type + > dp_ax; + + return_type max_distance(adt, xdt); + comparator_type comparator(max_distance); + dp_ax strategy(comparator); + + test_geometry(wkt, expected, max_distance, strategy); +} +#endif + + +template +void test_all() +{ + test_geometry >( + "LINESTRING(0 0,5 5,10 10)", + "LINESTRING(0 0,10 10)", 1.0); + + test_geometry >( + "LINESTRING(0 0, 5 5, 6 5, 10 10)", + "LINESTRING(0 0,10 10)", 1.0); + + test_geometry >( + "LINESTRING(0 0,5 5,7 5,10 10)", + "LINESTRING(0 0,5 5,7 5,10 10)", 1.0); + + // Lightning-form which fails for Douglas-Peucker + test_geometry >( + "LINESTRING(0 0,120 6,80 10,200 0)", + "LINESTRING(0 0,120 6,80 10,200 0)", 7); + + // Same which reordered coordinates + test_geometry >( + "LINESTRING(0 0,80 10,120 6,200 0)", + "LINESTRING(0 0,80 10,200 0)", 7); + + // Duplicate point is removed + test_geometry >( + "LINESTRING(0 0,0 0)", + "LINESTRING(0 0)", 1.0); + + // Mail 2013-10-07, real-life test, piece of River Leine + // PostGIS returns exactly the same result + test_geometry >( + "LINESTRING(4293586 3290439,4293568 3290340,4293566 3290332,4293570 3290244,4293576 3290192" + ",4293785 3289660,4293832 3289597,4293879 3289564,4293937 3289545,4294130 3289558" + ",4294204 3289553,4294240 3289539,4294301 3289479,4294317 3289420,4294311 3289353" + ",4294276 3289302,4293870 3289045,4293795 3288978,4293713 3288879,4293669 3288767" + ",4293654 3288652,4293657 3288563,4293690 3288452,4293761 3288360,4293914 3288215" + ",4293953 3288142,4293960 3288044,4293951 3287961,4293913 3287875,4293708 3287628" + ",4293658 3287542,4293633 3287459,4293630 3287383,4293651 3287323,4293697 3287271" + ",4293880 3287128,4293930 3287045,4293938 3286977,4293931 3286901,4293785 3286525" + ",4293775 3286426,4293786 3286358,4293821 3286294,4294072 3286076,4294134 3285986)", + "LINESTRING(4293586 3290439,4293785 3289660,4294317 3289420,4293654 3288652,4293960 3288044" + ",4293633 3287459,4293786 3286358,4294134 3285986)", 250); + + /* TODO fix this + test_geometry >( + "LINESTRING(0 0,5 5,7 5,10 10)", + "LINESTRING(0 0,5 5,7 5,10 10)", 1.0); + */ + + /* + + Above can be checked in PostGIS by: + + select astext(ST_Simplify(geomfromtext('LINESTRING(0 0, 5 5, 10 10)'),1.0)) as simplified + union all select astext(ST_Simplify(geomfromtext('LINESTRING(0 0, 5 5, 6 5, 10 10)'),1.0)) + etc + */ + + + test_geometry >( + "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0))", + "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,4 0))", 1.0); + + test_geometry >( + "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0),(7 3,7 6,1 6,1 3,4 3,7 3))", + "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,4 0),(7 3,7 6,1 6,1 3,7 3))", 1.0); + + // Closing point should be simplified away + test_geometry >( + "POLYGON((1 0,0 0,0 4,4 4,4 0,1 0))", + "POLYGON((0 0,0 4,4 4,4 0,0 0))", 0.1); + + // Section around closing point should be simplified away + test_geometry >( + "POLYGON((5 0,4 0,3 0,2 0,1 0,0 0,0 5,5 5,5 0))", + "POLYGON((5 0,0 0,0 5,5 5,5 0))", 0.1); + + // Manually rotate this WKT over all the 5 redundant points at closing area + test_geometry >( + "POLYGON((4 0,3 0,2 0,1 0,0 0,0 5,5 5,5 0,4 0))", + "POLYGON((0 0,0 5,5 5,5 0,0 0))", 0.1); + test_geometry >( + "POLYGON((3 0,2 0,1 0,0 0,0 5,5 5,5 0,4 0,3 0))", + "POLYGON((0 0,0 5,5 5,5 0,0 0))", 0.1); + test_geometry >( + "POLYGON((2 0,1 0,0 0,0 5,5 5,5 0,4 0,3 0,2 0))", + "POLYGON((0 0,0 5,5 5,5 0,0 0))", 0.1); + test_geometry >( + "POLYGON((1 0,0 0,0 5,5 5,5 0,4 0,3 0,2 0,1 0))", + "POLYGON((0 0,0 5,5 5,5 0,0 0))", 0.1); + test_geometry >( + "POLYGON((0 0,0 5,5 5,5 0,4 0,3 0,2 0,1 0,0 0))", + "POLYGON((0 0,0 5,5 5,5 0,0 0))", 0.1); + + // Test wither all collinear points in between are simplified away + // First approach did select one of them because it was the end of the + // "closing area". Now the opposite is taken, which is farthest and never + // collinear + test_geometry >( + "POLYGON((2 0,1 0,0 0,0 1,0 2,0 3,0 4,1 4,2 4,3 4,4 4,4 3,4 2,4 1,4 0,3 0,2 0))", + "POLYGON((0 0,0 4,4 4,4 0,0 0))", 1.0); + + // Test simplifying away one of the sides (collinear), then closing point + // and finally the whole polygon + std::string const near_triangle = "POLYGON((0.55 0.55,1 0,0.5 0,0 0,0 1,0.55 0.55))"; + test_geometry >(near_triangle, + "POLYGON((0.55 0.55,1 0,0 0,0 1,0.55 0.55))", 0.01); + test_geometry >(near_triangle, + "POLYGON((1 0,0 0,0 1,1 0))", 0.1); + // 0.9 should still result in a simplified polygon + test_geometry >(near_triangle, + "POLYGON((1 0,0 0,0 1,1 0))", 0.9); + test_geometry >(near_triangle, + "POLYGON(())", 1.1); + + // Test simplifying away the closing point, and closing it explicitly + std::string const salamina = "POLYGON((2616131.59828 4579307.29099,2616687.86177 4579151.05325,2618172.52982 4578718.79836,2618728.79332 4578522.73574,2620336.91468 4577424.54293,2620522.48427 4576992.50129,2621264.76264 4569815.3917,2621140.75272 4569502.07546,2620491.53745 4568208.96982,2620151.34509 4567855.90928,2612606.55528 4562800.36094,2611833.3301 4562291.50023,2611369.5731 4562174.16117,2610225.54269 4562408.69959,2605896.21638 4564367.29512,2605494.13038 4564641.6634,2605277.94792 4566288.44857,2606019.89233 4569423.46562,2609050.12019 4577424.54293,2614337.90732 4579347.12775,2615296.7021 4579543.34723,2616131.59828 4579307.29099))"; + test_geometry >(salamina, 196318951.5097456, 100); + test_geometry >(salamina, 194471472.35804176, 200); + test_geometry >(salamina, 191735337.33374023, 500); + test_geometry >(salamina, 186593693.18401337, 1000); + test_geometry >(salamina, 181448561.04094696, 2000); + test_geometry >(salamina, 141965392.92240524, 5000); + + // Interior ring (sized ~ 1) should be simplified away (distance 5) + test_geometry >( + "POLYGON((0 0,0 10,10 10,10 0,0 0),(5 5,6 6,5 6,5 5))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", 5.0); + +// // Non-closed version +// test_geometry >( +// "POLYGON((1 0,0 0,0 4,4 4,4 0))", +// "POLYGON((0 0,0 4,4 4,4 0))", 0.1); + + + { + // Test with explicit strategy + + typedef bg::strategy::simplify::douglas_peucker + < + P, + bg::strategy::distance::projected_point + > dp; + + test_geometry >( + "LINESTRING(0 0,5 5,10 10)", + "LINESTRING(0 0,10 10)", 1.0, dp()); + } + + + // POINT: check compilation + test_geometry

( + "POINT(0 0)", + "POINT(0 0)", 1.0); + + + // RING: check compilation and behaviour + test_geometry >( + "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0))", + "POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,4 0))", 1.0); + + +#ifdef TEST_PULL89 + test_with_ax >( + "LINESTRING(0 0,120 6,80 10,200 0)", + "LINESTRING(0 0,80 10,200 0)", 10, 7); +#endif +} + +template +void test_zigzag() +{ + static const std::string zigzag = "LINESTRING(0 10,1 7,1 9,2 6,2 7,3 4,3 5,5 3,4 5,6 2,6 3,9 1,7 3,10 1,9 2,12 1,10 2,13 1,11 2,14 1,12 2,16 1,14 2,17 3,15 3,18 4,16 4,19 5,17 5,20 6,18 6,21 8,19 7,21 9,19 8,21 10,19 9,21 11,19 10,20 13,19 11)"; + + static const std::string expected100 = "LINESTRING(0 10,3 4,5 3,4 5,6 2,9 1,7 3,10 1,9 2,16 1,14 2,17 3,15 3,18 4,16 4,19 5,17 5,21 8,19 7,21 9,19 8,21 10,19 9,21 11,19 10,20 13,19 11)"; + static const std::string expected150 = "LINESTRING(0 10,6 2,16 1,14 2,21 8,19 7,21 9,19 8,21 10,19 9,20 13,19 11)"; + static const std::string expected200 = "LINESTRING(0 10,6 2,16 1,14 2,21 8,19 7,20 13,19 11)"; + static const std::string expected225 = "LINESTRING(0 10,6 2,16 1,21 8,19 11)"; + test_geometry >(zigzag, expected100, 1.0001); + test_geometry >(zigzag, expected150, 1.5001); + test_geometry >(zigzag, expected200, 2.0001); + test_geometry >(zigzag, expected225, 2.25); // should be larger than sqrt(5)=2.236 + +#ifdef TEST_PULL89 + // This should work (results might vary but should have LESS points then expected above + // Small xtd, larger adt, + test_with_ax >(zigzag, expected100, 1.0001, 1.0001); + test_with_ax >(zigzag, expected150, 1.5001, 1.0001); + test_with_ax >(zigzag, expected200, 2.0001, 1.0001); + test_with_ax >(zigzag, expected225, 2.25, 1.0001); +#endif + +} + + +template +void test_3d() +{ + test_geometry >( + "LINESTRING(0 0 0,1 1 1,2 2 0)", + "LINESTRING(0 0 0,2 2 0)", 1.0001); + test_geometry >( + "LINESTRING(0 0 0,1 1 1,2 2 0)", + "LINESTRING(0 0 0,1 1 1,2 2 0)", 0.9999); +} + + +template +void test_spherical() +{ + test_geometry >( + "LINESTRING(4.1 52.1,4.2 52.2,4.3 52.3)", + "LINESTRING(4.1 52.1,4.3 52.3)", 0.01); +} + + +int test_main(int, char* []) +{ + // Integer compiles, but simplify-process fails (due to distances) + //test_all >(); + + test_all >(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + + test_all >(); + + test_3d >(); + + test_spherical > >(); + + test_zigzag >(); + +#if defined(HAVE_TTMATH) + test_all >(); + test_spherical > >(); +#endif +#endif + + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/simplify_countries.cpp b/src/boost/libs/geometry/test/algorithms/simplify_countries.cpp new file mode 100644 index 000000000..87f674339 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/simplify_countries.cpp @@ -0,0 +1,188 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// (Unit) Test + +// Copyright (c) 2018 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#include + +#include + +#if defined(TEST_WITH_SVG) +# include +#endif + + + +template +std::string read_from_file(std::string const& filename) +{ + MultiPolygon mp; + std::ifstream in(filename.c_str()); + while (in.good()) + { + std::string line; + std::getline(in, line); + if (! line.empty()) + { + typename boost::range_value::type pol; + bg::read_wkt(line, pol); + mp.push_back(pol); + } + } + std::ostringstream out; + if (! mp.empty()) + { + out << std::fixed << std::setprecision(19) << bg::wkt(mp); + } + + BOOST_CHECK(! out.str().empty()); + + return out.str(); +} + + +template +void test_one(std::string const& caseid, std::string const& wkt, + double distance_in_meters, + double expected_area_ratio, double expected_perimeter_ratio, + std::size_t expected_polygon_count = 0, + std::size_t expected_interior_count = 0, + std::size_t expected_point_count = 0) +{ + boost::ignore_unused(caseid); + + MultiPolygon geometry, simplified; + bg::read_wkt(wkt, geometry); + bg::correct(geometry); + bg::simplify(geometry, simplified, distance_in_meters); + + double const area_ratio = bg::area(simplified) / bg::area(geometry); + double const perimeter_ratio = bg::perimeter(simplified) / bg::perimeter(geometry); + + BOOST_CHECK_CLOSE(perimeter_ratio, expected_perimeter_ratio, 0.01); + BOOST_CHECK_CLOSE(area_ratio, expected_area_ratio, 0.01); + BOOST_CHECK_EQUAL(expected_polygon_count, boost::size(simplified)); + BOOST_CHECK_EQUAL(expected_interior_count, bg::num_interior_rings(simplified)); + BOOST_CHECK_EQUAL(expected_point_count, bg::num_points(simplified)); + +// To add new tests, this is convenient and write the test itself: +// std::cout << "test_one(\"" << caseid << "\", " << caseid +// << ", " << distance_in_meters +// << std::setprecision(6) +// << ", " << area_ratio +// << ", " << perimeter_ratio +// << ", " << boost::size(simplified) +// << ", " << bg::num_interior_rings(simplified) +// << ", " << bg::num_points(simplified) +// << ");" +// << std::endl; + +#if defined(TEST_WITH_SVG) + { + typedef typename boost::range_value::type polygon; + + std::ostringstream filename; + filename << "simplify_" << caseid << "_" << distance_in_meters << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper + < + typename bg::point_type::type + > mapper(svg, 1200, 800); + mapper.add(geometry); + mapper.add(simplified); + + mapper.map(geometry, "fill-opacity:0.5;fill:rgb(153,204,0);" + "stroke:rgb(153,204,0);stroke-width:1"); + BOOST_FOREACH(polygon const& pol, simplified) + { + mapper.map(pol, + bg::area(pol) > 0 ? "fill:none;stroke:rgb(255,0,0);stroke-width:1" + : "fill:none;stroke:rgb(255,0,255);stroke-width:1"); + } + } +#endif +} + + +template +void test_all() +{ + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon mp; + + // The unit test uses countries originally added for buffer unit test + std::string base_folder = "buffer/data/"; + + // Verify for Greece, Italy, Netherlands, Norway and UK + std::string gr = read_from_file(base_folder + "gr.wkt"); + std::string it = read_from_file(base_folder + "it.wkt"); + std::string nl = read_from_file(base_folder + "nl.wkt"); + std::string no = read_from_file(base_folder + "no.wkt"); + std::string uk = read_from_file(base_folder + "uk.wkt"); + + // Gradually simplify more aggresively. + // Area ratio (first) can increase or decrease + // Perimeter ratio (second) should decrease. + // Polygons, interior rings, points should decrease + test_one("gr", gr, 100, 0.999905, 0.999758, 68, 0, 2520); + test_one("gr", gr, 200, 0.999773, 0.998865, 68, 0, 2019); + test_one("gr", gr, 500, 0.999026, 0.995931, 68, 0, 1468); + test_one("gr", gr, 1000, 0.997782, 0.991475, 68, 0, 1132); + test_one("gr", gr, 2000, 0.994448, 0.9793, 65, 0, 854); + test_one("gr", gr, 5000, 0.979743, 0.910266, 50, 0, 471); + test_one("gr", gr, 10000, 0.968349, 0.778863, 28, 0, 245); + test_one("gr", gr, 20000, 0.961943, 0.607009, 10, 0, 97); // Many islands disappear + + test_one("it", it, 100, 1.00001, 0.999813, 22, 1, 1783); + test_one("it", it, 200, 1.00009, 0.9991, 22, 1, 1406); + test_one("it", it, 500, 1.00019, 0.996848, 22, 1, 1011); + test_one("it", it, 1000, 1.00041, 0.99294, 22, 1, 749); + test_one("it", it, 2000, 1.00086, 0.985144, 22, 1, 546); + test_one("it", it, 5000, 1.00147, 0.93927, 11, 1, 283); + test_one("it", it, 10000, 1.01089, 0.882198, 4, 1, 153); + test_one("it", it, 20000, 1.00893, 0.828774, 4, 0, 86); // San Marino disappears + + test_one("nl", nl, 100, 0.999896, 0.999804, 8, 0, 789); + test_one("nl", nl, 200, 0.999733, 0.999095, 8, 0, 633); + test_one("nl", nl, 500, 0.999423, 0.996313, 8, 0, 436); + test_one("nl", nl, 1000, 0.997893, 0.991951, 8, 0, 331); + test_one("nl", nl, 2000, 0.996129, 0.981998, 8, 0, 234); + test_one("nl", nl, 5000, 0.986128, 0.896, 5, 0, 132); + test_one("nl", nl, 10000, 0.973917, 0.832522, 4, 0, 75); + test_one("nl", nl, 20000, 0.970675, 0.739275, 3, 0, 40); + + test_one("no", no, 100, 0.999966, 0.999975, 95, 0, 7650); + test_one("no", no, 200, 0.999812, 0.999731, 95, 0, 6518); + test_one("no", no, 500, 0.99929, 0.998092, 95, 0, 4728); + test_one("no", no, 1000, 0.998473, 0.994075, 95, 0, 3524); + test_one("no", no, 2000, 0.996674, 0.985863, 92, 0, 2576); + test_one("no", no, 5000, 0.99098, 0.965689, 87, 0, 1667); + test_one("no", no, 10000, 0.978207, 0.906525, 69, 0, 1059); + test_one("no", no, 20000, 0.955223, 0.786546, 38, 0, 593); + + test_one("uk", uk, 100, 0.999942, 0.999878, 48, 0, 3208); + test_one("uk", uk, 200, 0.999843, 0.999291, 48, 0, 2615); + test_one("uk", uk, 500, 0.999522, 0.996888, 48, 0, 1885); + test_one("uk", uk, 1000, 0.999027, 0.992306, 48, 0, 1396); + test_one("uk", uk, 2000, 0.998074, 0.983839, 47, 0, 1032); + test_one("uk", uk, 5000, 0.991901, 0.943496, 35, 0, 611); + test_one("uk", uk, 10000, 0.990039, 0.871969, 23, 0, 359); + test_one("uk", uk, 20000, 0.979171, 0.737577, 11, 0, 193); + +} + +int test_main(int, char* []) +{ + test_all >(); + return 0; +} + diff --git a/src/boost/libs/geometry/test/algorithms/simplify_multi.cpp b/src/boost/libs/geometry/test/algorithms/simplify_multi.cpp new file mode 100644 index 000000000..04591f0df --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/simplify_multi.cpp @@ -0,0 +1,65 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include + + +template +void test_all() +{ + test_geometry >( + "MULTIPOINT((0 0),(1 1))", + "MULTIPOINT((0 0),(1 1))", 1.0); + + test_geometry > >( + "MULTILINESTRING((0 0,5 5,10 10))", + "MULTILINESTRING((0 0,10 10))", 1.0); + + typedef bg::model::multi_polygon > mp; + test_geometry( + "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0)))", + "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,4 0)))", 1.0); + test_geometry( + "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0),(7 3,7 6,1 6,1 3,4 3,7 3)))", + "MULTIPOLYGON(((4 0,8 2,8 7,4 9,0 7,0 2,4 0),(7 3,7 6,1 6,1 3,7 3)))", 1.0); + + // Ticket 5954 https://svn.boost.org/trac/boost/ticket/5954 + test_geometry( + "MULTIPOLYGON(((0.561648 1,1 1,1 0,0.468083 0,0.52758 0.00800554,0.599683 0.0280924,0.601611 0.265374,0.622693 0.316765,0.69507 0.357497,0.695623 0.429711,0.655111 0.502298,0.696467 0.543147,0.840712 0.593546,0.882583 0.66546,0.852357 0.748213,0.84264 0.789567,0.832667 0.841202,0.832667 0.841202,0.740538 0.873004,0.617349 0.905045,0.566576 0.977697,0.561648 1)),((0 0.801979,0.0308575 0.786234,0.0705513 0.631135,0.141616 0.527248,0.233985 0.505872,0.264777 0.526263,0.336631 0.505009,0.356603 0.422321,0.355803 0.350038,0.375252 0.205364,0.415206 0.0709182,0.45479 0,0 0,0 0,0 0.801979)))", + 0.51961289352, 1.0 / 2048.0); + + // Same polygon but multiplied with 2047.0 + test_geometry( + "MULTIPOLYGON(((1149.69 2047,2047 2047,2047 0,958.166 0,1079.96 16.3873,1227.55 57.5051,1231.5 543.221,1274.65 648.418,1422.81 731.796,1423.94 879.618,1341.01 1028.2,1425.67 1111.82,1720.94 1214.99,1806.65 1362.2,1744.77 1531.59,1724.88 1616.24,1704.47 1721.94,1704.47 1721.94,1515.88 1787.04,1263.71 1852.63,1159.78 2001.35,1149.69 2047)),((0 1641.65,63.1653 1609.42,144.419 1291.93,289.888 1079.28,478.967 1035.52,541.999 1077.26,689.084 1033.75,729.966 864.491,728.329 716.528,768.141 420.38,849.927 145.17,930.955 0,0 0,0 0,0 1641.65)))", + 0.51961289352 * (2047.0 * 2047.0), 1.0); + // End ticket 5954 +} + +int test_main( int , char* [] ) +{ + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/test_centroid.hpp b/src/boost/libs/geometry/test/algorithms/test_centroid.hpp new file mode 100644 index 000000000..7e4d99483 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/test_centroid.hpp @@ -0,0 +1,146 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2015. +// Modifications copyright (c) 2015, 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) + +#ifndef BOOST_GEOMETRY_TEST_CENTROID_HPP +#define BOOST_GEOMETRY_TEST_CENTROID_HPP + +// Test-functionality, shared between single and multi tests + +#include + +#include + +#include +#include +#include +#include + +#include + + +template +struct check_result +{ + template + static void apply(Point1 const& actual, Point2 const& expected) + { + check_result::apply(actual, expected); + + BOOST_CHECK_CLOSE(bg::get(actual), bg::get(expected), 0.001); + } +}; + +template <> +struct check_result<0> +{ + template + static void apply(Point1 const&, Point2 const&) + {} +}; + + +template +void test_with_other_calculation_type(Geometry const& geometry, Point& c1) +{ + typedef typename bg::point_type::type point_type; + // Calculate it with user defined strategy + Point c2; + bg::centroid(geometry, c2, + bg::strategy::centroid::bashein_detmer()); + + std::cout << typeid(CalculationType).name() << ": " << std::setprecision(20) + << bg::get<0>(c2) << " " << bg::get<1>(c2) + << " -> difference: " << bg::distance(c1, c2) + << std::endl; +} + +template +void test_centroid(Geometry const& geometry, T const& d1, T const& d2, T const& d3 = T(), T const& d4 = T(), T const& d5 = T()) +{ + Point c1; + + bg::centroid(geometry, c1); + check_result::type::value>::apply(c1, boost::make_tuple(d1, d2, d3, d4, d5)); + + boost::variant v(geometry); + bg::centroid(v, c1); + +#ifdef REPORT_RESULTS + std::cout << "normal: " << std::setprecision(20) << bg::get<0>(c1) << " " << bg::get<1>(c1) << std::endl; + + //test_with_other_calculation_type(geometry, c1); + test_with_other_calculation_type(geometry, c1); + test_with_other_calculation_type(geometry, c1); +#if defined(HAVE_TTMATH) + test_with_other_calculation_type(geometry, c1); +#endif + +#endif +} + +template +void test_centroid(std::string const& wkt, T const& d1, T const& d2, T const& d3 = T(), T const& d4 = T(), T const& d5 = T()) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + + test_centroid(geometry, d1, d2, d3, d4, d5); +} + +template +void test_centroid(Geometry const& geometry, T const& d1, T const& d2, T const& d3 = T(), T const& d4 = T(), T const& d5 = T()) +{ + test_centroid::type>(geometry, d1, d2, d3, d4, d5); +} + +template +void test_centroid(std::string const& wkt, T const& d1, T const& d2, T const& d3 = T(), T const& d4 = T(), T const& d5 = T()) +{ + test_centroid::type>(wkt, d1, d2, d3, d4, d5); +} + +template +void test_centroid_exception() +{ + Geometry geometry; + try + { + typename bg::point_type::type c; + bg::centroid(geometry, c); + } + catch(bg::centroid_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "A centroid_exception should have been thrown" ); +} + +template +void test_centroid_exception(std::string const& wkt) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + try + { + typename bg::point_type::type c; + bg::centroid(geometry, c); + } + catch(bg::centroid_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "A centroid_exception should have been thrown" ); +} + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/test_convert.hpp b/src/boost/libs/geometry/test/algorithms/test_convert.hpp new file mode 100644 index 000000000..fe91907da --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/test_convert.hpp @@ -0,0 +1,77 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef BOOST_GEOMETRY_TEST_CONVERT_HPP +#define BOOST_GEOMETRY_TEST_CONVERT_HPP + + +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include + +#include + +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + + +template +void check_mixed(Geometry1 const& geometry1, std::string const& expected, int expected_point_count) +{ + Geometry2 geometry2; + bg::convert(geometry1, geometry2); + + std::ostringstream out; + out << bg::wkt(geometry2); + BOOST_CHECK_EQUAL(out.str(), expected); + + std::size_t n = bg::num_points(geometry2); + BOOST_CHECK_MESSAGE(expected_point_count < 0 || int(n) == expected_point_count, + "convert: " + << " #points expected: " << expected_point_count + << " detected: " << n + << " expected wkt: " << expected + ); +} + +template +void test_mixed(std::string const& wkt, std::string const& expected, int expected_point_count) +{ + Geometry1 geometry1; + bg::read_wkt(wkt, geometry1); + check_mixed(geometry1, expected, expected_point_count); + check_mixed(boost::variant(geometry1), expected, expected_point_count); +} + +template +void test_mixed_identical_result(std::string const& wkt) +{ + test_mixed(wkt, wkt, -1); + test_mixed(wkt, wkt, -1); +} + +template +void test_mixed_reversible_result(std::string const& wkt1, std::string const& wkt2) +{ + test_mixed(wkt1, wkt2, -1); + test_mixed(wkt2, wkt1, -1); +} + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/test_convex_hull.hpp b/src/boost/libs/geometry/test/algorithms/test_convex_hull.hpp new file mode 100644 index 000000000..a3ab82df4 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/test_convex_hull.hpp @@ -0,0 +1,191 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle +// Contributed and/or modified by Menelaos Karavelas, 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) + +#ifndef BOOST_GEOMETRY_TEST_CONVEX_HULL_HPP +#define BOOST_GEOMETRY_TEST_CONVEX_HULL_HPP + +#include + +#include + +#include +#include +#include +#include +#include + +#include + +#include + +#include + + +template +void check_convex_hull(Geometry const& geometry, Hull const& hull, + std::size_t /*size_original*/, std::size_t size_hull, + double expected_area, double expected_perimeter, + bool reverse) +{ + std::size_t n = bg::num_points(hull); + + BOOST_CHECK_MESSAGE(n == size_hull, + "convex hull: " << bg::wkt(geometry) + << " -> " << bg::wkt(hull) + << " type " + << (typeid(typename bg::coordinate_type::type).name()) + << " -> Expected: " << size_hull + << " detected: " << n); + + + // We omit this check as it is not important for the hull algorithm + // BOOST_CHECK(bg::num_points(geometry) == size_original); + + typename bg::default_area_result::type ah = bg::area(hull); + if (reverse) + { + ah = -ah; + } + + BOOST_CHECK_CLOSE(ah, expected_area, 0.001); + + if ( expected_perimeter >= 0 ) + { + typename bg::default_length_result::type + ph = bg::perimeter(hull); + + BOOST_CHECK_CLOSE(ph, expected_perimeter, 0.001); + } +} + +namespace resolve_variant { + +struct closure_visitor : public boost::static_visitor +{ + template + bg::closure_selector operator()(Geometry const&) const + { + return bg::closure::value; + } +}; + +template +inline bg::closure_selector get_closure(Geometry const&) +{ + return bg::closure::value; +} + +template +inline bg::closure_selector get_closure(boost::variant const& v) +{ + return boost::apply_visitor(closure_visitor(), v); +} + +} // namespace resolve_variant + +template +void test_convex_hull(Geometry const& geometry, + std::size_t size_original, std::size_t size_hull_closed, + double expected_area, double expected_perimeter, + bool reverse) +{ + bool const is_original_closed = resolve_variant::get_closure(geometry) != bg::open; + static bool const is_hull_closed = bg::closure::value != bg::open; + + // convex_hull_insert() uses the original Geometry as a source of the info about the order and closure + std::size_t const size_hull_from_orig = is_original_closed ? size_hull_closed : size_hull_closed - 1; + std::size_t const size_hull = is_hull_closed ? size_hull_closed : size_hull_closed - 1; + + Hull hull; + + // Test version with output iterator + bg::detail::convex_hull::convex_hull_insert(geometry, std::back_inserter(hull.outer())); + check_convex_hull(geometry, hull, size_original, size_hull_from_orig, expected_area, expected_perimeter, reverse); + + // Test version with ring as output + bg::clear(hull); + bg::convex_hull(geometry, hull.outer()); + check_convex_hull(geometry, hull, size_original, size_hull, expected_area, expected_perimeter, false); + + // Test version with polygon as output + bg::clear(hull); + bg::convex_hull(geometry, hull); + check_convex_hull(geometry, hull, size_original, size_hull, expected_area, expected_perimeter, false); + + // Test version with strategy + bg::clear(hull); + bg::convex_hull(geometry, hull.outer(), Strategy()); + check_convex_hull(geometry, hull, size_original, size_hull, expected_area, expected_perimeter, false); + + // Test version with output iterator and strategy + bg::clear(hull); + bg::detail::convex_hull::convex_hull_insert(geometry, std::back_inserter(hull.outer()), Strategy()); + check_convex_hull(geometry, hull, size_original, size_hull_from_orig, expected_area, expected_perimeter, reverse); +} + + +template +void test_geometry_order(std::string const& wkt, + std::size_t size_original, std::size_t size_hull_closed, + double expected_area, double expected_perimeter = -1.0) +{ + typedef bg::model::polygon + < + typename bg::point_type::type, + Clockwise, + Closed + > hull_type; + + typedef bg::strategy::convex_hull::graham_andrew + < + Geometry, + typename bg::point_type::type + > strategy_type; + + Geometry geometry; + bg::read_wkt(wkt, geometry); + boost::variant v(geometry); + + test_convex_hull(geometry, size_original, size_hull_closed, expected_area, expected_perimeter, !Clockwise); + test_convex_hull(v, size_original, size_hull_closed, expected_area, expected_perimeter, !Clockwise); +} + +template +void test_geometry(std::string const& wkt, + std::size_t size_original, std::size_t size_hull_closed, + double expected_area, double expected_perimeter = -1.0) +{ + test_geometry_order(wkt, size_original, size_hull_closed, expected_area, expected_perimeter); + test_geometry_order(wkt, size_original, size_hull_closed, expected_area, expected_perimeter); + test_geometry_order(wkt, size_original, size_hull_closed, expected_area, expected_perimeter); + test_geometry_order(wkt, size_original, size_hull_closed, expected_area, expected_perimeter); +} + +template +void test_empty_input() +{ + Geometry geometry; + bg::model::polygon + < + typename bg::point_type::type + > hull; + + bg::convex_hull(geometry, hull); + BOOST_CHECK_MESSAGE(bg::is_empty(hull), "Output convex hull should be empty" ); +} + + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/test_correct.hpp b/src/boost/libs/geometry/test/algorithms/test_correct.hpp new file mode 100644 index 000000000..1576b1602 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/test_correct.hpp @@ -0,0 +1,54 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#ifndef BOOST_GEOMETRY_TEST_CORRECT_HPP +#define BOOST_GEOMETRY_TEST_CORRECT_HPP + + +// Test-functionality, shared between single and multi tests + +#include + +#include + +#include +#include +#include +#include + +template +void check_geometry(Geometry const& geometry, std::string const& expected) +{ + std::ostringstream out; + out << bg::wkt_manipulator(geometry, false); + + BOOST_CHECK_EQUAL(out.str(), expected); +} + +template +void test_geometry(std::string const& wkt, std::string const& expected) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + boost::variant v(geometry); + + bg::correct(geometry); + check_geometry(geometry, expected); + + bg::correct(v); + check_geometry(v, expected); +} + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/test_for_each.hpp b/src/boost/libs/geometry/test/algorithms/test_for_each.hpp new file mode 100644 index 000000000..741bd26bb --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/test_for_each.hpp @@ -0,0 +1,277 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef BOOST_GEOMETRY_TEST_FOR_EACH_HPP +#define BOOST_GEOMETRY_TEST_FOR_EACH_HPP + +#include + +#include +#include + +#include +#include +#include +#include + + +template +inline void translate_x_function(Point& p) +{ + bg::set<0>(p, bg::get<0>(p) + 100.0); +} + +template +struct scale_y_functor +{ + inline void operator()(Point& p) + { + bg::set<1>(p, bg::get<1>(p) * 100.0); + } +}; + +template +struct sum_x_functor +{ + typename bg::coordinate_type::type sum; + + sum_x_functor() + : sum(0) + {} + + inline void operator()(Point const& p) + { + sum += bg::get<0>(p); + } +}; + +// Per segment +static std::ostringstream g_out; + +template +inline void stream_segment(Segment const& s) +{ + g_out << bg::dsv(s) << " "; +} + +template +struct sum_segment_length +{ + typename bg::coordinate_type::type sum; + + sum_segment_length() + : sum(0) + {} + inline void operator()(Segment const& s) + { + sum += bg::distance(s.first, s.second); + } +}; + +template +inline void modify_segment(Segment& s) +{ + if (bg::math::equals(bg::get<0,0>(s), 1.0)) + { + bg::set<0,0>(s, 10.0); + } +} + + +template +void test_per_point_const(Geometry const& geometry, int expected) +{ + typedef typename bg::point_type::type point_type; + + // Class (functor) + sum_x_functor functor; + functor = bg::for_each_point(geometry, functor); + BOOST_CHECK_EQUAL(functor.sum, expected); + + + // Lambda +#if !defined(BOOST_NO_CXX11_LAMBDAS) + + typename bg::coordinate_type::type sum_x = 0; + + bg::for_each_point + ( + geometry, + [&sum_x](point_type const& p) + { + sum_x += bg::get<0>(p); + } + + ); + + BOOST_CHECK_EQUAL(sum_x, expected); +#endif +} + +template +void test_per_point_non_const(Geometry& geometry, + std::string const& expected1, + std::string const& expected2) +{ +#if !defined(BOOST_NO_CXX11_LAMBDAS) + Geometry copy = geometry; +#endif + + typedef typename bg::point_type::type point_type; + + // function + bg::for_each_point(geometry, translate_x_function); + std::ostringstream out1; + out1 << bg::wkt(geometry); + + BOOST_CHECK_MESSAGE(out1.str() == expected1, + "for_each_point: " + << " expected " << expected1 + << " got " << bg::wkt(geometry)); + + // functor + bg::for_each_point(geometry, scale_y_functor()); + + std::ostringstream out2; + out2 << bg::wkt(geometry); + + BOOST_CHECK_MESSAGE(out2.str() == expected2, + "for_each_point: " + << " expected " << expected2 + << " got " << bg::wkt(geometry)); + +#if !defined(BOOST_NO_CXX11_LAMBDAS) + // Lambda, both functions above together. Without / with capturing + + geometry = copy; + bg::for_each_point + ( + geometry, + [](point_type& p) + { + bg::set<0>(p, bg::get<0>(p) + 100); + } + + ); + + typename bg::coordinate_type::type scale = 100; + bg::for_each_point + ( + geometry, + [&](point_type& p) + { + bg::set<1>(p, bg::get<1>(p) * scale); + } + + ); + + std::ostringstream out3; + out3 << bg::wkt(geometry); + + BOOST_CHECK_MESSAGE(out3.str() == expected2, + "for_each_point (lambda): " + << " expected " << expected2 + << " got " << bg::wkt(geometry)); +#endif + +} + + +template +void test_per_point(std::string const& wkt + , int expected_sum_x + , std::string const& expected1 + , std::string const& expected2 + ) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + test_per_point_const(geometry, expected_sum_x); + test_per_point_non_const(geometry, expected1, expected2); +} + + + +template +void test_per_segment_const(Geometry const& geometry, + std::string const& expected_dsv, + double expected_length) +{ + typedef typename bg::point_type::type point_type; + + // function + g_out.str(""); + g_out.clear(); + bg::for_each_segment(geometry, + stream_segment >); + std::string out = g_out.str(); + boost::trim(out); + BOOST_CHECK_EQUAL(out, expected_dsv); + + // functor + sum_segment_length > functor; + functor = bg::for_each_segment(geometry, functor); + + BOOST_CHECK_CLOSE(functor.sum, expected_length, 0.0001); +} + + +template +void test_per_segment_non_const(Geometry& geometry, + std::string const& expected_wkt) +{ + typedef typename bg::point_type::type point_type; + + // function + bg::for_each_segment(geometry, + modify_segment >); + + std::ostringstream out; + out << bg::wkt(geometry); + + BOOST_CHECK_MESSAGE(out.str() == expected_wkt, + "for_each_segment: " + << " expected " << expected_wkt + << " got " << bg::wkt(geometry)); + + // function is working here, functor works for all others, + // it will also work here. +} + + +template +void test_per_segment(std::string const& wkt + , std::string const& expected_dsv + , double expected_length + , std::string const& expected_wkt + ) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + test_per_segment_const(geometry, expected_dsv, expected_length); + test_per_segment_non_const(geometry, expected_wkt); +} + + + +template +void test_geometry(std::string const& wkt + , int expected_sum_x + , std::string const& expected1 + , std::string const& expected2 + , std::string const& expected_dsv + , double expected_length + , std::string const& expected_wkt + ) +{ + test_per_point(wkt, expected_sum_x, expected1, expected2); + test_per_segment(wkt, expected_dsv, expected_length, expected_wkt); +} + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/test_is_simple.hpp b/src/boost/libs/geometry/test/algorithms/test_is_simple.hpp new file mode 100644 index 000000000..d4162d04b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/test_is_simple.hpp @@ -0,0 +1,121 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +#include + +#ifdef BOOST_GEOMETRY_TEST_DEBUG +#include "pretty_print_geometry.hpp" +#endif + +namespace bg = ::boost::geometry; + +template +void test_simple_s(Geometry const& geometry, + Strategy const& strategy, + bool expected_result, + bool check_validity = true) +{ + bool simple = bg::is_simple(geometry, strategy); + bool valid = ! check_validity || bg::is_valid(geometry, strategy); + + BOOST_CHECK_MESSAGE( valid == true, + "Expected valid geometry, " + << " wkt: " << bg::wkt(geometry) ); + + BOOST_CHECK_MESSAGE( simple == expected_result, + "Expected: " << expected_result + << " detected: " << simple + << " wkt: " << bg::wkt(geometry) ); +} + +template +void test_simple(Geometry const& geometry, bool expected_result, + bool check_validity = true) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "=======" << std::endl; +#endif + + bool simple = bg::is_simple(geometry); + bool valid = ! check_validity || bg::is_valid(geometry); + + BOOST_CHECK_MESSAGE( valid == true, + "Expected valid geometry, " + << " wkt: " << bg::wkt(geometry) ); + + BOOST_CHECK_MESSAGE( simple == expected_result, + "Expected: " << expected_result + << " detected: " << simple + << " wkt: " << bg::wkt(geometry) ); + + typedef typename bg::strategy::intersection::services::default_strategy + < + CSTag + >::type strategy_type; + + test_simple_s(geometry, strategy_type(), expected_result, check_validity); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "Geometry: "; + pretty_print_geometry::apply(std::cout, geometry); + std::cout << std::endl; + std::cout << std::boolalpha; + std::cout << "is simple: " << simple << std::endl; + std::cout << "expected result: " << expected_result << std::endl; + std::cout << "=======" << std::endl; + std::cout << std::endl << std::endl; + std::cout << std::noboolalpha; +#endif +} + +template +void test_simple(Geometry const& geometry, + bool expected_result, + bool check_validity = true) +{ + typedef typename bg::cs_tag::type cs_tag; + test_simple(geometry, expected_result, check_validity); +} + +template +void test_simple(boost::variant const& variant_geometry, + bool expected_result, + bool check_validity = true) +{ + typedef typename bg::cs_tag::type cs_tag; + test_simple(variant_geometry, expected_result, check_validity); +} diff --git a/src/boost/libs/geometry/test/algorithms/test_is_valid.hpp b/src/boost/libs/geometry/test/algorithms/test_is_valid.hpp new file mode 100644 index 000000000..df0be5b81 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/test_is_valid.hpp @@ -0,0 +1,508 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_TEST_IS_VALID_HPP +#define BOOST_GEOMETRY_TEST_IS_VALID_HPP + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +#include + +#include + +#ifdef BOOST_GEOMETRY_TEST_DEBUG +#include "pretty_print_geometry.hpp" +#endif + + +namespace bg = ::boost::geometry; + +typedef bg::model::point point_type; +typedef bg::model::segment segment_type; +typedef bg::model::box box_type; +typedef bg::model::linestring linestring_type; +typedef bg::model::multi_linestring multi_linestring_type; +typedef bg::model::multi_point multi_point_type; + + +//---------------------------------------------------------------------------- + + +// returns true if a geometry can be converted to closed +template +< + typename Geometry, + typename Tag = typename bg::tag::type, + bg::closure_selector Closure = bg::closure::value +> +struct is_convertible_to_closed +{ + static inline bool apply(Geometry const&) + { + return false; + } +}; + +template +struct is_convertible_to_closed +{ + static inline bool apply(Ring const& ring) + { + return boost::size(ring) > 0; + } +}; + +template +struct is_convertible_to_closed +{ + typedef typename bg::ring_type::type ring_type; + + template + static inline + bool apply_to_interior_rings(InteriorRings const& interior_rings) + { + return bg::detail::check_iterator_range + < + is_convertible_to_closed + >::apply(boost::begin(interior_rings), + boost::end(interior_rings)); + } + + static inline bool apply(Polygon const& polygon) + { + return boost::size(bg::exterior_ring(polygon)) > 0 + && apply_to_interior_rings(bg::interior_rings(polygon)); + } +}; + +template +struct is_convertible_to_closed +{ + typedef typename boost::range_value::type polygon; + + static inline bool apply(MultiPolygon const& multi_polygon) + { + return bg::detail::check_iterator_range + < + is_convertible_to_closed, + false // do not allow empty multi-polygon + >::apply(boost::begin(multi_polygon), + boost::end(multi_polygon)); + } +}; + + +//---------------------------------------------------------------------------- + + +// returns true if a geometry can be converted to cw +template +< + typename Geometry, + typename Tag = typename bg::tag::type, + bg::order_selector Order = bg::point_order::value +> +struct is_convertible_to_cw +{ + static inline bool apply(Geometry const&) + { + return bg::point_order::value == bg::counterclockwise; + } +}; + + +//---------------------------------------------------------------------------- + + +// returns true if geometry can be converted to polygon +template +< + typename Geometry, + typename Tag = typename bg::tag::type +> +struct is_convertible_to_polygon +{ + typedef Geometry type; + static bool const value = false; +}; + +template +struct is_convertible_to_polygon +{ + typedef bg::model::polygon + < + typename bg::point_type::type, + bg::point_order::value == bg::clockwise, + bg::closure::value == bg::closed + > type; + + static bool const value = true; +}; + + +//---------------------------------------------------------------------------- + + +// returns true if geometry can be converted to multi-polygon +template +< + typename Geometry, + typename Tag = typename bg::tag::type +> +struct is_convertible_to_multipolygon +{ + typedef Geometry type; + static bool const value = false; +}; + +template +struct is_convertible_to_multipolygon +{ + typedef bg::model::multi_polygon + < + typename is_convertible_to_polygon::type + > type; + + static bool const value = true; +}; + +template +struct is_convertible_to_multipolygon +{ + typedef bg::model::multi_polygon type; + static bool const value = true; +}; + + +//---------------------------------------------------------------------------- + + +template +struct validity_checker +{ + template + static inline bool apply(std::string const& case_id, + Geometry const& geometry, + bool expected_result, + std::string& reason) + { + bool valid = ValidityTester::apply(geometry); + std::string const reason_valid + = bg::validity_failure_type_message(bg::no_failure); + reason = ValidityTester::reason(geometry); + std::string reason_short = reason.substr(0, reason_valid.length()); + + BOOST_CHECK_MESSAGE(valid == expected_result, + "case id: " << case_id + << ", Expected: " << expected_result + << ", detected: " << valid + << "; wkt: " << bg::wkt(geometry)); + + BOOST_CHECK_MESSAGE(reason != "", + "case id (empty reason): " << case_id + << ", Expected: " << valid + << ", detected reason: " << reason + << "; wkt: " << bg::wkt(geometry)); + + BOOST_CHECK_MESSAGE((valid && reason == reason_valid) + || + (! valid && reason != reason_valid) + || + (! valid && reason_short != reason_valid), + "case id (reason): " << case_id + << ", Expected: " << valid + << ", detected reason: " << reason + << "; wkt: " << bg::wkt(geometry)); + + return valid; + } +}; + + +//---------------------------------------------------------------------------- + + +struct default_validity_tester +{ + template + static inline bool apply(Geometry const& geometry) + { + return bg::is_valid(geometry); + } + + template + static inline std::string reason(Geometry const& geometry) + { + std::string message; + bg::is_valid(geometry, message); + return message; + } +}; + + +template +struct validity_tester_linear +{ + template + static inline bool apply(Geometry const& geometry) + { + bool const irrelevant = true; + bg::is_valid_default_policy visitor; + return bg::is_valid(geometry, visitor, bg::default_strategy()); + } + + template + static inline std::string reason(Geometry const& geometry) + { + bool const irrelevant = true; + std::ostringstream oss; + bg::failing_reason_policy visitor(oss); + bg::is_valid(geometry, visitor, bg::default_strategy()); + return oss.str(); + } +}; + + +template +struct validity_tester_areal +{ + template + static inline bool apply(Geometry const& geometry) + { + bg::is_valid_default_policy visitor; + return bg::is_valid(geometry, visitor, bg::default_strategy()); + } + + template + static inline std::string reason(Geometry const& geometry) + { + std::ostringstream oss; + bg::failing_reason_policy visitor(oss); + bg::is_valid(geometry, visitor, bg::default_strategy()); + return oss.str(); + } + +}; + + +template +struct validity_tester_geo_areal +{ + template + static inline bool apply(Geometry const& geometry) + { + bg::is_valid_default_policy visitor; + bg::strategy::intersection::geographic_segments<> s; + return bg::is_valid(geometry, visitor, s); + } + + template + static inline std::string reason(Geometry const& geometry) + { + std::ostringstream oss; + bg::failing_reason_policy visitor(oss); + bg::strategy::intersection::geographic_segments<> s; + bg::is_valid(geometry, visitor, s); + return oss.str(); + } + +}; + + +//---------------------------------------------------------------------------- + + +template +< + typename ValidityTester, + typename Geometry, + typename ClosedGeometry = Geometry, + typename CWGeometry = Geometry, + typename CWClosedGeometry = Geometry, + typename Tag = typename bg::tag::type +> +class test_valid +{ +protected: + template + static inline void base_test(std::string const& case_id, + G const& g, + bool expected_result) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "=======" << std::endl; +#endif + + std::string reason; + bool valid = validity_checker + < + ValidityTester + >::apply(case_id, g, expected_result, reason); + boost::ignore_unused(valid); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "case id: " << case_id << ", Geometry: "; + pretty_print_geometry::apply(std::cout, g); + std::cout << std::endl; + std::cout << "wkt: " << bg::wkt(g) << std::endl; + std::cout << std::boolalpha; + std::cout << "is valid? " << valid << std::endl; + std::cout << "expected result: " << expected_result << std::endl; + std::cout << "reason: " << reason << std::endl; + std::cout << "=======" << std::endl; + std::cout << std::noboolalpha; +#endif + } + +public: + static inline void apply(std::string const& case_id, + Geometry const& geometry, + bool expected_result) + { + std::stringstream sstr; + sstr << case_id << "-original"; // which is: CCW open + base_test(sstr.str(), geometry, expected_result); + + if ( is_convertible_to_closed::apply(geometry) ) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "...checking closed geometry..." + << std::endl; +#endif + ClosedGeometry closed_geometry; + bg::convert(geometry, closed_geometry); + sstr.str(""); + sstr << case_id << "-2closed"; + base_test(sstr.str(), closed_geometry, expected_result); + } + if ( is_convertible_to_cw::apply(geometry) ) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "...checking cw open geometry..." + << std::endl; +#endif + CWGeometry cw_geometry; + bg::convert(geometry, cw_geometry); + sstr.str(""); + sstr << case_id << "-2CW"; + base_test(sstr.str(), cw_geometry, expected_result); + if ( is_convertible_to_closed::apply(cw_geometry) ) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "...checking cw closed geometry..." + << std::endl; +#endif + CWClosedGeometry cw_closed_geometry; + bg::convert(cw_geometry, cw_closed_geometry); + sstr.str(""); + sstr << case_id << "-2CWclosed"; + base_test(sstr.str(), cw_closed_geometry, expected_result); + } + } + + if ( BOOST_GEOMETRY_CONDITION(is_convertible_to_polygon::value) ) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "...checking geometry converted to polygon..." + << std::endl; +#endif + typename is_convertible_to_polygon::type polygon; + bg::convert(geometry, polygon); + sstr.str(""); + sstr << case_id << "-2Polygon"; + base_test(sstr.str(), polygon, expected_result); + } + + if ( BOOST_GEOMETRY_CONDITION(is_convertible_to_multipolygon::value) ) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "...checking geometry converted to multi-polygon..." + << std::endl; +#endif + typename is_convertible_to_multipolygon + < + Geometry + >::type multipolygon; + + bg::convert(geometry, multipolygon); + sstr.str(""); + sstr << case_id << "-2MultiPolygon"; + base_test(sstr.str(), multipolygon, expected_result); + } + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; +#endif + } + + static inline void apply(std::string const& case_id, + std::string const& wkt, + bool expected_result) + { + apply(case_id, from_wkt(wkt), expected_result); + } +}; + + +//---------------------------------------------------------------------------- + + +template +class test_valid_variant + : test_valid +{ +private: + typedef test_valid base_type; + +public: + static inline void apply(std::string const& case_id, + VariantGeometry const& vg, + bool expected_result) + { + std::ostringstream oss; + base_type::base_test(case_id, vg, expected_result); + } +}; + + +#endif // BOOST_GEOMETRY_TEST_IS_VALID_HPP diff --git a/src/boost/libs/geometry/test/algorithms/test_length.hpp b/src/boost/libs/geometry/test/algorithms/test_length.hpp new file mode 100644 index 000000000..c4242209b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/test_length.hpp @@ -0,0 +1,99 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// Copyright (c) 2016 Oracle and/or its affiliates. +// Contributed and/or modified by Vissarion Fisikopoulos, 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) + +#ifndef BOOST_GEOMETRY_TEST_LENGTH_HPP +#define BOOST_GEOMETRY_TEST_LENGTH_HPP + +#include + +#include +#include +#include +#include + +template +void test_length(Geometry const& geometry, long double expected_length) +{ + typename bg::default_length_result::type + length = bg::length(geometry); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::ostringstream out; + out << typeid(typename bg::coordinate_type::type).name() + << std::endl + << typeid(typename bg::default_length_result::type).name() + << std::endl + << "length : " << bg::length(geometry) + << std::endl; + std::cout << out.str(); +#endif + + BOOST_CHECK_CLOSE(length, expected_length, 0.0001); +} + +template +void test_length(Geometry const& geometry, long double expected_length, Strategy strategy) +{ + typename bg::default_length_result::type + length = bg::length(geometry, strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::ostringstream out; + out << typeid(typename bg::coordinate_type::type).name() + << std::endl + << typeid(typename bg::default_length_result::type).name() + << std::endl + << "length : " << bg::length(geometry, strategy) + << std::endl; + std::cout << out.str(); +#endif + + BOOST_CHECK_CLOSE(length, expected_length, 0.0001); +} + +template +void test_geometry(std::string const& wkt, double expected_length) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + test_length(geometry, expected_length); +#if !defined(BOOST_GEOMETRY_TEST_DEBUG) + test_length(boost::variant(geometry), expected_length); +#endif +} + +template +void test_geometry(std::string const& wkt, double expected_length, Strategy strategy) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + test_length(geometry, expected_length, strategy); +#if !defined(BOOST_GEOMETRY_TEST_DEBUG) + test_length(boost::variant(geometry), expected_length, strategy); +#endif +} + +template +void test_empty_input(Geometry const& geometry) +{ + try + { + bg::length(geometry); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "A empty_input_exception should have been thrown" ); +} + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/test_overlay.hpp b/src/boost/libs/geometry/test/algorithms/test_overlay.hpp new file mode 100644 index 000000000..69a0d17a3 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/test_overlay.hpp @@ -0,0 +1,161 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef BOOST_GEOMETRY_TEST_OVERLAY_HPP +#define BOOST_GEOMETRY_TEST_OVERLAY_HPP + +#include + +// 1. (Example) testcases +static std::string example_box = "box(1.5 1.5, 4.5 2.5)"; + +static std::string example_polygon = + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3)" + "(4.0 2.0, 4.2 1.4, 4.8 1.9, 4.4 2.2, 4.0 2.0))"; + +static std::string example_ring = + "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))"; + +static std::string example_star = + "POLYGON((4.0 -0.5 , 3.5 1.0 , 2.0 1.5 , 3.5 2.0 , 4.0 3.5 , 4.5 2.0 , 6.0 1.5 , 4.5 1.0 , 4.0 -0.5))"; + +static std::string polygon_empty = "POLYGON EMPTY"; + +// 2. Alphabetically ordered testcase pairs + +static std::string crossed[2] = + {"POLYGON((0 0,0 5,5 5,5 0,0 0),(4 1,3 4,1 2,4 1))", + "POLYGON((2 1,1 4,4 3,2 1))"}; + +static std::string disjoint[2] = + {"POLYGON((3 0,3 1,4 1,4 0,3 0))", + "POLYGON((3 4,3 5,4 5,4 4,3 4))"}; + +static std::string distance_zero[2] = + {"POLYGON((1 1,1 4,4 4,4 1,1 1))", + "POLYGON((1.9 0.9,2.0 4.000001,2.1 1.0,1.9 0.9))"}; + +// e-45 gives 'convenient' IEEE-single-FP-error, +static std::string epsilon[2] = + {"POLYGON((0.0 0.0" + ",3.0e-45 4.0e-45" + ",4.0e-45 1.0e-45" + ",0.0 0.0))", + "POLYGON((2.0e-45 2.0e-45" + ",6.0e-45 4.0e-45" + ",4.0e-45 -1.0e-45" + ",2.0e-45 2.0e-45))"}; + +static std::string epsilon_multi_ip[2] = + { + "POLYGON(" + "(0.0e-44 2.0e-44,0.5e-44 2.5e-44,1.2e-44 2.0e-44,1.7e-44 2.5e-44,2.5e-44 2.0e-44,2.0e-44 1.5e-44" + ",2.5e-44 1.0e-44,2.0e-44 0.5e-44,1.7e-44 0.0e-44,1.5e-44 0.5e-44,1.2e-44 0.0e-44,1.0e-44 0.5e-44" + ",0.7e-44 0.0e-44,0.5e-44 1.7e-44,0.12e-44 1.5e-44,0.5e-44 1.2e-44,0.0e-44 1.0e-44,0.0e-44 2.0e-44))", + "POLYGON(" + "(0.2e-44 0.2e-44,0.2e-44 2.2e-44,2.2e-44 2.2e-44,2.2e-44 0.2e-44,0.2e-44 0.2e-44))" + }; + +static std::string equal_holes_disjoint[2] = + {"POLYGON((0 0,0 9,9 9,9 0,0 0),(1 1,4 1,4 8,1 8,1 1),(5 1,8 1,8 4,5 4,5 1))", + "POLYGON((0 0,0 9,9 9,9 0,0 0),(1 1,4 1,4 8,1 8,1 1),(5 5,8 5,8 8,5 8,5 5))"}; + +static std::string first_within_second[2] = + {"POLYGON((2 2,2 3,3 3,3 2,2 2))", + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))"}; + +static std::string first_within_hole_of_second[2] = + {"POLYGON((2 2,2 3,3 3,3 2,2 2))", + "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(1 1,4 1,4 4,1 4,1 1))"}; + +// == case 52 +static std::string fitting[2] = + {"POLYGON((0 0,0 5,5 5,5 0,0 0),(4 1,3 4,1 2,4 1))", + "POLYGON((1 2,3 4,4 1,1 2))"}; + +static std::string identical[2] = + {"POLYGON((0 0,0 1,1 1,1 0,0 0))", + "POLYGON((1 1,1 0,0 0,0 1,1 1))"}; + +// case 2102 from "algorithms/detail/overlay/robustness/assemble.hpp" +static std::string intersect_exterior_and_interiors_winded[2] = + {"POLYGON((2 0.5,0.5 2,0.5 8,2 9.5,6 9.5,8.5 8,8.5 2,7 0.5,2 0.5),(2 2,7 2,7 8,2 8,2 2))", + "POLYGON((1 1,1 9,8 9,8 1,1 1),(4 4,5 4,5 5,4 5,4 4))"}; + +static std::string intersect_holes_disjoint[2] = + {"POLYGON((0 0,0 7,5 7,5 0,0 0),(2 2,3 2,3 3,2 3,2 2))", + "POLYGON((1 1,1 6,6 6,6 1,1 1),(2 4,3 4,3 5,2 5,2 4))"}; + +static std::string intersect_holes_intersect[2] = + {"POLYGON((0 0,0 7,5 7,5 0,0 0),(2 2,3 2,3 3,2 3,2 2))", + "POLYGON((1 1,1 6,6 6,6 1,1 1),(2.5 2.5,3.5 2.5,3.5 3.5,2.5 3.5,2.5 2.5))"}; + +static std::string intersect_holes_intersect_and_disjoint[2] = + {"POLYGON((0 0,0 7,5 7,5 0,0 0),(2 2,3 2,3 3,2 3,2 2),(2 4,3 4,3 5,2 5,2 4))", + "POLYGON((1 1,1 6,6 6,6 1,1 1),(2.5 2.5,3.5 2.5,3.5 3.5,2.5 3.5,2.5 2.5))"}; + +static std::string intersect_holes_intersect_and_touch[2] = + {"POLYGON((0 0,0 7,5 7,5 0,0 0),(2 2,3 2,3 3,2 3,2 2),(2.5 4,3 4.5,2.5 5,2 4.5,2.5 4))", + "POLYGON((1 1,1 6,6 6,6 1,1 1),(2.5 2.5,3.5 2.5,3.5 3.5,2.5 3.5,2.5 2.5),(3.5 4,4 4.5,3.5 5,3 4.5,3.5 4))"}; + +static std::string intersect_holes_new_ring[2] = + {"POLYGON((4 4,4 16,16 16,16 4,4 4),(7 6,14 10,7 14,11 10,7 6))", + "POLYGON((2 2,2 18,18 18,18 2,2 2),(13 6,9 10,13 14,6 10,13 6))"}; + +static std::string isovist1[2] = + { + "POLYGON((37.29449462890625 1.7902572154998779, 46.296027072709599 -2.4984308554828116, 45.389434814453125 -4.5143837928771973, 47.585065917176543 -6.1314922196594779, 46.523914387974358 -8.5152102535033496, 42.699958801269531 -4.4278755187988281, 42.577877044677734 -4.4900407791137695, 42.577911376953125 -4.4901103973388672, 40.758884429931641 -5.418975830078125, 40.6978759765625 -5.4500408172607422, 41.590042114257813 -7.2021245956420898, 57.297810222148939 -37.546793343968417, 50.974888957147442 -30.277285722290763, 37.140213012695313 1.3446992635726929, 37.000419616699219 1.664225697517395, 37.29449462890625 1.7902572154998779))", + "POLYGON((43.644271850585938 0.96149998903274536,43.764598846435547 0.93951499462127686,49.071769542946825 0.61489892713413252,48.43512638981781 -0.81299959072453376,47.830955505371094 -0.69758313894271851,47.263670054709685 -1.784876824891044,46.695858001708984 -1.6093428134918213,45.389434814453125 -4.5143837928771973,47.604561877161387 -6.087697464505224,46.559533858616469 -8.435196445683264,42.699958801269531 -4.4278755187988281,42.577877044677734 -4.4900407791137695,42.577911376953125 -4.4901103973388672,40.758884429931641 -5.418975830078125,40.6978759765625 -5.4500408172607422,41.590042114257813 -7.2021245956420898,57.524304765518266 -37.807195733984784,41.988733475572282 -19.945838749437218,41.821544647216797 -19.211688995361328,40.800632476806641 -17.208097457885742,39.966808319091797 -17.625011444091797,38.823680877685547 -16.296066284179688,37.326129913330078 -17.190576553344727,35.963497161865234 -15.476018905639648,35.656356811523438 -15.66030216217041,34.931102752685547 -16.223842620849609,34.634240447128811 -15.85007183479255,34.886280059814453 -14.120697975158691,34.658355712890625 -13.81736946105957,34.328716278076172 -13.992490768432617,33.598796844482422 -14.546377182006836,33.164891643669634 -14.000060288415174,33.566280364990234 -12.450697898864746,33.339523315429688 -12.147735595703125,32.998821258544922 -12.323249816894531,32.274600982666016 -12.879127502441406,31.682494778186321 -12.133624901803865,32.226280212402344 -10.790698051452637,32.000633239746094 -10.488097190856934,31.669155120849609 -10.653837203979492,30.947774887084961 -11.208560943603516,30.207040612748258 -10.275926149505661,30.896280288696289 -9.1206979751586914,30.670633316040039 -8.8180980682373047,30.339155197143555 -8.9838371276855469,29.619997024536133 -9.5368013381958008,29.135100397190627 -8.9262827849488211,32.718830108642578 -4.3281683921813965,32.708168029785156 -2.3611698150634766,32.708126068115234 -2.3611700534820557,32.708126068115234 -2.3611266613006592,30.501169204711914 -2.3718316555023193,27.069889344709196 -4.2926591211028242,26.472516656201325 -3.5380830513658776,36.954700469970703 1.2597870826721191,37.140213012695313 1.3446992635726929,37.000419616699219 1.664225697517395,37.29449462890625 1.7902572154998779,37.43402099609375 1.470055103302002,51.370888500897557 7.4163459734570729,51.20102152843122 7.1738039562841562,42.721500396728516 3.6584999561309814,42.721500396728516 2.2342472076416016,42.399410247802734 1.4956772327423096,43.644271850585938 0.96149998903274536))" + }; + +static std::string new_hole[2] = + {"POLYGON((2 2,2 5,5 5,5 2,2 2))", + "POLYGON((0 0,0 6,3 6,3 4,1 4,1 3,3 3,3 0,0 0))"}; + +static std::string only_hole_intersections[3] = + {"POLYGON((0 0,0 10,20 10,20 0,0 0),(1 1,7 5,5 7,1 1),(11 1,17 5,15 7,11 1))", + "POLYGON((0 0,0 10,20 10,20 0,0 0),(1 1,7 6,6 7,1 1),(11 1,17 6,16 7,11 1))", + "POLYGON((0.5 0.5,0.5 9.5,19.5 9.5,19.5 0.5,0.5 0.5),(1 1,7 6,6 7,1 1),(11 1,17 6,16 7,11 1))"}; + +static std::string side_side[2] = + {"POLYGON((0 0,0 1,1 1,1 0,0 0))", + "POLYGON((1 0,1 1,2 1,2 0,1 0))"}; + +static std::string simplex_normal[2] = + {"POLYGON((0 1,2 5,5 3,0 1))", + "POLYGON((3 0,0 3,4 5,3 0))"}; + +static std::string simplex_reversed[2] = + {"POLYGON((0 1,5 3,2 5,0 1))", + "POLYGON((3 0,4 5,0 3,3 0))"}; + +static std::string star_comb_15[2] = + {"POLYGON((25 52.5,27.1694 29.5048,46.5004 42.146,29.8746 26.1126,51.8105 18.8807,28.9092 21.8826,36.9318 0.223356,25 20,13.0682 0.223356,21.0908 21.8826,-1.81052 18.8807,20.1254 26.1126,3.49963 42.146,22.8306 29.5048,25 52.5))", + "POLYGON((25 0,0 25,25 50,50 25,49.0741 24.0741,25 48.1481,24.0741 47.2222,48.1481 23.1481,47.2222 22.2222,23.1481 46.2963,22.2222 45.3704,46.2963 21.2963,45.3704 20.3704,21.2963 44.4444,20.3704 43.5185,44.4444 19.4444,43.5185 18.5185,19.4444 42.5926,18.5185 41.6667,42.5926 17.5926,41.6667 16.6667,17.5926 40.7407,16.6667 39.8148,40.7407 15.7407,39.8148 14.8148,15.7407 38.8889,14.8148 37.963,38.8889 13.8889,37.963 12.963,13.8889 37.037,12.963 36.1111,37.037 12.037,36.1111 11.1111,12.037 35.1852,11.1111 34.2593,35.1852 10.1852,34.2593 9.25926,10.1852 33.3333,9.25926 32.4074,33.3333 8.33333,32.4074 7.40741,8.33333 31.4815,7.40741 30.5556,31.4815 6.48148,30.5556 5.55556,6.48148 29.6296,5.55556 28.7037,29.6296 4.62963,28.7037 3.7037,4.62963 27.7778,3.7037 26.8519,27.7778 2.77778,26.8519 1.85185,2.77778 25.9259,1.85185 25,25.9259 0.925926,25 0))"}; + +static std::string two_bends[2] = + {"POLYGON((0 4,4 8,7 7,8 4,5 3,4 0,0 4))", + "POLYGON((0 4,4 8,5 5,8 4,7 1,4 0,0 4))"}; + +// within each other, having no intersections but many holes within each other +static std::string winded[2] = + {"POLYGON((0 0,0 11,11 11,11 0,0 0),(3 3,4 3,4 4,3 4,3 3),(5 3,6 3,6 4,5 4,5 3),(2 6,7 6,7 9,2 9,2 6),(9 2,10 2,10 5,9 5,9 2))", + "POLYGON((1 1,1 10,10 10,10 6,8 6,8 1,1 1),(2 2,7 2,7 5,2 5,2 2),(3 7,4 7,4 8,3 8,3 7),(5 7,6 7,6 8,5 8,5 7),(8 7,9 7,9 8,8 8,8 7))"}; + +static std::string within_holes_disjoint[2] = + {"POLYGON((0 0,0 7,7 7,7 0,0 0),(2 2,3 2,3 3,2 3,2 2))", + "POLYGON((1 1,1 6,6 6,6 1,1 1),(2 4,3 4,3 5,2 5,2 4))"}; + +// == case 53 +static std::string wrapped[3] = { + "POLYGON((2 2,2 3,3 3,3 2,2 2))", + /*a:*/ "POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,3 2,3 1,4 1,4 4,1 4,1 3,2 3,2 2,0 2))", // NOT st_isvalid + /*b:*/ "POLYGON((0 2,0 5,5 5,5 0,2 0,2 2,0 2),(1 3,2 3,2 2,3 2,3 1,4 1,4 4,1 4,1 3))" // st_isvalid + }; + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/test_perimeter.hpp b/src/boost/libs/geometry/test/algorithms/test_perimeter.hpp new file mode 100644 index 000000000..32a5defb6 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/test_perimeter.hpp @@ -0,0 +1,103 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef BOOST_GEOMETRY_TEST_PERIMETER_HPP +#define BOOST_GEOMETRY_TEST_PERIMETER_HPP + + +#include + +#include + +#include +#include +#include + + +template +void test_perimeter(Geometry const& geometry, long double expected_perimeter) +{ + typename bg::default_length_result::type + perimeter = bg::perimeter(geometry); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::ostringstream out; + out << typeid(typename bg::coordinate_type::type).name() + << std::endl + //<< typeid(typename bg::default_perimeter_result::type).name() + << std::endl + << "perimeter : " << bg::perimeter(geometry) + << std::endl; + std::cout << out.str(); +#endif + + BOOST_CHECK_CLOSE(perimeter, expected_perimeter, 0.0001); +} + + +template +void test_perimeter(Geometry const& geometry, long double expected_perimeter, Strategy strategy) +{ + typename bg::default_length_result::type + perimeter = bg::perimeter(geometry, strategy); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::ostringstream out; + out << typeid(typename bg::coordinate_type::type).name() + << std::endl + //<< typeid(typename bg::default_perimeter_result::type).name() + << std::endl + << "perimeter : " << bg::perimeter(geometry, strategy) + << std::endl; + std::cout << out.str(); +#endif + + BOOST_CHECK_CLOSE(perimeter, expected_perimeter, 0.0001); +} + +template +void test_geometry(std::string const& wkt, double expected_perimeter) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + boost::variant v(geometry); + + test_perimeter(geometry, expected_perimeter); +#if !defined(BOOST_GEOMETRY_TEST_DEBUG) + test_perimeter(v, expected_perimeter); +#endif +} + +template +void test_geometry(std::string const& wkt, double expected_perimeter, Strategy strategy) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + boost::variant v(geometry); + + test_perimeter(geometry, expected_perimeter, strategy); +#if !defined(BOOST_GEOMETRY_TEST_DEBUG) + test_perimeter(v, expected_perimeter, strategy); +#endif +} + +template +void test_empty_input(Geometry const& geometry) +{ + try + { + bg::perimeter(geometry); + } + catch(bg::empty_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "A empty_input_exception should have been thrown" ); +} + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/test_reverse.hpp b/src/boost/libs/geometry/test/algorithms/test_reverse.hpp new file mode 100644 index 000000000..101429251 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/test_reverse.hpp @@ -0,0 +1,46 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef BOOST_GEOMETRY_TEST_REVERSE_HPP +#define BOOST_GEOMETRY_TEST_REVERSE_HPP + +// Test-functionality, shared between single and multi tests + +#include +#include +#include +#include + + +template +void check_geometry(Geometry& geometry, std::string const& wkt, std::string const& expected) +{ + bg::reverse(geometry); + + std::ostringstream out; + out << bg::wkt(geometry); + + BOOST_CHECK_MESSAGE(out.str() == expected, + "reverse: " << wkt + << " expected " << expected + << " got " << out.str()); +} + +template +void test_geometry(std::string const& wkt, std::string const& expected) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + boost::variant v(geometry); + + check_geometry(geometry, wkt, expected); + check_geometry(v, wkt, expected); +} + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/test_simplify.hpp b/src/boost/libs/geometry/test/algorithms/test_simplify.hpp new file mode 100644 index 000000000..2ae96d58b --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/test_simplify.hpp @@ -0,0 +1,241 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef BOOST_GEOMETRY_TEST_SIMPLIFY_HPP +#define BOOST_GEOMETRY_TEST_SIMPLIFY_HPP + +// Test-functionality, shared between single and multi tests + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +template +< + typename GeometryForTag, + typename Tag = typename bg::tag::type +> +struct test_equality +{ + template + static void apply(Geometry const& geometry, Expected const& expected) + { + // Verify both spatially equal AND number of points, because several + // of the tests only check explicitly on collinear points being + // simplified away + bool const result + = bg::equals(geometry, expected) + && bg::num_points(geometry) == bg::num_points(expected); + + BOOST_CHECK_MESSAGE(result, + " result: " << bg::wkt(geometry) << " " << bg::area(geometry) + << " expected: " << bg::wkt(expected) << " " << bg::area(expected)); + + } +}; + +// Linestring does NOT yet have "geometry::equals" implemented +// Until then, WKT's are compared (which is acceptable for linestrings, but not +// for polygons, because simplify might rotate them) +template +struct test_equality +{ + template + static void apply(Geometry const& geometry, Expected const& expected) + { + std::ostringstream out1, out2; + out1 << bg::wkt(geometry); + out2 << bg::wkt(expected); + BOOST_CHECK_EQUAL(out1.str(), out2.str()); + } +}; + + +template +struct test_inserter +{ + template + static void apply(Geometry& , Expected const& , double ) + {} +}; + +template <> +struct test_inserter +{ + template + static void apply(Geometry& geometry, + Expected const& expected, + DistanceMeasure const& distance) + { + { + Geometry simplified; + bg::detail::simplify::simplify_insert(geometry, + std::back_inserter(simplified), distance); + + test_equality::apply(simplified, expected); + } + +#ifdef TEST_PULL89 + { + typedef typename bg::point_type::type point_type; + typedef typename bg::strategy::distance::detail::projected_point_ax<>::template result_type::type distance_type; + typedef bg::strategy::distance::detail::projected_point_ax_less less_comparator; + + distance_type max_distance(distance); + less_comparator less(max_distance); + + bg::strategy::simplify::detail::douglas_peucker + < + point_type, + bg::strategy::distance::detail::projected_point_ax<>, + less_comparator + > strategy(less); + + Geometry simplified; + bg::detail::simplify::simplify_insert(geometry, + std::back_inserter(simplified), max_distance, strategy); + + test_equality::apply(simplified, expected); + } +#endif + } +}; + +template +void check_geometry(Geometry const& geometry, + Expected const& expected, + DistanceMeasure const& distance) +{ + Geometry simplified; + bg::simplify(geometry, simplified, distance); + test_equality::apply(simplified, expected); +} + +template +void check_geometry(Geometry const& geometry, + Expected const& expected, + DistanceMeasure const& distance, + Strategy const& strategy) +{ + Geometry simplified; + bg::simplify(geometry, simplified, distance, strategy); + test_equality::apply(simplified, expected); +} + +template +void check_geometry_with_area(Geometry const& geometry, + double expected_area, + DistanceMeasure const& distance) +{ + Geometry simplified; + bg::simplify(geometry, simplified, distance); + BOOST_CHECK_CLOSE(bg::area(simplified), expected_area, 0.01); +} + + +template +void test_geometry(std::string const& wkt, + std::string const& expected_wkt, + DistanceMeasure distance) +{ + typedef typename bg::point_type::type point_type; + + Geometry geometry, expected; + + bg::read_wkt(wkt, geometry); + bg::read_wkt(expected_wkt, expected); + + boost::variant v(geometry); + + // Define default strategy for testing + typedef bg::strategy::simplify::douglas_peucker + < + typename bg::point_type::type, + bg::strategy::distance::projected_point + > dp; + + check_geometry(geometry, expected, distance); + check_geometry(v, expected, distance); + + + BOOST_CONCEPT_ASSERT( (bg::concepts::SimplifyStrategy) ); + + check_geometry(geometry, expected, distance, dp()); + check_geometry(v, expected, distance, dp()); + + // Check inserter (if applicable) + test_inserter + < + typename bg::tag::type + >::apply(geometry, expected, distance); + +#ifdef TEST_PULL89 + // Check using non-default less comparator in douglass_peucker + typedef typename bg::strategy::distance::detail::projected_point_ax<>::template result_type::type distance_type; + typedef bg::strategy::distance::detail::projected_point_ax_less less_comparator; + + distance_type const max_distance(distance); + less_comparator const less(max_distance); + + typedef bg::strategy::simplify::detail::douglas_peucker + < + point_type, + bg::strategy::distance::detail::projected_point_ax<>, + less_comparator + > douglass_peucker_with_less; + + BOOST_CONCEPT_ASSERT( (bg::concepts::SimplifyStrategy) ); + + check_geometry(geometry, expected, distance, douglass_peucker_with_less(less)); + check_geometry(v, expected, distance, douglass_peucker_with_less(less)); +#endif +} + +template +void test_geometry(std::string const& wkt, + std::string const& expected_wkt, + DistanceMeasure const& distance, + Strategy const& strategy) +{ + Geometry geometry, expected; + + bg::read_wkt(wkt, geometry); + bg::read_wkt(expected_wkt, expected); + bg::correct_closure(geometry); + bg::correct_closure(expected); + + boost::variant v(geometry); + + BOOST_CONCEPT_ASSERT( (bg::concepts::SimplifyStrategy::type>) ); + + check_geometry(geometry, expected, distance, strategy); + check_geometry(v, expected, distance, strategy); +} + +template +void test_geometry(std::string const& wkt, + double expected_area, + DistanceMeasure const& distance) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + bg::correct_closure(geometry); + + check_geometry_with_area(geometry, expected_area, distance); +} + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/test_unique.hpp b/src/boost/libs/geometry/test/algorithms/test_unique.hpp new file mode 100644 index 000000000..be9d23565 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/test_unique.hpp @@ -0,0 +1,39 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + + +#ifndef BOOST_GEOMETRY_TEST_UNIQUE_HPP +#define BOOST_GEOMETRY_TEST_UNIQUE_HPP + +// Test-functionality, shared between single and multi tests + +#include +#include + +#include + + +template +void test_geometry(std::string const& wkt, std::string const& expected) +{ + Geometry geometry; + + bg::read_wkt(wkt, geometry); + bg::unique(geometry); + + std::ostringstream out; + out << bg::wkt(geometry); + + BOOST_CHECK_MESSAGE(out.str() == expected, + "unique: " << wkt + << " expected " << expected + << " got " << out.str()); +} + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/touches/Jamfile b/src/boost/libs/geometry/test/algorithms/touches/Jamfile new file mode 100644 index 000000000..fcce33366 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/touches/Jamfile @@ -0,0 +1,24 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2016. +# Modifications copyright (c) 2014-2016, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-touches + : + [ run touches.cpp : : : : algorithms_touches ] + [ run touches_box.cpp : : : : algorithms_touches_box ] + [ run touches_multi.cpp : : : : algorithms_touches_multi ] + [ run touches_self.cpp : : : : algorithms_touches_self ] + [ run touches_sph.cpp : : : : algorithms_touches_sph ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/touches/test_touches.hpp b/src/boost/libs/geometry/test/algorithms/touches/test_touches.hpp new file mode 100644 index 000000000..fa7e39a34 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/touches/test_touches.hpp @@ -0,0 +1,142 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2013, 2015, 2016, 2017. +// Modifications copyright (c) 2013-2017 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) + +#ifndef BOOST_GEOMETRY_TEST_TOUCHES_HPP +#define BOOST_GEOMETRY_TEST_TOUCHES_HPP + + +#include + +#include +#include +#include +#include +#include + +#include +#include + + +struct no_strategy {}; + +template +void check_touches(Geometry1 const& geometry1, + Geometry2 const& geometry2, + std::string const& wkt1, + std::string const& wkt2, + bool expected, + Strategy const& strategy) +{ + bool detected = bg::touches(geometry1, geometry2, strategy); + + BOOST_CHECK_MESSAGE(detected == expected, + "touches: " << wkt1 + << " with " << wkt2 + << " -> Expected: " << expected + << " detected: " << detected); + + detected = bg::touches(geometry2, geometry1, strategy); + + BOOST_CHECK_MESSAGE(detected == expected, + "touches: " << wkt2 + << " with " << wkt1 + << " -> Expected: " << expected + << " detected: " << detected); +} + +template +void check_touches(Geometry1 const& geometry1, + Geometry2 const& geometry2, + std::string const& wkt1, + std::string const& wkt2, + bool expected, + no_strategy = no_strategy()) +{ + bool detected = bg::touches(geometry1, geometry2); + + BOOST_CHECK_MESSAGE(detected == expected, + "touches: " << wkt1 + << " with " << wkt2 + << " -> Expected: " << expected + << " detected: " << detected); + + detected = bg::touches(geometry2, geometry1); + + BOOST_CHECK_MESSAGE(detected == expected, + "touches: " << wkt2 + << " with " << wkt1 + << " -> Expected: " << expected + << " detected: " << detected); +} + +template +void test_touches(std::string const& wkt1, + std::string const& wkt2, bool expected) +{ + Geometry1 geometry1; + Geometry2 geometry2; + + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); + + boost::variant v1(geometry1); + boost::variant v2(geometry2); + + typedef typename bg::strategy::relate::services::default_strategy + < + Geometry1, Geometry2 + >::type strategy_type; + + check_touches(geometry1, geometry2, wkt1, wkt2, expected, no_strategy()); + check_touches(geometry1, geometry2, wkt1, wkt2, expected, strategy_type()); + check_touches(v1, geometry2, wkt1, wkt2, expected, no_strategy()); + check_touches(geometry1, v2, wkt1, wkt2, expected, no_strategy()); + check_touches(v1, v2, wkt1, wkt2, expected, no_strategy()); +} + +template +void test_geometry(std::string const& wkt1, + std::string const& wkt2, + bool expected) +{ + test_touches(wkt1, wkt2, expected); +} + + +template +void check_self_touches(Geometry const& geometry, + std::string const& wkt, + bool expected) +{ + bool detected = bg::touches(geometry); + + BOOST_CHECK_MESSAGE(detected == expected, + "touches: " << wkt + << " -> Expected: " << expected + << " detected: " << detected); +} + +template +void test_self_touches(std::string const& wkt, bool expected) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + boost::variant v(geometry); + + check_self_touches(geometry, wkt, expected); + check_self_touches(v, wkt, expected); +} + + + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/touches/touches.cpp b/src/boost/libs/geometry/test/algorithms/touches/touches.cpp new file mode 100644 index 000000000..80db2d9b9 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/touches/touches.cpp @@ -0,0 +1,226 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2013, 2014. 2015. +// Modifications copyright (c) 2013-2015, 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) + +#include "test_touches.hpp" + +template +void test_all() +{ + typedef bg::model::multi_point

mpoint; + typedef bg::model::ring

ring; + typedef bg::model::polygon

polygon; + typedef bg::model::linestring

linestring; + typedef bg::model::multi_polygon mpolygon; + typedef bg::model::multi_linestring mlinestring; + + // Touching at corner + test_touches + ( + "POLYGON((0 0,0 100,100 100,100 0,0 0))", + "POLYGON((100 100,100 200,200 200, 200 100,100 100))", + true + ); + + // Intersecting at corner + test_touches + ( + "POLYGON((0 0,0 100,101 101,100 0,0 0))", + "POLYGON((100 100,100 200,200 200, 200 100,100 100))", + false + ); + + // Touching at side (interior of a segment) + test_touches + ( + "POLYGON((0 0,0 100,100 100,100 0,0 0))", + "POLYGON((200 0,100 50,200 100,200 0))", + true + ); + + // Touching at side (partly collinear) + test_touches + ( + "POLYGON((0 0,0 100,100 100,100 0,0 0))", + "POLYGON((200 20,100 20,100 80,200 80,200 20))", + true + ); + + // Completely equal + test_touches + ( + "POLYGON((0 0,0 100,100 100,100 0,0 0))", + "POLYGON((0 0,0 100,100 100,100 0,0 0))", + false + ); + + // Spatially equal + test_touches + ( + "POLYGON((0 0,0 100,100 100,100 0,0 0))", + "POLYGON((0 0,0 100,100 100,100 80,100 20,100 0,0 0))", + false + ); + + // Spatially equal (without equal segments) + test_touches + ( + "POLYGON((0 0,0 100,100 100,100 0,0 0))", + "POLYGON((0 0,0 50,0 100,50 100,100 100,100 50,100 0,50 0,0 0))", + false + ); + + + // Touching at side (opposite equal) + test_touches + ( + "POLYGON((0 0,0 100,100 100,100 0,0 0))", + "POLYGON((200 0,100 0,100 100,200 100,200 0))", + true + ); + + // Touching at side (opposite equal - but with real "equal" turning point) + test_touches + ( + "POLYGON((0 0,0 100,100 100,100 80,100 20,100 0,0 0))", + "POLYGON((200 0,100 0,100 20,100 80,100 100,200 100,200 0))", + true + ); + // First partly collinear to side, than overlapping + test_touches + ( + "POLYGON((0 0,0 100,100 100,100 0,0 0))", + "POLYGON((200 20,100 20,100 50,50 50,50 80,100 80,200 80,200 20))", + false + ); + + // Touching interior (= no touch) + test_touches + ( + "POLYGON((0 0,0 100,100 100,100 0,0 0))", + "POLYGON((20 20,20 80,100 50,20 20))", + false + ); + + // Fitting in hole + test_touches + ( + "POLYGON((0 0,0 100,100 100,100 0,0 0),(40 40,60 40,60 60,40 60,40 40))", + "POLYGON((40 40,40 60,60 60,60 40,40 40))", + true + ); + + // mysql 21873343 + test_touches + ( + "POLYGON((0 0,0 10,10 10,10 0,0 0), (0 8, 8 5, 8 8, 0 8))", + "POLYGON((0 8,-8 5,-8 8,0 8))", + true + ); + test_touches + ( + "POLYGON((0 0,0 10,10 10,10 0,0 0), (0 6, 6 3, 6 6, 0 6))", + "POLYGON((0 6,-6 3,-6 6,0 6))", + true + ); + + // Point-Polygon + test_touches("POINT(40 50)", "POLYGON((40 40,40 60,60 60,60 40,40 40))", true); + test_touches("POINT(40 50)", "POLYGON((40 40,40 60,60 60,60 40,40 40))", true); + test_touches("POINT(60 60)", "POLYGON((40 40,40 60,60 60,60 40,40 40))", true); + test_touches("POINT(50 50)", "POLYGON((40 40,40 60,60 60,60 40,40 40))", false); + test_touches("POINT(30 50)", "POLYGON((40 40,40 60,60 60,60 40,40 40))", false); + + // Point-MultiPolygon + test_touches("POINT(40 50)", "MULTIPOLYGON(((40 40,40 60,60 60,60 40,40 40)),((0 0,0 10,10 10,10 0)))", true); + + // Point-Linestring + test_touches("POINT(0 0)", "LINESTRING(0 0, 2 2, 10 2)", true); + test_touches("POINT(2 2)", "LINESTRING(0 0, 2 2, 10 2)", false); + test_touches("POINT(1 1)", "LINESTRING(0 0, 2 2, 10 2)", false); + test_touches("POINT(5 5)", "LINESTRING(0 0, 2 2, 10 2)", false); + + // Point-MultiLinestring + test_touches("POINT(0 0)", "MULTILINESTRING((0 0, 2 2, 10 2),(5 5, 6 6))", true); + test_touches("POINT(0 0)", "MULTILINESTRING((0 0, 2 2, 10 2),(0 0, 6 6))", false); + + // MultiPoint-Polygon + test_touches("MULTIPOINT(40 50, 30 50)", "POLYGON((40 40,40 60,60 60,60 40,40 40))", true); + test_touches("MULTIPOINT(40 50, 50 50)", "POLYGON((40 40,40 60,60 60,60 40,40 40))", false); + + // Linestring-Linestring + test_touches("LINESTRING(0 0,2 0)", "LINESTRING(0 0,0 2)", true); + test_touches("LINESTRING(0 0,2 0)", "LINESTRING(2 0,2 2)", true); + test_touches("LINESTRING(0 0,2 0)", "LINESTRING(0 2,0 0)", true); + test_touches("LINESTRING(0 0,2 0)", "LINESTRING(2 2,2 0)", true); + test_touches("LINESTRING(2 0,0 0)", "LINESTRING(0 0,0 2)", true); + test_touches("LINESTRING(2 0,0 0)", "LINESTRING(2 0,2 2)", true); + test_touches("LINESTRING(2 0,0 0)", "LINESTRING(0 2,0 0)", true); + test_touches("LINESTRING(2 0,0 0)", "LINESTRING(2 2,2 0)", true); + test_touches("LINESTRING(0 0,2 0)", "LINESTRING(1 0,1 1)", true); + test_touches("LINESTRING(0 0,2 0)", "LINESTRING(1 1,1 0)", true); + test_touches("LINESTRING(2 0,0 0)", "LINESTRING(1 0,1 1)", true); + test_touches("LINESTRING(2 0,0 0)", "LINESTRING(1 1,1 0)", true); + + test_touches("LINESTRING(0 0,10 0)", "LINESTRING(0 0,5 5,10 0)", true); + test_touches("LINESTRING(0 0,10 10)", "LINESTRING(0 0,0 5,10 5)", false); + + test_touches("LINESTRING(0 5,5 6,10 5)", "LINESTRING(0 7,5 6,10 7)", false); + test_touches("LINESTRING(0 5,5 6,10 5)", "LINESTRING(10 7,5 6,0 7)", false); + test_touches("LINESTRING(10 5,5 6,0 5)", "LINESTRING(0 7,5 6,10 7)", false); + test_touches("LINESTRING(10 5,5 6,0 5)", "LINESTRING(10 7,5 6,0 7)", false); + + test_touches("LINESTRING(0 0,1 1,2 2)", "LINESTRING(2 0,2 2,1 2,1 1)", true); + test_touches("LINESTRING(2 2,1 1,0 0)", "LINESTRING(2 0,2 2,1 2,1 1)", true); + test_touches("LINESTRING(0 0,1 1,2 2)", "LINESTRING(1 1,1 2,2 2,2 0)", true); + test_touches("LINESTRING(2 2,1 1,0 0)", "LINESTRING(1 1,1 2,2 2,2 0)", true); + + test_touches("LINESTRING(0 0,1 1,0 1)", "LINESTRING(1 1,2 2,1 2,1 1)", false); + + test_touches("LINESTRING(0 0,1 1,0 1)", "MULTILINESTRING((1 1,2 2),(1 2,1 1))", false); + + //Linestring-Polygon + test_touches("LINESTRING(10 0,15 5,10 10,5 15,5 10,0 10,5 15,5 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_touches("LINESTRING(5 10,5 15,0 10,5 10,5 15,10 10,15 5,10 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_touches("LINESTRING(5 10,5 15,0 10,5 10,5 15,10 10,5 5,10 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_touches("LINESTRING(0 15,5 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_touches("LINESTRING(0 15,5 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_touches("LINESTRING(0 15,5 10,5 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_touches("LINESTRING(10 15,5 10,0 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + + test_touches("LINESTRING(0 0,3 3)", "POLYGON((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 9,1 9,0 0))", true); + + test_touches("LINESTRING(-1 -1,3 3)", "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 9,1 9,0 0)))", true); + + test_touches("MULTILINESTRING((0 0,11 11))", "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 9,1 9,0 0)))", false); +} + +int test_main( int , char* [] ) +{ + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} + +/* +with viewy as +( +select geometry::STGeomFromText('POLYGON((0 0,0 100,100 100,100 0,0 0))',0) as p + , geometry::STGeomFromText('POLYGON((200 0,100 50,200 100,200 0))',0) as q +) +-- select p from viewy union all select q from viewy +select p.STTouches(q) from viewy +*/ diff --git a/src/boost/libs/geometry/test/algorithms/touches/touches_box.cpp b/src/boost/libs/geometry/test/algorithms/touches/touches_box.cpp new file mode 100644 index 000000000..7325bc2c2 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/touches/touches_box.cpp @@ -0,0 +1,66 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2013, 2014, 2015. +// Modifications copyright (c) 2013-2015, 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) + +#include "test_touches.hpp" + +template +void test_all() +{ + typedef bg::model::box

box; + + test_touches("POLYGON((0 0,0 5,5 5,5 0,0 0))", "POLYGON((5 1,5 2,6 2,6 1,5 1))", true); + test_touches("POLYGON((0 0,0 5,5 5,5 0,0 0))", "POLYGON((4 1,4 2,5 2,5 1,4 1))", false); + test_touches("POLYGON((0 0,0 5,5 5,5 0,0 0))", "POLYGON((4 1,4 2,6 2,6 1,4 1))", false); + + // Point-size + test_touches("POLYGON((0 0,0 5,5 5,5 0,0 0))", "POLYGON((5 5,5 5,5 5,5 5,5 5))", true); + // TODO: should it be TRUE? + test_touches("POLYGON((5 5,5 5,5 5,5 5,5 5))", "POLYGON((5 5,5 5,5 5,5 5,5 5))", true); +} + +template +void test_box_3d() +{ + typedef bg::model::box

box; + + check_touches(box(P(0,0,0),P(5,5,5)), box(P(5,1,2),P(6,6,6)), + "box(P(0,0,0),P(5,5,5))", "box(P(5,1,2),P(6,6,6))", + true); + + check_touches(box(P(0,0,0),P(5,5,5)), box(P(5,5,5),P(6,6,6)), + "box(P(0,0,0),P(5,5,5))", "box(P(5,5,5),P(6,6,6))", + true); +} + + +int test_main( int , char* [] ) +{ + test_all >(); + test_box_3d >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} + +/* +with viewy as +( +select geometry::STGeomFromText('POLYGON((0 0,0 100,100 100,100 0,0 0))',0) as p + , geometry::STGeomFromText('POLYGON((200 0,100 50,200 100,200 0))',0) as q +) +-- select p from viewy union all select q from viewy +select p.STTouches(q) from viewy +*/ diff --git a/src/boost/libs/geometry/test/algorithms/touches/touches_multi.cpp b/src/boost/libs/geometry/test/algorithms/touches/touches_multi.cpp new file mode 100644 index 000000000..65de6b52c --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/touches/touches_multi.cpp @@ -0,0 +1,80 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + + +#include "test_touches.hpp" + +#include +#include +#include + + +template +void test_all() +{ + typedef bg::model::polygon

polygon; + typedef bg::model::multi_polygon mp; + typedef bg::model::linestring

linestring; + typedef bg::model::multi_linestring ml; + + test_self_touches("MULTIPOLYGON(((0 0,0 100,100 100,100 0,0 0)))", + false); + + // Exactly equal + test_touches("MULTIPOLYGON(((0 0,0 100,100 100,100 0,0 0)))", + "MULTIPOLYGON(((0 0,0 100,100 100,100 0,0 0)))", + false); + + // Spatially equal + test_touches("MULTIPOLYGON(((0 0,0 100,100 100,100 0,0 0)))", + "MULTIPOLYGON(((0 0,0 100,100 100,100 80,100 20,100 0,0 0)))", + false); + + // One exactly equal, another pair touching + test_touches("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((20 0,20 10,30 10,30 0,20 0)))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((30 10,30 20,40 20,40 10,30 10)))", + false); + + // One spatially equal (without equal segments), another pair touching + test_touches("MULTIPOLYGON(((0 0,0 5,0 10,5 10,10 10,10 5,10 0,5 0,0 0)),((20 0,20 10,30 10,30 0,20 0)))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((30 10,30 20,40 20,40 10,30 10)))", + false); + + // Alternate touches + test_touches("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((20 0,20 10,30 10,30 0,20 0)))", + "MULTIPOLYGON(((10 10,10 20,20 20,20 10,10 10)),((30 10,30 20,40 20,40 10,30 10)))", + true); + + // Touch plus inside + test_touches("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((20 0,20 10,30 10,30 0,20 0)))", + "MULTIPOLYGON(((10 10,10 20,20 20,20 10,10 10)),((22 2,28 2,28 8,22 8,22 2)))", + false); + + + test_touches("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((20 0,20 10,30 10,30 0,20 0)))", + "MULTILINESTRING((10 10,10 20,20 20,20 10,10 10),(30 10,30 20,40 20,40 10,30 10))", + true); + + test_touches("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((20 0,20 10,30 10,30 0,20 0)))", + "MULTILINESTRING((10 10,10 20,20 20,20 10,10 10),(22 2,28 2,28 8,22 8,22 2))", + false); + + test_touches("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((20 0,20 10,30 10,30 0,20 0)))", + "MULTILINESTRING((10 10,10 20,20 20,20 10,10 10),(50 2,60 2,60 8,50 8,50 2))", + true); +} + +int test_main( int , char* [] ) +{ + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/touches/touches_self.cpp b/src/boost/libs/geometry/test/algorithms/touches/touches_self.cpp new file mode 100644 index 000000000..00ea47daa --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/touches/touches_self.cpp @@ -0,0 +1,43 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2013, 2014. 2015. +// Modifications copyright (c) 2013-2015, 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) + +#include "test_touches.hpp" + +template +void test_all() +{ + typedef bg::model::polygon

polygon; + + // Just a normal polygon + test_self_touches("POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))", false); + + // Self intersecting + test_self_touches("POLYGON((1 2,1 1,2 1,2 2.25,3 2.25,3 0,0 0,0 3,3 3,2.75 2,1 2))", false); + + // Self touching at a point + test_self_touches("POLYGON((0 0,0 3,2 3,2 2,1 2,1 1,2 1,2 2,3 2,3 0,0 0))", true); + + // Self touching at a segment + test_self_touches("POLYGON((0 0,0 3,2 3,2 2,1 2,1 1,2 1,2 2.5,3 2.5,3 0,0 0))", true); +} + +int test_main( int , char* [] ) +{ + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/touches/touches_sph.cpp b/src/boost/libs/geometry/test/algorithms/touches/touches_sph.cpp new file mode 100644 index 000000000..352a9bff1 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/touches/touches_sph.cpp @@ -0,0 +1,239 @@ +// Boost.Geometry + +// Copyright (c) 2016 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) + +#include "test_touches.hpp" + +#include +#include + +#include + + +template +void test_polygon_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + + test_geometry(case_1[0], case_1[1], + false); + test_geometry(case_1[0], case_1[1], + false); + + test_geometry(case_1[0], case_1[1], + false); + test_geometry(case_2[0], case_2[1], + false); + test_geometry(case_3_sph[0], case_3_sph[1], + false); + test_geometry(case_3_2_sph[0], case_3_2_sph[1], + false); + test_geometry(case_4[0], case_4[1], + false); + test_geometry(case_5[0], case_5[1], + false); + test_geometry(case_6_sph[0], case_6_sph[1], + false); + + test_geometry(case_7[0], case_7[1], + true); + test_geometry(case_8_sph[0], case_8_sph[1], + true); + test_geometry(case_9_sph[0], case_9_sph[1], + true); + test_geometry(case_10_sph[0], case_10_sph[1], + true); + test_geometry(case_11_sph[0], case_11_sph[1], + false); + test_geometry(case_12[0], case_12[1], + false); + + test_geometry(case_13_sph[0], case_13_sph[1], + true); + test_geometry(case_14_sph[0], case_14_sph[1], + true); + test_geometry(case_15_sph[0], case_15_sph[1], + true); + test_geometry(case_16_sph[0], case_16_sph[1], + true); + test_geometry(case_17_sph[0], case_17_sph[1], + false); + test_geometry(case_18_sph[0], case_18_sph[1], + false); +} + +template +void test_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_1[0], case_multi_2[0], + false); + test_geometry(case_2[0], case_multi_2[0], + false); +} + +template +void test_multi_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_multi_2[0], case_multi_2[1], + false); +} + +template +void test_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::polygon

ring; + + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(0 0,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(5 0,5 5,10 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(5 1,5 5,9 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(11 1,11 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + false); + + test_geometry("LINESTRING(9 1,10 5,9 9,1 9,1 1,9 1)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + false); + + test_geometry("LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + true); +} + +template +void test_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("LINESTRING(10 1,10 5,10 9)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)))", + true); +} + +template +void test_multi_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((11 11, 20 20),(5 7, 4 1))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2))", + false); + + test_geometry("MULTILINESTRING((6 6,15 15),(0 0, 7 7))", + "POLYGON((5 5,5 15,15 15,15 5,5 5))", + false); + + test_geometry("MULTILINESTRING((3 10.031432746397092, 1 5, 1 10.013467818052765, 3 4, 7 8, 6 10.035925377760330, 10 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + false); +} + +template +void test_multi_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_linestring mls; + typedef bg::model::multi_polygon mpoly; + + test_geometry("MULTILINESTRING((0 0,10 0,10 10,0 10,0 0),(2 2,5 5,2 8,2 2))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(2 2,5 5,2 8,2 2)))", + true); + + test_geometry("MULTILINESTRING((0 0,10 0,10 10),(10 10,0 10,0 0),(20 20,50 50,20 80,20 20))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + true); + + test_geometry("MULTILINESTRING((5 -2,4 -2,5 0),(5 -2,6 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + false); +} + +template +void test_linestring_linestring() +{ + typedef bg::model::linestring

ls; + + test_geometry("LINESTRING(0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", false); + + test_geometry("LINESTRING(1 0,2 2,2 3)", "LINESTRING(0 0, 2 2, 3 2)", false); +} + +template +void test_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("LINESTRING(0 0,10 0)", + "MULTILINESTRING((1 0,2 0),(1 1,2 1))", + false); + + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,0 5,0 0),(0 0,5 0,5 5))", + false); +} + +template +void test_multi_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0))", + false); +} + + +template +void test_all() +{ + test_polygon_polygon

(); + test_polygon_multi_polygon

(); + test_multi_polygon_multi_polygon

(); + + test_linestring_polygon

(); + test_linestring_multi_polygon

(); + test_multi_linestring_polygon

(); + test_multi_linestring_multi_polygon

(); + + test_linestring_linestring

(); + test_linestring_multi_linestring

(); + test_multi_linestring_multi_linestring

(); +} + + +int test_main( int , char* [] ) +{ + test_all > >(); + +#if defined(HAVE_TTMATH) + test_cs > >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/transform.cpp b/src/boost/libs/geometry/test/algorithms/transform.cpp new file mode 100644 index 000000000..68811cf80 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/transform.cpp @@ -0,0 +1,165 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +template +void check_transform(Geometry1 const& geometry1, + Geometry2 const& expected) +{ + Geometry2 geometry2; + BOOST_CHECK(bg::transform(geometry1, geometry2)); + + std::ostringstream result_wkt, expected_wkt; + result_wkt << bg::wkt(geometry2); + expected_wkt << bg::wkt(expected); + BOOST_CHECK_EQUAL(result_wkt.str(), expected_wkt.str()); +} + +template +void test_transform_point(Value value) +{ + P1 p1; + bg::set<0>(p1, 1); + bg::set<1>(p1, 2); + boost::variant v(p1); + + P2 expected; + bg::assign(expected, p1); + bg::multiply_value(expected, value); + + check_transform(p1, expected); + check_transform(v, expected); +} + +template +void test_transform_linestring(Value value) +{ + typedef bg::model::linestring line1_type; + typedef bg::model::linestring line2_type; + + line1_type line1; + line1.push_back(bg::make(1, 1)); + line1.push_back(bg::make(2, 2)); + boost::variant v(line1); + + line2_type expected; + for (BOOST_AUTO(p, line1.begin()); p != line1.end(); ++p) + { + P2 new_point; + bg::assign(new_point, *p); + bg::multiply_value(new_point, value); + expected.push_back(new_point); + } + + check_transform(line1, expected); + check_transform(v, expected); +} + + +template +void test_all(Value value) +{ + test_transform_point(value); + test_transform_linestring(value); +} + +template +void test_transformations(double phi, double theta, double r) +{ + typedef bg::model::point cartesian_type; + cartesian_type p; + + // 1: using spherical coordinates + { + typedef bg::model::point > spherical_type; + spherical_type sph1; + assign_values(sph1, phi, theta, r); + BOOST_CHECK(transform(sph1, p)); + + spherical_type sph2; + BOOST_CHECK(transform(p, sph2)); + + BOOST_CHECK_CLOSE(bg::get<0>(sph1), bg::get<0>(sph2), 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(sph1), bg::get<1>(sph2), 0.001); + } + + // 2: using spherical coordinates on unit sphere + { + typedef bg::model::point > spherical_type; + spherical_type sph1, sph2; + assign_values(sph1, phi, theta); + BOOST_CHECK(transform(sph1, p)); + BOOST_CHECK(transform(p, sph2)); + + BOOST_CHECK_CLOSE(bg::get<0>(sph1), bg::get<0>(sph2), 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(sph1), bg::get<1>(sph2), 0.001); + } +} + +int test_main(int, char* []) +{ + typedef bg::model::d2::point_xy P; + test_all(1.0); + test_all, bg::model::d2::point_xy >(1.0); + + test_all >, + bg::model::point > >(bg::math::d2r()); + test_all >, + bg::model::point > >(bg::math::r2d()); + + test_all >, + bg::model::point > >(bg::math::d2r()); + + test_transformations(4, 52, 1); + test_transformations(4, 52, 1); + + test_transformations + < + float, bg::radian + >(3 * bg::math::d2r(), 51 * bg::math::d2r(), 1); + + test_transformations + < + double, bg::radian + >(3 * bg::math::d2r(), 51 * bg::math::d2r(), 1); + +#if defined(HAVE_TTMATH) + typedef bg::model::d2::point_xy PT; + test_all(); + test_transformations(4, 52, 1); + test_transformations + < + ttmath_big, bg::radian + >(3 * bg::math::d2r(), 51 * bg::math::d2r(), 1); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/transform_multi.cpp b/src/boost/libs/geometry/test/algorithms/transform_multi.cpp new file mode 100644 index 000000000..66cb8ba6e --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/transform_multi.cpp @@ -0,0 +1,91 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#include + +#include +#include +#include +#include + +#include + + +// This test is a little different from transform.cpp test. +// This test explicitly tests all geometries, including multi* +// while the transform.cpp tests various strategies. + +template +void test_transform(std::string const& wkt, std::string const& expected) +{ + typedef typename bg::coordinate_type::type coordinate_type; + const std::size_t dim = bg::dimension::value; + + Geometry geometry_in, geometry_out; + bg::read_wkt(wkt, geometry_in); + bg::transform(geometry_in, geometry_out, + bg::strategy::transform::scale_transformer(2, 2)); + std::ostringstream detected; + detected << bg::wkt(geometry_out); + BOOST_CHECK_EQUAL(detected.str(), expected); +} + + +template +void test_all() +{ + typedef bg::model::d2::point_xy P; + + test_transform

( + "POINT(1 1)", + "POINT(2 2)"); + test_transform >( + "LINESTRING(1 1,2 2)", + "LINESTRING(2 2,4 4)"); + test_transform >( + "LINESTRING(1 1,2 2)", + "LINESTRING(2 2,4 4)"); + test_transform >( + "POLYGON((0 0,0 1,1 0,0 0))", + "POLYGON((0 0,0 2,2 0,0 0))"); + test_transform >( + "POLYGON((0 0,0 1,1 0,0 0))", + "POLYGON((0 0,0 2,2 0,0 0))"); + test_transform >( + "POLYGON((0 0,0 1,1 1,1 0,0 0))", + "POLYGON((0 0,0 2,2 2,2 0,0 0))"); + test_transform >( + "MULTIPOINT((1 1),(2 2))", + "MULTIPOINT((2 2),(4 4))"); + test_transform > >( + "MULTILINESTRING((1 1,2 2))", + "MULTILINESTRING((2 2,4 4))"); + test_transform > >( + "MULTIPOLYGON(((0 0,0 1,1 0,0 0)))", + "MULTIPOLYGON(((0 0,0 2,2 0,0 0)))"); +} + + +int test_main(int, char* []) +{ + test_all(); + +#ifdef HAVE_TTMATH + test_all(); +#endif + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/unique.cpp b/src/boost/libs/geometry/test/algorithms/unique.cpp new file mode 100644 index 000000000..4460029eb --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/unique.cpp @@ -0,0 +1,60 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#include +#include +#include + + + +template +void test_all() +{ + test_geometry >( + "LINESTRING(0 0,1 1)", + "LINESTRING(0 0,1 1)"); + + test_geometry >( + "LINESTRING(0 0,1 1,1 1)", + "LINESTRING(0 0,1 1)"); + + test_geometry >( + "LINESTRING(0 0,0 0,1 1)", + "LINESTRING(0 0,1 1)"); + + // Consecutive points + test_geometry >( + "LINESTRING(0 0,0 0,0 0,0 0,1 1,1 1,1 1)", + "LINESTRING(0 0,1 1)"); + + // Other types + test_geometry >( + "POLYGON((0 0,0 1,1 1,1 1,1 1,1 0,0 0,0 0))", + "POLYGON((0 0,0 1,1 1,1 0,0 0))"); + + // With holes + test_geometry >( + "POLYGON((0 0,0 10,10 10,10 10,10 10,10 0,0 0,0 0))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))"); +} + + + +int test_main(int, char* []) +{ + test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/unique_multi.cpp b/src/boost/libs/geometry/test/algorithms/unique_multi.cpp new file mode 100644 index 000000000..9061d7ef3 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/unique_multi.cpp @@ -0,0 +1,52 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#include + +#include + +#include +#include + +#include + + +template +void test_all() +{ + // Multi point, should happen nothing, even if there are duplicate points + test_geometry >( + "MULTIPOINT((0 0),(0 0),(1 1))", + "MULTIPOINT((0 0),(0 0),(1 1))"); + + test_geometry > >( + "MULTILINESTRING((0 0,1 1,1 1),(3 3,3 3,4 4))", + "MULTILINESTRING((0 0,1 1),(3 3,4 4))"); + + typedef bg::model::multi_polygon > mp; + test_geometry( + "MULTIPOLYGON(((0 0,0 1,1 1,1 1,1 1,1 0,0 0,0 0)))", + "MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)))"); + + // With holes + test_geometry( + "MULTIPOLYGON(((0 0,0 10,10 10,10 10,10 10,10 0,0 0,0 0)))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))"); + +} + +int test_main( int , char* [] ) +{ + test_all >(); + test_all >(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/within/Jamfile b/src/boost/libs/geometry/test/algorithms/within/Jamfile new file mode 100644 index 000000000..b3b788a04 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/within/Jamfile @@ -0,0 +1,27 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015, 2016. +# Modifications copyright (c) 2014-2016, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-algorithms-within + : + [ run within.cpp : : : : algorithms_within ] + [ run within_areal_areal.cpp : : : : algorithms_within_areal_areal ] + [ run within_linear_areal.cpp : : : : algorithms_within_linear_areal ] + [ run within_linear_linear.cpp : : : : algorithms_within_linear_linear ] + [ run within_multi.cpp : : : : algorithms_within_multi ] + [ run within_pointlike_geometry.cpp : : : : algorithms_within_pointlike_geometry ] + [ run within_sph.cpp : : : : algorithms_within_sph ] + [ run within_sph_geo.cpp : : : : algorithms_within_sph_geo ] + ; diff --git a/src/boost/libs/geometry/test/algorithms/within/test_within.hpp b/src/boost/libs/geometry/test/algorithms/within/test_within.hpp new file mode 100644 index 000000000..f4df47527 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/within/test_within.hpp @@ -0,0 +1,163 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2014, 2015, 2017, 2019. +// Modifications copyright (c) 2014-2019 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) + +#ifndef BOOST_GEOMETRY_TEST_WITHIN_HPP +#define BOOST_GEOMETRY_TEST_WITHIN_HPP + + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +struct no_strategy {}; + +template +bool call_within(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) +{ + return bg::within(geometry1, geometry2, strategy); +} + +template +bool call_within(Geometry1 const& geometry1, + Geometry2 const& geometry2, + no_strategy) +{ + return bg::within(geometry1, geometry2); +} + +template +void check_geometry(Geometry1 const& geometry1, + Geometry2 const& geometry2, + std::string const& wkt1, + std::string const& wkt2, + bool expected, + Strategy const& strategy) +{ + bool detected = call_within(geometry1, geometry2, strategy); + + BOOST_CHECK_MESSAGE(detected == expected, + "within: " << wkt1 + << " in " << wkt2 + << " -> Expected: " << expected + << " detected: " << detected); +} + +template +void test_geometry(std::string const& wkt1, + std::string const& wkt2, bool expected) +{ + Geometry1 geometry1; + Geometry2 geometry2; + bg::read_wkt(wkt1, geometry1); + bg::read_wkt(wkt2, geometry2); + boost::variant v1(geometry1); + boost::variant v2(geometry2); + + typedef typename bg::strategy::within::services::default_strategy + < + Geometry1, Geometry2 + >::type strategy_type; + + check_geometry(geometry1, geometry2, wkt1, wkt2, expected, strategy_type()); + check_geometry(geometry1, geometry2, wkt1, wkt2, expected, no_strategy()); + check_geometry(v1, geometry2, wkt1, wkt2, expected, no_strategy()); + check_geometry(geometry1, v2, wkt1, wkt2, expected, no_strategy()); + check_geometry(v1, v2, wkt1, wkt2, expected, no_strategy()); +} + +template +void test_ordered_ring(std::string const& wkt_point, + std::string const& wkt_geometry, bool expected, bool on_border) +{ + typedef bg::model::ring ring_type; + ring_type ring; + Point point; + + bg::read_wkt(wkt_geometry, ring); + if ( BOOST_GEOMETRY_CONDITION(! Clockwise) ) + { + std::reverse(boost::begin(ring), boost::end(ring)); + } + + bg::read_wkt(wkt_point, point); + + bool detected = bg::within(point, ring); + + BOOST_CHECK_MESSAGE(detected == expected, + "within: " << wkt_point + << " in " << wkt_geometry + << " -> Expected: " << expected + << " detected: " << detected + << " clockwise: " << int(Clockwise) + << " closed: " << int(Closed) + ); + + // other strategy (note that this one cannot detect OnBorder + // (without modifications) + + bg::strategy::within::franklin franklin; + detected = bg::within(point, ring, franklin); + if (! on_border) + { + BOOST_CHECK_MESSAGE(detected == expected, + "within: " << wkt_point + << " in " << wkt_geometry + << " -> Expected: " << expected + << " detected: " << detected + << " clockwise: " << int(Clockwise) + << " closed: " << int(Closed) + ); + } + + + bg::strategy::within::crossings_multiply cm; + detected = bg::within(point, ring, cm); + if (! on_border) + { + BOOST_CHECK_MESSAGE(detected == expected, + "within: " << wkt_point + << " in " << wkt_geometry + << " -> Expected: " << expected + << " detected: " << detected + << " clockwise: " << int(Clockwise) + << " closed: " << int(Closed) + ); + } +} + +template +void test_ring(std::string const& wkt_point, + std::string const& wkt_geometry, + bool expected, bool on_border) +{ + test_ordered_ring(wkt_point, wkt_geometry, expected, on_border); + test_ordered_ring(wkt_point, wkt_geometry, expected, on_border); + test_ordered_ring(wkt_point, wkt_geometry, expected, on_border); + test_ordered_ring(wkt_point, wkt_geometry, expected, on_border); + test_geometry >(wkt_point, wkt_geometry, expected); +} + +#endif diff --git a/src/boost/libs/geometry/test/algorithms/within/within.cpp b/src/boost/libs/geometry/test/algorithms/within/within.cpp new file mode 100644 index 000000000..b095d1752 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/within/within.cpp @@ -0,0 +1,152 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2014, 2015, 2016, 2018. +// Modifications copyright (c) 2014-2018 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) + +#include "test_within.hpp" + + +#include +#include +#include +#include +#include + +template +void test_point_box() +{ + typedef bg::model::box box_type1; + typedef bg::model::box box_type2; + + test_geometry("POINT(1 1)", "BOX(0 0,2 2)", true); + test_geometry("POINT(0 0)", "BOX(0 0,2 2)", false); + test_geometry("POINT(2 2)", "BOX(0 0,2 2)", false); + test_geometry("POINT(0 1)", "BOX(0 0,2 2)", false); + test_geometry("POINT(1 0)", "BOX(0 0,2 2)", false); + + test_geometry("POINT(3 3)", "BOX(1 1,4 4)", true); + test_geometry("POINT(3 3)", "BOX(0 0,5 5)", true); + + test_geometry("BOX(1 1,2 2)", "BOX(0 0,3 3)", true); + test_geometry("BOX(0 0,3 3)", "BOX(1 1,2 2)", false); + + test_geometry("BOX(1 1,3 3)", "BOX(0 0,3 3)", true); + test_geometry("BOX(3 1,3 3)", "BOX(0 0,3 3)", false); + + test_geometry("BOX(1 1,4 4)", "BOX(0 0,5 5)", true); + test_geometry("BOX(0 0,5 5)", "BOX(1 1,4 4)", false); + + /* + test_within_code("POINT(1 1)", "BOX(0 0,2 2)", 1); + test_within_code("POINT(1 0)", "BOX(0 0,2 2)", 0); + test_within_code("POINT(0 1)", "BOX(0 0,2 2)", 0); + test_within_code("POINT(0 3)", "BOX(0 0,2 2)", -1); + test_within_code("POINT(3 3)", "BOX(0 0,2 2)", -1); + + test_within_code("BOX(1 1,2 2)", "BOX(0 0,3 3)", 1); + test_within_code("BOX(0 1,2 2)", "BOX(0 0,3 3)", 0); + test_within_code("BOX(1 0,2 2)", "BOX(0 0,3 3)", 0); + test_within_code("BOX(1 1,2 3)", "BOX(0 0,3 3)", 0); + test_within_code("BOX(1 1,3 2)", "BOX(0 0,3 3)", 0); + test_within_code("BOX(1 1,3 4)", "BOX(0 0,3 3)", -1); + */ +} + +void test_point_box_3d() +{ + typedef boost::geometry::model::point point_type; + typedef boost::geometry::model::box box_type; + box_type box(point_type(0, 0, 0), point_type(4, 4, 4)); + BOOST_CHECK_EQUAL(bg::within(point_type(2, 2, 2), box), true); + BOOST_CHECK_EQUAL(bg::within(point_type(2, 4, 2), box), false); + BOOST_CHECK_EQUAL(bg::within(point_type(2, 2, 4), box), false); + BOOST_CHECK_EQUAL(bg::within(point_type(2, 2, 5), box), false); + + box_type box2(point_type(2, 2, 2), point_type(3, 3, 3)); + BOOST_CHECK_EQUAL(bg::within(box2, box), true); + +} + +template +void test_point_poly() +{ + typedef boost::geometry::model::polygon poly1; + typedef boost::geometry::model::polygon poly2; + + test_geometry("POINT(3 3)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); + test_geometry("POINT(3 3)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); +} + +template +void test_all() +{ + test_point_box(); + test_point_poly(); +} + +template +void test_all() +{ + test_all(); +} + +void test_strategy() +{ + // Test by explicitly specifying a strategy + typedef bg::model::d2::point_xy point_type; + typedef bg::model::box box_type; + point_type p(3, 3); + box_type b(point_type(0, 0), point_type(5, 5)); + box_type b0(point_type(0, 0), point_type(5, 0)); + + bool r = bg::within(p, b, + bg::strategy::within::cartesian_point_box()); + BOOST_CHECK_EQUAL(r, true); + + r = bg::within(b, b, + bg::strategy::within::box_in_box()); + BOOST_CHECK_EQUAL(r, true); + + r = bg::within(b0, b0, + bg::strategy::within::box_in_box()); + BOOST_CHECK_EQUAL(r, false); + + r = bg::within(p, b, + bg::strategy::within::point_in_box_by_side<>()); + BOOST_CHECK_EQUAL(r, true); +} + + +int test_main( int , char* [] ) +{ + typedef boost::geometry::model::d2::point_xy xyd; + typedef boost::geometry::model::d2::point_xy xyf; + typedef boost::geometry::model::d2::point_xy xyi; + typedef boost::geometry::model::point p2d; + + test_all(); + test_all(); + test_all(); + + test_all(); + test_all(); + + test_point_box_3d(); + test_strategy(); + + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/within/within_areal_areal.cpp b/src/boost/libs/geometry/test/algorithms/within/within_areal_areal.cpp new file mode 100644 index 000000000..625be46d8 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/within/within_areal_areal.cpp @@ -0,0 +1,105 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2014, 2015, 2016. +// Modifications copyright (c) 2014-2016 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) + + +#include "test_within.hpp" + + +#include +#include +#include + +template +void test_a_a() +{ + typedef bg::model::polygon poly1; + typedef bg::model::ring ring1; + typedef bg::model::multi_polygon mpoly1; + typedef bg::model::polygon poly2; + typedef bg::model::ring ring2; + typedef bg::model::multi_polygon mpoly2; + + test_geometry("POLYGON((0 0,0 2,2 2,2 0,0 0))", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); + test_geometry("POLYGON((0 0,0 5,5 5,5 0,0 0))", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); + test_geometry("POLYGON((0 0,0 6,6 6,6 0,0 0))", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); + + test_geometry("POLYGON((0 0,0 9,9 9,9 0,0 0),(3 3,6 3,6 6,3 6,3 3))", + "POLYGON((0 0,0 9,9 9,9 0,0 0),(3 3,6 3,6 6,3 6,3 3))", true); + test_geometry("POLYGON((0 0,0 9,9 9,9 0,0 0),(3 3,6 3,6 6,3 6,3 3))", + "POLYGON((0 0,0 9,9 9,9 0,0 0),(4 4,5 4,5 5,4 5,4 4))", true); + test_geometry("POLYGON((1 1,1 8,8 8,8 1,1 1),(3 3,6 3,6 6,3 6,3 3))", + "POLYGON((0 0,0 9,9 9,9 0,0 0),(3 3,6 3,6 6,3 6,3 3))", true); + test_geometry("POLYGON((1 1,1 8,8 8,8 1,1 1),(3 3,6 3,6 6,3 6,3 3))", + "POLYGON((0 0,0 9,9 9,9 0,0 0),(4 4,5 4,5 5,4 5,4 4))", true); + + test_geometry("POLYGON((0 0,0 2,2 2,2 0,0 0))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)))", true); + test_geometry("POLYGON((0 0,0 2,2 2,2 0,0 0))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)))", true); + + test_geometry("MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_geometry("MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((15 15,15 110,110 110,110 15,15 15)))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + + test_geometry("MULTIPOLYGON(((0 0,0 1,1 0,0 0)),((3 3,3 4,4 3,3 3)))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(3 3,4 3,4 4,3 4,3 3))", false); + + test_geometry("MULTIPOLYGON(((0 0,0 1,1 0,0 0)),((3 3,3 4,4 3,3 3)))", + "MULTIPOLYGON(((0 0,0 1,1 0,0 0)),((3 3,3 4,4 3,3 3)))", true); + test_geometry("MULTIPOLYGON(((0 0,0 1,1 0,0 0)),((3 3,3 4,4 3,3 3)))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)))", true); + test_geometry("MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)))", + "MULTIPOLYGON(((0 0,0 1,1 0,0 0)),((3 3,3 4,4 3,3 3)))", false); + + // https://svn.boost.org/trac/boost/ticket/10912 + test_geometry("POLYGON((0 0,0 5,5 5,5 0,0 0))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2),(6 6,8 6,8 8,6 8,6 6))", + false); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,2 4,4 4,4 2,2 2))", + false); + + test_geometry("POLYGON((0 0,0 5,5 5,5 0,0 0))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + true); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((0 0,0 -10,-10 -10,-10 0,0 0)))", + true); +} + +template +void test_all() +{ + test_a_a(); +} + +template +void test_all() +{ + test_a_a(); +} + +int test_main( int , char* [] ) +{ + test_all >(); + test_all >(); + test_all, bg::model::point >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/within/within_linear_areal.cpp b/src/boost/libs/geometry/test/algorithms/within/within_linear_areal.cpp new file mode 100644 index 000000000..63bb0028a --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/within/within_linear_areal.cpp @@ -0,0 +1,127 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2014, 2015, 2016. +// Modifications copyright (c) 2014-2016 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) + +#include "test_within.hpp" + + +#include +#include +#include +#include + +template +void test_l_a() +{ + typedef bg::model::linestring ls; + typedef bg::model::multi_linestring mls; + typedef bg::model::polygon poly; + typedef bg::model::ring ring; + typedef bg::model::multi_polygon mpoly; + + // B,I + test_geometry("LINESTRING(0 0, 2 2)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); + + // B,I + test_geometry("LINESTRING(0 0, 2 2)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); + // I + test_geometry("LINESTRING(1 1, 2 2)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); + // I,E + test_geometry("LINESTRING(1 1, 6 6)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); + // B + test_geometry("LINESTRING(0 0, 5 0)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); + test_geometry("LINESTRING(0 0, 0 5)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); + // E + test_geometry("LINESTRING(6 0, 6 5)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); + + // BIBIB + test_geometry("LINESTRING(0 0, 10 10)", "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)))", true); + // BIBEBIB + test_geometry("LINESTRING(0 0, 10 10)", "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((6 6,5 10,10 10,10 5,6 6)))", false); + + // MySQL report 18.12.2014 (https://svn.boost.org/trac/boost/ticket/10887) + test_geometry("LINESTRING(5 -2,5 2)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + true); + test_geometry("LINESTRING(5 -2,5 5)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + true); + test_geometry("LINESTRING(5 -2,5 0)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + true); + // MySQL report 18.12.2014 - extended + test_geometry("LINESTRING(5 -2,5 0)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)),((5 0,7 1,7 -1,5 0)))", + true); + test_geometry("LINESTRING(0 0,5 0)", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)),((5 0,7 1,7 -1,5 0)))", + false); + test_geometry("MULTILINESTRING((5 -2,4 -2,5 0),(5 -2,6 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + true); + test_geometry("MULTILINESTRING((0 0,0 1,5 0),(0 0,0 -1,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + false); + test_geometry("MULTILINESTRING((5 -2,4 -2,5 0),(6 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + true); + test_geometry("MULTILINESTRING((0 0,0 1,5 0),(0 -1,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + false); + test_geometry("MULTILINESTRING((0 0,5 0),(5 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + false); + test_geometry("MULTILINESTRING((5 -2,5 0),(0 0,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + false); + + // BI + test_geometry("MULTILINESTRING((0 0,2 2),(2 2,3 3))", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); + // I E + test_geometry("MULTILINESTRING((1 1,2 2),(6 6,7 7))", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); + + // I I + test_geometry("MULTILINESTRING((1 1,5 5),(6 6,7 7))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)))", + true); + // I E + test_geometry("MULTILINESTRING((1 1,5 5),(11 11,12 12))", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5)))", + false); +} + +template +void test_all() +{ + test_l_a(); +} + +template +void test_all() +{ + test_l_a(); +} + +int test_main( int , char* [] ) +{ + test_all >(); + test_all >(); + test_all, bg::model::point >(); + + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/within/within_linear_linear.cpp b/src/boost/libs/geometry/test/algorithms/within/within_linear_linear.cpp new file mode 100644 index 000000000..c4d7d348d --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/within/within_linear_linear.cpp @@ -0,0 +1,108 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2014, 2015, 2016. +// Modifications copyright (c) 2014-2016 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) + + +#include "test_within.hpp" + + +#include +#include +#include + +template +void test_l_l() +{ + typedef bg::model::linestring ls1; + typedef bg::model::multi_linestring mls1; + typedef bg::model::linestring ls2; + typedef bg::model::multi_linestring mls2; + + test_geometry("LINESTRING(0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", true); + + test_geometry("LINESTRING(0 0, 1 1, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", true); + test_geometry("LINESTRING(3 2, 2 2, 1 1, 0 0)", "LINESTRING(0 0, 2 2, 3 2)", true); + test_geometry("LINESTRING(0 0, 1 1, 2 2, 3 2)", "LINESTRING(3 2, 2 2, 0 0)", true); + test_geometry("LINESTRING(3 2, 2 2, 1 1, 0 0)", "LINESTRING(3 2, 2 2, 0 0)", true); + + test_geometry("LINESTRING(1 1, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", true); + test_geometry("LINESTRING(3 2, 2 2, 1 1)", "LINESTRING(0 0, 2 2, 4 2)", true); + test_geometry("LINESTRING(1 1, 2 2, 3 2)", "LINESTRING(4 2, 2 2, 0 0)", true); + test_geometry("LINESTRING(3 2, 2 2, 1 1)", "LINESTRING(4 2, 2 2, 0 0)", true); + + test_geometry("LINESTRING(1 1, 2 2, 3 3)", "LINESTRING(0 0, 2 2, 4 2)", false); + test_geometry("LINESTRING(1 1, 2 2, 3 2, 3 3)", "LINESTRING(0 0, 2 2, 4 2)", false); + test_geometry("LINESTRING(1 1, 2 2, 3 1)", "LINESTRING(0 0, 2 2, 4 2)", false); + test_geometry("LINESTRING(1 1, 2 2, 3 2, 3 1)", "LINESTRING(0 0, 2 2, 4 2)", false); + + test_geometry("LINESTRING(0 1, 1 1, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", false); + test_geometry("LINESTRING(0 1, 0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", false); + test_geometry("LINESTRING(1 0, 1 1, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", false); + test_geometry("LINESTRING(1 0, 0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 4 2)", false); + + // duplicated points + test_geometry("LINESTRING(1 1, 2 2, 2 2)", "LINESTRING(0 0, 2 2, 4 2)", true); + test_geometry("LINESTRING(1 1, 1 1, 2 2)", "LINESTRING(0 0, 2 2, 4 2)", true); + + test_geometry("LINESTRING(0 0, 0 0, 0 0, 1 1, 2 2, 2 2, 2 2, 2 2, 2 2, 2 2, 2 2, 2 2, 2 2, 2 2, 2 2, 2 2, 2 2, 2 2, 2 2, 2 2, 2 2, 2 2, 3 3)", + "LINESTRING(0 0, 2 2, 4 4)", true); + + // invalid linestrings +// test_geometry("LINESTRING(0 0)", "LINESTRING(0 0)", false); +// test_geometry("LINESTRING(1 1)", "LINESTRING(0 0, 2 2)", true); +// test_geometry("LINESTRING(0 0)", "LINESTRING(0 0, 2 2)", false); +// test_geometry("LINESTRING(0 0, 1 1)", "LINESTRING(0 0)", false); + + // spikes + // FOR NOW DISABLED + + /*test_geometry("LINESTRING(0 0,5 0,3 0,6 0)", "LINESTRING(0 0,6 0)", true); + + test_geometry("LINESTRING(0 0,2 2,3 3,1 1)", "LINESTRING(0 0,3 3,6 3)", true); + test_geometry("LINESTRING(0 0,3 3,6 3)", "LINESTRING(0 0,2 2,3 3,1 1)", false); + test_geometry("LINESTRING(0 0,2 2,3 3,1 1)", "LINESTRING(0 0,4 4,6 3)", true); + test_geometry("LINESTRING(0 0,4 4,6 3)", "LINESTRING(0 0,2 2,3 3,1 1)", false); + + test_geometry("LINESTRING(0 0,2 2,3 3,1 1,5 3)", "LINESTRING(0 0,3 3,6 3)", false);*/ + + test_geometry("LINESTRING(1 1, 2 2)", "MULTILINESTRING((0 0, 2 2),(3 3, 4 4))", true); + + test_geometry("MULTILINESTRING((0 0, 2 2),(3 3, 4 4))", "LINESTRING(0 0, 5 5)", true); + + test_geometry("MULTILINESTRING((1 1, 2 2),(3 3, 4 4))", "MULTILINESTRING((1 1, 2 2),(2 2, 5 5))", true); +} + +template +void test_all() +{ + test_l_l(); +} + +template +void test_all() +{ + test_l_l(); +} + +int test_main( int , char* [] ) +{ + test_all >(); + test_all >(); + test_all, bg::model::point >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/within/within_multi.cpp b/src/boost/libs/geometry/test/algorithms/within/within_multi.cpp new file mode 100644 index 000000000..b41529cc0 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/within/within_multi.cpp @@ -0,0 +1,54 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include "test_within.hpp" + + +template +void test_all() +{ + typedef bg::model::multi_polygon > mp; + + // test multi-with-one-polygon (trivial case) + test_geometry("POINT(1 1)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", true); + test_geometry("POINT(3 3)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", false); + test_geometry("POINT(0 1)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", false); + test_geometry("POINT(4 4)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", false); + + // test if it is in one of them + std::string multi("MULTIPOLYGON(" + "((0 0,0 2,2 2,2 0,0 0))" + "((3 3,3 6,6 6,6 3,3 3))" + ")"); + test_geometry("POINT(4 4)", multi, true); + test_geometry("POINT(1 1)", multi, true); + test_geometry("POINT(0 1)", multi, false); +} + +int test_main( int , char* [] ) +{ + //test_all >(); + test_all >(); + +#if defined(HAVE_TTMATH) + test_all >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/within/within_pointlike_geometry.cpp b/src/boost/libs/geometry/test/algorithms/within/within_pointlike_geometry.cpp new file mode 100644 index 000000000..523e183c0 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/within/within_pointlike_geometry.cpp @@ -0,0 +1,462 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2014, 2015, 2016, 2017. +// Modifications copyright (c) 2014-2017 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) + +#include "test_within.hpp" + + +#include +#include +#include +#include +#include + +template +void test_p_p() +{ + typedef bg::model::multi_point

mpt; + + test_geometry("POINT(0 0)", "POINT(0 0)", true); + test_geometry("POINT(0 0)", "POINT(1 1)", false); + + test_geometry("POINT(0 0)", "MULTIPOINT(0 0, 1 1)", true); + test_geometry("POINT(0 0)", "MULTIPOINT(1 1, 2 2)", false); + + test_geometry("MULTIPOINT(0 0)", "POINT(0 0)", true); + test_geometry("MULTIPOINT(0 0, 1 1)", "POINT(0 0)", false); + test_geometry("MULTIPOINT(0 0, 1 1)", "POINT(2 2)", false); + + test_geometry("MULTIPOINT(0 0)", "MULTIPOINT(0 0, 1 1)", true); + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTIPOINT(0 0, 1 1)", true); + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTIPOINT(0 0)", false); + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTIPOINT(1 1, 2 2)", false); + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTIPOINT(2 2, 3 4)", false); +} + +template +void test_p_l() +{ + typedef bg::model::multi_point

mpt; + typedef bg::model::segment

seg; + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("POINT(1 1)", "LINESTRING(0 0, 2 2)", true); + test_geometry("POINT(0 0)", "LINESTRING(0 0, 1 1)", false); + test_geometry("POINT(1 0)", "LINESTRING(0 0, 1 1)", false); + + test_geometry("POINT(0 0)", "LINESTRING(0 0,1 1,2 2)", false); + test_geometry("POINT(3 3)", "LINESTRING(0 0,1 1,2 2)", false); + test_geometry("POINT(1 1)", "LINESTRING(0 0,2 2,3 3)", true); + + test_geometry("POINT(1 1)", "LINESTRING(0 0, 2 2)", true); + test_geometry("POINT(0 0)", "LINESTRING(0 0, 1 1)", false); + + test_geometry("POINT(0 0)", "MULTILINESTRING((0 0,1 1,2 2),(0 0,0 1))", true); + test_geometry("POINT(0 0)", "MULTILINESTRING((0 0,1 1,2 2),(0 0,0 1),(0 0,1 0))", false); + + test_geometry("POINT(1 1)", "MULTILINESTRING((0 0, 1 1),(1 1, 2 2))", true); + test_geometry("POINT(1 1)", "MULTILINESTRING((0 0, 1 1),(2 2, 3 3))", false); + + test_geometry("MULTIPOINT(0 0, 1 1)", "LINESTRING(0 0, 2 2)", true); + + test_geometry("MULTIPOINT(0 0, 2 2)", "LINESTRING(0 0, 2 2)", false); + test_geometry("MULTIPOINT(1 1, 3 3)", "LINESTRING(0 0, 2 2)", false); + + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 3))", true); + test_geometry("MULTIPOINT(0 0, 2 2)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 3))", true); + test_geometry("MULTIPOINT(0 0, 3 3)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 3))", false); + test_geometry("MULTIPOINT(1 1, 4 4)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 3))", false); +} + +template +void test_p_a() +{ + typedef bg::model::multi_point

mpt; + typedef bg::model::ring

ring; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + // trivial case + test_ring

("POINT(1 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", true, false); + + // on border/corner + test_ring

("POINT(0 0)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", false, true); + test_ring

("POINT(0 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", false, true); + + // aligned to segment/vertex + test_ring

("POINT(1 1)", "POLYGON((0 0,0 3,3 3,3 1,2 1,2 0,0 0))", true, false); + test_ring

("POINT(1 1)", "POLYGON((0 0,0 3,4 3,3 1,2 2,2 0,0 0))", true, false); + + // same polygon, but point on border + test_ring

("POINT(3 3)", "POLYGON((0 0,0 3,3 3,3 1,2 1,2 0,0 0))", false, true); + test_ring

("POINT(3 3)", "POLYGON((0 0,0 3,4 3,3 1,2 2,2 0,0 0))", false, true); + + // holes + test_geometry("POINT(2 2)", + "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,3 1,3 3,1 3,1 1))", false); + + // Real-life problem (solved now), point is in the middle, 409623 is also a coordinate + // on the border, has been wrong in the past (2009) + test_ring

("POINT(146383 409623)", + "POLYGON((146351 410597,146521 410659,147906 410363,148088 410420" + ",148175 410296,148281 409750,148215 409623,148154 409666,148154 409666" + ",148130 409625,148035 409626,148035 409626,148008 409544,147963 409510" + ",147993 409457,147961 409352,147261 408687,147008 408586,145714 408840" + ",145001 409033,144486 409066,144616 409308,145023 410286,145254 410488" + ",145618 410612,145618 410612,146015 410565,146190 410545,146351 410597))", + true, false); + + test_geometry("POINT(2 2)", + "MULTIPOLYGON(((0 0,0 4,4 4,4 0,0 0),(1 1,3 1,3 3,1 3,1 1)),((5 5,5 9,9 9,9 5,5 5)))", false); + test_geometry("POINT(1 1)", + "MULTIPOLYGON(((0 0,0 4,4 4,4 0,0 0),(1 1,3 1,3 3,1 3,1 1)),((5 5,5 9,9 9,9 5,5 5)))", false); + test_geometry("POINT(1 1)", + "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0),(2 2,4 2,4 4,2 4,2 2)),((5 5,5 9,9 9,9 5,5 5)))", true); + test_geometry("POINT(6 6)", + "MULTIPOLYGON(((0 0,0 4,4 4,4 0,0 0),(1 1,3 1,3 3,1 3,1 1)),((5 5,5 9,9 9,9 5,5 5)))", true); + + test_geometry("POINT(6 4)", + "POLYGON((0 5, 5 0, 6 1, 5 2, 8 4, 5 6, 6 7, 5 8, 6 9, 5 10, 0 5))", true); + test_geometry("POINT(4 6)", + "POLYGON((5 0, 0 5, 1 6, 2 5, 4 8, 6 5, 7 6, 8 5, 9 6, 10 5, 5 0))", true); + + test_geometry("MULTIPOINT(0 0, 1 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", true); + + test_geometry("MULTIPOINT(0 0, 2 2)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", false); + test_geometry("MULTIPOINT(1 1, 3 3)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", false); + + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)),((2 2,2 3,3 3,3 2,2 2)))", true); + test_geometry("MULTIPOINT(0 0, 2 2)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)),((2 2,2 3,3 3,3 2,2 2)))", false); + test_geometry("MULTIPOINT(0 0, 3 3)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)),((2 2,2 3,3 3,3 2,2 2)))", false); + test_geometry("MULTIPOINT(1 1, 4 4)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)),((2 2,2 3,3 3,3 2,2 2)))", false); +} + +template +void test_all() +{ + test_p_p

(); + test_p_l

(); + test_p_a

(); +} + +template +void test_spherical_geographic() +{ + bg::model::polygon wrangel; + + typename boost::mpl::if_ + < + boost::is_same::type, bg::geographic_tag>, + bg::strategy::within::geographic_winding, + bg::strategy::within::spherical_winding + >::type ws; + + typename boost::mpl::if_ + < + boost::is_same::type, bg::geographic_tag>, + bg::strategy::side::geographic<>, + bg::strategy::side::spherical_side_formula<> + >::type ss; + + boost::ignore_unused(ws, ss); + + // SQL Server check (no geography::STWithin, so check with intersection trick) + /* + + with q as ( + select geography::STGeomFromText('POLYGON((-178.569 71.5641,-179.034 71.5977,-179.305 71.5514,-179.629 71.5772,-180 71.5358,179.53 71.4383,178.872 71.2175,178.618 71.0355,178.791 70.7964,179.273 70.8886,179.678 70.8955,-180 70.9972,-179.274 70.9078,-178.819 70.98,-177.939 71.0375,-177.62 71.1166,-177.439 71.2269,-177.503 71.2775,-177.833 71.3461,-178.018 71.4497,-178.569 71.5641))',4326) as wrangel + ) + + select wrangel.STArea()/1000000.0 + ,geography::STGeomFromText('POINT(-179.3 71.27)',4326).STIntersection(wrangel).STAsText() as workaround_within_1 + ,geography::STGeomFromText('POINT(-179.9 70.95)',4326).STIntersection(wrangel).STAsText() as workaround_within_2 + ,geography::STGeomFromText('POINT(179.9 70.95)',4326).STIntersection(wrangel).STAsText() as workaround_within_3 + from q + + -> 7669.10402181435 POINT (-179.3 71.27) GEOMETRYCOLLECTION EMPTY GEOMETRYCOLLECTION EMPTY + + PostGIS knows Within for Geography neither, and the intersection trick gives the same result + + */ + + bg::read_wkt("POLYGON((-178.568604 71.564148,-178.017548 71.449692,-177.833313 71.3461,-177.502838 71.277466 ,-177.439453 71.226929,-177.620026 71.116638,-177.9389 71.037491,-178.8186 70.979965,-179.274445 70.907761,-180 70.9972,179.678314 70.895538,179.272766 70.888596,178.791016 70.7964,178.617737 71.035538,178.872192 71.217484,179.530273 71.4383 ,-180 71.535843 ,-179.628601 71.577194,-179.305298 71.551361,-179.03421 71.597748,-178.568604 71.564148))", wrangel); + + bool within = bg::within(Point(-179.3, 71.27), wrangel); + BOOST_CHECK_EQUAL(within, true); + + within = bg::within(Point(-179.9, 70.95), wrangel); + BOOST_CHECK_EQUAL(within, false); + + within = bg::within(Point(179.9, 70.95), wrangel); + BOOST_CHECK_EQUAL(within, false); + + // Test using great circle mapper + // http://www.gcmap.com/mapui?P=5E52N-9E53N-7E50N-5E52N,7E52.5N,8E51.5N,6E51N + + bg::model::polygon triangle; + bg::read_wkt("POLYGON((5 52,9 53,7 50,5 52))", triangle); + BOOST_CHECK_EQUAL(bg::within(Point(7, 52.5), triangle, ws), true); + BOOST_CHECK_EQUAL(bg::within(Point(8.0, 51.5), triangle, ws), false); + BOOST_CHECK_EQUAL(bg::within(Point(6.0, 51.0), triangle, ws), false); + + // northern hemisphere + { + bg::model::polygon poly_n; + bg::read_wkt("POLYGON((10 50,30 50,30 40,10 40, 10 50))", poly_n); + Point pt_n1(20, 50.00001); + Point pt_n2(20, 40.00001); + BOOST_CHECK_EQUAL(ss.apply(poly_n.outer()[0], poly_n.outer()[1], pt_n1), -1); // right of segment + BOOST_CHECK_EQUAL(ss.apply(poly_n.outer()[2], poly_n.outer()[3], pt_n2), 1); // left of segment + BOOST_CHECK_EQUAL(bg::within(pt_n1, poly_n, ws), true); + BOOST_CHECK_EQUAL(bg::within(pt_n2, poly_n, ws), false); + } + // southern hemisphere + { + bg::model::polygon poly_s; + bg::read_wkt("POLYGON((10 -40,30 -40,30 -50,10 -50, 10 -40))", poly_s); + Point pt_s1(20, -40.00001); + Point pt_s2(20, -50.00001); + BOOST_CHECK_EQUAL(ss.apply(poly_s.outer()[0], poly_s.outer()[1], pt_s1), 1); // left of segment + BOOST_CHECK_EQUAL(ss.apply(poly_s.outer()[2], poly_s.outer()[3], pt_s2), -1); // right of segment + BOOST_CHECK_EQUAL(bg::within(pt_s1, poly_s, ws), false); + BOOST_CHECK_EQUAL(bg::within(pt_s2, poly_s, ws), true); + } + // crossing antimeridian, northern hemisphere + { + bg::model::polygon poly_n; + bg::read_wkt("POLYGON((170 50,-170 50,-170 40,170 40, 170 50))", poly_n); + Point pt_n11(180, 50.00001); + Point pt_n12(-180, 50.00001); + Point pt_n13(179, 50.00001); + Point pt_n14(-179, 50.00001); + Point pt_n21(180, 40.00001); + Point pt_n22(-180, 40.00001); + Point pt_n23(179, 40.00001); + Point pt_n24(-179, 40.00001); + BOOST_CHECK_EQUAL(bg::within(pt_n11, poly_n, ws), true); + BOOST_CHECK_EQUAL(bg::within(pt_n12, poly_n, ws), true); + BOOST_CHECK_EQUAL(bg::within(pt_n13, poly_n, ws), true); + BOOST_CHECK_EQUAL(bg::within(pt_n14, poly_n, ws), true); + BOOST_CHECK_EQUAL(bg::within(pt_n21, poly_n, ws), false); + BOOST_CHECK_EQUAL(bg::within(pt_n22, poly_n, ws), false); + BOOST_CHECK_EQUAL(bg::within(pt_n23, poly_n, ws), false); + BOOST_CHECK_EQUAL(bg::within(pt_n24, poly_n, ws), false); + } + + // TODO: Move to covered_by tests + + // Segment going through pole + { + bg::model::polygon poly_n1; + bg::read_wkt("POLYGON((-90 80,90 80,90 70,-90 70, -90 80))", poly_n1); + // Points on segment + BOOST_CHECK_EQUAL(bg::covered_by(Point(-90, 85), poly_n1, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(90, 85), poly_n1, ws), true); + // Points on pole + BOOST_CHECK_EQUAL(bg::covered_by(Point(90, 90), poly_n1, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(0, 90), poly_n1, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(45, 90), poly_n1, ws), true); + } + // Segment going through pole + { + bg::model::polygon poly_n2; + bg::read_wkt("POLYGON((-90 80,90 70,0 70,-90 80))", poly_n2); + // Points on segment + BOOST_CHECK_EQUAL(bg::covered_by(Point(-90, 85), poly_n2, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(90, 75), poly_n2, ws), true); + // Points outside but on the same level as segment + BOOST_CHECK_EQUAL(bg::covered_by(Point(-90, 75), poly_n2, ws), false); + } + // Possibly invalid, 2-segment polygon with segment going through pole + /*{ + bg::model::polygon poly_n; + bg::read_wkt("POLYGON((-90 80,90 70,-90 80))", poly_n); + // Point within + BOOST_CHECK_EQUAL(bg::within(Point(0, 89), poly_n), true); + // Points on segment + BOOST_CHECK_EQUAL(bg::covered_by(Point(-90, 85), poly_n), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(90, 75), poly_n), true); + // Points outside but on the same level as segment + BOOST_CHECK_EQUAL(bg::covered_by(Point(-90, 75), poly_n), false); + }*/ + // Segment endpoints on pole with arbitrary longitudes + { + bg::model::polygon poly_n3; + bg::read_wkt("POLYGON((45 90,45 80,0 80,45 90))", poly_n3); + BOOST_CHECK_EQUAL(bg::covered_by(Point(0, 85), poly_n3, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(45, 85), poly_n3, ws), true); + } + // Segment going through pole + { + bg::model::polygon poly_s1; + bg::read_wkt("POLYGON((-90 -80,-90 -70,90 -70,90 -80,-90 -80))", poly_s1); + // Points on segment + BOOST_CHECK_EQUAL(bg::covered_by(Point(-90, -85), poly_s1, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(90, -85), poly_s1, ws), true); + // Points on pole + BOOST_CHECK_EQUAL(bg::covered_by(Point(90, -90), poly_s1, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(0, -90), poly_s1, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(45, -90), poly_s1, ws), true); + } + // Segment endpoints on pole with arbitrary longitudes + { + bg::model::polygon poly_s2; + bg::read_wkt("POLYGON((45 -90,0 -80,45 -80,45 -90))", poly_s2); + BOOST_CHECK_EQUAL(bg::covered_by(Point(0, -85), poly_s2, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(45, -85), poly_s2, ws), true); + } + // Polygon covering nearly half of the globe but no poles + { + bg::model::polygon poly_h1; + bg::read_wkt("POLYGON((170 0, 170 -80,10 -80,0 -80,0 -20,10 -20,10 20,0 20,0 80,10 80,170 80,170 0))", poly_h1); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 90), poly_h1, ws), false); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 85), poly_h1, ws), false); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 50), poly_h1, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 0), poly_h1, ws), false); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, -50), poly_h1, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, -85), poly_h1, ws), false); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, -90), poly_h1, ws), false); + } + // Polygon covering more than half of the globe with both holes + { + bg::model::polygon poly_h2; + bg::read_wkt("POLYGON((180 0, 180 -80,0 -80,10 -80,10 -20,0 -20,0 20,10 20,10 80,0 80,180 80,180 0))", poly_h2); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 90), poly_h2, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 85), poly_h2, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 50), poly_h2, ws), false); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 0), poly_h2, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, -50), poly_h2, ws), false); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, -85), poly_h2, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, -90), poly_h2, ws), true); + } + // Polygon covering around half of the globe covering south pole + { + bg::model::polygon poly_h3; + bg::read_wkt("POLYGON((180 0, 180 -80,0 -80,0 -20,10 -20,10 20,0 20,0 80,10 80,170 80,180 0))", poly_h3); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 90), poly_h3, ws), false); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 85), poly_h3, ws), false); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 50), poly_h3, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 0), poly_h3, ws), false); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, -50), poly_h3, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, -85), poly_h3, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, -90), poly_h3, ws), true); + } + // Polygon covering around half of the globe covering north pole + { + bg::model::polygon poly_h4; + bg::read_wkt("POLYGON((180 0, 170 -80,10 -80,10 -20,0 -20,0 20,10 20,10 80,0 80,180 80,180 0))", poly_h4); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 90), poly_h4, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 85), poly_h4, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 50), poly_h4, ws), false); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, 0), poly_h4, ws), true); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, -50), poly_h4, ws), false); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, -85), poly_h4, ws), false); + BOOST_CHECK_EQUAL(bg::covered_by(Point(5, -90), poly_h4, ws), false); + } +} + +void test_large_integers() +{ + typedef bg::model::point int_point_type; + typedef bg::model::point double_point_type; + + std::string const polygon_li = "POLYGON((1872000 528000,1872000 192000,1536119 192000,1536000 528000,1200000 528000,1200000 863880,1536000 863880,1872000 863880,1872000 528000))"; + bg::model::polygon int_poly; + bg::model::polygon double_poly; + bg::read_wkt(polygon_li, int_poly); + bg::read_wkt(polygon_li, double_poly); + + std::string const point_li = "POINT(1592000 583950)"; + int_point_type int_point; + double_point_type double_point; + bg::read_wkt(point_li, int_point); + bg::read_wkt(point_li, double_point); + + bool wi = bg::within(int_point, int_poly); + bool wd = bg::within(double_point, double_poly); + + BOOST_CHECK_MESSAGE(wi == wd, "within different from within"); +} + +void test_tickets() +{ + typedef boost::geometry::model::d2::point_xy pt; + typedef boost::geometry::model::ring ring; + + // https://svn.boost.org/trac/boost/ticket/9628 + { + ring r; + r.push_back(pt(-19155.669324773193,54820.312032458620)); + r.push_back(pt(-13826.169324773080,54820.312032458627)); + r.push_back(pt(-13826.169324773078,52720.312032458663)); + r.push_back(pt(-12755.169324773129,52720.312032458663)); + r.push_back(pt(-12755.169324773129,51087.312032458671)); + r.push_back(pt(-12760.669324773080,51087.312032458671)); + r.push_back(pt(-12760.669324773082,51070.312032458627)); + r.push_back(pt(-19155.669324779392,51070.312032458620)); + r.push_back(pt(-19155.669324773193,54820.312032458620)); + + pt p( -12260.669324773118, 54820.312032458634 ); + + //boost::geometry::correct(r); + + bool within = boost::geometry::within(p, r); + BOOST_CHECK_EQUAL(within, false); + } + // similar + { + ring r; + r.push_back(pt(-14155.6,54820.312032458620)); + r.push_back(pt(-13826.1,54820.312032458625)); + r.push_back(pt(-12155.6,53720.3)); + r.push_back(pt(-14155.6,54820.312032458620)); + + pt p( -13826.0, 54820.312032458634 ); + + bool within = boost::geometry::within(p, r); + BOOST_CHECK_EQUAL(within, false); + } + + // https://svn.boost.org/trac/boost/ticket/10234 + { + pt p; + ring r; + bg::read_wkt("POINT(0.1377 5.00)", p); + bg::read_wkt("POLYGON((0.1277 4.97, 0.1277 5.00, 0.1278 4.9999999999999982, 0.1278 4.97, 0.1277 4.97))", r); + bool within = boost::geometry::within(p, r); + BOOST_CHECK_EQUAL(within, false); + bool covered_by = boost::geometry::covered_by(p, r); + BOOST_CHECK_EQUAL(covered_by, false); + } +} + +int test_main( int , char* [] ) +{ + test_large_integers(); + + test_all >(); + test_all >(); + + test_spherical_geographic > >(); + test_spherical_geographic > >(); + +#if defined(HAVE_TTMATH) + test_all >(); + test_spherical_geographic > >(); + test_spherical_geographic > >(); +#endif + + test_tickets(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/within/within_sph.cpp b/src/boost/libs/geometry/test/algorithms/within/within_sph.cpp new file mode 100644 index 000000000..455a8db49 --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/within/within_sph.cpp @@ -0,0 +1,273 @@ +// Boost.Geometry + +// Copyright (c) 2016 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) + +#include "test_within.hpp" + +#include +#include + +#include + + +template +void test_polygon_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + + test_geometry(case_1[0], case_1[1], + false); + test_geometry(case_1[0], case_1[1], + false); + + test_geometry(case_1[0], case_1[1], + false); + test_geometry(case_2[0], case_2[1], + false); + test_geometry(case_3_sph[0], case_3_sph[1], + true); + test_geometry(case_3_2_sph[0], case_3_2_sph[1], + true); + test_geometry(case_4[0], case_4[1], + false); + test_geometry(case_5[0], case_5[1], + false); + test_geometry(case_6_sph[0], case_6_sph[1], + false); + test_geometry(case_6_sph[1], case_6_sph[0], + true); + + test_geometry(case_7[0], case_7[1], + false); + test_geometry(case_8_sph[0], case_8_sph[1], + false); + test_geometry(case_9_sph[0], case_9_sph[1], + false); + test_geometry(case_10_sph[0], case_10_sph[1], + false); + test_geometry(case_11_sph[0], case_11_sph[1], + false); + test_geometry(case_11_sph[1], case_11_sph[0], + true); + test_geometry(case_12[0], case_12[1], + false); + + test_geometry(case_13_sph[0], case_13_sph[1], + false); + test_geometry(case_14_sph[0], case_14_sph[1], + false); + test_geometry(case_15_sph[0], case_15_sph[1], + false); + test_geometry(case_16_sph[0], case_16_sph[1], + false); + test_geometry(case_17_sph[0], case_17_sph[1], + false); + test_geometry(case_17_sph[1], case_17_sph[0], + true); + test_geometry(case_18_sph[0], case_18_sph[1], + false); + test_geometry(case_18_sph[1], case_18_sph[0], + true); +} + +template +void test_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_1[0], case_multi_2[0], + false); + test_geometry(case_2[0], case_multi_2[0], + false); +} + +template +void test_multi_polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry(case_multi_2[0], case_multi_2[1], + false); +} + +template +void test_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::polygon

ring; + + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(11 0,11 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + test_geometry("LINESTRING(0 0,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_geometry("LINESTRING(5 0,5 5,10 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_geometry("LINESTRING(5 1,5 5,9 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", true); + test_geometry("LINESTRING(11 1,11 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))", false); + + test_geometry("LINESTRING(9 1,10 5,9 9)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + true); + + test_geometry("LINESTRING(9 1,10 5,9 9,1 9,1 1,9 1)", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5))", + true); + + test_geometry("LINESTRING(0 0,10 0,10 10,0 10,0 0)", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + false); +} + +template +void test_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("LINESTRING(10 1,10 5,10 9)", + "MULTIPOLYGON(((0 20,0 30,10 30,10 20,0 20)),((0 0,0 10,10 10,10 0,0 0),(10 5,2 8,2 2,10 5)))", + false); +} + +template +void test_multi_linestring_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + + test_geometry("MULTILINESTRING((11 11, 20 20),(5 7, 4 1))", + "POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,4 4,2 4,2 2))", + false); + + test_geometry("MULTILINESTRING((6 6,15 15),(0 0, 7 7))", + "POLYGON((5 5,5 15,15 15,15 5,5 5))", + false); + + test_geometry("MULTILINESTRING((3 10.031432746397092, 1 5, 1 10.013467818052765, 3 4, 7 8, 6 10.035925377760330, 10 2))", + "POLYGON((0 0,0 10,10 10,10 0,0 0))", + true); +} + +template +void test_multi_linestring_multi_polygon() +{ + typedef bg::model::linestring

ls; + typedef bg::model::polygon

poly; + typedef bg::model::multi_linestring mls; + typedef bg::model::multi_polygon mpoly; + + test_geometry("MULTILINESTRING((0 0,10 0,10 10,0 10,0 0),(2 2,5 5,2 8,2 2))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(2 2,5 5,2 8,2 2)))", + false); + + test_geometry("MULTILINESTRING((0 0,10 0,10 10),(10 10,0 10,0 0),(20 20,50 50,20 80,20 20))", + "MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))", + false); + + test_geometry("MULTILINESTRING((5 -2,4 -2,5 0),(5 -2,6 -2,5 0))", + "MULTIPOLYGON(((5 0,0 5,10 5,5 0)),((5 0,10 -5,0 -5,5 0)))", + true); +} + +template +void test_linestring_linestring() +{ + typedef bg::model::linestring

ls; + + test_geometry("LINESTRING(0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", true); + + test_geometry("LINESTRING(1 0,2 2,2 3)", "LINESTRING(0 0, 2 2, 3 2)", false); +} + +template +void test_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("LINESTRING(0 0,10 0)", + "MULTILINESTRING((1 0,2 0),(1 1,2 1))", + false); + + test_geometry("LINESTRING(0 0,5 0,5 5,0 5,0 0)", + "MULTILINESTRING((5 5,0 5,0 0),(0 0,5 0,5 5))", + true); +} + +template +void test_multi_linestring_multi_linestring() +{ + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", + "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0))", + false); +} + +template +void test_point_polygon() +{ + typedef bg::model::polygon

poly; + + // https://svn.boost.org/trac/boost/ticket/9162 + test_geometry("POINT(0 90)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(-120 21)", + "POLYGON((30 0,30 30,90 30, 90 0, 30 0))", + false); + // extended + test_geometry("POINT(0 -90)", + "POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))", + true); + test_geometry("POINT(0 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(-180 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); +} + + +template +void test_all() +{ + test_polygon_polygon

(); + test_polygon_multi_polygon

(); + test_multi_polygon_multi_polygon

(); + + test_linestring_polygon

(); + test_linestring_multi_polygon

(); + test_multi_linestring_polygon

(); + test_multi_linestring_multi_polygon

(); + + test_linestring_linestring

(); + test_linestring_multi_linestring

(); + test_multi_linestring_multi_linestring

(); + + test_point_polygon

(); +} + + +int test_main( int , char* [] ) +{ + test_all > >(); + +#if defined(HAVE_TTMATH) + test_cs > >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/algorithms/within/within_sph_geo.cpp b/src/boost/libs/geometry/test/algorithms/within/within_sph_geo.cpp new file mode 100644 index 000000000..6b0fb1b2c --- /dev/null +++ b/src/boost/libs/geometry/test/algorithms/within/within_sph_geo.cpp @@ -0,0 +1,129 @@ +// Boost.Geometry + +// Copyright (c) 2016-2018 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) + +#include "test_within.hpp" + + +#include + + +template +void test_point_box_by_side() +{ + // Test spherical boxes + // See also http://www.gcmap.com/mapui?P=1E45N-19E45N-19E55N-1E55N-1E45N,10E55.1N,10E45.1N + typedef bg::model::box box_t; + bg::strategy::within::point_in_box_by_side<> by_side; + box_t box; + bg::read_wkt("POLYGON((1 45,19 55))", box); + BOOST_CHECK_EQUAL(bg::within(Point(10, 55.1), box, by_side), true); + BOOST_CHECK_EQUAL(bg::within(Point(10, 55.2), box, by_side), true); + BOOST_CHECK_EQUAL(bg::within(Point(10, 55.3), box, by_side), true); + BOOST_CHECK_EQUAL(bg::within(Point(10, 55.4), box, by_side), false); + + BOOST_CHECK_EQUAL(bg::within(Point(10, 45.1), box, by_side), false); + BOOST_CHECK_EQUAL(bg::within(Point(10, 45.2), box, by_side), false); + BOOST_CHECK_EQUAL(bg::within(Point(10, 45.3), box, by_side), false); + BOOST_CHECK_EQUAL(bg::within(Point(10, 45.4), box, by_side), true); + + // By default Box is not a polygon in spherical CS, edges are defined by small circles + BOOST_CHECK_EQUAL(bg::within(Point(10, 45.1), box), true); + BOOST_CHECK_EQUAL(bg::within(Point(10, 54.9), box), true); + BOOST_CHECK_EQUAL(bg::within(Point(10, 55), box), false); + BOOST_CHECK_EQUAL(bg::within(Point(10, 45), box), false); + + // Crossing the dateline (Near Tuvalu) + // http://www.gcmap.com/mapui?P=178E10S-178W10S-178W6S-178E6S-178E10S,180W5.999S,180E9.999S + // http://en.wikipedia.org/wiki/Tuvalu + + box_t tuvalu(Point(178, -10), Point(-178, -6)); + BOOST_CHECK_EQUAL(bg::within(Point(180, -8), tuvalu, by_side), true); + BOOST_CHECK_EQUAL(bg::within(Point(-180, -8), tuvalu, by_side), true); + BOOST_CHECK_EQUAL(bg::within(Point(180, -5.999), tuvalu, by_side), false); + BOOST_CHECK_EQUAL(bg::within(Point(180, -10.001), tuvalu, by_side), true); + + // The above definition of a Box is not valid + // min should be lesser than max + // By default Box is not a polygon in spherical CS, edges are defined by small circles + box_t tuvalu2(Point(178, -10), Point(182, -6)); + BOOST_CHECK_EQUAL(bg::within(Point(180, -8), tuvalu2), true); + BOOST_CHECK_EQUAL(bg::within(Point(-180, -8), tuvalu2), true); + BOOST_CHECK_EQUAL(bg::within(Point(180, -6.001), tuvalu2), true); + BOOST_CHECK_EQUAL(bg::within(Point(180, -5.999), tuvalu2), false); + BOOST_CHECK_EQUAL(bg::within(Point(180, -9.999), tuvalu2), true); + BOOST_CHECK_EQUAL(bg::within(Point(180, -10.001), tuvalu2), false); +} + + +template +void test_point_box() +{ + typedef bg::model::box

box_t; + + test_geometry("POINT(0 0)", "BOX(0 0, 1 1)", false); + test_geometry("POINT(1 1)", "BOX(0 0, 2 2)", true); + + test_geometry("POINT(180 1)", "BOX(170 0, 190 2)", true); + test_geometry("POINT(-180 1)", "BOX(170 0, 190 2)", true); + test_geometry("POINT(180 1)", "BOX(170 0, 180 2)", false); + test_geometry("POINT(-180 1)", "BOX(170 0, 180 2)", false); + test_geometry("POINT(179 1)", "BOX(170 0, 190 2)", true); + test_geometry("POINT(-179 1)", "BOX(170 0, 190 2)", true); + test_geometry("POINT(179 1)", "BOX(170 0, 180 2)", true); + test_geometry("POINT(-179 1)", "BOX(170 0, 180 2)", false); + test_geometry("POINT(169 1)", "BOX(170 0, 180 2)", false); + + test_point_box_by_side

(); +} + +template +void test_box_box() +{ + typedef bg::model::box

box_t; + + test_geometry("BOX(0 0, 1 1)", "BOX(0 0, 1 1)", true); + + test_geometry("BOX(-170 0,-160 1)", "BOX(-180 0, 180 1)", true); + test_geometry("BOX(-170 0,-160 1)", "BOX(170 0, 200 1)", true); + test_geometry("BOX(-170 0,-150 1)", "BOX(170 0, 200 1)", false); + test_geometry("BOX(0 0,1 1)", "BOX(170 0, 370 1)", true); + test_geometry("BOX(0 0,10 1)", "BOX(170 0, 370 1)", true); + test_geometry("BOX(-180 0,10 1)", "BOX(170 0, 370 1)", true); + test_geometry("BOX(-180 0,20 1)", "BOX(170 0, 370 1)", false); + test_geometry("BOX(10 0,20 1)", "BOX(170 0, 370 1)", false); + test_geometry("BOX(160 0,180 1)", "BOX(170 0, 370 1)", false); + + test_geometry("BOX(-180 0,-170 1)", "BOX(180 0, 190 1)", true); // invalid? + test_geometry("BOX(-180 0,-170 1)", "BOX(180 0, 191 1)", true); // invalid? + test_geometry("BOX(-180 0,-170 1)", "BOX(179 0, 190 1)", true); + test_geometry("BOX(-180 0,-170 1)", "BOX(181 0, 190 1)", false); // invalid? + test_geometry("BOX(-180 0,-170 1)", "BOX(180 0, 189 1)", false); // invalid? +} + + +template +void test_cs() +{ + test_point_box

(); + test_box_box

(); +} + + +int test_main( int , char* [] ) +{ + test_cs > >(); + test_cs > >(); + +#if defined(HAVE_TTMATH) + test_cs > >(); + test_cs > >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/arithmetic/Jamfile b/src/boost/libs/geometry/test/arithmetic/Jamfile new file mode 100644 index 000000000..232fe79fb --- /dev/null +++ b/src/boost/libs/geometry/test/arithmetic/Jamfile @@ -0,0 +1,19 @@ +# Boost.Geometry +# +# Copyright (c) 2007-2019 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2019 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2019 Mateusz Loskot, London, UK. +# Copyright (c) 2015-2019 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-arithmetic + : + [ run general.cpp : : : : arithmetic_general ] + [ run dot_product.cpp : : : : arithmetic_dot_product ] + [ run cross_product.cpp : : : : arithmetic_cross_product ] + [ run infinite_line_functions.cpp : : : : arithmetic_infinite_line_functions ] + [ compile-fail cross_product.cpp : TEST_FAIL_CROSS_PRODUCT : arithmetic_cross_product_cf ] + ; diff --git a/src/boost/libs/geometry/test/arithmetic/cross_product.cpp b/src/boost/libs/geometry/test/arithmetic/cross_product.cpp new file mode 100644 index 000000000..cb1ddf617 --- /dev/null +++ b/src/boost/libs/geometry/test/arithmetic/cross_product.cpp @@ -0,0 +1,87 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2009-2012 Mateusz Loskot, 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 +// http://www.boost.org/LICENSE_1_0.txt) + + +#include + +#include + +#include + +#include + +#include +#include +#include +#include + + +template +void test_2d() +{ + P p1; + bg::assign_values(p1, 20, 30); + P p2; + bg::assign_values(p2, 45, 70); + P c = bg::cross_product(p1, p2); + + typedef typename bg::coordinate_type

::type scalar_type; + BOOST_CHECK_EQUAL(bg::get<0>(c), scalar_type(50)); +} + +template +void test_3d() +{ + P p1; + bg::assign_values(p1, 20, 30, 10); + P p2; + bg::assign_values(p2, 45, 70, 20); + P c = bg::cross_product(p1, p2); + + typedef typename bg::coordinate_type

::type scalar_type; + BOOST_CHECK_EQUAL(bg::get<0>(c), scalar_type(-100)); + BOOST_CHECK_EQUAL(bg::get<1>(c), scalar_type(50)); + BOOST_CHECK_EQUAL(bg::get<2>(c), scalar_type(50)); +} + +#ifdef TEST_FAIL_CROSS_PRODUCT +template +void test_4d() +{ + P p1; + bg::assign_values(p1, 20, 30, 10); + bg::set<3>(p1, 15); + P p2; + bg::assign_values(p2, 45, 70, 20); + bg::set<3>(p2, 35); + P c = bg::cross_product(p1, p2); + boost::ignore_unused(c); +} +#endif + +int test_main(int, char* []) +{ + test_2d >(); + test_2d >(); + test_2d >(); + + test_3d >(); + test_3d >(); + test_3d >(); + +#ifdef TEST_FAIL_CROSS_PRODUCT + test_4d >(); + test_4d >(); + test_4d >(); +#endif + + return 0; +} + diff --git a/src/boost/libs/geometry/test/arithmetic/dot_product.cpp b/src/boost/libs/geometry/test/arithmetic/dot_product.cpp new file mode 100644 index 000000000..2242e3c30 --- /dev/null +++ b/src/boost/libs/geometry/test/arithmetic/dot_product.cpp @@ -0,0 +1,53 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include + +#include + + +#include + +#include +#include +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +template +void test_all() +{ + P p1; + bg::assign_values(p1, 1, 2, 3); + P p2; + bg::assign_values(p2, 4, 5, 6); + BOOST_CHECK(bg::dot_product(p1, p2) == 1*4 + 2*5 + 3*6); +} + +int test_main(int, char* []) +{ + test_all(); + test_all(); + test_all(); + test_all(); + test_all >(); + test_all >(); + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/arithmetic/general.cpp b/src/boost/libs/geometry/test/arithmetic/general.cpp new file mode 100644 index 000000000..a329a6e52 --- /dev/null +++ b/src/boost/libs/geometry/test/arithmetic/general.cpp @@ -0,0 +1,142 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include + + +#include + +#include + +#include +#include +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +template +void test_addition() +{ + P p1; + bg::assign_values(p1, 1, 2, 3); + bg::add_value(p1, 10); + BOOST_CHECK(bg::get<0>(p1) == 11); + BOOST_CHECK(bg::get<1>(p1) == 12); + BOOST_CHECK(bg::get<2>(p1) == 13); + + P2 p2(4, 5, 6); + bg::add_point(p1, p2); + BOOST_CHECK(bg::get<0>(p1) == 15); + BOOST_CHECK(bg::get<1>(p1) == 17); + BOOST_CHECK(bg::get<2>(p1) == 19); +} + +template +void test_subtraction() +{ + P p1; + bg::assign_values(p1, 1, 2, 3); + bg::subtract_value(p1, 10); + BOOST_CHECK(bg::get<0>(p1) == -9); + BOOST_CHECK(bg::get<1>(p1) == -8); + BOOST_CHECK(bg::get<2>(p1) == -7); + + P2 p2(4, 6, 8); + bg::subtract_point(p1, p2); + BOOST_CHECK(bg::get<0>(p1) == -13); + BOOST_CHECK(bg::get<1>(p1) == -14); + BOOST_CHECK(bg::get<2>(p1) == -15); +} + +template +void test_multiplication() +{ + P p1; + bg::assign_values(p1, 1, 2, 3); + bg::multiply_value(p1, 5); + BOOST_CHECK(bg::get<0>(p1) == 5); + BOOST_CHECK(bg::get<1>(p1) == 10); + BOOST_CHECK(bg::get<2>(p1) == 15); + + P2 p2(4, 5, 6); + bg::multiply_point(p1, p2); + BOOST_CHECK(bg::get<0>(p1) == 20); + BOOST_CHECK(bg::get<1>(p1) == 50); + BOOST_CHECK(bg::get<2>(p1) == 90); +} + +template +void test_division() +{ + P p1; + bg::assign_values(p1, 50, 100, 150); + bg::divide_value(p1, 5); + BOOST_CHECK(bg::get<0>(p1) == 10); + BOOST_CHECK(bg::get<1>(p1) == 20); + BOOST_CHECK(bg::get<2>(p1) == 30); + + P2 p2(2, 4, 6); + bg::divide_point(p1, p2); + BOOST_CHECK(bg::get<0>(p1) == 5); + BOOST_CHECK(bg::get<1>(p1) == 5); + BOOST_CHECK(bg::get<2>(p1) == 5); +} + +template +void test_assign() +{ + P p1; + P2 p2(12, 34, 56); + bg::assign_values(p1, 12, 34, 56); + bg::assign_point(p1, p2); + BOOST_CHECK(bg::get<0>(p1) == 12); + BOOST_CHECK(bg::get<1>(p1) == 34); + BOOST_CHECK(bg::get<2>(p1) == 56); + + bg::assign_value(p1, 78); + BOOST_CHECK(bg::get<0>(p1) == 78); + BOOST_CHECK(bg::get<1>(p1) == 78); + BOOST_CHECK(bg::get<2>(p1) == 78); +} + + +template +void test_all() +{ + typedef test::test_const_point P2; + + test_addition(); + test_subtraction(); + test_multiplication(); + test_division(); + test_assign(); +} + + +int test_main(int, char* []) +{ + test_all(); + test_all(); + test_all(); + test_all(); + test_all >(); + test_all >(); + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/arithmetic/infinite_line_functions.cpp b/src/boost/libs/geometry/test/arithmetic/infinite_line_functions.cpp new file mode 100755 index 000000000..9c879178c --- /dev/null +++ b/src/boost/libs/geometry/test/arithmetic/infinite_line_functions.cpp @@ -0,0 +1,205 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2018-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2019. +// Modifications copyright (c) 2019, 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) + +#include + +#include +#include +#include +#include +#include + +namespace +{ + // Boost.Test does not support BOOST_CHECK_CLOSE for integral types + template + bool is_small(T const& value) + { + static long double const epsilon = 1.0e-5; + return bg::math::abs(value) < epsilon; + } +} + +template +void verify_point_on_line(bg::model::infinite_line const& line, + C const& x, C const& y) +{ + BOOST_CHECK_MESSAGE(is_small(line.a * x + line.b * y + line.c), + "Point is not located on the line"); +} + +template +void test_side_value() +{ + typedef bg::model::infinite_line line_type; + + // Horizontal line going right + line_type line = bg::detail::make::make_infinite_line(0, 0, 10, 0); + + // Point above (= on left side) + T d = bg::arithmetic::side_value(line, 5, 5); + BOOST_CHECK_MESSAGE(d > 0, "point not on left side"); + + // Point below (= on right side) + d = bg::arithmetic::side_value(line, 5, -5); + BOOST_CHECK_MESSAGE(d < 0, "point not on right side"); + + // Diagonal not through origin, from right (down) to left (up) + line = bg::detail::make::make_infinite_line(5, 2, -7, 10); + d = bg::arithmetic::side_value(line, 5, 2); + BOOST_CHECK_MESSAGE(is_small(d), "point not on line"); + d = bg::arithmetic::side_value(line, -7, 10); + BOOST_CHECK_MESSAGE(is_small(d), "point not on line"); + + // vector is (-12, 8), move (-3,2) on the line from (5,2) + d = bg::arithmetic::side_value(line, 2, 4); + BOOST_CHECK_MESSAGE(is_small(d), "point not on line"); + + // Go perpendicular (2,3) from (2,4) up, so right of the line (negative) + d = bg::arithmetic::side_value(line, 4, 7); + BOOST_CHECK_MESSAGE(d < 0, "point not on right side"); + + // Go perpendicular (2,3) from (2,4) down, so left of the line (positive) + d = bg::arithmetic::side_value(line, 0, 1); + BOOST_CHECK_MESSAGE(d > 0, "point not on left side"); +} + + +template +void test_get_intersection() +{ + typedef bg::model::infinite_line line_type; + + // Diagonal lines (first is same as in distance measure, + // second is perpendicular and used there for distance measures) + line_type p = bg::detail::make::make_infinite_line(5, 2, -7, 10); + line_type q = bg::detail::make::make_infinite_line(4, 7, 0, 1); + + typedef bg::model::point point_type; + point_type ip; + BOOST_CHECK(bg::arithmetic::intersection_point(p, q, ip)); + + BOOST_CHECK_MESSAGE(is_small(bg::get<0>(ip) - 2), "x-coordinate wrong"); + BOOST_CHECK_MESSAGE(is_small(bg::get<1>(ip) - 4), "y-coordinate wrong"); + + verify_point_on_line(p, bg::get<0>(ip), bg::get<1>(ip)); + verify_point_on_line(q, bg::get<0>(ip), bg::get<1>(ip)); +} + +template +void test_same_direction() +{ + bg::model::infinite_line p, q; + + // Exactly opposite, diagonal + p = bg::detail::make::make_infinite_line(2, 1, 12, 11); + q = bg::detail::make::make_infinite_line(12, 11, 2, 1); + BOOST_CHECK(! bg::arithmetic::similar_direction(p, q)); + + // Exactly opposite, horizontal + p = bg::detail::make::make_infinite_line(0, 0, 10, 0); + q = bg::detail::make::make_infinite_line(10, 0, 0, 0); + BOOST_CHECK(! bg::arithmetic::similar_direction(p, q)); + + // Exactly opposite, vertical + p = bg::detail::make::make_infinite_line(0, 0, 0, 10); + q = bg::detail::make::make_infinite_line(0, 10, 0, 0); + BOOST_CHECK(! bg::arithmetic::similar_direction(p, q)); + + // Exactly equal, diagonal + p = bg::detail::make::make_infinite_line(0, 0, 10, 10); + q = bg::detail::make::make_infinite_line(0, 0, 10, 10); + BOOST_CHECK(bg::arithmetic::similar_direction(p, q)); + + // Exactly equal, horizontal + p = bg::detail::make::make_infinite_line(0, 0, 10, 0); + q = bg::detail::make::make_infinite_line(0, 0, 10, 0); + BOOST_CHECK(bg::arithmetic::similar_direction(p, q)); + + // Exactly equal, vertical + p = bg::detail::make::make_infinite_line(0, 0, 0, 10); + q = bg::detail::make::make_infinite_line(0, 0, 0, 10); + BOOST_CHECK(bg::arithmetic::similar_direction(p, q)); + + // Coming together, diagonal + p = bg::detail::make::make_infinite_line(0, 0, 10, 10); + q = bg::detail::make::make_infinite_line(20, 20, 10, 10); + BOOST_CHECK(! bg::arithmetic::similar_direction(p, q)); + + // Leaving from common point, diagonal + p = bg::detail::make::make_infinite_line(10, 10, 0, 0); + q = bg::detail::make::make_infinite_line(0, 0, 10, 10); + BOOST_CHECK(! bg::arithmetic::similar_direction(p, q)); + + // Continuing each other, diagonal + p = bg::detail::make::make_infinite_line(0, 0, 10, 10); + q = bg::detail::make::make_infinite_line(10, 10, 20, 20); + BOOST_CHECK(bg::arithmetic::similar_direction(p, q)); + + // (Nearly) perpendicular + p = bg::detail::make::make_infinite_line(0, 0, 10, 10); + q = bg::detail::make::make_infinite_line(0, 0, -10, 10); + BOOST_CHECK(! bg::arithmetic::similar_direction(p, q)); + + // 45 deg + p = bg::detail::make::make_infinite_line(0, 0, 10, 10); + q = bg::detail::make::make_infinite_line(0, 0, 0, 10); + BOOST_CHECK(bg::arithmetic::similar_direction(p, q)); + + // a bit more than 45 deg + p = bg::detail::make::make_infinite_line(0, 0, 10, 10); + q = bg::detail::make::make_infinite_line(0, 0, -1, 10); + BOOST_CHECK(! bg::arithmetic::similar_direction(p, q)); + + // 135 deg + p = bg::detail::make::make_infinite_line(0, 0, 10, 10); + q = bg::detail::make::make_infinite_line(0, 0, -10, 0); + BOOST_CHECK(! bg::arithmetic::similar_direction(p, q)); +} + +template +void test_degenerate() +{ + typedef bg::model::infinite_line line_type; + + line_type line = bg::detail::make::make_infinite_line(0, 0, 10, 0); + BOOST_CHECK(! bg::arithmetic::is_degenerate(line)); + + line = bg::detail::make::make_infinite_line(0, 0, 0, 10); + BOOST_CHECK(! bg::arithmetic::is_degenerate(line)); + + line = bg::detail::make::make_infinite_line(0, 0, 10, 10); + BOOST_CHECK(! bg::arithmetic::is_degenerate(line)); + + line = bg::detail::make::make_infinite_line(0, 0, 0, 0); + BOOST_CHECK(bg::arithmetic::is_degenerate(line)); +} + + +template +void test_all() +{ + test_side_value(); + test_get_intersection(); + test_same_direction(); + test_degenerate(); +} + +int test_main(int, char* []) +{ + test_all(); + test_all(); + test_all(); + test_all(); + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/Jamfile b/src/boost/libs/geometry/test/concepts/Jamfile new file mode 100644 index 000000000..dd1ad4eb7 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/Jamfile @@ -0,0 +1,30 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# Copyright (c) 2015 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-concepts + : + [ run linestring_concept.cpp : : : : concepts_linestring_concept ] + [ compile point_array.cpp : : concepts_point_array ] + [ compile point_concept_checker.cpp : : concepts_point_concept_checker ] + [ compile point_well_formed.cpp : : concepts_point_well_formed ] + [ compile point_well_formed_non_cartesian.cpp : : concepts_point_well_formed_non_cartesian ] + [ compile point_well_formed_traits.cpp : : concepts_point_well_formed_traits ] + [ compile-fail point_geographic_custom_with_wrong_units.cpp : : concepts_point_geographic_custom_with_wrong_units ] + [ compile-fail point_geographic_with_wrong_units.cpp : : concepts_point_geographic_with_wrong_units ] + [ compile-fail point_spherical_custom_with_wrong_units.cpp : : concepts_point_spherical_custom_with_wrong_units ] + [ compile-fail point_spherical_with_wrong_units.cpp : : concepts_point_spherical_with_wrong_units ] + [ compile-fail point_with_incorrect_dimension.cpp : : concepts_point_with_incorrect_dimension ] + [ compile-fail point_without_coordinate_type.cpp : : concepts_point_without_coordinate_type ] + [ compile-fail point_without_dimension.cpp : : concepts_point_without_dimension ] + [ compile-fail point_without_getter.cpp : : concepts_point_without_getter ] + [ compile-fail point_without_setter.cpp : : concepts_point_without_setter ] +# [ run polygon_concept.cpp : : : : concepts_polygon_concept ] + ; diff --git a/src/boost/libs/geometry/test/concepts/function_asserting_a_point.hpp b/src/boost/libs/geometry/test/concepts/function_asserting_a_point.hpp new file mode 100644 index 000000000..802d19852 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/function_asserting_a_point.hpp @@ -0,0 +1,30 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept unit tests +// +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef GEOMETRY_TEST_POINT_CONCEPT_FUNCTION_ASSERTING_A_POINT_HPP +#define GEOMETRY_TEST_POINT_CONCEPT_FUNCTION_ASSERTING_A_POINT_HPP + +#include + +#include + +namespace bg = boost::geometry; + +namespace test +{ + template + void function_asserting_a_point(P& p1, const CP& p2) + { + BOOST_CONCEPT_ASSERT((bg::concepts::Point

)); + BOOST_CONCEPT_ASSERT((bg::concepts::ConstPoint

)); + + bg::get<0>(p1) = bg::get<0>(p2); + } +} + +#endif // GEOMETRY_TEST_POINT_CONCEPT_FUNCTION_ASSERTING_A_POINT_HPP diff --git a/src/boost/libs/geometry/test/concepts/function_requiring_a_point.hpp b/src/boost/libs/geometry/test/concepts/function_requiring_a_point.hpp new file mode 100644 index 000000000..d8628e940 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/function_requiring_a_point.hpp @@ -0,0 +1,29 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept unit tests +// +// Copyright (c) 2008-2016 Bruno Lalande, Paris, France. +// Copyright (c) 2007-2016 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2016 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 +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef GEOMETRY_TEST_POINT_CONCEPT_FUNCTION_REQUIRING_A_POINT_HPP +#define GEOMETRY_TEST_POINT_CONCEPT_FUNCTION_REQUIRING_A_POINT_HPP + +#include + +namespace bg = boost::geometry; + +namespace test +{ + template + inline void function_requiring_a_point(P& p1, const C& p2) + { + BOOST_CONCEPT_ASSERT((bg::concepts::Point

)); + BOOST_CONCEPT_ASSERT((bg::concepts::ConstPoint)); + + bg::set<0>(p1, bg::get<0>(p2)); + } +} + +#endif // GEOMETRY_TEST_POINT_CONCEPT_FUNCTION_REQUIRING_A_POINT_HPP diff --git a/src/boost/libs/geometry/test/concepts/linestring_concept.cpp b/src/boost/libs/geometry/test/concepts/linestring_concept.cpp new file mode 100644 index 000000000..06f3dfcf9 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/linestring_concept.cpp @@ -0,0 +1,77 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + + +#include +#include +#include + + + +template +void test_linestring() +{ + BOOST_CONCEPT_ASSERT( (bg::concepts::Linestring) ); + BOOST_CONCEPT_ASSERT( (bg::concepts::ConstLinestring) ); + + Geometry geometry; + typedef typename bg::point_type::type P; + + bg::clear(geometry); + BOOST_CHECK_EQUAL(boost::size(geometry), 0u); + + bg::append(geometry, bg::make

(1, 2)); + BOOST_CHECK_EQUAL(boost::size(geometry), 1u); + + bg::append(geometry, bg::make

(3, 4)); + BOOST_CHECK_EQUAL(boost::size(geometry), 2u); + + bg::traits::resize::apply(geometry, 1); + BOOST_CHECK_EQUAL(boost::size(geometry), 1u); + + //std::cout << bg::dsv(geometry) << std::endl; + P p = *boost::begin(geometry); + //std::cout << bg::dsv(p) << std::endl; + BOOST_CHECK_EQUAL(bg::get<0>(p), 1); + BOOST_CHECK_EQUAL(bg::get<1>(p), 2); + + bg::clear(geometry); + BOOST_CHECK_EQUAL(boost::size(geometry), 0u); +} + +template +void test_all() +{ + test_linestring >(); + test_linestring >(); + test_linestring >(); +} + +int test_main(int, char* []) +{ + test_all >(); + test_all >(); + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/point_array.cpp b/src/boost/libs/geometry/test/concepts/point_array.cpp new file mode 100644 index 000000000..000deadc0 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_array.cpp @@ -0,0 +1,29 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include + +#include +#include "function_requiring_a_point.hpp" + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) + + +int main() +{ + float p1[3] = { 0, 0, 0 }; + const float p2[3] = { 0, 0, 0 }; + test::function_requiring_a_point(p1, p2); + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/point_concept_checker.cpp b/src/boost/libs/geometry/test/concepts/point_concept_checker.cpp new file mode 100644 index 000000000..ea51a2e96 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_concept_checker.cpp @@ -0,0 +1,76 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include +#include + +struct ro_point +{ + float x, y; +}; + + +struct rw_point +{ + float x, y; +}; + + +namespace boost { namespace geometry { namespace traits { + +template <> struct tag { typedef point_tag type; }; +template <> struct coordinate_type { typedef float type; }; +template <> struct coordinate_system { typedef cs::cartesian type; }; +template <> struct dimension { enum { value = 2 }; }; + +template <> struct access +{ + static float get(ro_point const& p) { return p.x; } +}; + +template <> struct access +{ + static float get(ro_point const& p) { return p.y; } +}; + + + + +template <> struct tag { typedef point_tag type; }; +template <> struct coordinate_type { typedef float type; }; +template <> struct coordinate_system { typedef cs::cartesian type; }; +template <> struct dimension { enum { value = 2 }; }; + +template <> struct access +{ + static float get(rw_point const& p) { return p.x; } + static void set(rw_point& p, float value) { p.x = value; } +}; + +template <> struct access +{ + static float get(rw_point const& p) { return p.y; } + static void set(rw_point& p, float value) { p.y = value; } +}; + + +}}} // namespace bg::traits + + +int main() +{ + boost::geometry::concepts::check(); + boost::geometry::concepts::check(); +} diff --git a/src/boost/libs/geometry/test/concepts/point_geographic_custom_with_wrong_units.cpp b/src/boost/libs/geometry/test/concepts/point_geographic_custom_with_wrong_units.cpp new file mode 100644 index 000000000..5ac6e03e7 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_geographic_custom_with_wrong_units.cpp @@ -0,0 +1,29 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#include +#include + + +namespace bg = boost::geometry; + +struct dummy {}; + +int main() +{ + bg::concepts::check + < + ro_lon_lat_point > const + >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/point_geographic_with_wrong_units.cpp b/src/boost/libs/geometry/test/concepts/point_geographic_with_wrong_units.cpp new file mode 100644 index 000000000..9ea423181 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_geographic_with_wrong_units.cpp @@ -0,0 +1,29 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#include +#include +#include + + +namespace bg = boost::geometry; + + +int main() +{ + bg::concepts::check + < + bg::model::point > + >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/point_spherical_custom_with_wrong_units.cpp b/src/boost/libs/geometry/test/concepts/point_spherical_custom_with_wrong_units.cpp new file mode 100644 index 000000000..4a44f3236 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_spherical_custom_with_wrong_units.cpp @@ -0,0 +1,28 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#include +#include + + +namespace bg = boost::geometry; + + +int main() +{ + bg::concepts::check + < + rw_lon_lat_point > + >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/point_spherical_with_wrong_units.cpp b/src/boost/libs/geometry/test/concepts/point_spherical_with_wrong_units.cpp new file mode 100644 index 000000000..960db4a4d --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_spherical_with_wrong_units.cpp @@ -0,0 +1,26 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#include +#include +#include + + +namespace bg = boost::geometry; + + +int main() +{ + bg::model::point > p; + + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/point_well_formed.cpp b/src/boost/libs/geometry/test/concepts/point_well_formed.cpp new file mode 100644 index 000000000..20ae39c62 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_well_formed.cpp @@ -0,0 +1,34 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include + +#include +#include + +#include "function_requiring_a_point.hpp" + +struct point: public boost::tuple +{ +}; + +BOOST_GEOMETRY_REGISTER_POINT_2D(point, float, cs::cartesian, get<0>(), get<1>()) + +int main() +{ + point p1; + point const p2 = point(); + test::function_requiring_a_point(p1, p2); + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/point_well_formed_non_cartesian.cpp b/src/boost/libs/geometry/test/concepts/point_well_formed_non_cartesian.cpp new file mode 100644 index 000000000..adbc14ce0 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_well_formed_non_cartesian.cpp @@ -0,0 +1,64 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include + +#include +#include +#include + + +namespace bg = boost::geometry; + + +template +inline void test_coordinate_system() +{ + typedef bg::model::point bg_double_point; + typedef bg::model::point bg_int_point; + + typedef rw_lon_lat_point rw_double_point; + typedef ro_lon_lat_point ro_double_point; + + typedef rw_lon_lat_point rw_int_point; + typedef ro_lon_lat_point ro_int_point; + + bg::concepts::check(); + bg::concepts::check(); + + bg::concepts::check(); + bg::concepts::check(); + + bg::concepts::check(); + bg::concepts::check(); + bg::concepts::check(); + + bg::concepts::check(); + bg::concepts::check(); + bg::concepts::check(); +} + + +int main() +{ + test_coordinate_system >(); + test_coordinate_system >(); + + test_coordinate_system >(); + test_coordinate_system >(); + + test_coordinate_system >(); + test_coordinate_system >(); + + test_coordinate_system >(); + test_coordinate_system >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/point_well_formed_traits.cpp b/src/boost/libs/geometry/test/concepts/point_well_formed_traits.cpp new file mode 100644 index 000000000..fc4ab82f2 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_well_formed_traits.cpp @@ -0,0 +1,88 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include + +#include "function_requiring_a_point.hpp" + +struct point +{ + point(): x(), y() {} + float x, y; +}; + +namespace boost { namespace geometry { namespace traits { + +template <> +struct tag +{ + typedef point_tag type; +}; + +template <> +struct coordinate_type +{ + typedef float type; +}; + +template <> +struct coordinate_system +{ + typedef bg::cs::cartesian type; +}; + +template <> +struct dimension +{ + enum { value = 2 }; +}; + +template <> +struct access +{ + static float get(point const& p) + { + return p.x; + } + + static void set(point& p, float value) + { + p.x = value; + } +}; + +template <> +struct access +{ + static float get(point const& p) + { + return p.y; + } + + static void set(point& p, float value) + { + p.y = value; + } +}; + + +}}} // namespace bg::traits + +int main() +{ + point p1; + const point p2; + test::function_requiring_a_point(p1, p2); + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/point_with_incorrect_dimension.cpp b/src/boost/libs/geometry/test/concepts/point_with_incorrect_dimension.cpp new file mode 100644 index 000000000..79ffc8bee --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_with_incorrect_dimension.cpp @@ -0,0 +1,59 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include + +#include "function_asserting_a_point.hpp" +#include "function_requiring_a_point.hpp" + +#include + +struct point +{ + point() : x(0), y(0) {} // initialize to suppress warnings + float x, y; +}; + +namespace boost { namespace geometry { namespace traits { + +template <> struct tag { typedef point_tag type; }; +template <> struct coordinate_type { typedef float type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; +template <> struct dimension { enum { value = 3 }; }; + +template <> struct access +{ + static float get(point const& p) { return p.x; } + static void set(point& p, float value) { p.x = value; } +}; + +template <> struct access +{ + static float get(point const& p) { return p.y; } + static void set(point& p, float value) { p.y = value; } +}; + + +}}} // namespace bg::traits + + +int main() +{ + point p1; + const point p2; + test::function_requiring_a_point(p1, p2); + test::function_asserting_a_point(p1, p2); + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/point_without_coordinate_type.cpp b/src/boost/libs/geometry/test/concepts/point_without_coordinate_type.cpp new file mode 100644 index 000000000..3896e4690 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_without_coordinate_type.cpp @@ -0,0 +1,54 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include "function_requiring_a_point.hpp" + +#include + +struct point +{ + point() : x(0), y(0) {} // initialize to suppress warnings + float x, y; +}; + +namespace boost { namespace geometry { namespace traits { + +template <> struct tag { typedef point_tag type; }; +//template <> struct coordinate_type { typedef float type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; +template <> struct dimension { enum { value = 2 }; }; + +template <> struct access +{ + static float get(point const& p) { return p.x; } + static void set(point& p, float value) { p.x = value; } +}; + +template <> struct access +{ + static float get(point const& p) { return p.y; } + static void set(point& p, float value) { p.y = value; } +}; + + +}}} // namespace bg::traits + +int main() +{ + point p1; + const point p2; + test::function_requiring_a_point(p1, p2); + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/point_without_dimension.cpp b/src/boost/libs/geometry/test/concepts/point_without_dimension.cpp new file mode 100644 index 000000000..11182ed2b --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_without_dimension.cpp @@ -0,0 +1,56 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include "function_requiring_a_point.hpp" + +#include + +struct point +{ + point() : x(0), y(0) {} // initialize to suppress warnings + float x, y; +}; + + +namespace boost { namespace geometry { namespace traits { + +template <> struct tag { typedef point_tag type; }; +template <> struct coordinate_type { typedef float type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; +//template <> struct dimension { enum { value = 2 }; }; + +template <> struct access +{ + static float get(point const& p) { return p.x; } + static void set(point& p, float value) { p.x = value; } +}; + +template <> struct access +{ + static float get(point const& p) { return p.y; } + static void set(point& p, float value) { p.y = value; } +}; + + +}}} // namespace bg::traits + + +int main() +{ + point p1; + const point p2; + test::function_requiring_a_point(p1, p2); + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/point_without_getter.cpp b/src/boost/libs/geometry/test/concepts/point_without_getter.cpp new file mode 100644 index 000000000..5d19924e2 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_without_getter.cpp @@ -0,0 +1,52 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include "function_requiring_a_point.hpp" + +#include + +struct point +{ + point() : x(0), y(0) {} // initialize to suppress warnings + float x, y; +}; + +namespace boost { namespace geometry { namespace traits { + +template <> struct tag { typedef point_tag type; }; +template <> struct coordinate_type { typedef float type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; +template <> struct dimension { enum { value = 2 }; }; + +template <> struct access +{ + static void set(point& p, float value) { p.x = value; } +}; + +template <> struct access +{ + static void set(point& p, float value) { p.y = value; } +}; + + +}}} // namespace bg::traits + +int main() +{ + point p1; + const point p2; + test::function_requiring_a_point(p1, p2); + return 0; +} diff --git a/src/boost/libs/geometry/test/concepts/point_without_setter.cpp b/src/boost/libs/geometry/test/concepts/point_without_setter.cpp new file mode 100644 index 000000000..78be83994 --- /dev/null +++ b/src/boost/libs/geometry/test/concepts/point_without_setter.cpp @@ -0,0 +1,52 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include "function_requiring_a_point.hpp" + +#include + +struct point +{ + point() : x(0), y(0) {} // initialize to suppress warnings + float x, y; +}; + +namespace boost { namespace geometry { namespace traits { + +template <> struct tag { typedef point_tag type; }; +template <> struct coordinate_type { typedef float type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; +template <> struct dimension { enum { value = 2 }; }; + +template <> struct access +{ + static float get(point const& p) { return p.x; } +}; + +template <> struct access +{ + static float get(point const& p) { return p.y; } +}; + + +}}} // namespace bg::traits + +int main() +{ + point p1; + const point p2; + test::function_requiring_a_point(p1, p2); + return 0; +} diff --git a/src/boost/libs/geometry/test/core/Jamfile b/src/boost/libs/geometry/test/core/Jamfile new file mode 100644 index 000000000..1564d034f --- /dev/null +++ b/src/boost/libs/geometry/test/core/Jamfile @@ -0,0 +1,29 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# Copyright (c) 2015 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-core + : + [ run access.cpp : : : : core_access ] + [ run assert.cpp : : : : core_assert ] + [ run coordinate_dimension.cpp : : : : core_coordinate_dimension ] + [ run coordinate_system.cpp : : : : core_coordinate_system ] + [ run coordinate_type.cpp : : : : core_coordinate_type ] + [ run geometry_id.cpp : : : : core_geometry_id ] + [ run point_type.cpp : : : : core_point_type ] + [ run radian_access.cpp : : : : core_radian_access ] + [ run radius.cpp : : : : core_radius ] +# [ run reverse_dispatch.cpp : : : : core_reverse_dispatch ] + [ run ring.cpp : : : : core_ring ] + [ run tag.cpp : : : : core_tag ] + [ run topological_dimension.cpp : : : : core_topological_dimension ] + ; + +# The reverse_dispatch somehow asks for UAC-control on MinGW... diff --git a/src/boost/libs/geometry/test/core/access.cpp b/src/boost/libs/geometry/test/core/access.cpp new file mode 100644 index 000000000..451348bb4 --- /dev/null +++ b/src/boost/libs/geometry/test/core/access.cpp @@ -0,0 +1,133 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include + + +#include + + +#include +#include + +#include +#include + + +#include +#include +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +template +void test_get_set() +{ + typedef typename bg::coordinate_type::type coordinate_type; + + G g; + bg::set<0>(g, coordinate_type(1)); + bg::set<1>(g, coordinate_type(2)); + + coordinate_type x = bg::get<0>(g); + coordinate_type y = bg::get<1>(g); + + BOOST_CHECK_CLOSE(double(x), 1.0, 0.0001); + BOOST_CHECK_CLOSE(double(y), 2.0, 0.0001); +} + +template +void test_indexed_get_set(G& g) +{ + bg::set<0, 0>(g, 1); + bg::set<0, 1>(g, 2); + bg::set<1, 0>(g, 3); + bg::set<1, 1>(g, 4); + + typedef typename bg::coordinate_type::type coordinate_type; + coordinate_type x1 = bg::get<0, 0>(g); + coordinate_type y1 = bg::get<0, 1>(g); + coordinate_type x2 = bg::get<1, 0>(g); + coordinate_type y2 = bg::get<1, 1>(g); + + BOOST_CHECK_CLOSE(double(x1), 1.0, 0.0001); + BOOST_CHECK_CLOSE(double(y1), 2.0, 0.0001); + BOOST_CHECK_CLOSE(double(x2), 3.0, 0.0001); + BOOST_CHECK_CLOSE(double(y2), 4.0, 0.0001); +} + +template +void test_indexed_get(G const& g, T a, T b, T c, T d) +{ + T x1 = bg::get<0, 0>(g); + T y1 = bg::get<0, 1>(g); + T x2 = bg::get<1, 0>(g); + T y2 = bg::get<1, 1>(g); + + BOOST_CHECK_CLOSE(double(x1), double(a), 0.0001); + BOOST_CHECK_CLOSE(double(y1), double(b), 0.0001); + BOOST_CHECK_CLOSE(double(x2), double(c), 0.0001); + BOOST_CHECK_CLOSE(double(y2), double(d), 0.0001); +} + +template +void test_all() +{ + typedef typename bg::coordinate_type

::type coordinate_type; + + // POINT, setting coordinate + test_get_set

(); + + + // BOX, setting left/right/top/bottom + bg::model::box

b; + test_indexed_get_set(b); + + // SEGMENT (in GGL not having default constructor; however that is not a requirement) + P p1 = bg::make_zero

(); + P p2 = bg::make_zero

(); + bg::model::referring_segment

s(p1, p2); + test_indexed_get_set(s); + + // CONST SEGMENT + bg::set<0>(p1, 1); // we don't use assign because dim in {2,3} + bg::set<1>(p1, 2); + bg::set<0>(p2, 3); + bg::set<1>(p2, 4); + bg::model::referring_segment

cs(p1, p2); + test_indexed_get(cs, + coordinate_type(1), coordinate_type(2), + coordinate_type(3), coordinate_type(4)); +} + + +int test_main(int, char* []) +{ + test_get_set(); + test_get_set(); + test_get_set(); + test_get_set(); + + test_get_set >(); + + test_all >(); + test_all >(); + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/core/assert.cpp b/src/boost/libs/geometry/test/core/assert.cpp new file mode 100644 index 000000000..59d90dee1 --- /dev/null +++ b/src/boost/libs/geometry/test/core/assert.cpp @@ -0,0 +1,65 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// Copyright (c) 2015 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) + + +#include + +#define BOOST_GEOMETRY_ENABLE_ASSERT_HANDLER +#include + +struct assert_failure_exception + : std::exception +{ + const char * what() const throw() + { + return "assertion failure"; + } +}; + +namespace boost { namespace geometry { + +inline void assertion_failed(char const * /*expr*/, char const * /*function*/, char const * /*file*/, long /*line*/) +{ + throw assert_failure_exception(); +} + +inline void assertion_failed_msg(char const * /*expr*/, char const * /*msg*/, char const * /*function*/, char const * /*file*/, long /*line*/) +{ + throw assert_failure_exception(); +} + +}} + +void fun1(bool condition) +{ + BOOST_GEOMETRY_ASSERT(condition); +} + +void fun2(bool condition, const char* msg = "") +{ + BOOST_GEOMETRY_ASSERT_MSG(condition, msg); +} + +bool is_ok(assert_failure_exception const& ) { return true; } + +int test_main(int, char* []) +{ + int a = 1; + + fun1(a == 1); + BOOST_CHECK_EXCEPTION(fun1(a == 2), assert_failure_exception, is_ok); + fun2(a == 1); + BOOST_CHECK_EXCEPTION(fun2(a == 2), assert_failure_exception, is_ok); + + return 0; +} diff --git a/src/boost/libs/geometry/test/core/coordinate_dimension.cpp b/src/boost/libs/geometry/test/core/coordinate_dimension.cpp new file mode 100644 index 000000000..94a90bbfd --- /dev/null +++ b/src/boost/libs/geometry/test/core/coordinate_dimension.cpp @@ -0,0 +1,74 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#include + + +#include + + +#include + +#include +#include + +#include + +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + + +template +void test_geometry() +{ + BOOST_CHECK_EQUAL(bg::dimension::type::value, Expected); +} + +template +void test_all() +{ + test_geometry(); + test_geometry

(); + test_geometry , D>(); + test_geometry , D>(); + test_geometry , D>(); + test_geometry , D>(); + test_geometry , D>(); + test_geometry , D>(); + + test_geometry, D>(); + test_geometry, D>(); +} + +int test_main(int, char* []) +{ + test_geometry(); + test_geometry(); + test_geometry(); + + test_geometry(); + test_geometry(); + test_geometry(); + + test_geometry, 2>(); + test_geometry, 3>(); + + test_all, 2 >(); + test_all, 2 >(); + test_all, 2 >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/core/coordinate_system.cpp b/src/boost/libs/geometry/test/core/coordinate_system.cpp new file mode 100644 index 000000000..5a79f329e --- /dev/null +++ b/src/boost/libs/geometry/test/core/coordinate_system.cpp @@ -0,0 +1,101 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#include + + +#include + + +#include + +#include +#include + +#include + +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + + +template +void test_geometry() +{ + BOOST_CHECK_EQUAL(typeid(typename bg::coordinate_system::type).name(), + typeid(Expected).name()); +} + +template +void test_all() +{ + test_geometry(); + test_geometry

(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + + test_geometry, Expected>(); + test_geometry, Expected>(); +} + +int test_main(int, char* []) +{ + // Because of the included headerfiles, there are always cartesian + test_geometry(); + test_geometry(); + test_geometry(); + + test_geometry(); + test_geometry(); + test_geometry(); + + // Because of the included headerfiles, there are always cartesian + test_geometry, bg::cs::cartesian>(); + test_geometry, bg::cs::cartesian>(); + + + // Test cartesian + test_all, bg::cs::cartesian>(); + test_all, bg::cs::cartesian>(); + test_all, bg::cs::cartesian>(); + + // Test spherical + test_all >, + bg::cs::spherical >(); + test_all >, + bg::cs::spherical >(); + test_all >, + bg::cs::spherical >(); + + test_all >, + bg::cs::spherical >(); + test_all >, + bg::cs::spherical >(); + test_all >, + bg::cs::spherical >(); + + // Test other + test_all >, + bg::cs::polar >(); + + test_all >, + bg::cs::geographic >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/core/coordinate_type.cpp b/src/boost/libs/geometry/test/core/coordinate_type.cpp new file mode 100644 index 000000000..e382a8908 --- /dev/null +++ b/src/boost/libs/geometry/test/core/coordinate_type.cpp @@ -0,0 +1,78 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#include + + +#include + + +#include + +#include +#include + +#include + +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + + +template +void test_geometry() +{ + BOOST_CHECK_EQUAL(typeid(typename bg::coordinate_type::type).name(), + typeid(Expected).name()); +} + +template +void test_all() +{ + test_geometry(); + test_geometry

(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + test_geometry , Expected>(); + + test_geometry, Expected>(); + test_geometry, Expected>(); +} + +int test_main(int, char* []) +{ + test_geometry(); + test_geometry(); + test_geometry(); + + test_geometry(); + test_geometry(); + test_geometry(); + + test_geometry, float>(); + test_geometry, double>(); + test_geometry, long double>(); + test_geometry, double>(); + + test_all, int>(); + test_all, float>(); + test_all, double>(); + test_all, long double>(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/core/geometry_id.cpp b/src/boost/libs/geometry/test/core/geometry_id.cpp new file mode 100644 index 000000000..3d7f89c95 --- /dev/null +++ b/src/boost/libs/geometry/test/core/geometry_id.cpp @@ -0,0 +1,73 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#include + + +#include + +#include + +#include +#include + +#include + +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + + +template +void test_geometry() +{ + BOOST_CHECK_EQUAL(bg::geometry_id::type::value, Expected); +} + +template +void test_all() +{ + test_geometry(); + test_geometry

(); + test_geometry , 2>(); + test_geometry , 93>(); + test_geometry , 3>(); + test_geometry , 94>(); + test_geometry , 92>(); + test_geometry , 92>(); + + test_geometry, 2>(); + test_geometry, 2>(); +} + +int test_main(int, char* []) +{ + test_geometry(); + test_geometry(); + test_geometry(); + + test_geometry(); + test_geometry(); + test_geometry(); + + test_geometry, 1>(); + test_geometry, 1>(); + + test_all >(); + test_all >(); + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/core/point_type.cpp b/src/boost/libs/geometry/test/core/point_type.cpp new file mode 100644 index 000000000..1d6446dc6 --- /dev/null +++ b/src/boost/libs/geometry/test/core/point_type.cpp @@ -0,0 +1,96 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2014. +// Modifications copyright (c) 2014 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) + + +#include + +#include + +#include + +#include +#include + +#include +#include + +#include + +#include + +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + + +template +void test_geometry() +{ + BOOST_CHECK_EQUAL(typeid(typename bg::point_type::type).name(), + typeid(Expected).name()); + + static const bool is_same = boost::is_same::type, Expected>::value; + BOOST_CHECK(is_same); +} + +template +void test_all() +{ + test_geometry(); + test_geometry

(); + test_geometry(); + test_geometry(); + test_geometry(); + test_geometry(); + test_geometry , P>(); + test_geometry *&, P>(); + test_geometry , P>(); + test_geometry , P>(); + test_geometry , P>(); + test_geometry , P>(); + test_geometry , P>(); + + test_geometry, P>(); + test_geometry, P>(); +} + +int test_main(int, char* []) +{ + test_geometry(); + test_geometry(); + test_geometry(); + + test_geometry(); + test_geometry(); + test_geometry(); + + test_geometry, + boost::tuple >(); + test_geometry, + boost::tuple >(); + + test_geometry > >, + boost::tuple >(); + + test_all >(); + test_all >(); + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/core/radian_access.cpp b/src/boost/libs/geometry/test/core/radian_access.cpp new file mode 100644 index 000000000..d0aa59ac3 --- /dev/null +++ b/src/boost/libs/geometry/test/core/radian_access.cpp @@ -0,0 +1,110 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include + +#include + +#include +#include +#include + + +template +void test_get(T const& c, T const& e) +{ + //std::cout << "get_as_radian " << typeid(P).name() << std::endl; + + typedef typename bg::coordinate_type

::type coordinate_type; + + P p; + bg::set(p, coordinate_type(c)); + + coordinate_type g = bg::get_as_radian(p); + + BOOST_CHECK_CLOSE(double(g), double(e), 0.0001); +} + + +template +void test_set(T const& c, T const& e) +{ + //std::cout << "set_from_radian " << typeid(P).name() << std::endl; + + typedef typename bg::coordinate_type

::type coordinate_type; + + P p; + bg::set_from_radian(p, coordinate_type(c)); + + coordinate_type g = bg::get(p); + + BOOST_CHECK_CLOSE(double(g), double(e), 0.0001); +} + + +template +void test() +{ + double d2r = 3.1415926535897932384626433832795 / 180.0; + + // Degree + test_get<0, bg::model::point > > + (1.0, 1.0 * d2r); + test_get<1, bg::model::point > > + (2.0, 2.0 * d2r); + + test_set<0, bg::model::point > > + (1.0, 1.0 / d2r); + test_set<1, bg::model::point > > + (2.0, 2.0 / d2r); + + + // Radian + test_get<0, bg::model::point > > + (1.0, 1.0); + test_get<1, bg::model::point > > + (1.0, 1.0); + + test_set<0, bg::model::point > > + (1.0, 1.0); + test_set<1, bg::model::point > > + (1.0, 1.0); + + + // Cartesian (== untouched, no conversion) + test_get<0, bg::model::point > + (1.0, 1.0); + test_get<1, bg::model::point > + (1.0, 1.0); + + // Dimension >=2, should always be untouched, even for degree + // (assuming lat/lon + height) + test_set<2, bg::model::point > > + (1.0, 1.0); + test_set<2, bg::model::point > > + (1.0, 1.0); + +} + + + + +int test_main(int, char* []) +{ + //test(); + test(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/core/radius.cpp b/src/boost/libs/geometry/test/core/radius.cpp new file mode 100644 index 000000000..719dcdcdb --- /dev/null +++ b/src/boost/libs/geometry/test/core/radius.cpp @@ -0,0 +1,64 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014. +// Modifications copyright (c) 2014 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. + +// 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) + + +#include + +#include +#include + +#include +#include + +#include + + +template +void test_get_set() +{ + typedef typename bg::radius_type::type radius_type; + + G g; + bg::set_radius(g, radius_type(5)); + + radius_type x = bg::get_radius(g); + + BOOST_CHECK_CLOSE(double(x), 5.0, 0.0001); +} + +template +void test_all() +{ + typedef bg::srs::spheroid Sd; + test_get_set<0, Sd>(); + test_get_set<2, Sd>(); + + typedef bg::srs::sphere Se; + test_get_set<0, Se>(); +} + + +int test_main(int, char* []) +{ + test_all(); + test_all(); + test_all(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/core/reverse_dispatch.cpp b/src/boost/libs/geometry/test/core/reverse_dispatch.cpp new file mode 100644 index 000000000..cff472ec2 --- /dev/null +++ b/src/boost/libs/geometry/test/core/reverse_dispatch.cpp @@ -0,0 +1,65 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include + +#include + +#include + + + +template +void test_reversed() +{ + BOOST_CHECK_EQUAL((bg::reverse_dispatch::type::value), + Expected); +} + + +template +void test_all() +{ + + test_reversed(); + test_reversed, false>(); + test_reversed, P, true>(); + test_reversed, P, true>(); + test_reversed, bg::model::ring

, false>(); + test_reversed, bg::model::linestring

, true>(); +} + +template +void test_mixed() +{ + test_reversed(); +} + + +int test_main(int, char* []) +{ + test_all >(); + test_mixed + < + bg::model::point, + bg::model::point > + >(); + test_mixed + < + bg::model::point >, + bg::model::point > + >(); + return 0; +} diff --git a/src/boost/libs/geometry/test/core/ring.cpp b/src/boost/libs/geometry/test/core/ring.cpp new file mode 100644 index 000000000..cf7ee5d7e --- /dev/null +++ b/src/boost/libs/geometry/test/core/ring.cpp @@ -0,0 +1,99 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014. +// Modifications copyright (c) 2014 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. + +// 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) + + +#include + + +// To be tested: +#include +#include +#include + +// For geometries: +#include +#include +#include + + +#include + + +template +void test_order_closure(bg::order_selector expected_order, bg::closure_selector exptected_closure) +{ + bg::order_selector order = bg::point_order::value; + bg::closure_selector closure = bg::closure::value; + + BOOST_CHECK_EQUAL(order, expected_order); + BOOST_CHECK_EQUAL(closure, exptected_closure); +} + + +template +void test_ring(std::string const& wkt, + std::size_t expected_main_count, + std::size_t expected_interior_ring_count, + std::size_t expected_first_interior_count) +{ + typedef bg::model::polygon

the_polygon; + typedef typename bg::ring_type::type the_ring; + typedef typename bg::interior_return_type::type the_interior; + + the_polygon poly; + bg::read_wkt(wkt, poly); + + the_ring ext = bg::exterior_ring(poly); + the_interior rings = bg::interior_rings(poly); + + BOOST_CHECK_EQUAL(bg::num_interior_rings(poly), expected_interior_ring_count); + BOOST_CHECK_EQUAL(boost::size(rings), expected_interior_ring_count); + BOOST_CHECK_EQUAL(boost::size(ext), expected_main_count); + if (boost::size(rings)) + { + BOOST_CHECK_EQUAL(boost::size(rings.front()), expected_first_interior_count); + } +} + + +template +void test_all() +{ + test_ring

("POLYGON((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))", 5, 1, 5); + test_ring

("POLYGON((0 0,0 3,3 3,3 0,0 0),(1 1,2 2,2 1,1 1),(1 1,1 2,2 2,1 1))", 5, 2, 4); + test_ring

("POLYGON((0 0,0 3,3 3,3 0,0 0))", 5, 0, 0); + + test_order_closure< bg::model::polygon >(bg::clockwise, bg::closed); + test_order_closure< bg::model::polygon >(bg::clockwise, bg::open); + test_order_closure< bg::model::polygon >(bg::counterclockwise, bg::closed); + test_order_closure< bg::model::polygon >(bg::counterclockwise, bg::open); + + test_order_closure< bg::model::polygon

*>(bg::clockwise, bg::closed); + test_order_closure< bg::model::polygon

&>(bg::clockwise, bg::closed); + test_order_closure< bg::model::polygon

const>(bg::clockwise, bg::closed); + test_order_closure< bg::model::polygon

*&>(bg::clockwise, bg::closed); + test_order_closure< const bg::model::polygon

*>(bg::clockwise, bg::closed); +} + + +int test_main(int, char* []) +{ + test_all >(); + return 0; +} diff --git a/src/boost/libs/geometry/test/core/tag.cpp b/src/boost/libs/geometry/test/core/tag.cpp new file mode 100644 index 000000000..f67c58d4b --- /dev/null +++ b/src/boost/libs/geometry/test/core/tag.cpp @@ -0,0 +1,89 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2014. +// Modifications copyright (c) 2014 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) + + +#include + +#include + +#include + +#include + +#include +#include + +#include + +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + + +template +void test_geometry() +{ + BOOST_CHECK_EQUAL(typeid(typename bg::tag::type).name(), + typeid(Expected).name()); + + static const bool is_same = boost::is_same::type, Expected>::value; + BOOST_CHECK(is_same); +} + +template +void test_all() +{ + test_geometry(); + test_geometry

(); + test_geometry(); + test_geometry(); + test_geometry(); + test_geometry(); + test_geometry , bg::linestring_tag>(); + test_geometry *&, bg::linestring_tag>(); + test_geometry , bg::ring_tag>(); + test_geometry , bg::polygon_tag>(); + test_geometry , bg::box_tag>(); + test_geometry , bg::segment_tag>(); + test_geometry , bg::segment_tag>(); + + test_geometry, bg::linestring_tag>(); + test_geometry, bg::linestring_tag>(); + +} + +int test_main(int, char* []) +{ + test_geometry(); + test_geometry(); + test_geometry(); + + test_geometry(); + test_geometry(); + test_geometry(); + + test_geometry, bg::point_tag>(); + test_geometry, bg::point_tag>(); + + test_all, 2 >(); + test_all, 2 >(); + test_all, 2 >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/core/topological_dimension.cpp b/src/boost/libs/geometry/test/core/topological_dimension.cpp new file mode 100644 index 000000000..392e5f866 --- /dev/null +++ b/src/boost/libs/geometry/test/core/topological_dimension.cpp @@ -0,0 +1,73 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#include + +#include + +#include + +#include +#include +#include + + +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + + +template +void test_geometry() +{ + BOOST_CHECK_EQUAL(bg::topological_dimension::type::value, Expected); +} + +template +void test_all() +{ + test_geometry(); + test_geometry

(); + test_geometry , 1>(); + test_geometry , 2>(); // being discussed + test_geometry , 2>(); + test_geometry , 2>(); + test_geometry , 1>(); + test_geometry , 1>(); + + test_geometry, 1>(); + test_geometry, 1>(); + +} + +int test_main(int, char* []) +{ + test_geometry(); + test_geometry(); + test_geometry(); + + test_geometry(); + test_geometry(); + test_geometry(); + + test_geometry, 0>(); + test_geometry, 0>(); + + test_all >(); + test_all >(); + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/cs_undefined/Jamfile b/src/boost/libs/geometry/test/cs_undefined/Jamfile new file mode 100644 index 000000000..b5e53d916 --- /dev/null +++ b/src/boost/libs/geometry/test/cs_undefined/Jamfile @@ -0,0 +1,21 @@ +# Boost.Geometry +# +# Copyright (c) 2019, Oracle and/or its affiliates. +# +# Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle +# +# Licensed under the Boost Software License version 1.0. +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-cs_undefined + : + [ compile distance.cpp : : csundef_distance ] + [ compile envelope_expand.cpp : : csundef_envelope_expand ] + [ compile index.cpp : : csundef_index ] + [ compile is.cpp : : csundef_is ] + [ compile measure.cpp : : csundef_measure ] + [ compile other.cpp : : csundef_other ] + [ compile relops1.cpp : : csundef_relops1 ] + [ compile relops2.cpp : : csundef_relops2 ] + [ compile setops.cpp : : csundef_setops ] + ; diff --git a/src/boost/libs/geometry/test/cs_undefined/common.hpp b/src/boost/libs/geometry/test/cs_undefined/common.hpp new file mode 100644 index 000000000..92cb80680 --- /dev/null +++ b/src/boost/libs/geometry/test/cs_undefined/common.hpp @@ -0,0 +1,69 @@ +// Boost.Geometry + +// Copyright (c) 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_TEST_CS_UNDEFINED_COMMON_HPP +#define BOOST_GEOMETRY_TEST_CS_UNDEFINED_COMMON_HPP + +#include + +#include + +#include + +#include + +struct geom +{ + //typedef bg::model::point point; + typedef bg::model::point point; + typedef bg::model::box box; + typedef bg::model::segment segment; + typedef bg::model::linestring linestring; + typedef bg::model::ring ring; + typedef bg::model::polygon polygon; + typedef bg::model::multi_linestring multi_linestring; + typedef bg::model::multi_polygon multi_polygon; + typedef bg::model::multi_point multi_point; + + geom() + { + pt = point(0, 0); + b = box(point(-1, -1), point(1, 1)); + s = segment(point(0, 0), point(1, 1)); + ls.push_back(point(0, 0)); + ls.push_back(point(1, 1)); + ls.push_back(point(1.1, 1.1)); + r.push_back(point(0, 0)); + r.push_back(point(0, 1)); + r.push_back(point(1, 1)); + r.push_back(point(1, 0)); + r.push_back(point(0, 0)); + po.outer() = r; + po.inners().push_back(ring()); + po.inners().back().push_back(point(0, 0)); + po.inners().back().push_back(point(0.2, 0.1)); + po.inners().back().push_back(point(0.1, 0.2)); + po.inners().back().push_back(point(0, 0)); + mls.push_back(ls); + mpo.push_back(po); + mpt.push_back(pt); + } + + point pt; + box b; + segment s; + linestring ls; + ring r; + polygon po; + multi_linestring mls; + multi_polygon mpo; + multi_point mpt; +}; + +#endif // BOOST_GEOMETRY_TEST_CS_UNDEFINED_COMMON_HPP diff --git a/src/boost/libs/geometry/test/cs_undefined/distance.cpp b/src/boost/libs/geometry/test/cs_undefined/distance.cpp new file mode 100644 index 000000000..8bd03a44c --- /dev/null +++ b/src/boost/libs/geometry/test/cs_undefined/distance.cpp @@ -0,0 +1,113 @@ +// Boost.Geometry + +// Copyright (c) 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include "common.hpp" + +#include + +int test_main(int, char*[]) +{ + geom g; + + bg::distance(g.pt, g.pt, bg::strategy::distance::pythagoras<>()); + bg::distance(g.pt, g.pt, bg::strategy::distance::haversine<>()); + bg::distance(g.pt, g.pt, bg::strategy::distance::geographic<>()); + bg::distance(g.pt, g.mpt, bg::strategy::distance::pythagoras<>()); + bg::distance(g.pt, g.mpt, bg::strategy::distance::haversine<>()); + bg::distance(g.pt, g.mpt, bg::strategy::distance::geographic<>()); + bg::distance(g.mpt, g.mpt, bg::strategy::distance::pythagoras<>()); + bg::distance(g.mpt, g.mpt, bg::strategy::distance::haversine<>()); + bg::distance(g.mpt, g.mpt, bg::strategy::distance::geographic<>()); + bg::distance(g.pt, g.ls, bg::strategy::distance::projected_point<>()); + bg::distance(g.pt, g.ls, bg::strategy::distance::cross_track<>()); + bg::distance(g.pt, g.ls, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.pt, g.mls, bg::strategy::distance::projected_point<>()); + bg::distance(g.pt, g.mls, bg::strategy::distance::cross_track<>()); + bg::distance(g.pt, g.mls, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.mpt, g.ls, bg::strategy::distance::projected_point<>()); + bg::distance(g.mpt, g.ls, bg::strategy::distance::cross_track<>()); + bg::distance(g.mpt, g.ls, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.mpt, g.mls, bg::strategy::distance::projected_point<>()); + bg::distance(g.mpt, g.mls, bg::strategy::distance::cross_track<>()); + bg::distance(g.mpt, g.mls, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.ls, g.ls, bg::strategy::distance::projected_point<>()); + bg::distance(g.ls, g.ls, bg::strategy::distance::cross_track<>()); + bg::distance(g.ls, g.ls, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.ls, g.mls, bg::strategy::distance::projected_point<>()); + bg::distance(g.ls, g.mls, bg::strategy::distance::cross_track<>()); + bg::distance(g.ls, g.mls, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.mls, g.mls, bg::strategy::distance::projected_point<>()); + bg::distance(g.mls, g.mls, bg::strategy::distance::cross_track<>()); + bg::distance(g.mls, g.mls, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.pt, g.r, bg::strategy::distance::projected_point<>()); + bg::distance(g.pt, g.r, bg::strategy::distance::cross_track<>()); + bg::distance(g.pt, g.r, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.pt, g.po, bg::strategy::distance::projected_point<>()); + bg::distance(g.pt, g.po, bg::strategy::distance::cross_track<>()); + bg::distance(g.pt, g.po, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.pt, g.mpo, bg::strategy::distance::projected_point<>()); + bg::distance(g.pt, g.mpo, bg::strategy::distance::cross_track<>()); + bg::distance(g.pt, g.mpo, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.mpt, g.r, bg::strategy::distance::projected_point<>()); + bg::distance(g.mpt, g.r, bg::strategy::distance::cross_track<>()); + bg::distance(g.mpt, g.r, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.mpt, g.po, bg::strategy::distance::projected_point<>()); + bg::distance(g.mpt, g.po, bg::strategy::distance::cross_track<>()); + bg::distance(g.mpt, g.po, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.mpt, g.mpo, bg::strategy::distance::projected_point<>()); + bg::distance(g.mpt, g.mpo, bg::strategy::distance::cross_track<>()); + bg::distance(g.mpt, g.mpo, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.ls, g.r, bg::strategy::distance::projected_point<>()); + bg::distance(g.ls, g.r, bg::strategy::distance::cross_track<>()); + bg::distance(g.ls, g.r, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.ls, g.po, bg::strategy::distance::projected_point<>()); + bg::distance(g.ls, g.po, bg::strategy::distance::cross_track<>()); + bg::distance(g.ls, g.po, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.ls, g.mpo, bg::strategy::distance::projected_point<>()); + bg::distance(g.ls, g.mpo, bg::strategy::distance::cross_track<>()); + bg::distance(g.ls, g.mpo, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.mls, g.r, bg::strategy::distance::projected_point<>()); + bg::distance(g.mls, g.r, bg::strategy::distance::cross_track<>()); + bg::distance(g.mls, g.r, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.mls, g.po, bg::strategy::distance::projected_point<>()); + bg::distance(g.mls, g.po, bg::strategy::distance::cross_track<>()); + bg::distance(g.mls, g.po, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.mls, g.mpo, bg::strategy::distance::projected_point<>()); + bg::distance(g.mls, g.mpo, bg::strategy::distance::cross_track<>()); + bg::distance(g.mls, g.mpo, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.r, g.r, bg::strategy::distance::projected_point<>()); + bg::distance(g.r, g.r, bg::strategy::distance::cross_track<>()); + bg::distance(g.r, g.r, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.r, g.po, bg::strategy::distance::projected_point<>()); + bg::distance(g.r, g.po, bg::strategy::distance::cross_track<>()); + bg::distance(g.r, g.po, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.r, g.mpo, bg::strategy::distance::projected_point<>()); + bg::distance(g.r, g.mpo, bg::strategy::distance::cross_track<>()); + bg::distance(g.r, g.mpo, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.po, g.r, bg::strategy::distance::projected_point<>()); + bg::distance(g.po, g.r, bg::strategy::distance::cross_track<>()); + bg::distance(g.po, g.r, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.po, g.po, bg::strategy::distance::projected_point<>()); + bg::distance(g.po, g.po, bg::strategy::distance::cross_track<>()); + bg::distance(g.po, g.po, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.po, g.mpo, bg::strategy::distance::projected_point<>()); + bg::distance(g.po, g.mpo, bg::strategy::distance::cross_track<>()); + bg::distance(g.po, g.mpo, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.mpo, g.r, bg::strategy::distance::projected_point<>()); + bg::distance(g.mpo, g.r, bg::strategy::distance::cross_track<>()); + bg::distance(g.mpo, g.r, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.mpo, g.po, bg::strategy::distance::projected_point<>()); + bg::distance(g.mpo, g.po, bg::strategy::distance::cross_track<>()); + bg::distance(g.mpo, g.po, bg::strategy::distance::geographic_cross_track<>()); + bg::distance(g.mpo, g.mpo, bg::strategy::distance::projected_point<>()); + bg::distance(g.mpo, g.mpo, bg::strategy::distance::cross_track<>()); + bg::distance(g.mpo, g.mpo, bg::strategy::distance::geographic_cross_track<>()); + + return 0; +} diff --git a/src/boost/libs/geometry/test/cs_undefined/envelope_expand.cpp b/src/boost/libs/geometry/test/cs_undefined/envelope_expand.cpp new file mode 100644 index 000000000..5d16e6f25 --- /dev/null +++ b/src/boost/libs/geometry/test/cs_undefined/envelope_expand.cpp @@ -0,0 +1,53 @@ +// Boost.Geometry + +// Copyright (c) 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include "common.hpp" + +#include +#include + +int test_main(int, char*[]) +{ + geom g; + + bg::expand(g.b, g.pt, bg::strategy::expand::cartesian_point()); + bg::expand(g.b, g.pt, bg::strategy::expand::spherical_point()); + bg::expand(g.b, g.b, bg::strategy::expand::cartesian_box()); + bg::expand(g.b, g.b, bg::strategy::expand::spherical_box()); + bg::expand(g.b, g.s, bg::strategy::expand::cartesian_segment()); + bg::expand(g.b, g.s, bg::strategy::expand::spherical_segment<>()); + bg::expand(g.b, g.s, bg::strategy::expand::geographic_segment<>()); + + bg::envelope(g.pt, g.b, bg::strategy::envelope::cartesian_point()); + bg::envelope(g.pt, g.b, bg::strategy::envelope::spherical_point()); + bg::envelope(g.b, g.b, bg::strategy::envelope::cartesian_box()); + bg::envelope(g.b, g.b, bg::strategy::envelope::spherical_box()); + bg::envelope(g.s, g.b, bg::strategy::envelope::cartesian_segment<>()); + bg::envelope(g.s, g.b, bg::strategy::envelope::spherical_segment<>()); + bg::envelope(g.s, g.b, bg::strategy::envelope::geographic_segment<>()); + bg::envelope(g.ls, g.b, bg::strategy::envelope::cartesian<>()); + bg::envelope(g.ls, g.b, bg::strategy::envelope::spherical<>()); + bg::envelope(g.ls, g.b, bg::strategy::envelope::geographic<>()); + bg::envelope(g.r, g.b, bg::strategy::envelope::cartesian<>()); + bg::envelope(g.r, g.b, bg::strategy::envelope::spherical<>()); + bg::envelope(g.r, g.b, bg::strategy::envelope::geographic<>()); + bg::envelope(g.po, g.b, bg::strategy::envelope::cartesian<>()); + bg::envelope(g.po, g.b, bg::strategy::envelope::spherical<>()); + bg::envelope(g.po, g.b, bg::strategy::envelope::geographic<>()); + bg::envelope(g.mls, g.b, bg::strategy::envelope::cartesian<>()); + bg::envelope(g.mls, g.b, bg::strategy::envelope::spherical<>()); + bg::envelope(g.mls, g.b, bg::strategy::envelope::geographic<>()); + bg::envelope(g.mpo, g.b, bg::strategy::envelope::cartesian<>()); + bg::envelope(g.mpo, g.b, bg::strategy::envelope::spherical<>()); + bg::envelope(g.mpo, g.b, bg::strategy::envelope::geographic<>()); + bg::envelope(g.mpt, g.b, bg::strategy::envelope::cartesian_multipoint()); + bg::envelope(g.mpt, g.b, bg::strategy::envelope::spherical_multipoint()); + + return 0; +} diff --git a/src/boost/libs/geometry/test/cs_undefined/index.cpp b/src/boost/libs/geometry/test/cs_undefined/index.cpp new file mode 100644 index 000000000..008187044 --- /dev/null +++ b/src/boost/libs/geometry/test/cs_undefined/index.cpp @@ -0,0 +1,101 @@ +// Boost.Geometry + +// Copyright (c) 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include "common.hpp" + +// These includes are required for the following code to compile. +// This is probably wrong. +#include +#include +#include +#include + +#include + +#include + +namespace bgi = boost::geometry::index; + +template +< + typename VG, typename QG, + typename VTag = typename bg::tag::type, + typename QTag = typename bg::tag::type +> +struct call_query +{ + template + static inline void apply(Rtree const& , Res const& ) + {} +}; + +template +struct call_query +{ + template + static inline void apply(Rtree const& rtree, QG const& qg) + { + std::vector res; + rtree.query(bgi::intersects(qg), std::back_inserter(res)); + } +}; + +template +inline void rtree_test(G const& g, P const& p) +{ + { + bgi::rtree rtree; + } + + std::vector de2(100, g); + + bgi::rtree rtree(de2, p); + rtree.insert(g); + rtree.remove(g); + rtree.count(g); + + call_query::apply(rtree, geom::point(0, 0)); +} + +int test_main(int, char*[]) +{ + geom g; + + rtree_test(g.pt, bgi::parameters, bg::strategy::index::cartesian<> >()); + rtree_test(g.pt, bgi::parameters, bg::strategy::index::cartesian<> >()); + rtree_test(g.pt, bgi::parameters, bg::strategy::index::cartesian<> >()); + rtree_test(g.b, bgi::parameters, bg::strategy::index::cartesian<> >()); + rtree_test(g.b, bgi::parameters, bg::strategy::index::cartesian<> >()); + rtree_test(g.b, bgi::parameters, bg::strategy::index::cartesian<> >()); + rtree_test(g.s, bgi::parameters, bg::strategy::index::cartesian<> >()); + rtree_test(g.s, bgi::parameters, bg::strategy::index::cartesian<> >()); + rtree_test(g.s, bgi::parameters, bg::strategy::index::cartesian<> >()); + + rtree_test(g.pt, bgi::parameters, bg::strategy::index::spherical<> >()); + rtree_test(g.pt, bgi::parameters, bg::strategy::index::spherical<> >()); + rtree_test(g.pt, bgi::parameters, bg::strategy::index::spherical<> >()); + rtree_test(g.b, bgi::parameters, bg::strategy::index::spherical<> >()); + rtree_test(g.b, bgi::parameters, bg::strategy::index::spherical<> >()); + rtree_test(g.b, bgi::parameters, bg::strategy::index::spherical<> >()); + rtree_test(g.s, bgi::parameters, bg::strategy::index::spherical<> >()); + rtree_test(g.s, bgi::parameters, bg::strategy::index::spherical<> >()); + rtree_test(g.s, bgi::parameters, bg::strategy::index::spherical<> >()); + + rtree_test(g.pt, bgi::parameters, bg::strategy::index::geographic<> >()); + rtree_test(g.pt, bgi::parameters, bg::strategy::index::geographic<> >()); + rtree_test(g.pt, bgi::parameters, bg::strategy::index::geographic<> >()); + rtree_test(g.b, bgi::parameters, bg::strategy::index::geographic<> >()); + rtree_test(g.b, bgi::parameters, bg::strategy::index::geographic<> >()); + rtree_test(g.b, bgi::parameters, bg::strategy::index::geographic<> >()); + rtree_test(g.s, bgi::parameters, bg::strategy::index::geographic<> >()); + rtree_test(g.s, bgi::parameters, bg::strategy::index::geographic<> >()); + rtree_test(g.s, bgi::parameters, bg::strategy::index::geographic<> >()); + + return 0; +} diff --git a/src/boost/libs/geometry/test/cs_undefined/is.cpp b/src/boost/libs/geometry/test/cs_undefined/is.cpp new file mode 100644 index 000000000..c043d301b --- /dev/null +++ b/src/boost/libs/geometry/test/cs_undefined/is.cpp @@ -0,0 +1,44 @@ +// Boost.Geometry + +// Copyright (c) 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include "common.hpp" + +#include +#include + +template +inline void is(G const& g, S const& s) +{ + bg::is_simple(g, s); + bg::is_valid(g, s); +} + +template +inline void is_x(G const& g) +{ + ::is(g, bg::strategy::intersection::cartesian_segments<>()); + ::is(g, bg::strategy::intersection::spherical_segments<>()); + ::is(g, bg::strategy::intersection::geographic_segments<>()); +} + +int test_main(int, char*[]) +{ + geom g; + + ::is_x(g.pt); + ::is_x(g.mpt); + ::is_x(g.s); + ::is_x(g.ls); + ::is_x(g.mls); + ::is_x(g.r); + ::is_x(g.po); + ::is_x(g.mpo); + + return 0; +} diff --git a/src/boost/libs/geometry/test/cs_undefined/measure.cpp b/src/boost/libs/geometry/test/cs_undefined/measure.cpp new file mode 100644 index 000000000..40d8a4f97 --- /dev/null +++ b/src/boost/libs/geometry/test/cs_undefined/measure.cpp @@ -0,0 +1,51 @@ +// Boost.Geometry + +// Copyright (c) 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include "common.hpp" + +#include +#include +#include + +int test_main(int, char*[]) +{ + geom g; + + bg::area(g.r, bg::strategy::area::cartesian<>()); + bg::area(g.r, bg::strategy::area::spherical<>()); + bg::area(g.r, bg::strategy::area::geographic<>()); + bg::area(g.po, bg::strategy::area::cartesian<>()); + bg::area(g.po, bg::strategy::area::spherical<>()); + bg::area(g.po, bg::strategy::area::geographic<>()); + bg::area(g.mpo, bg::strategy::area::cartesian<>()); + bg::area(g.mpo, bg::strategy::area::spherical<>()); + bg::area(g.mpo, bg::strategy::area::geographic<>()); + + bg::length(g.s, bg::strategy::distance::pythagoras<>()); + bg::length(g.s, bg::strategy::distance::haversine<>()); + bg::length(g.s, bg::strategy::distance::geographic<>()); + bg::length(g.ls, bg::strategy::distance::pythagoras<>()); + bg::length(g.ls, bg::strategy::distance::haversine<>()); + bg::length(g.ls, bg::strategy::distance::geographic<>()); + bg::length(g.mls, bg::strategy::distance::pythagoras<>()); + bg::length(g.mls, bg::strategy::distance::haversine<>()); + bg::length(g.mls, bg::strategy::distance::geographic<>()); + + bg::perimeter(g.r, bg::strategy::distance::pythagoras<>()); + bg::perimeter(g.r, bg::strategy::distance::haversine<>()); + bg::perimeter(g.r, bg::strategy::distance::geographic<>()); + bg::perimeter(g.po, bg::strategy::distance::pythagoras<>()); + bg::perimeter(g.po, bg::strategy::distance::haversine<>()); + bg::perimeter(g.po, bg::strategy::distance::geographic<>()); + bg::perimeter(g.mpo, bg::strategy::distance::pythagoras<>()); + bg::perimeter(g.mpo, bg::strategy::distance::haversine<>()); + bg::perimeter(g.mpo, bg::strategy::distance::geographic<>()); + + return 0; +} diff --git a/src/boost/libs/geometry/test/cs_undefined/other.cpp b/src/boost/libs/geometry/test/cs_undefined/other.cpp new file mode 100644 index 000000000..fe2ad6501 --- /dev/null +++ b/src/boost/libs/geometry/test/cs_undefined/other.cpp @@ -0,0 +1,40 @@ +// Boost.Geometry + +// Copyright (c) 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include "common.hpp" + +#include +#include + +template +inline void simplify(G const& g1, G & g2) +{ + bg::simplify(g1, g2, 1, bg::strategy::simplify::douglas_peucker >()); + bg::simplify(g1, g2, 1, bg::strategy::simplify::douglas_peucker >()); + + // TODO: douglas_peucker does not define a ctor taking distance strategy + // which is needed in geographic CS + bg::simplify(g1, g2, 1, bg::strategy::simplify::douglas_peucker >()); +} + +int test_main(int, char*[]) +{ + geom g, o; + + // this compiles but it shouldn't! + // internally default_strategy is defined as not_applicable_strategy for box + bg::centroid(g.b, o.pt); + + ::simplify(g.ls, o.ls); + // TODO: + //::simplify(g.r, o.r); // area (point order) strategy not propagated + //::simplify(g.po, o.po); // area (point order) strategy not propagated + + return 0; +} diff --git a/src/boost/libs/geometry/test/cs_undefined/relops1.cpp b/src/boost/libs/geometry/test/cs_undefined/relops1.cpp new file mode 100644 index 000000000..c22bb6b07 --- /dev/null +++ b/src/boost/libs/geometry/test/cs_undefined/relops1.cpp @@ -0,0 +1,50 @@ +// Boost.Geometry + +// Copyright (c) 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include "test_relops.hpp" + +int test_main(int, char*[]) +{ + geom g; + + bg::disjoint(g.pt, g.b, bg::strategy::covered_by::cartesian_point_box()); + bg::disjoint(g.pt, g.b, bg::strategy::covered_by::spherical_point_box()); + bg::disjoint(g.b, g.b, bg::strategy::disjoint::cartesian_box_box()); + bg::disjoint(g.b, g.b, bg::strategy::disjoint::spherical_box_box()); + bg::within(g.pt, g.b, bg::strategy::within::cartesian_point_box()); + bg::within(g.pt, g.b, bg::strategy::within::spherical_point_box()); + bg::within(g.b, g.b, bg::strategy::within::cartesian_box_box()); + bg::within(g.b, g.b, bg::strategy::within::spherical_box_box()); + bg::covered_by(g.pt, g.b, bg::strategy::covered_by::cartesian_point_box()); + bg::covered_by(g.pt, g.b, bg::strategy::covered_by::spherical_point_box()); + bg::covered_by(g.b, g.b, bg::strategy::covered_by::cartesian_box_box()); + bg::covered_by(g.b, g.b, bg::strategy::covered_by::spherical_box_box()); + + // P/P + ::rel_pp(g.pt, g.pt); + ::rel_pp(g.pt, g.mpt); + ::rel_pp(g.mpt, g.mpt); + + // P/L + //::rel_ps(g.pt, g.s); // relate not implemented + ::rel_ps(g.pt, g.ls); + ::rel_ps(g.pt, g.mls); + //::rel_ps(g.mpt, g.s); // relate not implemented + ::rel_ps(g.mpt, g.ls); + ::rel_ps(g.mpt, g.mls); + // P/A + ::rel_ps(g.pt, g.r); + ::rel_ps(g.mpt, g.r); + ::rel_ps(g.pt, g.po); + ::rel_ps(g.mpt, g.po); + ::rel_ps(g.pt, g.mpo); + ::rel_ps(g.mpt, g.mpo); + + return 0; +} diff --git a/src/boost/libs/geometry/test/cs_undefined/relops2.cpp b/src/boost/libs/geometry/test/cs_undefined/relops2.cpp new file mode 100644 index 000000000..11f971b87 --- /dev/null +++ b/src/boost/libs/geometry/test/cs_undefined/relops2.cpp @@ -0,0 +1,48 @@ +// Boost.Geometry + +// Copyright (c) 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include "test_relops.hpp" + +int test_main(int, char*[]) +{ + geom g; + + // L/L + //::rel_ss(g.s, g.s); // relate not implemented + //::rel_ss(g.s, g.ls); // relate not implemented + //::rel_ss(g.s, g.mls); // relate not implemented + //::rel_ss(g.ls, g.s); // relate not implemented + ::rel_ss(g.ls, g.ls); + ::rel_ss(g.ls, g.mls); + //::rel_ss(g.mls, g.s); // relate not implemented + ::rel_ss(g.mls, g.ls); + ::rel_ss(g.mls, g.mls); + // L/A + //::rel_ss(g.s, g.r); // relate not implemented + ::rel_ss(g.ls, g.r); + ::rel_ss(g.mls, g.r); + //::rel_ss(g.s, g.po); // relate not implemented + ::rel_ss(g.ls, g.po); + ::rel_ss(g.mls, g.po); + //::rel_ss(g.s, g.mpo); // relate not implemented + ::rel_ss(g.ls, g.mpo); + ::rel_ss(g.mls, g.mpo); + // A/A + ::rel_ss(g.r, g.r); + ::rel_ss(g.po, g.r); + ::rel_ss(g.mpo, g.r); + ::rel_ss(g.r, g.po); + ::rel_ss(g.po, g.po); + ::rel_ss(g.mpo, g.po); + ::rel_ss(g.r, g.mpo); + ::rel_ss(g.po, g.mpo); + ::rel_ss(g.mpo, g.mpo); + + return 0; +} diff --git a/src/boost/libs/geometry/test/cs_undefined/setops.cpp b/src/boost/libs/geometry/test/cs_undefined/setops.cpp new file mode 100644 index 000000000..d684214a4 --- /dev/null +++ b/src/boost/libs/geometry/test/cs_undefined/setops.cpp @@ -0,0 +1,281 @@ +// Boost.Geometry + +// Copyright (c) 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#include "common.hpp" + +#include +#include +#include +#include + +template +inline void set_idsu(G1 const& g1, G2 const& g2, G3 & g3, S const& s) +{ + bg::intersection(g1, g2, g3, s); + bg::difference(g1, g2, g3, s); + bg::sym_difference(g1, g2, g3, s); + bg::union_(g1, g2, g3, s); +} + +template +inline void set_ids(G1 const& g1, G2 const& g2, G3 & g3, S const& s) +{ + bg::intersection(g1, g2, g3, s); + bg::difference(g1, g2, g3, s); + bg::sym_difference(g1, g2, g3, s); +} + +template +inline void set_id(G1 const& g1, G2 const& g2, G3 & g3, S const& s) +{ + bg::intersection(g1, g2, g3, s); + bg::difference(g1, g2, g3, s); +} + +template +inline void set_i(G1 const& g1, G2 const& g2, G3 & g3, S const& s) +{ + bg::intersection(g1, g2, g3, s); +} + +template +inline void set_d(G1 const& g1, G2 const& g2, G3 & g3, S const& s) +{ + bg::difference(g1, g2, g3, s); +} + +template +inline void set_idsu_pp(G1 const& g1, G2 const& g2, G3 & g3) +{ + ::set_idsu(g1, g2, g3, bg::strategy::within::cartesian_point_point()); + ::set_idsu(g1, g2, g3, bg::strategy::within::spherical_point_point()); +} + +template +inline void set_idsu_ps(G1 const& g1, G2 const& g2, G3 & g3) +{ + typedef typename bg::point_type::type point_type; + ::set_idsu(g1, g2, g3, bg::strategy::within::cartesian_winding()); + ::set_idsu(g1, g2, g3, bg::strategy::within::spherical_winding()); + ::set_idsu(g1, g2, g3, bg::strategy::within::geographic_winding()); +} + +template +inline void set_idsu_ss(G1 const& g1, G2 const& g2, G3 & g3) +{ + ::set_idsu(g1, g2, g3, bg::strategy::intersection::cartesian_segments<>()); + ::set_idsu(g1, g2, g3, bg::strategy::intersection::spherical_segments<>()); + ::set_idsu(g1, g2, g3, bg::strategy::intersection::geographic_segments<>()); +} + +template +inline void set_ids_pp(G1 const& g1, G2 const& g2, G3 & g3) +{ + ::set_ids(g1, g2, g3, bg::strategy::within::cartesian_point_point()); + ::set_ids(g1, g2, g3, bg::strategy::within::spherical_point_point()); +} + +template +inline void set_ids_ps(G1 const& g1, G2 const& g2, G3 & g3) +{ + typedef typename bg::point_type::type point_type; + ::set_ids(g1, g2, g3, bg::strategy::within::cartesian_winding()); + ::set_ids(g1, g2, g3, bg::strategy::within::spherical_winding()); + ::set_ids(g1, g2, g3, bg::strategy::within::geographic_winding()); +} + +template +inline void set_ids_ss(G1 const& g1, G2 const& g2, G3 & g3) +{ + ::set_ids(g1, g2, g3, bg::strategy::intersection::cartesian_segments<>()); + ::set_ids(g1, g2, g3, bg::strategy::intersection::spherical_segments<>()); + ::set_ids(g1, g2, g3, bg::strategy::intersection::geographic_segments<>()); +} + +template +inline void set_id_pp(G1 const& g1, G2 const& g2, G3 & g3) +{ + ::set_id(g1, g2, g3, bg::strategy::within::cartesian_point_point()); + ::set_id(g1, g2, g3, bg::strategy::within::spherical_point_point()); +} + +template +inline void set_id_ps(G1 const& g1, G2 const& g2, G3 & g3) +{ + typedef typename bg::point_type::type point_type; + ::set_id(g1, g2, g3, bg::strategy::within::cartesian_winding()); + ::set_id(g1, g2, g3, bg::strategy::within::spherical_winding()); + ::set_id(g1, g2, g3, bg::strategy::within::geographic_winding()); +} + +template +inline void set_id_ss(G1 const& g1, G2 const& g2, G3 & g3) +{ + ::set_id(g1, g2, g3, bg::strategy::intersection::cartesian_segments<>()); + ::set_id(g1, g2, g3, bg::strategy::intersection::spherical_segments<>()); + ::set_id(g1, g2, g3, bg::strategy::intersection::geographic_segments<>()); +} + +template +inline void set_i_pp(G1 const& g1, G2 const& g2, G3 & g3) +{ + ::set_i(g1, g2, g3, bg::strategy::within::cartesian_point_point()); + ::set_i(g1, g2, g3, bg::strategy::within::spherical_point_point()); +} + +template +inline void set_i_ps(G1 const& g1, G2 const& g2, G3 & g3) +{ + typedef typename bg::point_type::type point_type; + ::set_i(g1, g2, g3, bg::strategy::within::cartesian_winding()); + ::set_i(g1, g2, g3, bg::strategy::within::spherical_winding()); + ::set_i(g1, g2, g3, bg::strategy::within::geographic_winding()); +} + +template +inline void set_i_ss(G1 const& g1, G2 const& g2, G3 & g3) +{ + ::set_i(g1, g2, g3, bg::strategy::intersection::cartesian_segments<>()); + ::set_i(g1, g2, g3, bg::strategy::intersection::spherical_segments<>()); + ::set_i(g1, g2, g3, bg::strategy::intersection::geographic_segments<>()); +} + +template +inline void set_d_pp(G1 const& g1, G2 const& g2, G3 & g3) +{ + ::set_d(g1, g2, g3, bg::strategy::within::cartesian_point_point()); + ::set_d(g1, g2, g3, bg::strategy::within::spherical_point_point()); +} + +template +inline void set_d_ps(G1 const& g1, G2 const& g2, G3 & g3) +{ + typedef typename bg::point_type::type point_type; + ::set_d(g1, g2, g3, bg::strategy::within::cartesian_winding()); + ::set_d(g1, g2, g3, bg::strategy::within::spherical_winding()); + ::set_d(g1, g2, g3, bg::strategy::within::geographic_winding()); +} + +template +inline void set_d_ss(G1 const& g1, G2 const& g2, G3 & g3) +{ + ::set_d(g1, g2, g3, bg::strategy::intersection::cartesian_segments<>()); + ::set_d(g1, g2, g3, bg::strategy::intersection::spherical_segments<>()); + ::set_d(g1, g2, g3, bg::strategy::intersection::geographic_segments<>()); +} + +int test_main(int, char*[]) +{ + geom g; + + // P/P->P + ::set_idsu_pp(g.pt, g.pt, g.mpt); + ::set_idsu_pp(g.pt, g.mpt, g.mpt); + ::set_idsu_pp(g.mpt, g.mpt, g.mpt); + + // P/L->P + ::set_id_ps(g.pt, g.s, g.mpt); + ::set_id_ps(g.pt, g.ls, g.mpt); + ::set_id_ps(g.pt, g.mls, g.mpt); + ::set_id_ps(g.mpt, g.s, g.mpt); + ::set_id_ps(g.mpt, g.ls, g.mpt); + ::set_id_ps(g.mpt, g.mls, g.mpt); + + // P/A->P + // no intersection nor difference + //::set_id_ps(g.pt, g.r, g.mpt); + //::set_id_ps(g.pt, g.po, g.mpt); + //::set_id_ps(g.pt, g.mpo, g.mpt); + //::set_id_ps(g.mpt, g.r, g.mpt); + //::set_id_ps(g.mpt, g.po, g.mpt); + //::set_id_ps(g.mpt, g.mpo, g.mpt); + + // L/L->P + ::set_ids_ss(g.s, g.s, g.mpt); + //::set_i_ss(g.s, g.ls, g.mpt); // no intersection nor difference + //::set_i_ss(g.s, g.mls, g.mpt); // no intersection nor difference + //::set_i_ss(g.ls, g.s, g.mpt); // no intersection nor difference + ::set_ids_ss(g.ls, g.ls, g.mpt); + ::set_i_ss(g.ls, g.mls, g.mpt); // no difference nor sym_difference + //::set_i_ss(g.mls, g.s, g.mpt); // no intersection nor difference + ::set_i_ss(g.mls, g.ls, g.mpt); // no difference nor sym_difference + ::set_ids_ss(g.mls, g.mls, g.mpt); + + // L/L->L + //::set_ids_ss(g.s, g.s, g.mls); // union not implemented, missing specialization + //::set_idsu_ss(g.s, g.ls, g.mls); // missing specialization + //::set_idsu_ss(g.s, g.mls, g.mls); // missing specialization + //::set_idsu_ss(g.ls, g.s, g.mls); // missing specialization + ::set_idsu_ss(g.ls, g.ls, g.mls); + ::set_idsu_ss(g.ls, g.mls, g.mls); + //::set_idsu_ss(g.mls, g.s, g.mls); // missing specialization + ::set_idsu_ss(g.mls, g.ls, g.mls); + ::set_idsu_ss(g.mls, g.mls, g.mls); + + // S/B->L ? + + // L/B->L ? + + // L/A->P + //::set_ids_ss(g.s, g.r, g.mpt); // no intersection + //::set_ids_ss(g.s, g.po, g.mpt); // no intersection + //::set_ids_ss(g.s, g.mpo, g.mpt); // no intersection + ::set_ids_ss(g.ls, g.r, g.mpt); + ::set_ids_ss(g.ls, g.po, g.mpt); + ::set_ids_ss(g.ls, g.mpo, g.mpt); + ::set_ids_ss(g.mls, g.r, g.mpt); + ::set_ids_ss(g.mls, g.po, g.mpt); + ::set_ids_ss(g.mls, g.mpo, g.mpt); + + // L/A->L + //::set_id_ss(g.s, g.r, g.mls); // no intersection + //::set_id_ss(g.s, g.po, g.mls); // no intersection + //::set_id_ss(g.s, g.mpo, g.mls); // no intersection + ::set_id_ss(g.ls, g.r, g.mls); + ::set_id_ss(g.ls, g.po, g.mls); + ::set_id_ss(g.ls, g.mpo, g.mls); + ::set_id_ss(g.mls, g.r, g.mls); + ::set_id_ss(g.mls, g.po, g.mls); + ::set_id_ss(g.mls, g.mpo, g.mls); + + // A/A->P + ::set_i_ss(g.r, g.r, g.mpt); + ::set_i_ss(g.r, g.po, g.mpt); + ::set_i_ss(g.r, g.mpo, g.mpt); + ::set_i_ss(g.po, g.r, g.mpt); + ::set_i_ss(g.po, g.po, g.mpt); + ::set_i_ss(g.po, g.mpo, g.mpt); + ::set_i_ss(g.mpo, g.r, g.mpt); + ::set_i_ss(g.mpo, g.po, g.mpt); + ::set_i_ss(g.mpo, g.mpo, g.mpt); + + // A/A->L + ::set_i_ss(g.r, g.r, g.mls); + ::set_i_ss(g.r, g.po, g.mls); + ::set_i_ss(g.r, g.mpo, g.mls); + ::set_i_ss(g.po, g.r, g.mls); + ::set_i_ss(g.po, g.po, g.mls); + ::set_i_ss(g.po, g.mpo, g.mls); + ::set_i_ss(g.mpo, g.r, g.mls); + ::set_i_ss(g.mpo, g.po, g.mls); + ::set_i_ss(g.mpo, g.mpo, g.mls); + + // A/A->A + ::set_idsu_ss(g.r, g.r, g.mpo); + ::set_idsu_ss(g.r, g.po, g.mpo); + ::set_idsu_ss(g.r, g.mpo, g.mpo); + ::set_idsu_ss(g.po, g.r, g.mpo); + ::set_idsu_ss(g.po, g.po, g.mpo); + ::set_idsu_ss(g.po, g.mpo, g.mpo); + ::set_idsu_ss(g.mpo, g.r, g.mpo); + ::set_idsu_ss(g.mpo, g.po, g.mpo); + ::set_idsu_ss(g.mpo, g.mpo, g.mpo); + + return 0; +} diff --git a/src/boost/libs/geometry/test/cs_undefined/test_relops.hpp b/src/boost/libs/geometry/test/cs_undefined/test_relops.hpp new file mode 100644 index 000000000..7a366bcd6 --- /dev/null +++ b/src/boost/libs/geometry/test/cs_undefined/test_relops.hpp @@ -0,0 +1,164 @@ +// Boost.Geometry + +// Copyright (c) 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_GEOMETRY_TEST_CS_UNDEFINED_TEST_RELOPS_HPP +#define BOOST_GEOMETRY_TEST_CS_UNDEFINED_TEST_RELOPS_HPP + +#include "common.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template +< + typename G1, + typename G2, + std::size_t Dim1 = bg::topological_dimension::value, + std::size_t Dim2 = bg::topological_dimension::value +> +struct call_equals +{ + template + static void apply(G1 const& g1, G2 const& g2, S const& s) {} +}; + +template +struct call_equals +{ + template + static void apply(G1 const& g1, G2 const& g2, S const& s) + { + bg::equals(g1, g2, s); + } +}; + +template +< + typename G1, + typename G2, + std::size_t Dim1 = bg::topological_dimension::value, + std::size_t Dim2 = bg::topological_dimension::value +> +struct call_overlaps +{ + template + static void apply(G1 const& g1, G2 const& g2, S const& s) {} +}; + +template +struct call_overlaps +{ + template + static void apply(G1 const& g1, G2 const& g2, S const& s) + { + bg::overlaps(g1, g2, s); + } +}; + +template +< + typename G1, + typename G2, + std::size_t Dim1 = bg::topological_dimension::value, + std::size_t Dim2 = bg::topological_dimension::value +> +struct call_touches +{ + template + static void apply(G1 const& g1, G2 const& g2, S const& s) + { + bg::touches(g1, g2, s); + } +}; + +template +struct call_touches +{ + template + static void apply(G1 const& g1, G2 const& g2, S const& s) {} +}; + +template +< + typename G1, + typename G2, + std::size_t Dim1 = bg::topological_dimension::value, + std::size_t Dim2 = bg::topological_dimension::value +> +struct call_crosses +{ + template + static void apply(G1 const& g1, G2 const& g2, S const& s) + { + bg::crosses(g1, g2, s); + } +}; + +template +struct call_crosses +{ + template + static void apply(G1 const& g1, G2 const& g2, S const& s) {} +}; + +template +struct call_crosses +{ + template + static void apply(G1 const& g1, G2 const& g2, S const& s) {} +}; + +template +inline void rel(G1 const& g1, G2 const& g2, S const& s) +{ + bg::relation(g1, g2, s); + bg::relate(g1, g2, bg::de9im::mask("*********"), s); + bg::covered_by(g1, g2, s); + call_crosses::apply(g1, g2, s); + bg::disjoint(g1, g2, s); + call_equals::apply(g1, g2, s); + bg::intersects(g1, g2, s); + call_overlaps::apply(g1, g2, s); + call_touches::apply(g1, g2, s); + bg::within(g1, g2, s); +} + +template +inline void rel_pp(G1 const& g1, G2 const& g2) +{ + ::rel(g1, g2, bg::strategy::within::cartesian_point_point()); + ::rel(g1, g2, bg::strategy::within::spherical_point_point()); +} + +template +inline void rel_ps(G1 const& g1, G2 const& g2) +{ + typedef typename bg::point_type::type point; + ::rel(g1, g2, bg::strategy::within::cartesian_winding()); + ::rel(g1, g2, bg::strategy::within::spherical_winding()); + ::rel(g1, g2, bg::strategy::within::geographic_winding()); +} + +template +inline void rel_ss(G1 const& g1, G2 const& g2) +{ + ::rel(g1, g2, bg::strategy::intersection::cartesian_segments<>()); + ::rel(g1, g2, bg::strategy::intersection::spherical_segments<>()); + ::rel(g1, g2, bg::strategy::intersection::geographic_segments<>()); +} + +#endif // BOOST_GEOMETRY_TEST_CS_UNDEFINED_TEST_RELOPS_HPP diff --git a/src/boost/libs/geometry/test/formulas/Jamfile b/src/boost/libs/geometry/test/formulas/Jamfile new file mode 100644 index 000000000..28ca87194 --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/Jamfile @@ -0,0 +1,21 @@ +# Boost.Geometry +# +# Copyright (c) 2016-2019, 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, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-formulas + : + [ run inverse.cpp : : : : formulas_inverse ] + [ run inverse_karney.cpp : : : : formulas_inverse_karney ] + [ run direct.cpp : : : : formulas_direct ] + [ run direct_accuracy.cpp : : : : formulas_direct_accuracy ] + [ run direct_meridian.cpp : : : : formulas_direct_meridian ] + [ run intersection.cpp : : : : formulas_intersection ] + [ run vertex_longitude.cpp : : : : formulas_vertex_longitude ] + ; diff --git a/src/boost/libs/geometry/test/formulas/direct.cpp b/src/boost/libs/geometry/test/formulas/direct.cpp new file mode 100644 index 000000000..97fb170f4 --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/direct.cpp @@ -0,0 +1,176 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016-2018 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 +// Contributed and/or modified by Adeel Ahmad, as part of Google Summer of Code 2018 program + +// 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) + +#include "test_formula.hpp" +#include "direct_cases.hpp" +#include "direct_cases_antipodal.hpp" + +#include +#include +#include +//#include +#include + +#include + +#ifdef BOOST_GEOEMTRY_TEST_WITH_GEOGRAPHICLIB +#include +#include +#endif // BOOST_GEOEMTRY_TEST_WITH_GEOGRAPHICLIB + +inline void symmetrize_wrt_origin(expected_result & r) +{ + r.lon2 = -r.lon2; + r.lat2 = -r.lat2; + r.reduced_length = -r.reduced_length; +} + +inline expected_results symmetric_wrt_origin(expected_results r) +{ + r.distance = -r.distance; + symmetrize_wrt_origin(r.karney); + symmetrize_wrt_origin(r.series); + symmetrize_wrt_origin(r.spherical); + symmetrize_wrt_origin(r.thomas); + symmetrize_wrt_origin(r.thomas1st); + symmetrize_wrt_origin(r.vincenty); + return r; +} + +template +void check_direct(Result const& result, expected_result const& expected, expected_result const& reference, + double reference_error, bool check_reference_only = false) +{ + check_direct_sph(result, expected, reference, reference_error, check_reference_only); + check_one(result.reduced_length, expected.reduced_length, reference.reduced_length, reference_error); + check_one(result.geodesic_scale, expected.geodesic_scale, reference.geodesic_scale, reference_error); +} + +template +void check_direct_sph(Result const& result, expected_result const& expected, expected_result const& reference, + double reference_error, bool check_reference_only = false) +{ + check_one(result.lon2, expected.lon2, reference.lon2, reference_error, true, check_reference_only); + check_one(result.lat2, expected.lat2, reference.lat2, reference_error, true, check_reference_only); + check_one(result.reverse_azimuth, expected.reverse_azimuth, reference.reverse_azimuth, reference_error, true, check_reference_only); +} + +void test_all(expected_results const& results) +{ + double const d2r = bg::math::d2r(); + double const r2d = bg::math::r2d(); + + double lon1r = results.p1.lon * d2r; + double lat1r = results.p1.lat * d2r; + double distance = results.distance; + double azi12r = results.azimuth12 * d2r; + + double lon1d = results.p1.lon; + double lat1d = results.p1.lat; + double azi12d = results.azimuth12; + + // WGS84 + bg::srs::spheroid spheroid(6378137.0, 6356752.3142451793); + bg::srs::sphere const sphere; + + bg::formula::result_direct result; + + typedef bg::formula::vincenty_direct vi_t; + result = vi_t::apply(lon1r, lat1r, distance, azi12r, spheroid); + result.lon2 *= r2d; + result.lat2 *= r2d; + result.reverse_azimuth *= r2d; + check_direct(result, results.vincenty, results.karney, 0.00000001); + + typedef bg::formula::thomas_direct th_t; + result = th_t::apply(lon1r, lat1r, distance, azi12r, spheroid); + result.lon2 *= r2d; + result.lat2 *= r2d; + result.reverse_azimuth *= r2d; + check_direct(result, results.thomas, results.karney, 0.0000001); + + typedef bg::formula::thomas_direct th_t1st; + result = th_t1st::apply(lon1r, lat1r, distance, azi12r, spheroid); + result.lon2 *= r2d; + result.lat2 *= r2d; + result.reverse_azimuth *= r2d; + check_direct(result, results.thomas1st, results.karney, 0.0000001); +/* + typedef bg::formula::series_expansion_direct series; + result = series::apply(lon1r, lat1r, distance, azi12r, spheroid); + result.lon2 *= r2d; + result.lat2 *= r2d; + result.reverse_azimuth *= r2d; + check_direct(result, results.series, results.karney, 0.0000001); +*/ + result = bg::formula::spherical_direct(lon1r, lat1r, distance, + azi12r, sphere); + result.lon2 *= r2d; + result.lat2 *= r2d; + result.reverse_azimuth *= r2d; + check_direct_sph(result, results.spherical, results.karney, 0.1); + + typedef bg::formula::karney_direct ka_t; + result = ka_t::apply(lon1d, lat1d, distance, azi12d, spheroid); + check_direct(result, results.karney, results.karney, 0.0000001); + +#ifdef BOOST_GEOEMTRY_TEST_WITH_GEOGRAPHICLIB + { + using namespace GeographicLib; + Geodesic geod(Constants::WGS84_a(), Constants::WGS84_f()); + double foo = 0; + geod.Direct(lat1d, lon1d, azi12d, distance, + result.lat2, result.lon2, result.reverse_azimuth, + result.reduced_length, result.geodesic_scale, foo); + boost::ignore_unused(foo); + check_direct(result, results.karney, results.karney, 0.0000001); + } +#endif +} + +void test_karney_antipodal(expected_results_antipodal const& results) +{ + double lon1d = results.p1.lon; + double lat1d = results.p1.lat; + double distance = results.distance; + double azi12d = results.azimuth12; + + // WGS84 + bg::srs::spheroid spheroid(6378137.0, 6356752.3142451793); + + bg::formula::result_direct result; + + typedef bg::formula::karney_direct ka_t; + result = ka_t::apply(lon1d, lat1d, distance, azi12d, spheroid); + check_direct(result, results.karney, results.karney, 0.0000001, true); +} + +int test_main(int, char*[]) +{ + for (size_t i = 0; i < expected_size; ++i) + { + test_all(expected[i]); + + if (expected[i].p1.lon == 0 && expected[i].p1.lat == 0) + { + test_all(symmetric_wrt_origin(expected[i])); + } + } + + for (size_t i = 0; i < expected_size_antipodal; ++i) + { + test_karney_antipodal(expected_antipodal[i]); + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/formulas/direct_accuracy.cpp b/src/boost/libs/geometry/test/formulas/direct_accuracy.cpp new file mode 100644 index 000000000..e485caafb --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/direct_accuracy.cpp @@ -0,0 +1,97 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2019 Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, 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) + +#include + +#include +#include + +#ifdef BOOST_GEOEMTRY_TEST_WITH_GEOGRAPHICLIB +#include +#include +#endif // BOOST_GEOEMTRY_TEST_WITH_GEOGRAPHICLIB + +int test_main(int, char*[]) +{ + +#ifdef BOOST_GEOEMTRY_TEST_WITH_GEOGRAPHICLIB + // accuracy test from https://github.com/boostorg/geometry/issues/560 + using namespace GeographicLib; + + const long double wgs84_a = 6378137.0L; + const long double wgs84_f = 1.0L / 298.257223563L; + const long double one_minus_f = 1.0L - wgs84_f; + const long double wgs84_b = wgs84_a * one_minus_f; + + const boost::geometry::srs::spheroid BoostWGS84(wgs84_a, wgs84_b); + + // boost karney_direct function class with azimuth output and SeriesOrder = 6 + typedef boost::geometry::formula::karney_direct + BoostKarneyDirect_6; + + // boost karney_direct function class with azimuth output and SeriesOrder = 8 + typedef boost::geometry::formula::karney_direct + BoostKarneyDirect_8; + + // boost test BOOST_CHECK_CLOSE macro takes a percentage accuracy parameter + const double EPSILON = std::numeric_limits::epsilon(); + const double CALCULATION_TOLERANCE = 100 * EPSILON; + + const Geodesic GeographicLibWGS84(Geodesic::WGS84()); + + // Loop around latitudes: 0 to 89 degrees + for (int i=0; i < 90; ++i) + { + // The latitude in degrees. + double latitude(1.0 * i); + + // Loop around longitudes: 1 to 179 degrees + for (int j=1; j < 180; ++j) + { + // The longitude in degrees. + double longitude(1.0 * j); + + // The Geodesic: distance in metres, start azimuth and finish azimuth in degrees. + double distance_m, azimuth, azi2; + GeographicLibWGS84.Inverse(0.0, 0.0, latitude, longitude, distance_m, azimuth, azi2); + + // The GeographicLib position and azimuth at the distance in metres + double lat2k, lon2k, azi2k; + GeographicLibWGS84.Direct(0.0, 0.0, azimuth, distance_m, lat2k, lon2k, azi2k); + BOOST_CHECK_CLOSE(latitude, lat2k, 140 * CALCULATION_TOLERANCE); + BOOST_CHECK_CLOSE(longitude, lon2k, 120 * CALCULATION_TOLERANCE); + + // The boost karney_direct order 6 position at the azimuth and distance in metres. + boost::geometry::formula::result_direct results_6 + = BoostKarneyDirect_6::apply(0.0, 0.0, distance_m, azimuth, BoostWGS84); + BOOST_CHECK_CLOSE(azi2, results_6.reverse_azimuth, 140 * CALCULATION_TOLERANCE); + BOOST_CHECK_CLOSE(latitude, results_6.lat2, 220 * CALCULATION_TOLERANCE); + + /******** Test below only passes with >= 10172000 * CALCULATION_TOLERANCE !! ********/ + BOOST_CHECK_CLOSE(longitude, results_6.lon2, 10171000 * CALCULATION_TOLERANCE); + /*****************************************************************************/ + + // The boost karney_direct order 8 position at the azimuth and distance in metres. + boost::geometry::formula::result_direct results_8 + = BoostKarneyDirect_8::apply(0.0, 0.0, distance_m, azimuth, BoostWGS84); + BOOST_CHECK_CLOSE(azi2, results_8.reverse_azimuth, 140 * CALCULATION_TOLERANCE); + BOOST_CHECK_CLOSE(latitude, results_8.lat2, 220 * CALCULATION_TOLERANCE); + + /******** Test below only passes with >= 10174000 * CALCULATION_TOLERANCE !! ********/ + BOOST_CHECK_CLOSE(longitude, results_8.lon2, 10173000 * CALCULATION_TOLERANCE); + /*****************************************************************************/ + } + } +#endif // BOOST_GEOEMTRY_TEST_WITH_GEOGRAPHICLIB + + return 0; +} + diff --git a/src/boost/libs/geometry/test/formulas/direct_cases.hpp b/src/boost/libs/geometry/test/formulas/direct_cases.hpp new file mode 100644 index 000000000..1ac436e6f --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/direct_cases.hpp @@ -0,0 +1,700 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016-2018 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, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_GEOMETRY_TEST_DIRECT_CASES_HPP +#define BOOST_GEOMETRY_TEST_DIRECT_CASES_HPP + +struct coordinates +{ + double lon; + double lat; +}; + +struct expected_result +{ + double lon2; + double lat2; + double reverse_azimuth; + double reduced_length; + double geodesic_scale; +}; + +struct expected_results +{ + coordinates p1; + double distance; + double azimuth12; + expected_result karney; + expected_result vincenty; + expected_result thomas; + expected_result thomas1st; + expected_result series; + expected_result spherical; +}; + +expected_results expected[] = +{ + + { + { 0, 0 }, 250000, 0, + { 0.00000000000000000000, 2.26091191238511868278, 0.00000000000000000000, 249935.55905595037620514631, 0.99922674639115516282 }, + { 0.00000000000000000000, 2.26091191236402178077, 0.00000000000000000000, 249935.55905951990280300379, 0.99922674639116959572 }, + { 0.00000000000000000000, 2.26091189386641744363, 0.00000000000000000000, 249935.55701571033569052815, 0.99922674640382092015 }, + { 0.00000000000000000000, 2.26091190837723177154, 0.00000000000000000000, 249935.55863258230965584517, 0.99922674639389641449 }, + { 0.00000000000000000000, 2.26091191238508226746, 0.00000000000000000000, 249935.55905602785060182214, 0.99922674639115527384 }, + { 0.00000000000000000000, 2.24830091939884413321, 0.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 0 }, 250000, 45, + { 1.58842150169031337548, 1.59850419267109766785, 45.02216068943542381930, 249935.55885449703782796860, 0.99922674504834751996 }, + { 1.58842150168977558344, 1.59850419267017707092, 45.02216068943540250302, 249935.55886070139240473509, 0.99922674504834840814 }, + { 1.58842149958854261804, 1.59850419056543535667, 45.02216068937701010100, 249935.55853169565671123564, 0.99922674505038500126 }, + { 1.58842150075770360829, 1.59850419406187715943, 45.02216068947401339528, 249935.55908163820276968181, 0.99922674504700181863 }, + { 1.58842150169031270934, 1.59850419267109744581, 45.02216068943543092473, 249935.55885453775408677757, 0.99922674504834751996 }, + { 1.59019688120571478507, 1.58958477520588337129, 45.02206163500609648054, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 0 }, 250000, 90, + { 2.24578821029880382198, 0.00000000000000000000, 90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { 2.24578821029880382198, 0.00000000000000013841, 90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { 2.24578821029880382198, 0.00000000000000013841, 90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { 2.24578821029880382198, 0.00000000000000013841, 90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { 2.24578821029880382198, 0.00000000000000013841, 90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { 2.24830091939884413321, 0.00000000000000013763, 90.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 0 }, 250000, 135, + { 1.58842150169031337548, -1.59850419267109766785, 134.97783931056457618070, 249935.55885449703782796860, 0.99922674504834751996 }, + { 1.58842150168977580549, -1.59850419267017707092, 134.97783931056460460240, 249935.55886070139240473509, 0.99922674504834840814 }, + { 1.58842149958854261804, -1.59850419056543602281, 134.97783931062298279357, 249935.55853169583133421838, 0.99922674505038500126 }, + { 1.58842150075770360829, -1.59850419406187760352, 134.97783931052597949929, 249935.55908163831918500364, 0.99922674504700181863 }, + { 1.58842150169033402562, -1.59850419267108945220, 134.97783931056457618070, 249935.55885453653172589839, 0.99922674504834751996 }, + { 1.59019688120571345280, -1.58958477520588448151, 134.97793836499391773032, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 0 }, 250000, 180, + { 0.00000000000000000000, -2.26091191238511868278, -180.00000000000000000000, 249935.55905595037620514631, 0.99922674639115516282 }, + { 0.00000000000000027517, -2.26091191236402178077, 180.00000000000000000000, 249935.55905951990280300379, 0.99922674639116959572 }, + { 0.00000000000000000000, -2.26091189386641744363, 180.00000000000000000000, 249935.55701571033569052815, 0.99922674640382092015 }, + { 0.00000000000000000000, -2.26091190837723177154, 180.00000000000000000000, 249935.55863258230965584517, 0.99922674639389641449 }, + { 0.00000000000000000000, -2.26091191238511468597, 180.00000000000000000000, 249935.55905603148858062923, 0.99922674639115527384 }, + { 0.00000000000000000000, -2.24830091939884635366, 180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 0 }, 250000, -45, + { -1.58842150169031337548, 1.59850419267109766785, -45.02216068943542381930, 249935.55885449703782796860, 0.99922674504834751996 }, + { -1.58842150168977558344, 1.59850419267017707092, -45.02216068943540250302, 249935.55886070139240473509, 0.99922674504834840814 }, + { -1.58842149958854261804, 1.59850419056543535667, -45.02216068937701010100, 249935.55853169565671123564, 0.99922674505038500126 }, + { -1.58842150075770360829, 1.59850419406187715943, -45.02216068947401339528, 249935.55908163820276968181, 0.99922674504700181863 }, + { -1.58842150169031270934, 1.59850419267109744581, -45.02216068943543092473, 249935.55885453775408677757, 0.99922674504834751996 }, + { -1.59019688120571478507, 1.58958477520588337129, -45.02206163500609648054, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 0 }, 250000, -90, + { -2.24578821029880382198, 0.00000000000000000000, -90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { -2.24578821029880382198, 0.00000000000000013841, -90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { -2.24578821029880382198, 0.00000000000000013841, -90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { -2.24578821029880382198, 0.00000000000000013841, -90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { -2.24578821029880382198, 0.00000000000000013841, -90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { -2.24830091939884413321, 0.00000000000000013763, -90.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 0 }, 250000, -135, + { -1.58842150169031337548, -1.59850419267109766785, -134.97783931056457618070, 249935.55885449703782796860, 0.99922674504834751996 }, + { -1.58842150168977580549, -1.59850419267017707092, -134.97783931056460460240, 249935.55886070139240473509, 0.99922674504834840814 }, + { -1.58842149958854261804, -1.59850419056543602281, -134.97783931062298279357, 249935.55853169583133421838, 0.99922674505038500126 }, + { -1.58842150075770360829, -1.59850419406187760352, -134.97783931052597949929, 249935.55908163831918500364, 0.99922674504700181863 }, + { -1.58842150169033402562, -1.59850419267108945220, -134.97783931056457618070, 249935.55885453653172589839, 0.99922674504834751996 }, + { -1.59019688120571345280, -1.58958477520588448151, -134.97793836499391773032, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 0 }, 250000, -180, + { 0.00000000000000000000, -2.26091191238511868278, -180.00000000000000000000, 249935.55905595037620514631, 0.99922674639115516282 }, + { -0.00000000000000027517, -2.26091191236402178077, -180.00000000000000000000, 249935.55905951990280300379, 0.99922674639116959572 }, + { 0.00000000000000000000, -2.26091189386641744363, -180.00000000000000000000, 249935.55701571033569052815, 0.99922674640382092015 }, + { 0.00000000000000000000, -2.26091190837723177154, -180.00000000000000000000, 249935.55863258230965584517, 0.99922674639389641449 }, + { 0.00000000000000000000, -2.26091191238511468597, -180.00000000000000000000, 249935.55905603148858062923, 0.99922674639115527384 }, + { 0.00000000000000000000, -2.24830091939884635366, -180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 0 }, 250000, 0, + { -1.00000000000000000000, 2.26091191238511868278, 0.00000000000000000000, 249935.55905595037620514631, 0.99922674639115516282 }, + { -1.00000000000000000000, 2.26091191236402178077, 0.00000000000000000000, 249935.55905951990280300379, 0.99922674639116959572 }, + { -1.00000000000000000000, 2.26091189386641744363, 0.00000000000000000000, 249935.55701571033569052815, 0.99922674640382092015 }, + { -1.00000000000000000000, 2.26091190837723177154, 0.00000000000000000000, 249935.55863258230965584517, 0.99922674639389641449 }, + { -1.00000000000000000000, 2.26091191238508226746, 0.00000000000000000000, 249935.55905602785060182214, 0.99922674639115527384 }, + { -1.00000000000000000000, 2.24830091939884413321, 0.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 0 }, 250000, 45, + { 0.58842150169031337548, 1.59850419267109766785, 45.02216068943542381930, 249935.55885449703782796860, 0.99922674504834751996 }, + { 0.58842150168977558344, 1.59850419267017707092, 45.02216068943540250302, 249935.55886070139240473509, 0.99922674504834840814 }, + { 0.58842149958854272906, 1.59850419056543535667, 45.02216068937701010100, 249935.55853169565671123564, 0.99922674505038500126 }, + { 0.58842150075770371931, 1.59850419406187715943, 45.02216068947401339528, 249935.55908163820276968181, 0.99922674504700181863 }, + { 0.58842150169031270934, 1.59850419267109744581, 45.02216068943543092473, 249935.55885453775408677757, 0.99922674504834751996 }, + { 0.59019688120571467405, 1.58958477520588337129, 45.02206163500609648054, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 0 }, 250000, 90, + { 1.24578821029880382198, 0.00000000000000000000, 90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { 1.24578821029880382198, 0.00000000000000013841, 90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { 1.24578821029880382198, 0.00000000000000013841, 90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { 1.24578821029880382198, 0.00000000000000013841, 90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { 1.24578821029880382198, 0.00000000000000013841, 90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { 1.24830091939884435526, 0.00000000000000013763, 90.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 0 }, 250000, 135, + { 0.58842150169031337548, -1.59850419267109766785, 134.97783931056457618070, 249935.55885449703782796860, 0.99922674504834751996 }, + { 0.58842150168977569447, -1.59850419267017707092, 134.97783931056460460240, 249935.55886070139240473509, 0.99922674504834840814 }, + { 0.58842149958854272906, -1.59850419056543602281, 134.97783931062298279357, 249935.55853169583133421838, 0.99922674505038500126 }, + { 0.58842150075770371931, -1.59850419406187760352, 134.97783931052597949929, 249935.55908163831918500364, 0.99922674504700181863 }, + { 0.58842150169033402562, -1.59850419267108945220, 134.97783931056457618070, 249935.55885453653172589839, 0.99922674504834751996 }, + { 0.59019688120571345280, -1.58958477520588448151, 134.97793836499391773032, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 0 }, 250000, 180, + { -1.00000000000000000000, -2.26091191238511868278, -180.00000000000000000000, 249935.55905595037620514631, 0.99922674639115516282 }, + { -0.99999999999999977796, -2.26091191236402178077, 180.00000000000000000000, 249935.55905951990280300379, 0.99922674639116959572 }, + { -1.00000000000000000000, -2.26091189386641744363, 180.00000000000000000000, 249935.55701571033569052815, 0.99922674640382092015 }, + { -1.00000000000000000000, -2.26091190837723177154, 180.00000000000000000000, 249935.55863258230965584517, 0.99922674639389641449 }, + { -1.00000000000000000000, -2.26091191238511468597, 180.00000000000000000000, 249935.55905603148858062923, 0.99922674639115527384 }, + { -1.00000000000000000000, -2.24830091939884635366, 180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 0 }, 250000, -45, + { -2.58842150169031359752, 1.59850419267109766785, -45.02216068943542381930, 249935.55885449703782796860, 0.99922674504834751996 }, + { -2.58842150168977536140, 1.59850419267017707092, -45.02216068943540250302, 249935.55886070139240473509, 0.99922674504834840814 }, + { -2.58842149958854284009, 1.59850419056543535667, -45.02216068937701010100, 249935.55853169565671123564, 0.99922674505038500126 }, + { -2.58842150075770360829, 1.59850419406187715943, -45.02216068947401339528, 249935.55908163820276968181, 0.99922674504700181863 }, + { -2.58842150169031270934, 1.59850419267109744581, -45.02216068943543092473, 249935.55885453775408677757, 0.99922674504834751996 }, + { -2.59019688120571478507, 1.58958477520588337129, -45.02206163500609648054, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 0 }, 250000, -90, + { -3.24578821029880382198, 0.00000000000000000000, -90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { -3.24578821029880382198, 0.00000000000000013841, -90.00000000000000000000, 249935.55865304192411713302, 0.99922674370552955203 }, + { -3.24578821029880382198, 0.00000000000000013841, -90.00000000000000000000, 249935.55865304192411713302, 0.99922674370552955203 }, + { -3.24578821029880382198, 0.00000000000000013841, -90.00000000000000000000, 249935.55865304192411713302, 0.99922674370552955203 }, + { -3.24578821029880382198, 0.00000000000000013841, -90.00000000000000000000, 249935.55865304192411713302, 0.99922674370552955203 }, + { -3.24830091939884457730, 0.00000000000000013763, -90.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 0 }, 250000, -135, + { -2.58842150169031359752, -1.59850419267109766785, -134.97783931056457618070, 249935.55885449703782796860, 0.99922674504834751996 }, + { -2.58842150168977580549, -1.59850419267017707092, -134.97783931056460460240, 249935.55886070139240473509, 0.99922674504834840814 }, + { -2.58842149958854284009, -1.59850419056543602281, -134.97783931062298279357, 249935.55853169583133421838, 0.99922674505038500126 }, + { -2.58842150075770360829, -1.59850419406187760352, -134.97783931052597949929, 249935.55908163831918500364, 0.99922674504700181863 }, + { -2.58842150169027718221, -1.59850419267108945220, -134.97783931056457618070, 249935.55885453653172589839, 0.99922674504834751996 }, + { -2.59019688120571345280, -1.58958477520588448151, -134.97793836499391773032, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 0 }, 250000, -180, + { -1.00000000000000000000, -2.26091191238511868278, -180.00000000000000000000, 249935.55905595037620514631, 0.99922674639115516282 }, + { -1.00000000000000022204, -2.26091191236402178077, -180.00000000000000000000, 249935.55905951990280300379, 0.99922674639116959572 }, + { -1.00000000000000000000, -2.26091189386641744363, -180.00000000000000000000, 249935.55701571033569052815, 0.99922674640382092015 }, + { -1.00000000000000000000, -2.26091190837723177154, -180.00000000000000000000, 249935.55863258230965584517, 0.99922674639389641449 }, + { -1.00000000000000000000, -2.26091191238511468597, -180.00000000000000000000, 249935.55905603148858062923, 0.99922674639115527384 }, + { -1.00000000000000000000, -2.24830091939884635366, -180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 0 }, 250000, 0, + { 1.00000000000000000000, 2.26091191238511868278, 0.00000000000000000000, 249935.55905595037620514631, 0.99922674639115516282 }, + { 1.00000000000000000000, 2.26091191236402178077, 0.00000000000000000000, 249935.55905951990280300379, 0.99922674639116959572 }, + { 1.00000000000000000000, 2.26091189386641744363, 0.00000000000000000000, 249935.55701571033569052815, 0.99922674640382092015 }, + { 1.00000000000000000000, 2.26091190837723177154, 0.00000000000000000000, 249935.55863258230965584517, 0.99922674639389641449 }, + { 1.00000000000000000000, 2.26091191238508226746, 0.00000000000000000000, 249935.55905602785060182214, 0.99922674639115527384 }, + { 1.00000000000000000000, 2.24830091939884413321, 0.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 0 }, 250000, 45, + { 2.58842150169031359752, 1.59850419267109766785, 45.02216068943542381930, 249935.55885449703782796860, 0.99922674504834751996 }, + { 2.58842150168977536140, 1.59850419267017707092, 45.02216068943540250302, 249935.55886070139240473509, 0.99922674504834840814 }, + { 2.58842149958854284009, 1.59850419056543535667, 45.02216068937701010100, 249935.55853169565671123564, 0.99922674505038500126 }, + { 2.58842150075770360829, 1.59850419406187715943, 45.02216068947401339528, 249935.55908163820276968181, 0.99922674504700181863 }, + { 2.58842150169031270934, 1.59850419267109744581, 45.02216068943543092473, 249935.55885453775408677757, 0.99922674504834751996 }, + { 2.59019688120571478507, 1.58958477520588337129, 45.02206163500609648054, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 0 }, 250000, 90, + { 3.24578821029880382198, 0.00000000000000000000, 90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { 3.24578821029880382198, 0.00000000000000013841, 90.00000000000000000000, 249935.55865304192411713302, 0.99922674370552955203 }, + { 3.24578821029880382198, 0.00000000000000013841, 90.00000000000000000000, 249935.55865304192411713302, 0.99922674370552955203 }, + { 3.24578821029880382198, 0.00000000000000013841, 90.00000000000000000000, 249935.55865304192411713302, 0.99922674370552955203 }, + { 3.24578821029880382198, 0.00000000000000013841, 90.00000000000000000000, 249935.55865304192411713302, 0.99922674370552955203 }, + { 3.24830091939884457730, 0.00000000000000013763, 90.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 0 }, 250000, 135, + { 2.58842150169031359752, -1.59850419267109766785, 134.97783931056457618070, 249935.55885449703782796860, 0.99922674504834751996 }, + { 2.58842150168977580549, -1.59850419267017707092, 134.97783931056460460240, 249935.55886070139240473509, 0.99922674504834840814 }, + { 2.58842149958854284009, -1.59850419056543602281, 134.97783931062298279357, 249935.55853169583133421838, 0.99922674505038500126 }, + { 2.58842150075770360829, -1.59850419406187760352, 134.97783931052597949929, 249935.55908163831918500364, 0.99922674504700181863 }, + { 2.58842150169027718221, -1.59850419267108945220, 134.97783931056457618070, 249935.55885453653172589839, 0.99922674504834751996 }, + { 2.59019688120571345280, -1.58958477520588448151, 134.97793836499391773032, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 0 }, 250000, 180, + { 1.00000000000000000000, -2.26091191238511868278, -180.00000000000000000000, 249935.55905595037620514631, 0.99922674639115516282 }, + { 1.00000000000000022204, -2.26091191236402178077, 180.00000000000000000000, 249935.55905951990280300379, 0.99922674639116959572 }, + { 1.00000000000000000000, -2.26091189386641744363, 180.00000000000000000000, 249935.55701571033569052815, 0.99922674640382092015 }, + { 1.00000000000000000000, -2.26091190837723177154, 180.00000000000000000000, 249935.55863258230965584517, 0.99922674639389641449 }, + { 1.00000000000000000000, -2.26091191238511468597, 180.00000000000000000000, 249935.55905603148858062923, 0.99922674639115527384 }, + { 1.00000000000000000000, -2.24830091939884635366, 180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 0 }, 250000, -45, + { -0.58842150169031337548, 1.59850419267109766785, -45.02216068943542381930, 249935.55885449703782796860, 0.99922674504834751996 }, + { -0.58842150168977558344, 1.59850419267017707092, -45.02216068943540250302, 249935.55886070139240473509, 0.99922674504834840814 }, + { -0.58842149958854272906, 1.59850419056543535667, -45.02216068937701010100, 249935.55853169565671123564, 0.99922674505038500126 }, + { -0.58842150075770371931, 1.59850419406187715943, -45.02216068947401339528, 249935.55908163820276968181, 0.99922674504700181863 }, + { -0.58842150169031270934, 1.59850419267109744581, -45.02216068943543092473, 249935.55885453775408677757, 0.99922674504834751996 }, + { -0.59019688120571467405, 1.58958477520588337129, -45.02206163500609648054, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 0 }, 250000, -90, + { -1.24578821029880382198, 0.00000000000000000000, -90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { -1.24578821029880382198, 0.00000000000000013841, -90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { -1.24578821029880382198, 0.00000000000000013841, -90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { -1.24578821029880382198, 0.00000000000000013841, -90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { -1.24578821029880382198, 0.00000000000000013841, -90.00000000000000000000, 249935.55865304186590947211, 0.99922674370552955203 }, + { -1.24830091939884435526, 0.00000000000000013763, -90.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 0 }, 250000, -135, + { -0.58842150169031337548, -1.59850419267109766785, -134.97783931056457618070, 249935.55885449703782796860, 0.99922674504834751996 }, + { -0.58842150168977569447, -1.59850419267017707092, -134.97783931056460460240, 249935.55886070139240473509, 0.99922674504834840814 }, + { -0.58842149958854272906, -1.59850419056543602281, -134.97783931062298279357, 249935.55853169583133421838, 0.99922674505038500126 }, + { -0.58842150075770371931, -1.59850419406187760352, -134.97783931052597949929, 249935.55908163831918500364, 0.99922674504700181863 }, + { -0.58842150169033402562, -1.59850419267108945220, -134.97783931056457618070, 249935.55885453653172589839, 0.99922674504834751996 }, + { -0.59019688120571345280, -1.58958477520588448151, -134.97793836499391773032, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 0 }, 250000, -180, + { 1.00000000000000000000, -2.26091191238511868278, -180.00000000000000000000, 249935.55905595037620514631, 0.99922674639115516282 }, + { 0.99999999999999977796, -2.26091191236402178077, -180.00000000000000000000, 249935.55905951990280300379, 0.99922674639116959572 }, + { 1.00000000000000000000, -2.26091189386641744363, -180.00000000000000000000, 249935.55701571033569052815, 0.99922674640382092015 }, + { 1.00000000000000000000, -2.26091190837723177154, -180.00000000000000000000, 249935.55863258230965584517, 0.99922674639389641449 }, + { 1.00000000000000000000, -2.26091191238511468597, -180.00000000000000000000, 249935.55905603148858062923, 0.99922674639115527384 }, + { 1.00000000000000000000, -2.24830091939884635366, -180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, -1 }, 250000, 0, + { 0.00000000000000000000, 1.26092062918498104551, 0.00000000000000000000, 249935.55872467698645778000, 0.99922674479230122468 }, + { 0.00000000000000000000, 1.26092062916373448545, 0.00000000000000000000, 249935.55872643628390505910, 0.99922674479075712650 }, + { 0.00000000000000000000, 1.26092061053506587776, 0.00000000000000000000, 249935.55666816755547188222, 0.99922674480349771287 }, + { 0.00000000000000000000, 1.26092062023552875516, 0.00000000000000000000, 249935.55774092715000733733, 0.99922674479840822848 }, + { 0.00000000000000000000, 1.26092062918495995127, 0.00000000000000000000, 249935.55872469596215523779, 0.99922674479230122468 }, + { 0.00000000000000000000, 1.24830091939884435526, 0.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, -1 }, 250000, 45, + { 1.58789352027561725400, 0.59889382252477618707, 44.99444098733987829064, 249935.55869720416376367211, 0.99922674484119022864 }, + { 1.58789352027508279264, 0.59889382252384637528, 44.99444098733987118521, 249935.55869934445945546031, 0.99922674484277662632 }, + { 1.58789351816042789700, 0.59889382039736038799, 44.99444098731778751699, 249935.55836710281437262893, 0.99922674484483320345 }, + { 1.58789351933467837164, 0.59889382227058296504, 44.99444098733723507166, 249935.55866038752719759941, 0.99922674484142481877 }, + { 1.58789352027561680991, 0.59889382252477563195, 44.99444098733987829064, 249935.55869721624185331166, 0.99922674484119011762 }, + { 1.58966906957485254459, 0.58996975014221642031, 44.99431096332273227745, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, -1 }, 250000, 90, + { 2.24612766651409989649, -0.99922666842209439952, 89.96080977150054991398, 249935.55891569345840252936, 0.99922674685767398639 }, + { 2.24612766651347328661, -0.99922666842209439952, 89.96080977150054991398, 249935.55891513984533958137, 0.99922674686822765544 }, + { 2.24612766651409945240, -0.99922666842208529570, 89.96080977150032254031, 249935.55891660030465573072, 0.99922674686821844059 }, + { 2.24612766651409812013, -0.99922666841944873806, 89.96080977143354573400, 249935.55934300241642631590, 0.99922674685495815883 }, + { 2.24612766651407858021, -0.99922666842209184601, 89.96080977150054991398, 249935.55891566007630899549, 0.99922674685767387537 }, + { 2.24864304714222296155, -0.99923012194947846698, 89.96076583819413485799, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, -1 }, 250000, 135, + { 1.58943065821228057821, -2.59810442478829362045, 134.95009296248679220298, 249935.55953696221695281565, 0.99922675155892082266 }, + { 1.58943065821171258811, -2.59810442478739078709, 134.95009296248684904640, 249935.55953448649961501360, 0.99922675162094776180 }, + { 1.58943065613921019619, -2.59810442273856878614, 134.95009296257936171060, 249935.55921406237757764757, 0.99922675162293117523 }, + { 1.58943065729835319999, -2.59810443328209572655, 134.95009296210329807764, 249935.56090466637397184968, 0.99922675155085038945 }, + { 1.58943065821226814371, -2.59810442478831138402, 134.95009296248679220298, 249935.55953712956397794187, 0.99922675155892148879 }, + { 1.59120965314639395416, -2.58919942720575324557, 134.95016080642784572774, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, -1 }, 250000, 180, + { 0.00000000000000000000, -3.26088938011404927408, -180.00000000000000000000, 249935.55991226507467217743, 0.99922675429255258805 }, + { 0.00000000000000027540, -3.26088938009322193423, 180.00000000000000000000, 249935.55988221566076390445, 0.99922675435769237051 }, + { 0.00000000000000000000, -3.26088936183515265554, 180.00000000000000000000, 249935.55786483851261436939, 0.99922675437017982603 }, + { 0.00000000000000000000, -3.26088938879229361945, 180.00000000000000000000, 249935.56092769638053141534, 0.99922675428677187881 }, + { 0.00000000000000000000, -3.26088938011400975014, 180.00000000000000000000, 249935.55991249711951240897, 0.99922675429255336521 }, + { 0.00000000000000000000, -3.24830091939884901819, 180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, -1 }, 250000, -45, + { -1.58789352027561725400, 0.59889382252477618707, -44.99444098733987829064, 249935.55869720416376367211, 0.99922674484119022864 }, + { -1.58789352027508279264, 0.59889382252384637528, -44.99444098733987118521, 249935.55869934445945546031, 0.99922674484277662632 }, + { -1.58789351816042789700, 0.59889382039736038799, -44.99444098731778751699, 249935.55836710281437262893, 0.99922674484483320345 }, + { -1.58789351933467837164, 0.59889382227058296504, -44.99444098733723507166, 249935.55866038752719759941, 0.99922674484142481877 }, + { -1.58789352027561680991, 0.59889382252477563195, -44.99444098733987829064, 249935.55869721624185331166, 0.99922674484119011762 }, + { -1.58966906957485254459, 0.58996975014221642031, -44.99431096332273227745, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, -1 }, 250000, -90, + { -2.24612766651409989649, -0.99922666842209439952, -89.96080977150054991398, 249935.55891569345840252936, 0.99922674685767398639 }, + { -2.24612766651347328661, -0.99922666842209439952, -89.96080977150054991398, 249935.55891513984533958137, 0.99922674686822765544 }, + { -2.24612766651409945240, -0.99922666842208529570, -89.96080977150032254031, 249935.55891660030465573072, 0.99922674686821844059 }, + { -2.24612766651409812013, -0.99922666841944873806, -89.96080977143354573400, 249935.55934300241642631590, 0.99922674685495815883 }, + { -2.24612766651407858021, -0.99922666842209184601, -89.96080977150054991398, 249935.55891566007630899549, 0.99922674685767387537 }, + { -2.24864304714222296155, -0.99923012194947846698, -89.96076583819413485799, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, -1 }, 250000, -135, + { -1.58943065821228057821, -2.59810442478829362045, -134.95009296248679220298, 249935.55953696221695281565, 0.99922675155892082266 }, + { -1.58943065821171258811, -2.59810442478739078709, -134.95009296248684904640, 249935.55953448649961501360, 0.99922675162094776180 }, + { -1.58943065613921019619, -2.59810442273856878614, -134.95009296257936171060, 249935.55921406237757764757, 0.99922675162293117523 }, + { -1.58943065729835319999, -2.59810443328209572655, -134.95009296210329807764, 249935.56090466637397184968, 0.99922675155085038945 }, + { -1.58943065821226814371, -2.59810442478831138402, -134.95009296248679220298, 249935.55953712956397794187, 0.99922675155892148879 }, + { -1.59120965314639395416, -2.58919942720575324557, -134.95016080642784572774, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, -1 }, 250000, -180, + { 0.00000000000000000000, -3.26088938011404927408, -180.00000000000000000000, 249935.55991226507467217743, 0.99922675429255258805 }, + { -0.00000000000000027540, -3.26088938009322193423, -180.00000000000000000000, 249935.55988221566076390445, 0.99922675435769237051 }, + { 0.00000000000000000000, -3.26088936183515265554, -180.00000000000000000000, 249935.55786483851261436939, 0.99922675437017982603 }, + { 0.00000000000000000000, -3.26088938879229361945, -180.00000000000000000000, 249935.56092769638053141534, 0.99922675428677187881 }, + { 0.00000000000000000000, -3.26088938011400975014, -180.00000000000000000000, 249935.55991249711951240897, 0.99922675429255336521 }, + { 0.00000000000000000000, -3.24830091939884901819, -180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 1 }, 250000, 0, + { 0.00000000000000000000, 3.26088938011404927408, 0.00000000000000000000, 249935.55991226507467217743, 0.99922675429255258805 }, + { 0.00000000000000000000, 3.26088938009322193423, 0.00000000000000000000, 249935.55988221566076390445, 0.99922675435769237051 }, + { 0.00000000000000000000, 3.26088936183515265554, 0.00000000000000000000, 249935.55786483851261436939, 0.99922675437017982603 }, + { 0.00000000000000000000, 3.26088938879229361945, 0.00000000000000000000, 249935.56092769638053141534, 0.99922675428677187881 }, + { 0.00000000000000000000, 3.26088938011400220063, 0.00000000000000000000, 249935.55991249639191664755, 0.99922675429255336521 }, + { 0.00000000000000000000, 3.24830091939884457730, 0.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 1 }, 250000, 45, + { 1.58943065821228057821, 2.59810442478829362045, 45.04990703751319358616, 249935.55953696221695281565, 0.99922675155892082266 }, + { 1.58943065821171236607, 2.59810442478739123118, 45.04990703751315805903, 249935.55953448649961501360, 0.99922675162094765078 }, + { 1.58943065613921019619, 2.59810442273856923023, 45.04990703742064539483, 249935.55921406255220063031, 0.99922675162293117523 }, + { 1.58943065729835319999, 2.59810443328209572655, 45.04990703789670902779, 249935.56090466640307568014, 0.99922675155085038945 }, + { 1.58943065821227924594, 2.59810442478829228818, 45.04990703751319358616, 249935.55953712644986808300, 0.99922675155892171084 }, + { 1.59120965314638773691, 2.58919942720574303152, 45.04983919357213295598, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 1 }, 250000, 90, + { 2.24612766651409989649, 0.99922666842209439952, 90.03919022849945008602, 249935.55891569345840252936, 0.99922674685767398639 }, + { 2.24612766651347328661, 0.99922666842209484361, 90.03919022849945008602, 249935.55891513981623575091, 0.99922674686822765544 }, + { 2.24612766651409945240, 0.99922666842208562876, 90.03919022849967745969, 249935.55891660030465573072, 0.99922674686821866263 }, + { 2.24612766651409812013, 0.99922666841944918215, 90.03919022856645426600, 249935.55934300230001099408, 0.99922674685495815883 }, + { 2.24612766651412920638, 0.99922666842209206806, 90.03919022849945008602, 249935.55891566010541282594, 0.99922674685767398639 }, + { 2.24864304714222296155, 0.99923012194947880005, 90.03923416180586514201, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 1 }, 250000, 135, + { 1.58789352027561725400, -0.59889382252477618707, 135.00555901266011460393, 249935.55869720416376367211, 0.99922674484119022864 }, + { 1.58789352027508301468, -0.59889382252384604222, 135.00555901266014302564, 249935.55869934437214396894, 0.99922674484277662632 }, + { 1.58789351816042789700, -0.59889382039736038799, 135.00555901268222669387, 249935.55836710284347645938, 0.99922674484483320345 }, + { 1.58789351933467837164, -0.59889382227058296504, 135.00555901266275782291, 249935.55866038758540526032, 0.99922674484142481877 }, + { 1.58789352027559971248, -0.59889382252475087398, 135.00555901266014302564, 249935.55869721240014769137, 0.99922674484119011762 }, + { 1.58966906957488163243, -0.58996975014221753053, 135.00568903667726772255, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 1 }, 250000, 180, + { 0.00000000000000000000, -1.26092062918498104551, -180.00000000000000000000, 249935.55872467698645778000, 0.99922674479230122468 }, + { 0.00000000000000027502, -1.26092062916373448545, 180.00000000000000000000, 249935.55872643628390505910, 0.99922674479075712650 }, + { 0.00000000000000000000, -1.26092061053506587776, 180.00000000000000000000, 249935.55666816755547188222, 0.99922674480349771287 }, + { 0.00000000000000000000, -1.26092062023552875516, 180.00000000000000000000, 249935.55774092715000733733, 0.99922674479840822848 }, + { 0.00000000000000000000, -1.26092062918495328994, 180.00000000000000000000, 249935.55872469520545564592, 0.99922674479230122468 }, + { 0.00000000000000000000, -1.24830091939885789998, 180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 1 }, 250000, -45, + { -1.58943065821228057821, 2.59810442478829362045, -45.04990703751319358616, 249935.55953696221695281565, 0.99922675155892082266 }, + { -1.58943065821171236607, 2.59810442478739123118, -45.04990703751315805903, 249935.55953448649961501360, 0.99922675162094765078 }, + { -1.58943065613921019619, 2.59810442273856923023, -45.04990703742064539483, 249935.55921406255220063031, 0.99922675162293117523 }, + { -1.58943065729835319999, 2.59810443328209572655, -45.04990703789670902779, 249935.56090466640307568014, 0.99922675155085038945 }, + { -1.58943065821227924594, 2.59810442478829228818, -45.04990703751319358616, 249935.55953712644986808300, 0.99922675155892171084 }, + { -1.59120965314638773691, 2.58919942720574303152, -45.04983919357213295598, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 1 }, 250000, -90, + { -2.24612766651409989649, 0.99922666842209439952, -90.03919022849945008602, 249935.55891569345840252936, 0.99922674685767398639 }, + { -2.24612766651347328661, 0.99922666842209484361, -90.03919022849945008602, 249935.55891513981623575091, 0.99922674686822765544 }, + { -2.24612766651409945240, 0.99922666842208562876, -90.03919022849967745969, 249935.55891660030465573072, 0.99922674686821866263 }, + { -2.24612766651409812013, 0.99922666841944918215, -90.03919022856645426600, 249935.55934300230001099408, 0.99922674685495815883 }, + { -2.24612766651412920638, 0.99922666842209206806, -90.03919022849945008602, 249935.55891566010541282594, 0.99922674685767398639 }, + { -2.24864304714222296155, 0.99923012194947880005, -90.03923416180586514201, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 1 }, 250000, -135, + { -1.58789352027561725400, -0.59889382252477618707, -135.00555901266011460393, 249935.55869720416376367211, 0.99922674484119022864 }, + { -1.58789352027508301468, -0.59889382252384604222, -135.00555901266014302564, 249935.55869934437214396894, 0.99922674484277662632 }, + { -1.58789351816042789700, -0.59889382039736038799, -135.00555901268222669387, 249935.55836710284347645938, 0.99922674484483320345 }, + { -1.58789351933467837164, -0.59889382227058296504, -135.00555901266275782291, 249935.55866038758540526032, 0.99922674484142481877 }, + { -1.58789352027559971248, -0.59889382252475087398, -135.00555901266014302564, 249935.55869721240014769137, 0.99922674484119011762 }, + { -1.58966906957488163243, -0.58996975014221753053, -135.00568903667726772255, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 0, 1 }, 250000, -180, + { 0.00000000000000000000, -1.26092062918498104551, -180.00000000000000000000, 249935.55872467698645778000, 0.99922674479230122468 }, + { -0.00000000000000027502, -1.26092062916373448545, -180.00000000000000000000, 249935.55872643628390505910, 0.99922674479075712650 }, + { 0.00000000000000000000, -1.26092061053506587776, -180.00000000000000000000, 249935.55666816755547188222, 0.99922674480349771287 }, + { 0.00000000000000000000, -1.26092062023552875516, -180.00000000000000000000, 249935.55774092715000733733, 0.99922674479840822848 }, + { 0.00000000000000000000, -1.26092062918495328994, -180.00000000000000000000, 249935.55872469520545564592, 0.99922674479230122468 }, + { 0.00000000000000000000, -1.24830091939885789998, -180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, -1 }, 250000, 0, + { -1.00000000000000000000, 1.26092062918498104551, 0.00000000000000000000, 249935.55872467698645778000, 0.99922674479230122468 }, + { -1.00000000000000000000, 1.26092062916373448545, 0.00000000000000000000, 249935.55872643628390505910, 0.99922674479075712650 }, + { -1.00000000000000000000, 1.26092061053506587776, 0.00000000000000000000, 249935.55666816755547188222, 0.99922674480349771287 }, + { -1.00000000000000000000, 1.26092062023552875516, 0.00000000000000000000, 249935.55774092715000733733, 0.99922674479840822848 }, + { -1.00000000000000000000, 1.26092062918495995127, 0.00000000000000000000, 249935.55872469596215523779, 0.99922674479230122468 }, + { -1.00000000000000000000, 1.24830091939884435526, 0.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, -1 }, 250000, 45, + { 0.58789352027561725400, 0.59889382252477618707, 44.99444098733987829064, 249935.55869720416376367211, 0.99922674484119022864 }, + { 0.58789352027508279264, 0.59889382252384637528, 44.99444098733987118521, 249935.55869934445945546031, 0.99922674484277662632 }, + { 0.58789351816042800802, 0.59889382039736038799, 44.99444098731778751699, 249935.55836710281437262893, 0.99922674484483320345 }, + { 0.58789351933467837164, 0.59889382227058296504, 44.99444098733723507166, 249935.55866038752719759941, 0.99922674484142481877 }, + { 0.58789352027561669889, 0.59889382252477563195, 44.99444098733987829064, 249935.55869721624185331166, 0.99922674484119011762 }, + { 0.58966906957485232255, 0.58996975014221642031, 44.99431096332273227745, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, -1 }, 250000, 90, + { 1.24612766651409989649, -0.99922666842209439952, 89.96080977150054991398, 249935.55891569345840252936, 0.99922674685767398639 }, + { 1.24612766651347328661, -0.99922666842209439952, 89.96080977150054991398, 249935.55891513984533958137, 0.99922674686822765544 }, + { 1.24612766651409945240, -0.99922666842208529570, 89.96080977150032254031, 249935.55891660030465573072, 0.99922674686821844059 }, + { 1.24612766651409834218, -0.99922666841944873806, 89.96080977143354573400, 249935.55934300241642631590, 0.99922674685495815883 }, + { 1.24612766651407835816, -0.99922666842209184601, 89.96080977150054991398, 249935.55891566007630899549, 0.99922674685767387537 }, + { 1.24864304714222140724, -0.99923012194947846698, 89.96076583819413485799, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, -1 }, 250000, 135, + { 0.58943065821228057821, -2.59810442478829362045, 134.95009296248679220298, 249935.55953696221695281565, 0.99922675155892082266 }, + { 0.58943065821171258811, -2.59810442478739078709, 134.95009296248684904640, 249935.55953448649961501360, 0.99922675162094776180 }, + { 0.58943065613921030721, -2.59810442273856878614, 134.95009296257936171060, 249935.55921406237757764757, 0.99922675162293117523 }, + { 0.58943065729835331101, -2.59810443328209572655, 134.95009296210329807764, 249935.56090466637397184968, 0.99922675155085038945 }, + { 0.58943065821226814371, -2.59810442478831138402, 134.95009296248679220298, 249935.55953712956397794187, 0.99922675155892148879 }, + { 0.59120965314640527843, -2.58919942720575324557, 134.95016080642784572774, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, -1 }, 250000, 180, + { -1.00000000000000000000, -3.26088938011404927408, -180.00000000000000000000, 249935.55991226507467217743, 0.99922675429255258805 }, + { -0.99999999999999977796, -3.26088938009322193423, 180.00000000000000000000, 249935.55988221566076390445, 0.99922675435769237051 }, + { -1.00000000000000000000, -3.26088936183515265554, 180.00000000000000000000, 249935.55786483851261436939, 0.99922675437017982603 }, + { -1.00000000000000000000, -3.26088938879229361945, 180.00000000000000000000, 249935.56092769638053141534, 0.99922675428677187881 }, + { -1.00000000000000000000, -3.26088938011400975014, 180.00000000000000000000, 249935.55991249711951240897, 0.99922675429255336521 }, + { -0.99999999999998867573, -3.24830091939884901819, 180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, -1 }, 250000, -45, + { -2.58789352027561747605, 0.59889382252477618707, -44.99444098733987829064, 249935.55869720416376367211, 0.99922674484119022864 }, + { -2.58789352027508279264, 0.59889382252384637528, -44.99444098733987118521, 249935.55869934445945546031, 0.99922674484277662632 }, + { -2.58789351816042811905, 0.59889382039736038799, -44.99444098731778751699, 249935.55836710281437262893, 0.99922674484483320345 }, + { -2.58789351933467859368, 0.59889382227058296504, -44.99444098733723507166, 249935.55866038752719759941, 0.99922674484142481877 }, + { -2.58789352027561658787, 0.59889382252477563195, -44.99444098733987829064, 249935.55869721624185331166, 0.99922674484119011762 }, + { -2.58966906957485276664, 0.58996975014221642031, -44.99431096332273227745, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, -1 }, 250000, -90, + { -3.24612766651409989649, -0.99922666842209439952, -89.96080977150054991398, 249935.55891569345840252936, 0.99922674685767398639 }, + { -3.24612766651347328661, -0.99922666842209439952, -89.96080977150054991398, 249935.55891513984533958137, 0.99922674686822765544 }, + { -3.24612766651409989649, -0.99922666842208529570, -89.96080977150032254031, 249935.55891660030465573072, 0.99922674686821844059 }, + { -3.24612766651409812013, -0.99922666841944873806, -89.96080977143354573400, 249935.55934300241642631590, 0.99922674685495815883 }, + { -3.24612766651407813612, -0.99922666842209184601, -89.96080977150054991398, 249935.55891566007630899549, 0.99922674685767387537 }, + { -3.24864304714222429382, -0.99923012194947846698, -89.96076583819413485799, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, -1 }, 250000, -135, + { -2.58943065821228035617, -2.59810442478829362045, -134.95009296248679220298, 249935.55953696221695281565, 0.99922675155892082266 }, + { -2.58943065821171281016, -2.59810442478739078709, -134.95009296248684904640, 249935.55953448649961501360, 0.99922675162094776180 }, + { -2.58943065613921019619, -2.59810442273856878614, -134.95009296257936171060, 249935.55921406237757764757, 0.99922675162293117523 }, + { -2.58943065729835319999, -2.59810443328209572655, -134.95009296210329807764, 249935.56090466637397184968, 0.99922675155085038945 }, + { -2.58943065821226792167, -2.59810442478831138402, -134.95009296248679220298, 249935.55953712956397794187, 0.99922675155892148879 }, + { -2.59120965314638285193, -2.58919942720575324557, -134.95016080642784572774, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, -1 }, 250000, -180, + { -1.00000000000000000000, -3.26088938011404927408, -180.00000000000000000000, 249935.55991226507467217743, 0.99922675429255258805 }, + { -1.00000000000000022204, -3.26088938009322193423, -180.00000000000000000000, 249935.55988221566076390445, 0.99922675435769237051 }, + { -1.00000000000000000000, -3.26088936183515265554, -180.00000000000000000000, 249935.55786483851261436939, 0.99922675437017982603 }, + { -1.00000000000000000000, -3.26088938879229361945, -180.00000000000000000000, 249935.56092769638053141534, 0.99922675428677187881 }, + { -1.00000000000000000000, -3.26088938011400975014, -180.00000000000000000000, 249935.55991249711951240897, 0.99922675429255336521 }, + { -0.99999999999998867573, -3.24830091939884901819, -180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 1 }, 250000, 0, + { -1.00000000000000000000, 3.26088938011404927408, 0.00000000000000000000, 249935.55991226507467217743, 0.99922675429255258805 }, + { -1.00000000000000000000, 3.26088938009322193423, 0.00000000000000000000, 249935.55988221566076390445, 0.99922675435769237051 }, + { -1.00000000000000000000, 3.26088936183515265554, 0.00000000000000000000, 249935.55786483851261436939, 0.99922675437017982603 }, + { -1.00000000000000000000, 3.26088938879229361945, 0.00000000000000000000, 249935.56092769638053141534, 0.99922675428677187881 }, + { -1.00000000000000000000, 3.26088938011400220063, 0.00000000000000000000, 249935.55991249639191664755, 0.99922675429255336521 }, + { -1.00000000000000000000, 3.24830091939884457730, 0.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 1 }, 250000, 45, + { 0.58943065821228057821, 2.59810442478829362045, 45.04990703751319358616, 249935.55953696221695281565, 0.99922675155892082266 }, + { 0.58943065821171236607, 2.59810442478739123118, 45.04990703751315805903, 249935.55953448649961501360, 0.99922675162094765078 }, + { 0.58943065613921030721, 2.59810442273856923023, 45.04990703742064539483, 249935.55921406255220063031, 0.99922675162293117523 }, + { 0.58943065729835331101, 2.59810443328209572655, 45.04990703789670902779, 249935.56090466640307568014, 0.99922675155085038945 }, + { 0.58943065821227913492, 2.59810442478829228818, 45.04990703751319358616, 249935.55953712644986808300, 0.99922675155892171084 }, + { 0.59120965314638784793, 2.58919942720574303152, 45.04983919357213295598, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 1 }, 250000, 90, + { 1.24612766651409989649, 0.99922666842209439952, 90.03919022849945008602, 249935.55891569345840252936, 0.99922674685767398639 }, + { 1.24612766651347328661, 0.99922666842209484361, 90.03919022849945008602, 249935.55891513981623575091, 0.99922674686822765544 }, + { 1.24612766651409945240, 0.99922666842208562876, 90.03919022849967745969, 249935.55891660030465573072, 0.99922674686821866263 }, + { 1.24612766651409834218, 0.99922666841944918215, 90.03919022856645426600, 249935.55934300230001099408, 0.99922674685495815883 }, + { 1.24612766651412942842, 0.99922666842209206806, 90.03919022849945008602, 249935.55891566010541282594, 0.99922674685767398639 }, + { 1.24864304714222140724, 0.99923012194947880005, 90.03923416180586514201, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 1 }, 250000, 135, + { 0.58789352027561725400, -0.59889382252477618707, 135.00555901266011460393, 249935.55869720416376367211, 0.99922674484119022864 }, + { 0.58789352027508301468, -0.59889382252384604222, 135.00555901266014302564, 249935.55869934437214396894, 0.99922674484277662632 }, + { 0.58789351816042800802, -0.59889382039736038799, 135.00555901268222669387, 249935.55836710284347645938, 0.99922674484483320345 }, + { 0.58789351933467837164, -0.59889382227058296504, 135.00555901266275782291, 249935.55866038758540526032, 0.99922674484142481877 }, + { 0.58789352027559971248, -0.59889382252475087398, 135.00555901266014302564, 249935.55869721240014769137, 0.99922674484119011762 }, + { 0.58966906957488163243, -0.58996975014221753053, 135.00568903667726772255, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 1 }, 250000, 180, + { -1.00000000000000000000, -1.26092062918498104551, -180.00000000000000000000, 249935.55872467698645778000, 0.99922674479230122468 }, + { -0.99999999999999977796, -1.26092062916373448545, 180.00000000000000000000, 249935.55872643628390505910, 0.99922674479075712650 }, + { -1.00000000000000000000, -1.26092061053506587776, 180.00000000000000000000, 249935.55666816755547188222, 0.99922674480349771287 }, + { -1.00000000000000000000, -1.26092062023552875516, 180.00000000000000000000, 249935.55774092715000733733, 0.99922674479840822848 }, + { -1.00000000000000000000, -1.26092062918495328994, 180.00000000000000000000, 249935.55872469520545564592, 0.99922674479230122468 }, + { -1.00000000000000000000, -1.24830091939885789998, 180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 1 }, 250000, -45, + { -2.58943065821228035617, 2.59810442478829362045, -45.04990703751319358616, 249935.55953696221695281565, 0.99922675155892082266 }, + { -2.58943065821171236607, 2.59810442478739123118, -45.04990703751315805903, 249935.55953448649961501360, 0.99922675162094765078 }, + { -2.58943065613921019619, 2.59810442273856923023, -45.04990703742064539483, 249935.55921406255220063031, 0.99922675162293117523 }, + { -2.58943065729835319999, 2.59810443328209572655, -45.04990703789670902779, 249935.56090466640307568014, 0.99922675155085038945 }, + { -2.58943065821227902390, 2.59810442478829228818, -45.04990703751319358616, 249935.55953712644986808300, 0.99922675155892171084 }, + { -2.59120965314638818100, 2.58919942720574303152, -45.04983919357213295598, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 1 }, 250000, -90, + { -3.24612766651409989649, 0.99922666842209439952, -90.03919022849945008602, 249935.55891569345840252936, 0.99922674685767398639 }, + { -3.24612766651347328661, 0.99922666842209484361, -90.03919022849945008602, 249935.55891513981623575091, 0.99922674686822765544 }, + { -3.24612766651409989649, 0.99922666842208562876, -90.03919022849967745969, 249935.55891660030465573072, 0.99922674686821866263 }, + { -3.24612766651409812013, 0.99922666841944918215, -90.03919022856645426600, 249935.55934300230001099408, 0.99922674685495815883 }, + { -3.24612766651412920638, 0.99922666842209206806, -90.03919022849945008602, 249935.55891566010541282594, 0.99922674685767398639 }, + { -3.24864304714222429382, 0.99923012194947880005, -90.03923416180586514201, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 1 }, 250000, -135, + { -2.58789352027561747605, -0.59889382252477618707, -135.00555901266011460393, 249935.55869720416376367211, 0.99922674484119022864 }, + { -2.58789352027508279264, -0.59889382252384604222, -135.00555901266014302564, 249935.55869934437214396894, 0.99922674484277662632 }, + { -2.58789351816042811905, -0.59889382039736038799, -135.00555901268222669387, 249935.55836710284347645938, 0.99922674484483320345 }, + { -2.58789351933467859368, -0.59889382227058296504, -135.00555901266275782291, 249935.55866038758540526032, 0.99922674484142481877 }, + { -2.58789352027559971248, -0.59889382252475087398, -135.00555901266014302564, 249935.55869721240014769137, 0.99922674484119011762 }, + { -2.58966906957482478902, -0.58996975014221753053, -135.00568903667726772255, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { -1, 1 }, 250000, -180, + { -1.00000000000000000000, -1.26092062918498104551, -180.00000000000000000000, 249935.55872467698645778000, 0.99922674479230122468 }, + { -1.00000000000000022204, -1.26092062916373448545, -180.00000000000000000000, 249935.55872643628390505910, 0.99922674479075712650 }, + { -1.00000000000000000000, -1.26092061053506587776, -180.00000000000000000000, 249935.55666816755547188222, 0.99922674480349771287 }, + { -1.00000000000000000000, -1.26092062023552875516, -180.00000000000000000000, 249935.55774092715000733733, 0.99922674479840822848 }, + { -1.00000000000000000000, -1.26092062918495328994, -180.00000000000000000000, 249935.55872469520545564592, 0.99922674479230122468 }, + { -1.00000000000000000000, -1.24830091939885789998, -180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 1 }, 250000, 0, + { 1.00000000000000000000, 3.26088938011404927408, 0.00000000000000000000, 249935.55991226507467217743, 0.99922675429255258805 }, + { 1.00000000000000000000, 3.26088938009322193423, 0.00000000000000000000, 249935.55988221566076390445, 0.99922675435769237051 }, + { 1.00000000000000000000, 3.26088936183515265554, 0.00000000000000000000, 249935.55786483851261436939, 0.99922675437017982603 }, + { 1.00000000000000000000, 3.26088938879229361945, 0.00000000000000000000, 249935.56092769638053141534, 0.99922675428677187881 }, + { 1.00000000000000000000, 3.26088938011400220063, 0.00000000000000000000, 249935.55991249639191664755, 0.99922675429255336521 }, + { 1.00000000000000000000, 3.24830091939884457730, 0.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 1 }, 250000, 45, + { 2.58943065821228035617, 2.59810442478829362045, 45.04990703751319358616, 249935.55953696221695281565, 0.99922675155892082266 }, + { 2.58943065821171236607, 2.59810442478739123118, 45.04990703751315805903, 249935.55953448649961501360, 0.99922675162094765078 }, + { 2.58943065613921019619, 2.59810442273856923023, 45.04990703742064539483, 249935.55921406255220063031, 0.99922675162293117523 }, + { 2.58943065729835319999, 2.59810443328209572655, 45.04990703789670902779, 249935.56090466640307568014, 0.99922675155085038945 }, + { 2.58943065821227902390, 2.59810442478829228818, 45.04990703751319358616, 249935.55953712644986808300, 0.99922675155892171084 }, + { 2.59120965314638818100, 2.58919942720574303152, 45.04983919357213295598, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 1 }, 250000, 90, + { 3.24612766651409989649, 0.99922666842209439952, 90.03919022849945008602, 249935.55891569345840252936, 0.99922674685767398639 }, + { 3.24612766651347328661, 0.99922666842209484361, 90.03919022849945008602, 249935.55891513981623575091, 0.99922674686822765544 }, + { 3.24612766651409989649, 0.99922666842208562876, 90.03919022849967745969, 249935.55891660030465573072, 0.99922674686821866263 }, + { 3.24612766651409812013, 0.99922666841944918215, 90.03919022856645426600, 249935.55934300230001099408, 0.99922674685495815883 }, + { 3.24612766651412920638, 0.99922666842209206806, 90.03919022849945008602, 249935.55891566010541282594, 0.99922674685767398639 }, + { 3.24864304714222429382, 0.99923012194947880005, 90.03923416180586514201, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 1 }, 250000, 135, + { 2.58789352027561747605, -0.59889382252477618707, 135.00555901266011460393, 249935.55869720416376367211, 0.99922674484119022864 }, + { 2.58789352027508279264, -0.59889382252384604222, 135.00555901266014302564, 249935.55869934437214396894, 0.99922674484277662632 }, + { 2.58789351816042811905, -0.59889382039736038799, 135.00555901268222669387, 249935.55836710284347645938, 0.99922674484483320345 }, + { 2.58789351933467859368, -0.59889382227058296504, 135.00555901266275782291, 249935.55866038758540526032, 0.99922674484142481877 }, + { 2.58789352027559971248, -0.59889382252475087398, 135.00555901266014302564, 249935.55869721240014769137, 0.99922674484119011762 }, + { 2.58966906957482478902, -0.58996975014221753053, 135.00568903667726772255, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 1 }, 250000, 180, + { 1.00000000000000000000, -1.26092062918498104551, -180.00000000000000000000, 249935.55872467698645778000, 0.99922674479230122468 }, + { 1.00000000000000022204, -1.26092062916373448545, 180.00000000000000000000, 249935.55872643628390505910, 0.99922674479075712650 }, + { 1.00000000000000000000, -1.26092061053506587776, 180.00000000000000000000, 249935.55666816755547188222, 0.99922674480349771287 }, + { 1.00000000000000000000, -1.26092062023552875516, 180.00000000000000000000, 249935.55774092715000733733, 0.99922674479840822848 }, + { 1.00000000000000000000, -1.26092062918495328994, 180.00000000000000000000, 249935.55872469520545564592, 0.99922674479230122468 }, + { 1.00000000000000000000, -1.24830091939885789998, 180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 1 }, 250000, -45, + { -0.58943065821228057821, 2.59810442478829362045, -45.04990703751319358616, 249935.55953696221695281565, 0.99922675155892082266 }, + { -0.58943065821171236607, 2.59810442478739123118, -45.04990703751315805903, 249935.55953448649961501360, 0.99922675162094765078 }, + { -0.58943065613921030721, 2.59810442273856923023, -45.04990703742064539483, 249935.55921406255220063031, 0.99922675162293117523 }, + { -0.58943065729835331101, 2.59810443328209572655, -45.04990703789670902779, 249935.56090466640307568014, 0.99922675155085038945 }, + { -0.58943065821227913492, 2.59810442478829228818, -45.04990703751319358616, 249935.55953712644986808300, 0.99922675155892171084 }, + { -0.59120965314638784793, 2.58919942720574303152, -45.04983919357213295598, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 1 }, 250000, -90, + { -1.24612766651409989649, 0.99922666842209439952, -90.03919022849945008602, 249935.55891569345840252936, 0.99922674685767398639 }, + { -1.24612766651347328661, 0.99922666842209484361, -90.03919022849945008602, 249935.55891513981623575091, 0.99922674686822765544 }, + { -1.24612766651409945240, 0.99922666842208562876, -90.03919022849967745969, 249935.55891660030465573072, 0.99922674686821866263 }, + { -1.24612766651409834218, 0.99922666841944918215, -90.03919022856645426600, 249935.55934300230001099408, 0.99922674685495815883 }, + { -1.24612766651412942842, 0.99922666842209206806, -90.03919022849945008602, 249935.55891566010541282594, 0.99922674685767398639 }, + { -1.24864304714222140724, 0.99923012194947880005, -90.03923416180586514201, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 1 }, 250000, -135, + { -0.58789352027561725400, -0.59889382252477618707, -135.00555901266011460393, 249935.55869720416376367211, 0.99922674484119022864 }, + { -0.58789352027508301468, -0.59889382252384604222, -135.00555901266014302564, 249935.55869934437214396894, 0.99922674484277662632 }, + { -0.58789351816042800802, -0.59889382039736038799, -135.00555901268222669387, 249935.55836710284347645938, 0.99922674484483320345 }, + { -0.58789351933467837164, -0.59889382227058296504, -135.00555901266275782291, 249935.55866038758540526032, 0.99922674484142481877 }, + { -0.58789352027559971248, -0.59889382252475087398, -135.00555901266014302564, 249935.55869721240014769137, 0.99922674484119011762 }, + { -0.58966906957488163243, -0.58996975014221753053, -135.00568903667726772255, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, 1 }, 250000, -180, + { 1.00000000000000000000, -1.26092062918498104551, -180.00000000000000000000, 249935.55872467698645778000, 0.99922674479230122468 }, + { 0.99999999999999977796, -1.26092062916373448545, -180.00000000000000000000, 249935.55872643628390505910, 0.99922674479075712650 }, + { 1.00000000000000000000, -1.26092061053506587776, -180.00000000000000000000, 249935.55666816755547188222, 0.99922674480349771287 }, + { 1.00000000000000000000, -1.26092062023552875516, -180.00000000000000000000, 249935.55774092715000733733, 0.99922674479840822848 }, + { 1.00000000000000000000, -1.26092062918495328994, -180.00000000000000000000, 249935.55872469520545564592, 0.99922674479230122468 }, + { 1.00000000000000000000, -1.24830091939885789998, -180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, -1 }, 250000, 0, + { 1.00000000000000000000, 1.26092062918498104551, 0.00000000000000000000, 249935.55872467698645778000, 0.99922674479230122468 }, + { 1.00000000000000000000, 1.26092062916373448545, 0.00000000000000000000, 249935.55872643628390505910, 0.99922674479075712650 }, + { 1.00000000000000000000, 1.26092061053506587776, 0.00000000000000000000, 249935.55666816755547188222, 0.99922674480349771287 }, + { 1.00000000000000000000, 1.26092062023552875516, 0.00000000000000000000, 249935.55774092715000733733, 0.99922674479840822848 }, + { 1.00000000000000000000, 1.26092062918495995127, 0.00000000000000000000, 249935.55872469596215523779, 0.99922674479230122468 }, + { 1.00000000000000000000, 1.24830091939884435526, 0.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, -1 }, 250000, 45, + { 2.58789352027561747605, 0.59889382252477618707, 44.99444098733987829064, 249935.55869720416376367211, 0.99922674484119022864 }, + { 2.58789352027508279264, 0.59889382252384637528, 44.99444098733987118521, 249935.55869934445945546031, 0.99922674484277662632 }, + { 2.58789351816042811905, 0.59889382039736038799, 44.99444098731778751699, 249935.55836710281437262893, 0.99922674484483320345 }, + { 2.58789351933467859368, 0.59889382227058296504, 44.99444098733723507166, 249935.55866038752719759941, 0.99922674484142481877 }, + { 2.58789352027561658787, 0.59889382252477563195, 44.99444098733987829064, 249935.55869721624185331166, 0.99922674484119011762 }, + { 2.58966906957485276664, 0.58996975014221642031, 44.99431096332273227745, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, -1 }, 250000, 90, + { 3.24612766651409989649, -0.99922666842209439952, 89.96080977150054991398, 249935.55891569345840252936, 0.99922674685767398639 }, + { 3.24612766651347328661, -0.99922666842209439952, 89.96080977150054991398, 249935.55891513984533958137, 0.99922674686822765544 }, + { 3.24612766651409989649, -0.99922666842208529570, 89.96080977150032254031, 249935.55891660030465573072, 0.99922674686821844059 }, + { 3.24612766651409812013, -0.99922666841944873806, 89.96080977143354573400, 249935.55934300241642631590, 0.99922674685495815883 }, + { 3.24612766651407813612, -0.99922666842209184601, 89.96080977150054991398, 249935.55891566007630899549, 0.99922674685767387537 }, + { 3.24864304714222429382, -0.99923012194947846698, 89.96076583819413485799, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, -1 }, 250000, 135, + { 2.58943065821228035617, -2.59810442478829362045, 134.95009296248679220298, 249935.55953696221695281565, 0.99922675155892082266 }, + { 2.58943065821171281016, -2.59810442478739078709, 134.95009296248684904640, 249935.55953448649961501360, 0.99922675162094776180 }, + { 2.58943065613921019619, -2.59810442273856878614, 134.95009296257936171060, 249935.55921406237757764757, 0.99922675162293117523 }, + { 2.58943065729835319999, -2.59810443328209572655, 134.95009296210329807764, 249935.56090466637397184968, 0.99922675155085038945 }, + { 2.58943065821226792167, -2.59810442478831138402, 134.95009296248679220298, 249935.55953712956397794187, 0.99922675155892148879 }, + { 2.59120965314638285193, -2.58919942720575324557, 134.95016080642784572774, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, -1 }, 250000, 180, + { 1.00000000000000000000, -3.26088938011404927408, -180.00000000000000000000, 249935.55991226507467217743, 0.99922675429255258805 }, + { 1.00000000000000022204, -3.26088938009322193423, 180.00000000000000000000, 249935.55988221566076390445, 0.99922675435769237051 }, + { 1.00000000000000000000, -3.26088936183515265554, 180.00000000000000000000, 249935.55786483851261436939, 0.99922675437017982603 }, + { 1.00000000000000000000, -3.26088938879229361945, 180.00000000000000000000, 249935.56092769638053141534, 0.99922675428677187881 }, + { 1.00000000000000000000, -3.26088938011400975014, 180.00000000000000000000, 249935.55991249711951240897, 0.99922675429255336521 }, + { 0.99999999999998867573, -3.24830091939884901819, 180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, -1 }, 250000, -45, + { -0.58789352027561725400, 0.59889382252477618707, -44.99444098733987829064, 249935.55869720416376367211, 0.99922674484119022864 }, + { -0.58789352027508279264, 0.59889382252384637528, -44.99444098733987118521, 249935.55869934445945546031, 0.99922674484277662632 }, + { -0.58789351816042800802, 0.59889382039736038799, -44.99444098731778751699, 249935.55836710281437262893, 0.99922674484483320345 }, + { -0.58789351933467837164, 0.59889382227058296504, -44.99444098733723507166, 249935.55866038752719759941, 0.99922674484142481877 }, + { -0.58789352027561669889, 0.59889382252477563195, -44.99444098733987829064, 249935.55869721624185331166, 0.99922674484119011762 }, + { -0.58966906957485232255, 0.58996975014221642031, -44.99431096332273227745, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, -1 }, 250000, -90, + { -1.24612766651409989649, -0.99922666842209439952, -89.96080977150054991398, 249935.55891569345840252936, 0.99922674685767398639 }, + { -1.24612766651347328661, -0.99922666842209439952, -89.96080977150054991398, 249935.55891513984533958137, 0.99922674686822765544 }, + { -1.24612766651409945240, -0.99922666842208529570, -89.96080977150032254031, 249935.55891660030465573072, 0.99922674686821844059 }, + { -1.24612766651409834218, -0.99922666841944873806, -89.96080977143354573400, 249935.55934300241642631590, 0.99922674685495815883 }, + { -1.24612766651407835816, -0.99922666842209184601, -89.96080977150054991398, 249935.55891566007630899549, 0.99922674685767387537 }, + { -1.24864304714222140724, -0.99923012194947846698, -89.96076583819413485799, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, -1 }, 250000, -135, + { -0.58943065821228057821, -2.59810442478829362045, -134.95009296248679220298, 249935.55953696221695281565, 0.99922675155892082266 }, + { -0.58943065821171258811, -2.59810442478739078709, -134.95009296248684904640, 249935.55953448649961501360, 0.99922675162094776180 }, + { -0.58943065613921030721, -2.59810442273856878614, -134.95009296257936171060, 249935.55921406237757764757, 0.99922675162293117523 }, + { -0.58943065729835331101, -2.59810443328209572655, -134.95009296210329807764, 249935.56090466637397184968, 0.99922675155085038945 }, + { -0.58943065821226814371, -2.59810442478831138402, -134.95009296248679220298, 249935.55953712956397794187, 0.99922675155892148879 }, + { -0.59120965314640527843, -2.58919942720575324557, -134.95016080642784572774, 0.00000000000000000000, 1.00000000000000000000 } + },{ + { 1, -1 }, 250000, -180, + { 1.00000000000000000000, -3.26088938011404927408, -180.00000000000000000000, 249935.55991226507467217743, 0.99922675429255258805 }, + { 0.99999999999999977796, -3.26088938009322193423, -180.00000000000000000000, 249935.55988221566076390445, 0.99922675435769237051 }, + { 1.00000000000000000000, -3.26088936183515265554, -180.00000000000000000000, 249935.55786483851261436939, 0.99922675437017982603 }, + { 1.00000000000000000000, -3.26088938879229361945, -180.00000000000000000000, 249935.56092769638053141534, 0.99922675428677187881 }, + { 1.00000000000000000000, -3.26088938011400975014, -180.00000000000000000000, 249935.55991249711951240897, 0.99922675429255336521 }, + { 0.99999999999998867573, -3.24830091939884901819, -180.00000000000000000000, 0.00000000000000000000, 1.00000000000000000000 } + } + +}; + +size_t const expected_size = sizeof(expected) / sizeof(expected_results); +#endif // BOOST_GEOMETRY_TEST_DIRECT_CASES_HPP diff --git a/src/boost/libs/geometry/test/formulas/direct_cases_antipodal.hpp b/src/boost/libs/geometry/test/formulas/direct_cases_antipodal.hpp new file mode 100644 index 000000000..c6ba85248 --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/direct_cases_antipodal.hpp @@ -0,0 +1,343 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2018 Adeel Ahmad, Islamabad, Pakistan. + +// Contributed and/or modified by Adeel Ahmad, as part of Google Summer of Code 2018 program. + +// 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) + +#ifndef BOOST_GEOMETRY_TEST_DIRECT_CASES_ANTIPODAL_HPP +#define BOOST_GEOMETRY_TEST_DIRECT_CASES_ANTIPODAL_HPP + +#include "direct_cases.hpp" + +struct expected_results_antipodal +{ + coordinates p1; + double distance; + double azimuth12; + expected_result karney; +}; + +/* + These values are collected from GeodTest which is associated with GeographicLib: + https://zenodo.org/record/32156 + + The conversion to C++ array format is done using this Python script: + https://github.com/adl1995/boost-geometry-extra/blob/master/geographicLib-dataset-parse.py + + Geodesic scale (M12) is absent from the GeodTest dataset, so it is manually generated + using GeographicLib through this C++ script: + https://github.com/adl1995/boost-geometry-extra/blob/master/geographicLib-direct-antipodal.cpp +*/ +expected_results_antipodal expected_antipodal[] = +{ + { + { 0, 31.394417440639 }, 19980218.4055399, 34.266322930672, + { 179.615601631202912322, -31.275540610835465807, 145.782701113414306756, 49490.8807994496209, -0.996116451012525883079717914370121434 } + },{ + { 0, 29.788792273749 }, 19887224.5407334, 74.302205994192, + { 178.569451327813675741, -29.558013672069422725, 106.156240654579267308, 97043.7545600593058, -0.998624031147844926081802441331092268 } + },{ + { 0, 46.471843094141 }, 19944337.8863917, 63.693680310665, + { 179.083144618009561276, -46.284166405924629853, 116.699978859005570535, 53139.140576552365, -0.997597309645591900917338534782174975 } + },{ + { 0, 63.016506345929 }, 20000925.7533636, 153.393656073038, + { 179.862869954071637855, -63.02943882703369735, 26.619056019474552953, 12713.9284725111772, -1.00381317792143387457315384381217882 } + },{ + { 0, 19.796231412719 }, 19956338.1330537, 28.272934411318, + { 179.546498474461283862, -19.470586923091672503, 151.789094611690988249, 87191.1749625132931, -0.997015409027664833985227232915349305 } + },{ + { 0, 6.373459459035 }, 19946581.6983394, 56.859050230583, + { 179.240009269347556917, -6.204887833274217382, 123.169200847008284851, 53958.8698005263939, -0.999349049081101004077254401636309922 } + },{ + { 0, 66.380766469414 }, 19986277.7696849, 38.646950203356, + { 179.632633596894388233, -66.27177494016956425, 141.550919825824399405, 22198.215635049214, -0.996949176054954366854587988200364634 } + },{ + { 0, 16.483421185231 }, 19962737.9842573, 163.431254767325, + { 179.731567273052604726, -16.818424446748042212, 16.598399455529231288, 95318.4104529881431, -1.00272210232979741562076014815829694 } + },{ + { 0, 4.215702155486 }, 19932517.393764, 65.543168480886, + { 179.093771177769992874, -4.051917290690976764, 114.482669479963380006, 55205.4553703842317, -0.999655858425056553784315838129259646 } + },{ + { 0, 40.71372085907 }, 19951133.3595356, 143.672151631634, + { 179.404612926861498984, -41.047052242159400671, 36.54002600969304553, 70931.1530155553621, -1.00414169574077272173440178448799998 } + },{ + { 0, 15.465481491654 }, 19877383.8879911, 36.289185640976, + { 179.020726605204181801, -14.622355549425900341, 143.875673907461159912, 156419.0806764376957, -0.997639074397169589580869342171354219 } + },{ + { 0, 17.586197343531 }, 19982280.4639115, 157.929615091529, + { 179.722490735835379144, -17.731394230364437075, 22.089021105298661023, 69727.5357849255557, -1.00280451698301242835498214844847098 } + },{ + { 0, 5.7442768247 }, 19902873.7431814, 116.146983678305, + { 178.85894724576868462, -6.039853564481335581, 63.91482549951374061, 87149.6188944111673, -1.00039332893096744037109147029696032 } + },{ + { 0, 32.002904282111 }, 19967670.3104795, 163.052160078191, + { 179.744925422107715439, -32.297934520693132807, 17.004175883388454943, 78311.3164829640582, -1.00449903445302446414189034840092063 } + },{ + { 0, 55.902716926362 }, 19970525.337607, 98.927641063414, + { 179.300685189522463007, -55.934320218634018206, 81.374264168520557301, 23554.0093185709067, -1.00072788779083454713259015989024192 } + },{ + { 0, 22.69939784398 }, 19959286.1903172, 74.253870776761, + { 179.294173474584020749, -22.654875407651067149, 105.811588890213155275, 22369.7179951557679, -0.998972181419003457669703038845909759 } + },{ + { 0, 41.312328471121 }, 19962690.5721867, 11.277616109847, + { 179.817186837717804928, -40.954523601529804886, 168.784288786443902199, 77252.6121237260201, -0.994825151471527391322524636052548885 } + },{ + { 0, 27.927415327453 }, 19961296.8828333, 23.166421459647, + { 179.636508875679110143, -27.607314264234172721, 156.905194492817275222, 83096.5801709291101, -0.995959692767656723511038308060960844 } + },{ + { 0, 41.567228741451 }, 19944253.4454809, 176.66609526064, + { 179.931812964300204608, -42.103039532074194347, 3.361859685835349219, 96859.08180779197, -1.00513607140487626345759508694754913 } + },{ + { 0, 37.384208978567 }, 19928705.5911445, 39.072534864532, + { 179.225180174670992261, -36.916085670712060029, 141.212743814390850106, 92667.7834060578402, -0.995955516859159284415170532156480476 } + },{ + { 0, 59.011868682852 }, 19970442.3788306, 44.970301291063, + { 179.424923485514312807, -58.82705468054708336, 135.333817989802309531, 38071.1136293083857, -0.996658942892707400140750451100757346 } + },{ + { 0, 35.515406087737 }, 19948918.9139751, 28.528972431952, + { 179.50369572149476218, -35.119747127350258822, 151.622257906284404073, 84564.0387217601751, -0.995562861799169418475230486365035176 } + },{ + { 0, 58.170252463184 }, 19961407.0813807, 128.021116291844, + { 179.254737571455023977, -58.372261836268550805, 52.399129705193347143, 43715.3070711393309, -1.00285273713280753682397516968194395 } + },{ + { 0, 34.012183807959 }, 19970955.843065, 168.944519134772, + { 179.83713352180447672, -34.29640782899529639, 11.093048811826875835, 76493.5814538538151, -1.0047652354558671561335359001532197 } + },{ + { 0, 45.510762948553 }, 19940248.3450143, 99.886784003837, + { 178.981682578823726535, -45.582753595227824235, 80.542330522982505877, 48555.1946627894972, -1.00083807750906350619857221317943186 } + },{ + { 0, 4.19841765451 }, 19970496.5132933, 89.561550657928, + { 179.398024428225540172, -4.198416896099783242, 90.438456568689151881, 14.8790480103109, -0.999994104810285944218151144013972953 } + },{ + { 0, 40.890119148103 }, 19926563.5817492, 165.437641169967, + { 179.6557148951668192, -41.553556264538302258, 14.713597527941311478, 111805.7305227545923, -1.00492294933406567380984597548376769 } + },{ + { 0, 28.096672787686 }, 19883901.8482359, 115.174366374632, + { 178.606868012231657724, -28.472055035513955205, 65.257367020445564176, 107880.4353518862363, -1.00170803073331593502359737613005564 } + },{ + { 0, 6.50572154271 }, 19917276.4101551, 79.069492719523, + { 178.926013840891647541, -6.411745140559297675, 100.985091481519557845, 57073.3242952680707, -0.999736666933808471036115861352300271 } + },{ + { 0, .468835109567 }, 19849380.7342734, 80.234636214474, + { 178.325942223692180692, -.281751687044281805, 99.77243368342786593, 123845.4568822078908, -0.999801437209140719808431185811059549 } + },{ + { 0, 1.682746325049 }, 19890026.0274781, 10.076182752451, + { 179.717131561406935483, -.677647430701204515, 169.927471515299313238, 177917.2104306563981, -0.999538055691262194990542866435134783 } + },{ + { 0, 10.711305126218 }, 19962987.2134077, 7.528253696796, + { 179.874050163405229937, -10.349315378531556046, 172.480576051850009046, 104175.1095378254456, -0.998071853755238880268052525934763253 } + },{ + { 0, 53.374321544652 }, 19980478.1457438, 23.324715976877, + { 179.729445806011012057, -53.196257519024042184, 156.777734080146664812, 41907.8869272231053, -0.995333596277707566279957518418086693 } + },{ + { 0, 39.680221664519 }, 19956191.7841809, 7.075406493429, + { 179.87506206720154785, -39.256187213040660911, 172.967624741991546131, 86943.8110669895148, -0.994801087909667924868983845954062417 } + },{ + { 0, 1.377666714083 }, 19925401.4931301, 95.29199069739, + { 178.994542525209058878, -1.415358715570225495, 84.7178724483824156, 45800.9140624827059, -0.99999803170512457928253979844157584 } + },{ + { 0, 48.751426624188 }, 19988599.1160495, 40.252328570137, + { 179.661697715070846977, -48.688146707479475147, 139.808452951157199824, 26322.3790862461568, -0.995999245724129789181233718409202993 } + },{ + { 0, 59.443039048494 }, 19969935.9534732, 93.052184108221, + { 179.247605418616998285, -59.454371825393424121, 87.331416513795326158, 25342.4691896499534, -1.00020727848897084122370415570912883 } + },{ + { 0, 4.122408476235 }, 19938291.6332293, 167.73479753304, + { 179.749430572914989772, -4.689124208743755363, 12.274635577599782826, 127855.6475863583497, -1.00068600902837667732114823593292385 } + },{ + { 0, 46.422470082432 }, 19931980.7029341, 86.67365350297, + { 178.857408435141563774, -46.390934261324541952, 93.852683224054943377, 56114.680046867064, -0.999607096116300386512421027873642743 } + },{ + { 0, 32.614423729024 }, 19926887.3785175, 24.943814520557, + { 179.460593512880455451, -32.01874745886238612, 155.229917137448282531, 112355.3319340873104, -0.995562150676871926435751447570510209 } + },{ + { 0, 3.242895277973 }, 19964490.4789049, 30.247458779683, + { 179.556428318080663113, -3.001106476068264917, 149.760178923092147784, 80929.0418317066044, -0.999474184270344845337774586369050667 } + },{ + { 0, 6.29069210113 }, 19877160.8505733, 94.34299459284, + { 178.556859259685624933, -6.354208910915346725, 85.750059038253282986, 94127.1566760840083, -0.999976397350904933070125935046235099 } + },{ + { 0, 18.232086569498 }, 19927978.7462175, 164.41905055334, + { 179.658073278238477245, -18.87394850776853555, 15.640779355822506503, 129771.1882449660559, -1.00293460439063886191490837518358603 } + },{ + { 0, 12.049849333181 }, 19908004.4552909, 9.418096768309, + { 179.761046682699610657, -11.201990279782499264, 170.610608272305604585, 157761.5040571466343, -0.997761474497510958414636661473196 } + },{ + { 0, 40.289465276136 }, 19985674.936106, 143.092606818963, + { 179.644208494155329095, -40.370034926441385999, 36.958610382613096419, 36200.8933724688593, -1.00414965876091266672176516294712201 } + },{ + { 0, 2.197784650379 }, 19910509.7517973, 1.542117609437, + { 179.961199531084784854, -1.353440827124394777, 178.458582198505846426, 160403.6285079348996, -0.999488724639301051588802238256903365 } + },{ + { 0, 1.966575272177 }, 19875595.6267266, 170.112968791865, + { 179.699817324905962184, -3.101125282483752618, 9.89572776349855838, 192355.7206665719908, -1.00015463589804554089823795948177576 } + },{ + { 0, 25.078832492684 }, 19887997.7953866, 77.264585323781, + { 178.600804840925824646, -24.897833702325682511, 103.101167809583406892, 92442.9124509225839, -0.998981189838600847075156252685701475 } + },{ + { 0, 31.740361941314 }, 19972325.3556069, 143.930820896999, + { 179.553485210731879874, -31.909206787477701871, 36.145242998351638503, 54883.4113710054145, -1.00379461628115951299378139083273709 } + },{ + { 0, .05479250563 }, 19858049.4780499, 41.349430623518, + { 178.822647462220726609, .836079031223269324, 138.645259065012502544, 169078.442370111714, -0.9997793696948588104689292777038645 } + },{ + { 0, 36.685139871608 }, 19968965.6773632, 89.167975517493, + { 179.366667224014334712, -36.6833040833258687, 90.921025521408327068, 13327.2156799476918, -0.999916537946348604748436628142371774 } + },{ + { 0, 3.451199399671 }, 19938203.3838544, 91.541212417048, + { 179.107509334399258305, -3.459003521120242021, 88.476282464773035164, 32316.1747698810781, -1.00000397484395819880376166111091152 } + },{ + { 0, 27.692898794247 }, 19883493.6699045, 88.406440883665, + { 178.512356615673144314, -27.666009301228316555, 92.036345087713397961, 94128.7880896190836, -0.999736458322951659916100197733612731 } + },{ + { 0, 17.363238291869 }, 19980749.7638027, 39.697196316589, + { 179.567921315455829491, -17.288872648596950413, 140.321938237586060826, 46975.9359427664379, -0.997687691981715030209443284547887743 } + },{ + { 0, 37.006775102539 }, 19949309.9180043, 116.455543532607, + { 179.191103068859169842, -37.156365616364686838, 63.771817992036617793, 45856.1961421018701, -1.00221962858918423044940482213860378 } + },{ + { 0, 45.572883540957 }, 19940027.8586414, 137.627256708444, + { 179.224707765088686272, -45.94675931323086696, 42.723991162977357301, 74208.4359612889496, -1.00380887786447159371050474874209613 } + },{ + { 0, 43.63393981955 }, 19931045.2914508, 91.203625101465, + { 178.878236417027994157, -43.642335115130514773, 89.268780774643462256, 55253.5406349861764, -1.00002974153150514524668324156664312 } + },{ + { 0, 38.4995307019 }, 19918391.2222193, 141.232864609445, + { 179.143856004445269342, -39.042223438550921467, 39.117947060740562295, 102217.2563106863077, -1.00388164115732947401227193040540442 } + },{ + { 0, 27.55015339382 }, 19986004.7358853, 137.025135713548, + { 179.596220103573824099, -27.587412128122249651, 42.992898351962011956, 33938.7346646670654, -1.00316044390281167153489150223322213 } + },{ + { 0, 1.54507498314 }, 19978593.3191777, 36.816106412092, + { 179.567115633151308577, -1.448861185025252004, 143.185763012309022403, 56320.5800276739168, -0.999770499462467210349814195069484413 } + },{ + { 0, 45.217063644222 }, 19987042.0782465, 18.114645812265, + { 179.807382581661125, -45.086424050571516283, 161.928120141429818658, 45544.2915061261936, -0.994974179414854997816064496873877943 } + },{ + { 0, 13.473522450751 }, 19987364.078382, 156.839609002403, + { 179.726941062277208626, -13.570372758027936877, 23.170293747820406391, 65329.9068132034472, -1.00219093189506569530067281448282301 } + },{ + { 0, 6.287741997374 }, 19912159.8245954, 132.954797451112, + { 179.071252372259552052, -6.743450924917895817, 47.100789519677419746, 104772.4027498097375, -1.00071252411103017720961361192166805 } + },{ + { 0, 7.639709001531 }, 19976374.3699535, 29.731916588299, + { 179.616156296978583335, -7.48702643786017917, 150.279582966919438164, 69224.6591757209539, -0.998789792086741234911073661351110786 } + },{ + { 0, 5.893688050348 }, 19886907.2520668, 14.653438882877, + { 179.586212000450856399, -4.888408917114795625, 165.371181401863458848, 177183.5330818593022, -0.998794647031120752522781458537792787 } + },{ + { 0, 61.997076235476 }, 19976288.2901729, 149.562797049254, + { 179.605779116829636081, -62.19593758437129915, 30.65850204223272625, 36696.2853801462176, -1.00373071432437144245852778112748638 } + },{ + { 0, 50.507637741656 }, 19979542.5263293, 171.564028344478, + { 179.893569206021038536, -50.721890799900161112, 8.4746613464253591, 50644.5234828162697, -1.00508881632281776852266830246662721 } + },{ + { 0, 7.484475238477 }, 19867425.2906303, 57.020570370985, + { 178.638400003000590878, -6.926155588124333461, 123.087267812322270238, 132929.2775641349633, -0.999097042677338120775232255255104974 } + },{ + { 0, 56.851165323215 }, 19988235.9960515, 112.345749045605, + { 179.587046628550073045, -56.875248360744638525, 67.744017057185404441, 9971.0934553515518, -1.00182859249871403228837607457535341 } + },{ + { 0, 10.692273150738 }, 19893210.3050033, 102.824601316946, + { 178.709520715733071393, -10.851727623036704339, 77.308514969817191459, 83032.7122948051111, -1.00034345584508432835946223349310458 } + },{ + { 0, 46.694739303788 }, 19975447.9283188, 174.663684259477, + { 179.926838145841924189, -46.948618153686522669, 5.361568174833475454, 59614.5876209460645, -1.00520484875201732144489596976200119 } + },{ + { 0, 15.804386137005 }, 19855850.8800526, 74.932089158884, + { 178.367587635209819128, -15.522042847777054984, 105.357235560913450667, 123350.4326645237628, -0.999091578546475345135036150168161839 } + },{ + { 0, 4.371450175299 }, 19979071.1035552, 164.163592252794, + { 179.780887420199549421, -4.566109732313098407, 15.840695025950408814, 84137.2115482558728, -1.00076323969894742660358133434783667 } + },{ + { 0, 30.894388279688 }, 19968681.8321577, 77.35154610481, + { 179.375426183521944524, -30.871308884744172663, 102.709506078439532936, 14048.0277985734058, -0.998975176336422854284080585784977302 } + },{ + { 0, 9.541166838639 }, 19848553.7844137, 118.441353539081, + { 178.432934555386452839, -10.09982228112793472, 61.736686215549403663, 144831.1911566651614, -1.00060548620110489892454097571317106 } + },{ + { 0, 8.489292700054 }, 19995477.1669578, 171.963952699866, + { 179.906698338023119097, -8.559237750032113623, 8.037517851139094467, 72192.60793572974, -1.00152068486306466965629624610301107 } + },{ + { 0, 19.562401114224 }, 19893208.1788508, 126.362762598128, + { 178.838724116996037606, -20.05038360490599475, 53.875560227496658204, 112181.7524188837615, -1.00185202668802775249901060306001455 } + },{ + { 0, 42.260350252749 }, 19942715.0054774, 170.703419847646, + { 179.807860448877064601, -42.79985897702184353, 9.377654670896439828, 96336.3477142010769, -1.00508642406443549077721399953588843 } + },{ + { 0, 24.511403144656 }, 19924809.5184876, 102.913211410163, + { 178.957598444862223515, -24.616808725039883945, 77.297538210434837096, 55403.453072179318, -1.0008408309188838725134473861544393 } + },{ + { 0, 20.844284170708 }, 19909084.6340808, 44.172784008084, + { 179.069258863637226633, -20.321320573298341477, 136.01627115731728436, 111009.0987238994608, -0.997389183621778974142557672166731209 } + },{ + { 0, 2.426010809098 }, 19840940.6924189, 94.315194952561, + { 178.236397468862000784, -2.513715200833756776, 85.734896842737189557, 130002.6104886615638, -0.999825249844991659209370027383556589 } + },{ + { 0, 6.600682554664 }, 19878412.28273, 168.167678684515, + { 179.646475458013797028, -7.699164822656561787, 11.861035812918738552, 187426.3958525886692, -1.00098284856064978498579876031726599 } + },{ + { 0, 23.372339802326 }, 19899498.4582543, 161.197647943542, + { 179.499422665106094027, -24.239465200482591299, 18.932355367478826536, 151863.2545535951091, -1.00347666868431395492677893344080076 } + },{ + { 0, 16.194668264095 }, 19874825.6683239, 148.942349959054, + { 179.115193814080201851, -17.129419031459576897, 31.225656401221968078, 166033.3161394594622, -1.00222032222233647935638600756647065 } + },{ + { 0, 1.528726471528 }, 19897803.9939987, 69.212891442493, + { 178.791047180477802091, -1.282203000582034597, 110.802928803578167132, 85252.8333849204133, -0.999827144228156883265512533398577943 } + },{ + { 0, 6.297249676078 }, 19864042.0495193, 56.274639904925, + { 178.623258703845895437, -5.709470001196540278, 123.817184177744186806, 137475.1283083659258, -0.999190450178399580671850799262756482 } + },{ + { 0, 17.393540327984 }, 19962624.6302607, 107.855062015266, + { 179.330156510680163326, -17.431100690958209424, 72.181322855288535245, 19320.5501845044839, -1.00091841779689127989172447996679693 } + },{ + { 0, 46.284685151236 }, 19990422.3478916, 14.758013867151, + { 179.852534804091121255, -46.176234945675219984, 165.271681964991897184, 42614.1796365710104, -0.994894592261839960656288894824683666 } + },{ + { 0, 14.924320176299 }, 19891861.8615337, 31.446544793174, + { 179.195663739713760883, -14.125476432252858442, 148.678916887199611191, 149419.6596309045804, -0.997620142585332936313591289945179597 } + },{ + { 0, 23.668824656069 }, 19938736.4442268, 148.091483667618, + { 179.409875478773990359, -24.107855233601412399, 32.02919257641173958, 97771.7687385830819, -1.00323262872000595891108787327539176 } + },{ + { 0, 46.986276695896 }, 19968596.0414782, 174.796708941456, + { 179.92040916864362177, -47.301644191214905832, 5.234240076649939638, 66113.7417494369769, -1.00519095452608087093437916337279603 } + },{ + { 0, 65.946144289524 }, 19993734.5109736, 25.375428509648, + { 179.808282612725835525, -65.871840130833632868, 154.703163938350061652, 18355.2254271672769, -0.996436935914610577569305860379245132 } + },{ + { 0, 10.950298933293 }, 19975919.5586889, 28.779018914489, + { 179.624609619829763098, -10.787771536605316781, 151.238005588662201946, 70291.1998404303581, -0.998272071834115148902810688014142215 } + },{ + { 0, 13.609869340778 }, 19913213.8514358, 129.616021271129, + { 179.035623147420893383, -14.023624108675206222, 50.506400999466711623, 97596.7664002074776, -1.00146664642314031645753402699483559 } + },{ + { 0, 48.701427557433 }, 19972955.2699173, 102.875149183407, + { 179.385565054218238481, -48.735316652259656533, 77.294384444682547869, 18461.7742226227697, -1.00114676855429074464609584538266063 } + },{ + { 0, 31.519172055785 }, 19952318.3772514, 26.247105619999, + { 179.555251675378549409, -31.140142027808697534, 153.865822276646938125, 86354.7117605101002, -0.995739948399825047786748655198607594 } + },{ + { 0, 31.863784754278 }, 19993324.8682601, 29.572313410211, + { 179.722489476483407524, -31.826935359797657785, 150.440607907359037187, 41427.6181613499234, -0.995888009001147267440501309465616941 } + },{ + { 0, 76.434608546092 }, 19997750.023578, 167.428385412814, + { 179.918287057674124459, -76.48787937532808951, 12.621032110142724567, 9619.5267710862108, -1.00233963893091582164629471662919968 } + },{ + { 0, 73.114273316483 }, 19992866.6147806, 78.154765899661, + { 179.576736605988553624, -73.098788070892914568, 102.085693546950923465, 8580.6475692800946, -0.999384143308475469957841141876997426 } + },{ + { 0, 1.125639056292 }, 19852573.5442848, 67.184842289382, + { 178.426819580880619395, -.694775021853292564, 112.831314850896246589, 132932.8743502563937, -0.999732957962833457266071945923613384 } + } +}; + +size_t const expected_size_antipodal = sizeof(expected_antipodal) / sizeof(expected_results_antipodal); + +#endif // BOOST_GEOMETRY_TEST_DIRECT_CASES_ANTIPODAL_HPP diff --git a/src/boost/libs/geometry/test/formulas/direct_meridian.cpp b/src/boost/libs/geometry/test/formulas/direct_meridian.cpp new file mode 100644 index 000000000..aa94413b9 --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/direct_meridian.cpp @@ -0,0 +1,115 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2018 Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, 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) + +#define BOOST_GEOMETRY_NORMALIZE_LATITUDE + +#include + +#include "test_formula.hpp" +#include "direct_meridian_cases.hpp" + +#include +#include +#include + +template +void check_meridian_direct(Result& result, + Expected const& expected, + Reference& reference, + double reference_error) +{ + boost::geometry::math::normalize_spheroidal_coordinates + < + boost::geometry::radian, + double + >(result.lon2, result.lat2); + + boost::geometry::math::normalize_spheroidal_coordinates + < + boost::geometry::radian, + double + >(reference.lon2, reference.lat2); + + std::stringstream ss; + ss << "(" << result.lon2 * bg::math::r2d() + << " " << result.lat2 * bg::math::r2d() << ")"; + + check_one("lon:" + ss.str(), result.lon2, expected.lon, reference.lon2, + reference_error); + check_one("lat:" + ss.str(), result.lat2, expected.lat, reference.lat2, + reference_error); + check_one("rev_az:" + ss.str(), result.reverse_azimuth, + result.reverse_azimuth, reference.reverse_azimuth, reference_error); + check_one("red len:" + ss.str(), result.reduced_length, result.reduced_length, + reference.reduced_length, 0.01); + check_one("geo scale:" + ss.str(), result.geodesic_scale, result.geodesic_scale, + reference.geodesic_scale, 0.01); + +} + +void test_all(expected_results const& results) +{ + double const d2r = bg::math::d2r(); + + double lon1_rad = results.p1.lon * d2r; + double lat1_rad = results.p1.lat * d2r; + coordinates expected_point; + expected_point.lon = results.p2.lon * d2r; + expected_point.lat = results.p2.lat * d2r; + double distance = results.distance; + bool direction = results.direction; + + // WGS84 + bg::srs::spheroid spheroid(6378137.0, 6356752.3142451793); + + bg::formula::result_direct vincenty_result; + bg::formula::result_direct meridian_result; + + typedef bg::formula::vincenty_direct vi_t; + double vincenty_azimuth = direction ? 0.0 : bg::math::pi(); + vincenty_result = vi_t::apply(lon1_rad, lat1_rad, distance, vincenty_azimuth, spheroid); + + { + typedef bg::formula::meridian_direct eli; + meridian_result = eli::apply(lon1_rad, lat1_rad, distance, direction, spheroid); + check_meridian_direct(meridian_result, expected_point, vincenty_result, 0.001); + } + { + typedef bg::formula::meridian_direct eli; + meridian_result = eli::apply(lon1_rad, lat1_rad, distance, direction, spheroid); + check_meridian_direct(meridian_result, expected_point, vincenty_result, 0.00001); + } + { + typedef bg::formula::meridian_direct eli; + meridian_result = eli::apply(lon1_rad, lat1_rad, distance, direction, spheroid); + check_meridian_direct(meridian_result, expected_point, vincenty_result, 0.00000001); + } + { + typedef bg::formula::meridian_direct eli; + meridian_result = eli::apply(lon1_rad, lat1_rad, distance, direction, spheroid); + check_meridian_direct(meridian_result, expected_point, vincenty_result, 0.00000001); + } + { + typedef bg::formula::meridian_direct eli; + meridian_result = eli::apply(lon1_rad, lat1_rad, distance, direction, spheroid); + check_meridian_direct(meridian_result, expected_point, vincenty_result, 0.00000000001); + } +} + +int test_main(int, char*[]) +{ + for (size_t i = 0; i < expected_size; ++i) + { + test_all(expected[i]); + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/formulas/direct_meridian_cases.hpp b/src/boost/libs/geometry/test/formulas/direct_meridian_cases.hpp new file mode 100644 index 000000000..b02c42b28 --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/direct_meridian_cases.hpp @@ -0,0 +1,57 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2018 Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, 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) + +#ifndef BOOST_GEOMETRY_TEST_DIRECT_MERIDIAN_CASES_HPP +#define BOOST_GEOMETRY_TEST_DIRECT_MERIDIAN_CASES_HPP + +struct coordinates +{ + double lon; + double lat; +}; + +struct expected_results +{ + coordinates p1; + double distance; + bool direction;//north=true, south=false + coordinates p2; +}; + +expected_results expected[] = +{ + { {0, 0}, 100000, true, {0, 0.90435537782} }, + { {0, 0}, 200000, true, {0, 1.8087062846} }, + { {0, 0}, 300000, true, {0, 2.7130880778385226826} }, + { {0, 0}, 400000, true, {0, 3.6174296804714929365} }, + { {0, 0}, 500000, true, {0, 4.521753233678117212} }, + { {0, 0}, 600000, true, {0, 5.4260542596891729872} }, + { {0, 0}, 700000, true, {0, 6.3303283037366426811} }, + { {0, 0}, 800000, true, {0, 7.234570938597034484} }, + { {0, 0}, 900000, true, {0, 8.1386639105161684427} }, + { {0, 0}, 1000000, true, {0, 9.0428195432854963087} }, + { {0, 0}, 10000000, true, {0, 89.982400761362015373} }, + { {0, 0}, 10001965, true, {0, 90} }, + { {0, 0}, 11000000, true, {180, 81.063836359} }, + { {10, 0}, 11000000, true, {-170, 81.063836359} }, + { {0, 1}, 100000, true, {0, 1.9043634563000368942} }, + { {0, 10}, 100000, true, {0, 10.904070448} }, + { {0, 80}, 100000, true, {0, 80.895552833} }, + { {0, 0}, 40010000, true, {0, 0.01932683869} },//wrap the spheroid once + { {0, 10}, 100000, false, {0, 9.0956502718} }, + { {0, 10}, 2000000, false, {0, -8.0858305929} }, + { {0, 0}, 11000000, false, {180, -81.063836359} }, + { {0, 0}, 40010000, false, {0, -0.01932683869} } //wrap the spheroid once +}; + +size_t const expected_size = sizeof(expected) / sizeof(expected_results); + +#endif // BOOST_GEOMETRY_TEST_DIRECT_MERIDIAN_CASES_HPP diff --git a/src/boost/libs/geometry/test/formulas/intersection.cpp b/src/boost/libs/geometry/test/formulas/intersection.cpp new file mode 100644 index 000000000..4ab53aa24 --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/intersection.cpp @@ -0,0 +1,198 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016-2019 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, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "test_formula.hpp" +#include "intersection_cases.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +void check_result(expected_result const& result, expected_result const& expected, + expected_result const& reference, double reference_error, + bool check_reference_only) +{ + //BOOST_CHECK_MESSAGE((false), "(" << result.lon << " " << result.lat << ") vs (" << expected.lon << " " << expected.lat << ")"); + check_one(result.lon, expected.lon, reference.lon, reference_error, false, check_reference_only); + check_one(result.lat, expected.lat, reference.lat, reference_error, false, check_reference_only); +} + +void test_formulas(expected_results const& results, bool check_reference_only) +{ + // reference result + if (results.sjoberg_vincenty.lon == ND) + { + return; + } + + double const d2r = bg::math::d2r(); + double const r2d = bg::math::r2d(); + + double lona1r = results.p1.lon * d2r; + double lata1r = results.p1.lat * d2r; + double lona2r = results.p2.lon * d2r; + double lata2r = results.p2.lat * d2r; + double lonb1r = results.q1.lon * d2r; + double latb1r = results.q1.lat * d2r; + double lonb2r = results.q2.lon * d2r; + double latb2r = results.q2.lat * d2r; + + expected_result result; + + // WGS84 + bg::srs::spheroid spheroid(6378137.0, 6356752.3142451793); + + if (results.gnomonic_vincenty.lon != ND) + { + bg::formula::gnomonic_intersection + ::apply(lona1r, lata1r, lona2r, lata2r, lonb1r, latb1r, lonb2r, latb2r, result.lon, result.lat, spheroid); + result.lon *= r2d; + result.lat *= r2d; + check_result(result, results.gnomonic_vincenty, results.sjoberg_vincenty, 0.00000001, check_reference_only); + } + + if (results.gnomonic_thomas.lon != ND) + { + bg::formula::gnomonic_intersection + ::apply(lona1r, lata1r, lona2r, lata2r, lonb1r, latb1r, lonb2r, latb2r, result.lon, result.lat, spheroid); + result.lon *= r2d; + result.lat *= r2d; + check_result(result, results.gnomonic_thomas, results.sjoberg_vincenty, 0.0000001, check_reference_only); + } + + if (results.sjoberg_vincenty.lon != ND) + { + bg::formula::sjoberg_intersection + ::apply(lona1r, lata1r, lona2r, lata2r, lonb1r, latb1r, lonb2r, latb2r, result.lon, result.lat, spheroid); + result.lon *= r2d; + result.lat *= r2d; + check_result(result, results.sjoberg_vincenty, results.sjoberg_vincenty, 0.00000001, check_reference_only); + } + + if (results.sjoberg_thomas.lon != ND) + { + bg::formula::sjoberg_intersection + ::apply(lona1r, lata1r, lona2r, lata2r, lonb1r, latb1r, lonb2r, latb2r, result.lon, result.lat, spheroid); + result.lon *= r2d; + result.lat *= r2d; + check_result(result, results.sjoberg_thomas, results.sjoberg_vincenty, 0.0000001, check_reference_only); + } + + if (results.sjoberg_andoyer.lon != ND) + { + bg::formula::sjoberg_intersection + ::apply(lona1r, lata1r, lona2r, lata2r, lonb1r, latb1r, lonb2r, latb2r, result.lon, result.lat, spheroid); + result.lon *= r2d; + result.lat *= r2d; + check_result(result, results.sjoberg_andoyer, results.sjoberg_vincenty, 0.0001, check_reference_only); + } + + if (results.great_elliptic.lon != ND) + { + typedef bg::model::point > point_geo; + typedef bg::model::point point_3d; + point_geo a1(results.p1.lon, results.p1.lat); + point_geo a2(results.p2.lon, results.p2.lat); + point_geo b1(results.q1.lon, results.q1.lat); + point_geo b2(results.q2.lon, results.q2.lat); + point_3d a1v = bg::formula::geo_to_cart3d(a1, spheroid); + point_3d a2v = bg::formula::geo_to_cart3d(a2, spheroid); + point_3d b1v = bg::formula::geo_to_cart3d(b1, spheroid); + point_3d b2v = bg::formula::geo_to_cart3d(b2, spheroid); + point_3d resv(0, 0, 0); + point_geo res(0, 0); + bg::formula::great_elliptic_intersection(a1v, a2v, b1v, b2v, resv, spheroid); + res = bg::formula::cart3d_to_geo(resv, spheroid); + result.lon = bg::get<0>(res); + result.lat = bg::get<1>(res); + check_result(result, results.great_elliptic, results.sjoberg_vincenty, 0.01, check_reference_only); + } +} + +void test_4_input_combinations(expected_results const& results, bool check_reference_only) +{ + test_formulas(results, check_reference_only); + +#ifdef BOOST_GEOMETRY_TEST_GEO_INTERSECTION_TEST_SIMILAR + { + expected_results results_alt = results; + std::swap(results_alt.p1, results_alt.p2); + test_formulas(results_alt, true); + } + { + expected_results results_alt = results; + std::swap(results_alt.q1, results_alt.q2); + test_formulas(results_alt, true); + } + { + expected_results results_alt = results; + std::swap(results_alt.p1, results_alt.p2); + std::swap(results_alt.q1, results_alt.q2); + test_formulas(results_alt, true); + } +#endif +} + +void test_all(expected_results const& results) +{ + test_4_input_combinations(results, false); + +#ifdef BOOST_GEOMETRY_TEST_GEO_INTERSECTION_TEST_SIMILAR + expected_results results_alt = results; + results_alt.p1.lat *= -1; + results_alt.p2.lat *= -1; + results_alt.q1.lat *= -1; + results_alt.q2.lat *= -1; + results_alt.gnomonic_vincenty.lat *= -1; + results_alt.gnomonic_thomas.lat *= -1; + results_alt.sjoberg_vincenty.lat *= -1; + results_alt.sjoberg_thomas.lat *= -1; + results_alt.sjoberg_andoyer.lat *= -1; + results_alt.great_elliptic.lat *= -1; + test_4_input_combinations(results_alt, true); +#endif +} + +void test_bugs() +{ + // https://github.com/boostorg/geometry/issues/612 + { + double lon, lat; + bg::formula::sjoberg_intersection + ::apply(-0.0872665, -0.0872665, -0.0872665, 0.0872665, + 0.0, 1.57e-07, -0.392699, 1.57e-07, + lon, lat, bg::srs::spheroid()); + check_one("issue 612", lon, -0.087266500535674751); + check_one("issue 612", lat, 1.5892499139622920e-07); + } +} + +int test_main(int, char*[]) +{ + for (size_t i = 0; i < expected_size; ++i) + { + test_all(expected[i]); + } + + test_bugs(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/formulas/intersection_cases.hpp b/src/boost/libs/geometry/test/formulas/intersection_cases.hpp new file mode 100644 index 000000000..8fdcdb520 --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/intersection_cases.hpp @@ -0,0 +1,335 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016 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) + +#ifndef BOOST_GEOMETRY_TEST_INTERSECTION_CASES_HPP +#define BOOST_GEOMETRY_TEST_INTERSECTION_CASES_HPP + +struct coordinates +{ + double lon; + double lat; +}; + +struct expected_result +{ + double lon; + double lat; +}; + +struct expected_results +{ + coordinates p1; + coordinates p2; + coordinates q1; + coordinates q2; + expected_result gnomonic_vincenty; + expected_result gnomonic_thomas; + expected_result sjoberg_vincenty; + expected_result sjoberg_thomas; + expected_result sjoberg_andoyer; + expected_result great_elliptic; +}; + +#define ND 1000 + +expected_results expected[] = +{ + { + { -1, -1 },{ 1, 1 }, + { -1, 1 },{ 1, -1 }, + { 0.0000000000000000, 0.0000000000000000 }, + { 0.0000000000000000, 0.0000000000000000 }, + { 0.0000000000626537, -0.0000000000000000 }, + { -0.0000000187861002, -0.0000000000000000 }, + { -0.0000055778585615, -0.0000000000000000 }, + { -0.0000000000000000, -0.0000000000000000 } + },{ + // TODO: Newton method in Sjoberg formula is not used in this case + // due to f1 - f2 == 0. The other method is used instead. + // Hence different results. Look into this. + { 1, 1 },{ -1, -1 }, + { -1, 1 },{ 1, -1 }, + { 0.0000000000000000, 0.0000000000000000 }, + { 0.0000000000000000, 0.0000000000000000 }, + { 0.0000000000000000, 0.0000000000626632 }, + { -0.0000000000000006, -0.0000000187889745 }, + { -0.0000000000000001, -0.0000055787431353 }, + { -0.0000000000000000, 0.0000000000000000 } + },{ + // TODO: Newton method in Sjoberg formula is not used in this case + // due to f1 - f2 == 0. The other method is used instead. + // Hence different results. Look into this. + { -1, -1 },{ 1, 1 }, + { 1, -1 },{ -1, 1 }, + { 0.0000000000000000, 0.0000000000000000 }, + { 0.0000000000000000, 0.0000000000000000 }, + { -0.0000000000000000, -0.0000000000626632 }, + { -0.0000000000000004, 0.0000000187889746 }, + { 0.0000000000000001, 0.0000055787431353 }, + { 0.0000000000000000, 0.0000000000000000 } + },{ + { 1, 1 },{ -1, -1 }, + { 1, -1 },{ -1, 1 }, + { 0.0000000000000000, 0.0000000000000000 }, + { 0.0000000000000000, 0.0000000000000000 }, + { -0.0000000000626537, -0.0000000000000000 }, + { 0.0000000187860994, 0.0000000000000001 }, + { 0.0000055778585615, -0.0000000000000000 }, + { -0.0000000000000000, 0.0000000000000000 } + },{ + { 0, 0 },{ 1, 1 }, + { 0, 1 },{ 1, 0 }, + { 0.5000000000000000, 0.5000573755188470 }, + { 0.5000000000000000, 0.5000573755109839 }, + { 0.5000000000313266, 0.5000573755188389 }, + { 0.4999999906069524, 0.5000573755152582 }, + { 0.4999972102164753, 0.5000573755151276 }, + { 0.4999999999999999, 0.5000571197534014 } + },{ + { 1, 1 },{ 0, 0 }, + { 0, 1 },{ 1, 0 }, + { 0.5000000000000000, 0.5000573755188470 }, + { 0.5000000000000000, 0.5000573755109839 }, + { 0.5000000000000000, 0.5000573755501669 }, + { 0.4999999999999996, 0.5000573661218464 }, + { 0.4999999999999999, 0.5000545856093679 }, + { 0.4999999999999999, 0.5000571197534014 } + },{ + { 0, 0 },{ 1, 1 }, + { 1, 0 },{ 0, 1 }, + { 0.5000000000000000, 0.5000573755188470 }, + { 0.5000000000000000, 0.5000573755109839 }, + { 0.4999999999999999, 0.5000573754875109 }, + { 0.4999999999999999, 0.5000573849086647 }, + { 0.5000000000000000, 0.5000601654208935 }, + { 0.4999999999999999, 0.5000571197534014 } + },{ + { 1, 1 },{ 0, 0 }, + { 1, 0 },{ 0, 1 }, + { 0.5000000000000000, 0.5000573755188470 }, + { 0.5000000000000000, 0.5000573755109839 }, + { 0.4999999999686731, 0.5000573755188389 }, + { 0.5000000093930521, 0.5000573755152582 }, + { 0.5000027897835244, 0.5000573755151276 }, + { 0.4999999999999999, 0.5000571197534014 } + },{ + { 1, 1 }, {2, 2}, + {-2, -1}, {-1, -1}, + { ND, ND }, + { ND, ND }, + { -0.9981650042162076, -0.999999718164758 }, + { ND, ND }, + { ND, ND }, + { -0.9981731758085121, -0.9999997213000095 } + },{ + {-25, -31}, {3, 44}, + {-66, -14}, {-1, -1}, + { ND, ND }, + { ND, ND }, + { -15.83269406235058, -4.87746450262433 }, + { ND, ND }, + { ND, ND }, + { -15.82846301029918, -4.869650527718342 } + },{ + {-47, -8}, {-1, -4}, + {-40, -5}, {-5, -5}, + { ND, ND }, + { ND, ND }, + { -10.28209064194141, -5.124101297536392 }, + { ND, ND }, + { ND, ND }, + { -10.29663941896089, -5.123527178300465 } + }, { + {-43, -8}, {3, -4}, + {-43, -5}, {3, -7}, + { ND, ND }, + { ND, ND }, + { -19.95519754153282, -6.521540589691206 }, + { ND, ND }, + { ND, ND }, + { -19.95535387979888, -6.517861579906892 } + }, { + {-1, -17}, {-5, 3}, + {-40, -5}, {-1, -5}, + { ND, ND }, + { ND, ND }, + { -3.424525475838061, -5.070550173747042 }, + { ND, ND }, + { ND, ND }, + { -3.424493504575876, -5.070060631936228 } + }, { + {-29, -4}, {-1, -5}, + {-40, -5}, {-1, -5}, + { ND, ND }, + { ND, ND }, + { -0.9999999978280006, -5.00000000000684 }, + { ND, ND }, + { ND, ND }, + { -0.9999999999999919, -5 } + }, { + {-4, -6}, {-40, -5}, + {-40, -5}, {-1, -5}, + { ND, ND }, + { ND, ND }, + { -40.00000000470697, -4.999999999854269 }, + { ND, ND }, + { ND, ND }, + { -40.00000000000003, -4.999999999999998 } + }, { + {5, -4}, {-25, -5}, + {-40, -5}, {-1, -5}, + { ND, ND }, + { ND, ND }, + { -40.04870859732954, -4.998490166905039 }, + { ND, ND }, + { ND, ND }, + { -39.87674154148858, -5.003778171392734 } + }, { + {-44, -1}, {38, -7}, + {-54, -10}, {27, 3}, + { ND, ND }, + { ND, ND }, + { -12.49994722584679, -4.492062263169279 }, + { ND, ND }, + { ND, ND }, + { -12.49786552878283, -4.48224349980724 } + }, { + {-29, -5}, {10, -5}, + {-40, -5}, {-1, -5}, + { ND, ND }, + { ND, ND }, + { -14.99999999880286, -5.280237387890117 }, + { ND, ND }, + { ND, ND }, + { -14.99999999999999, -5.278284829442087 } + }, { + {-29, -5}, {7, -5}, + {-40, -5}, {-1, -5}, + { ND, ND }, + { ND, ND }, + { -12.68814198534678, -5.255404335144863 }, + { ND, ND }, + { ND, ND }, + { -12.68883814704657, -5.253634733357015 } + }, { + {-29, -5}, {2, -5}, + {-40, -5}, {-1, -5}, + { ND, ND }, + { ND, ND }, + { -6.793546728871506, -5.153444544719724 }, + { ND, ND }, + { ND, ND }, + { -6.794933162619669, -5.152409434095275 } + }, { + {-29, -5}, {2, -5}, + {-30, -5}, {-1, -5}, + { ND, ND }, + { ND, ND }, + { -22.13104411461423, -5.130155316882458 }, + { ND, ND }, + { ND, ND }, + { -22.13016591567375, -5.129277412801533 } + }, { + {-29, -5}, {2, -5}, + {-32, -5}, {-1, -5}, + { ND, ND }, + { ND, ND }, + { -14.99999999908104, -5.187213913248173 }, + { ND, ND }, + { ND, ND }, + { -15.00000000000009, -5.185931965560752 } + }, { + {-92, -24}, {44, 19}, + {-78, -5}, {50, -5}, + { ND, ND }, + { ND, ND }, + { -31.65127861442256, -10.84411293410938 }, + { ND, ND }, + { ND, ND }, + { -31.65294079308247, -10.76785432928444 } + }, { + {-93, -15}, {22, 3}, + {-78, -5}, {50, -5}, + { ND, ND }, + { ND, ND }, + { -32.33383382062637, -10.80295061031259 }, + { ND, ND }, + { ND, ND }, + { -32.26069578187354, -10.73176059393484 } + }, { + {-93, -15}, {28, 3}, + {-78, -5}, {50, -5}, + { ND, ND }, + { ND, ND }, + { -25.71257598566304, -11.13752154787724 }, + { ND, ND }, + { ND, ND }, + { -25.67761999514295, -11.05881610957402 } + }, { + {-54, -21}, {20, 17}, + {-59, -5}, {13, -5}, + { ND, ND }, + { ND, ND }, + { -22.96397490169162, -6.181426780426698 }, + { ND, ND }, + { ND, ND }, + { -22.95999443662035, -6.172089364736989 } + }, { + {-31, -10}, {-31, -2}, + {-37, -10}, {-25, -2}, + { ND, ND }, + { ND, ND }, + { -31.00000000000001, -6.062729839503469 }, + { ND, ND }, + { ND, ND }, + { -31, -6.062411484514648 } + }, { + {-26, -10}, {-26, 13}, + {-37, -4}, {-18, -4}, + { ND, ND }, + { ND, ND }, + { -25.99999999999969, -4.05441766735837 }, + { ND, ND }, + { ND, ND }, + { -26, -4.05405101510235 } + }, { + {-26, -10}, {154, 78}, + {-46, 41}, {-13, 36}, + { ND, ND }, + { ND, ND }, + { -26, 39.19492836828103 }, + { ND, ND }, + { ND, ND }, + { -26, 39.19004133747198 } + }, { + {-26, -10}, {154, 68}, + {-85, 79}, {22, 80}, + { ND, ND }, + { ND, ND }, + { -26.00000000000013, 83.7164889918963 }, + { ND, ND }, + { ND, ND }, + { -26.00000000000002, 83.71603758698208 } + }, { + {-25, 55}, {155, 68}, + {178, 79}, {124, 80}, + { ND, ND }, + { ND, ND }, + { 155, 80.55982670305147 }, + { ND, ND }, + { ND, ND }, + { 155, 80.55961176607357 } + } +}; + +size_t const expected_size = sizeof(expected) / sizeof(expected_results); + +#endif // BOOST_GEOMETRY_TEST_INTERSECTION_CASES_HPP diff --git a/src/boost/libs/geometry/test/formulas/inverse.cpp b/src/boost/libs/geometry/test/formulas/inverse.cpp new file mode 100644 index 000000000..cab678200 --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/inverse.cpp @@ -0,0 +1,93 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016-2019 Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Copyright (c) 2018 Adeel Ahmad, Islamabad, Pakistan. + +// Contributed and/or modified by Adeel Ahmad, as part of Google Summer of Code 2018 program + +// 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) + + +#include + +#include "test_formula.hpp" +#include "inverse_cases.hpp" + +#include +#include +#include + +#include + +template +void check_inverse(std::string const& name, + Result const& results, + bg::formula::result_inverse const& result, + expected_result const& expected, + expected_result const& reference, + double reference_error) +{ + std::stringstream ss; + ss << "(" << results.p1.lon << " " << results.p1.lat << ")->(" << results.p2.lon << " " << results.p2.lat << ")"; + + check_one(name + "_d " + ss.str(), + result.distance, expected.distance, reference.distance, reference_error); + check_one(name + "_a " + ss.str(), + result.azimuth, expected.azimuth, reference.azimuth, reference_error, true); + check_one(name + "_ra " + ss.str(), + result.reverse_azimuth, expected.reverse_azimuth, reference.reverse_azimuth, reference_error, true); + check_one(name + "_rl " + ss.str(), + result.reduced_length, expected.reduced_length, reference.reduced_length, reference_error); + check_one(name + "_gs " + ss.str(), + result.geodesic_scale, expected.geodesic_scale, reference.geodesic_scale, reference_error); +} + +void test_all(expected_results const& results) +{ + double const d2r = bg::math::d2r(); + double const r2d = bg::math::r2d(); + + double lon1r = results.p1.lon * d2r; + double lat1r = results.p1.lat * d2r; + double lon2r = results.p2.lon * d2r; + double lat2r = results.p2.lat * d2r; + + // WGS84 + bg::srs::spheroid spheroid(6378137.0, 6356752.3142451793); + + bg::formula::result_inverse result_v, result_t, result_a; + + typedef bg::formula::vincenty_inverse vi_t; + result_v = vi_t::apply(lon1r, lat1r, lon2r, lat2r, spheroid); + result_v.azimuth *= r2d; + result_v.reverse_azimuth *= r2d; + check_inverse("vincenty", results, result_v, results.vincenty, results.reference, 0.0000001); + + typedef bg::formula::thomas_inverse th_t; + result_t = th_t::apply(lon1r, lat1r, lon2r, lat2r, spheroid); + result_t.azimuth *= r2d; + result_t.reverse_azimuth *= r2d; + check_inverse("thomas", results, result_t, results.thomas, results.reference, 0.00001); + + typedef bg::formula::andoyer_inverse an_t; + result_a = an_t::apply(lon1r, lat1r, lon2r, lat2r, spheroid); + result_a.azimuth *= r2d; + result_a.reverse_azimuth *= r2d; + check_inverse("andoyer", results, result_a, results.andoyer, results.reference, 0.001); +} + +int test_main(int, char*[]) +{ + for (size_t i = 0; i < expected_size; ++i) + { + test_all(expected[i]); + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/formulas/inverse_cases.hpp b/src/boost/libs/geometry/test/formulas/inverse_cases.hpp new file mode 100644 index 000000000..586ed54ba --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/inverse_cases.hpp @@ -0,0 +1,626 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016-2020 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) + +#ifndef BOOST_GEOMETRY_TEST_INVERSE_CASES_HPP +#define BOOST_GEOMETRY_TEST_INVERSE_CASES_HPP + +struct coordinates +{ + double lon; + double lat; +}; + +struct expected_result +{ + double distance; + double azimuth; + double reverse_azimuth; + double reduced_length; + double geodesic_scale; +}; + +struct expected_results +{ + coordinates p1; + coordinates p2; + expected_result reference; // karney or vincenty + expected_result vincenty; + expected_result thomas; + expected_result andoyer; + +}; + +expected_results expected[] = +{ + { + { 0, 0 },{ 2, 0 }, + { 222638.98158654713188298047, 90.00000000000000000000, 90.00000000000000000000, 222593.46652303214068524539, 0.99938672191946420487 }, + { 222638.98158645280636847019, 90.00000000000000000000, 90.00000000000000000000, 222593.46652303214068524539, 0.99938672191946420487 }, + { 222638.98158654122380539775, 90.00000000000000000000, 90.00000000000000000000, 222593.46652303214068524539, 0.99938672191946420487 }, + { 222638.98158654125290922821, 90.00000000000000000000, 90.00000000000000000000, 222593.46652303214068524539, 0.99938672191946420487 } + },{ + { 0, 0 },{ 2, 2 }, + { 313775.70942918420769274235, 45.17488858648466987233, 45.20980230803674970730, 313648.30600607168162241578, 0.99878199603375228399 }, + { 313775.70929574419278651476, 45.17488858646600391467, 45.20980230801805532792, 313648.30601466231746599078, 0.99878199603375328319 }, + { 313775.70869052573107182980, 45.17488750916628958976, 45.20980122940459722258, 313648.30008120078127831221, 0.99878199607986462016 }, + { 313772.17715740547282621264, 45.17456700769592004008, 45.20948072916769433505, 313646.54128309490624815226, 0.99878200978130526888 } + },{ + { 0, 0 },{ 0, 2 }, + { 221149.45337213488528504968, 0.00000000000000000000, 0.00000000000000000000, 221104.84592454897938296199, 0.99939490135383823866 }, + { 221149.45318342180689796805, 0.00000000000000000000, 0.00000000000000000000, 221104.84593068063259124756, 0.99939490135383812763 }, + { 221149.45337045041378587484, 0.00000000000000000000, 0.00000000000000000000, 221104.84593068063259124756, 0.99939490135383812763 }, + { 221146.95820782837108708918, 0.00000000000000002350, 0.00000000000000002350, 221104.84893554644077084959, 0.99939490135383812763 } + },{ + { 0, 0 },{ -2, 2 }, + { 313775.70942918420769274235, -45.17488858648466987233, -45.20980230803674970730, 313648.30600607168162241578, 0.99878199603375228399 }, + { 313775.70929574419278651476, -45.17488858646600391467, -45.20980230801805532792, 313648.30601466231746599078, 0.99878199603375328319 }, + { 313775.70869052573107182980, -45.17488750916629669518, -45.20980122940459722258, 313648.30008120078127831221, 0.99878199607986462016 }, + { 313772.17715740547282621264, -45.17456700769592004008, -45.20948072916767301876, 313646.54128309484804049134, 0.99878200978130526888 } + },{ + { 0, 0 },{ -2, 0 }, + { 222638.98158654713188298047, -90.00000000000000000000, -90.00000000000000000000, 222593.46652303214068524539, 0.99938672191946420487 }, + { 222638.98158645280636847019, -90.00000000000000000000, -90.00000000000000000000, 222593.46652303214068524539, 0.99938672191946420487 }, + { 222638.98158654122380539775, -90.00000000000000000000, -90.00000000000000000000, 222593.46652303214068524539, 0.99938672191946420487 }, + { 222638.98158654125290922821, -90.00000000000000000000, -90.00000000000000000000, 222593.46652303214068524539, 0.99938672191946420487 } + },{ + { 0, 0 },{ -2, -2 }, + { 313775.70942918420769274235, -134.82511141351534433852, -134.79019769196324318727, 313648.30600607168162241578, 0.99878199603375228399 }, + { 313775.70929574419278651476, -134.82511141353401740162, -134.79019769198197309379, 313648.30601466225925832987, 0.99878199603375317217 }, + { 313775.70869052573107182980, -134.82511249083370330482, -134.79019877059539567199, 313648.30008120083948597312, 0.99878199607986462016 }, + { 313772.17715740547282621264, -134.82543299230408706535, -134.79051927083230566495, 313646.54128309502266347408, 0.99878200978130537990 } + },{ + { 0, 0 },{ 0, -2 }, + { 221149.45337213488528504968, -180.00000000000000000000, -180.00000000000000000000, 221104.84592454897938296199, 0.99939490135383823866 }, + { 221149.45318342180689796805, 180.00000000000000000000, 180.00000000000000000000, 221104.84593068063259124756, 0.99939490135383812763 }, + { 221149.45337045041378587484, 180.00000000000000000000, 180.00000000000000000000, 221104.84593068063259124756, 0.99939490135383812763 }, + { 221146.95820782837108708918, 180.00000000000000000000, 180.00000000000000000000, 221104.84893554644077084959, 0.99939490135383812763 } + },{ + { 0, 0 },{ 2, -2 }, + { 313775.70942918420769274235, 134.82511141351534433852, 134.79019769196324318727, 313648.30600607168162241578, 0.99878199603375228399 }, + { 313775.70929574419278651476, 134.82511141353401740162, 134.79019769198197309379, 313648.30601466225925832987, 0.99878199603375317217 }, + { 313775.70869052573107182980, 134.82511249083370330482, 134.79019877059539567199, 313648.30008120083948597312, 0.99878199607986462016 }, + { 313772.17715740547282621264, 134.82543299230408706535, 134.79051927083230566495, 313646.54128309502266347408, 0.99878200978130537990 } + },{ + { -1, 0 },{ 2, 0 }, + { 333958.47237982071237638593, 90.00000000000000000000, 90.00000000000000000000, 333804.87081722758011892438, 0.99862030063297502203 }, + { 333958.47237967920955270529, 90.00000000000000000000, 90.00000000000000000000, 333804.87081722758011892438, 0.99862030063297502203 }, + { 333958.47237982566002756357, 90.00000000000000000000, 90.00000000000000000000, 333804.87081722758011892438, 0.99862030063297502203 }, + { 333958.47237982566002756357, 90.00000000000000000000, 90.00000000000000000000, 333804.87081722758011892438, 0.99862030063297502203 } + },{ + { -1, 0 },{ 2, 2 }, + { 400487.62166116386651992798, 56.46443555420994186989, 56.51681282834063324572, 400222.73679570353124290705, 0.99801604059094650712 }, + { 400487.62155657896073535085, 56.46443555419775606197, 56.51681282832842612152, 400222.73680666065774857998, 0.99801604059094761734 }, + { 400487.62116943788714706898, 56.46443456250134573793, 56.51681183466060787168, 400222.72635490150423720479, 0.99801604069467231284 }, + { 400484.31980028707766905427, 56.46436757836366382435, 56.51674485214859089410, 400222.02724612434394657612, 0.99801604768666130063 } + },{ + { -1, 0 },{ 0, 2 }, + { 247576.47264764847932383418, 26.70874628270370010341, 26.72620180544743817563, 247513.88750887679634615779, 0.99924166327570262958 }, + { 247576.47247877591871656477, 26.70874628267113948255, 26.72620180541484202763, 247513.88751566910650581121, 0.99924166327570307367 }, + { 247576.47204536388744600117, 26.70874541733553186873, 26.72620093942252594843, 247513.88563483985490165651, 0.99924166328723251773 }, + { 247573.34468778557493351400, 26.70817834948789482041, 26.72563387223648589952, 247512.65741612159763462842, 0.99924167083675718981 } + },{ + { -1, 0 },{ -2, 2 }, + { 247576.47264764847932383418, -26.70874628270370010341, -26.72620180544743817563, 247513.88750887679634615779, 0.99924166327570262958 }, + { 247576.47247877591871656477, -26.70874628267113948255, -26.72620180541484202763, 247513.88751566910650581121, 0.99924166327570307367 }, + { 247576.47204536388744600117, -26.70874541733554607958, -26.72620093942252594843, 247513.88563483985490165651, 0.99924166328723251773 }, + { 247573.34468778557493351400, -26.70817834948789482041, -26.72563387223651432123, 247512.65741612159763462842, 0.99924167083675718981 } + },{ + { -1, 0 },{ -2, 0 }, + { 111319.49079327356594149023, -90.00000000000000000000, -90.00000000000000000000, 111313.80114861292531713843, 0.99984666872462601983 }, + { 111319.49079322640318423510, -90.00000000000000000000, -90.00000000000000000000, 111313.80114861292531713843, 0.99984666872462601983 }, + { 111319.49079326246283017099, -90.00000000000000000000, -90.00000000000000000000, 111313.80114861292531713843, 0.99984666872462601983 }, + { 111319.49079326246283017099, -90.00000000000000000000, -90.00000000000000000000, 111313.80114861292531713843, 0.99984666872462601983 } + },{ + { -1, 0 },{ -2, -2 }, + { 247576.47264764847932383418, -153.29125371729628568573, -153.27379819455256892979, 247513.88750887679634615779, 0.99924166327570262958 }, + { 247576.47247877591871656477, -153.29125371732885696474, -153.27379819458516863051, 247513.88751566907740198076, 0.99924166327570307367 }, + { 247576.47204536388744600117, -153.29125458266443615685, -153.27379906057745984072, 247513.88563483985490165651, 0.99924166328723251773 }, + { 247573.34468778557493351400, -153.29182165051210517959, -153.27436612776349988962, 247512.65741612162673845887, 0.99924167083675718981 } + },{ + { -1, 0 },{ 0, -2 }, + { 247576.47264764847932383418, 153.29125371729628568573, 153.27379819455256892979, 247513.88750887679634615779, 0.99924166327570262958 }, + { 247576.47247877591871656477, 153.29125371732885696474, 153.27379819458516863051, 247513.88751566907740198076, 0.99924166327570307367 }, + { 247576.47204536388744600117, 153.29125458266446457856, 153.27379906057745984072, 247513.88563483985490165651, 0.99924166328723251773 }, + { 247573.34468778557493351400, 153.29182165051210517959, 153.27436612776349988962, 247512.65741612162673845887, 0.99924167083675718981 } + },{ + { -1, 0 },{ 2, -2 }, + { 400487.62166116386651992798, 123.53556444579005813011, 123.48318717165936675428, 400222.73679570353124290705, 0.99801604059094650712 }, + { 400487.62155657896073535085, 123.53556444580226525431, 123.48318717167158808934, 400222.73680666059954091907, 0.99801604059094761734 }, + { 400487.62116943788714706898, 123.53556543749867557835, 123.48318816533939923374, 400222.72635490150423720479, 0.99801604069467231284 }, + { 400484.31980028707766905427, 123.53563242163632196480, 123.48325514785142331675, 400222.02724612434394657612, 0.99801604768666130063 } + },{ + { 1, 0 },{ 2, 0 }, + { 111319.49079327356594149023, 90.00000000000000000000, 90.00000000000000000000, 111313.80114861292531713843, 0.99984666872462601983 }, + { 111319.49079322640318423510, 90.00000000000000000000, 90.00000000000000000000, 111313.80114861292531713843, 0.99984666872462601983 }, + { 111319.49079326246283017099, 90.00000000000000000000, 90.00000000000000000000, 111313.80114861292531713843, 0.99984666872462601983 }, + { 111319.49079326246283017099, 90.00000000000000000000, 90.00000000000000000000, 111313.80114861292531713843, 0.99984666872462601983 } + },{ + { 1, 0 },{ 2, 2 }, + { 247576.47264764847932383418, 26.70874628270370010341, 26.72620180544743817563, 247513.88750887679634615779, 0.99924166327570262958 }, + { 247576.47247877591871656477, 26.70874628267113948255, 26.72620180541484202763, 247513.88751566910650581121, 0.99924166327570307367 }, + { 247576.47204536388744600117, 26.70874541733553186873, 26.72620093942252594843, 247513.88563483985490165651, 0.99924166328723251773 }, + { 247573.34468778557493351400, 26.70817834948789482041, 26.72563387223648589952, 247512.65741612159763462842, 0.99924167083675718981 } + },{ + { 1, 0 },{ 0, 2 }, + { 247576.47264764847932383418, -26.70874628270370010341, -26.72620180544743817563, 247513.88750887679634615779, 0.99924166327570262958 }, + { 247576.47247877591871656477, -26.70874628267113948255, -26.72620180541484202763, 247513.88751566910650581121, 0.99924166327570307367 }, + { 247576.47204536388744600117, -26.70874541733554607958, -26.72620093942252594843, 247513.88563483985490165651, 0.99924166328723251773 }, + { 247573.34468778557493351400, -26.70817834948789482041, -26.72563387223651432123, 247512.65741612159763462842, 0.99924167083675718981 } + },{ + { 1, 0 },{ -2, 2 }, + { 400487.62166116386651992798, -56.46443555420994186989, -56.51681282834063324572, 400222.73679570353124290705, 0.99801604059094650712 }, + { 400487.62155657896073535085, -56.46443555419775606197, -56.51681282832842612152, 400222.73680666065774857998, 0.99801604059094761734 }, + { 400487.62116943788714706898, -56.46443456250133863250, -56.51681183466062918797, 400222.72635490167886018753, 0.99801604069467231284 }, + { 400484.31980028707766905427, -56.46436757836366382435, -56.51674485214855536697, 400222.02724612399470061064, 0.99801604768666130063 } + },{ + { 1, 0 },{ -2, 0 }, + { 333958.47237982071237638593, -90.00000000000000000000, -90.00000000000000000000, 333804.87081722758011892438, 0.99862030063297502203 }, + { 333958.47237967920955270529, -90.00000000000000000000, -90.00000000000000000000, 333804.87081722758011892438, 0.99862030063297502203 }, + { 333958.47237982566002756357, -90.00000000000000000000, -90.00000000000000000000, 333804.87081722758011892438, 0.99862030063297502203 }, + { 333958.47237982566002756357, -90.00000000000000000000, -90.00000000000000000000, 333804.87081722758011892438, 0.99862030063297502203 } + },{ + { 1, 0 },{ -2, -2 }, + { 400487.62166116386651992798, -123.53556444579005813011, -123.48318717165936675428, 400222.73679570353124290705, 0.99801604059094650712 }, + { 400487.62155657896073535085, -123.53556444580226525431, -123.48318717167158808934, 400222.73680666059954091907, 0.99801604059094761734 }, + { 400487.62116943788714706898, -123.53556543749867557835, -123.48318816533941344460, 400222.72635490121319890022, 0.99801604069467231284 }, + { 400484.31980028707766905427, -123.53563242163632196480, -123.48325514785139489504, 400222.02724612463498488069, 0.99801604768666130063 } + },{ + { 1, 0 },{ 0, -2 }, + { 247576.47264764847932383418, -153.29125371729628568573, -153.27379819455256892979, 247513.88750887679634615779, 0.99924166327570262958 }, + { 247576.47247877591871656477, -153.29125371732885696474, -153.27379819458516863051, 247513.88751566907740198076, 0.99924166327570307367 }, + { 247576.47204536388744600117, -153.29125458266443615685, -153.27379906057745984072, 247513.88563483985490165651, 0.99924166328723251773 }, + { 247573.34468778557493351400, -153.29182165051210517959, -153.27436612776349988962, 247512.65741612162673845887, 0.99924167083675718981 } + },{ + { 1, 0 },{ 2, -2 }, + { 247576.47264764847932383418, 153.29125371729628568573, 153.27379819455256892979, 247513.88750887679634615779, 0.99924166327570262958 }, + { 247576.47247877591871656477, 153.29125371732885696474, 153.27379819458516863051, 247513.88751566907740198076, 0.99924166327570307367 }, + { 247576.47204536388744600117, 153.29125458266446457856, 153.27379906057745984072, 247513.88563483985490165651, 0.99924166328723251773 }, + { 247573.34468778557493351400, 153.29182165051210517959, 153.27436612776349988962, 247512.65741612162673845887, 0.99924167083675718981 } + },{ + { 0, -1 },{ 2, 0 }, + { 248575.56516798117081634700, 63.59904041930798257454, 63.58158489649751743400, 248512.21908866314333863556, 0.99923553066716652715 }, + { 248575.56515735003631561995, 63.59904041929794260568, 63.58158489648748457057, 248512.21909045605571009219, 0.99923553066715220528 }, + { 248575.56501938513247296214, 63.59903955892717419829, 63.58158403677443004653, 248512.21158473053947091103, 0.99923553071334769715 }, + { 248574.11260137573117390275, 63.59909262487922632090, 63.58163710212382113696, 248512.67536870032199658453, 0.99923552785888392069 } + },{ + { 0, -1 },{ 2, 2 }, + { 399491.95531813317211344838, 33.86382331638844789268, 33.88128418166377286980, 399229.04036820423789322376, 0.99802588852441009859 }, + { 399491.95525925338733941317, 33.86382331636024645150, 33.88128418163555721776, 399229.04037646017968654633, 0.99802588850630413742 }, + { 399491.95420239900704473257, 33.86382231856556046523, 33.88128318318352683036, 399229.03571708954405039549, 0.99802588855242924115 }, + { 399486.91562757542124018073, 33.86329689027443379246, 33.88075775553439683563, 399226.58732164395041763783, 0.99802591281687313973 } + },{ + { 0, -1 },{ 0, 2 }, + { 331723.84192993369651958346, 0.00000000000000000000, 0.00000000000000000000, 331573.30333569750655442476, 0.99863870153788791839 }, + { 331723.84185956208966672421, 0.00000000000000000000, 0.00000000000000000000, 331573.30334328504977747798, 0.99863870152539924163 }, + { 331723.84192803525365889072, 0.00000000000000000000, 0.00000000000000000000, 331573.30334328504977747798, 0.99863870152539924163 }, + { 331720.09633564797695726156, 0.00000000000000002351, 0.00000000000000002350, 331573.30672345001948997378, 0.99863870151614875237 } + },{ + { 0, -1 },{ -2, 2 }, + { 399491.95531813317211344838, -33.86382331638844789268, -33.88128418166377286980, 399229.04036820423789322376, 0.99802588852441009859 }, + { 399491.95525925338733941317, -33.86382331636024645150, -33.88128418163555721776, 399229.04037646017968654633, 0.99802588850630413742 }, + { 399491.95420239900704473257, -33.86382231856555335980, -33.88128318318355525207, 399229.03571708960225805640, 0.99802588855242924115 }, + { 399486.91562757542124018073, -33.86329689027443379246, -33.88075775553439683563, 399226.58732164395041763783, 0.99802591281687313973 } + },{ + { 0, -1 },{ -2, 0 }, + { 248575.56516798117081634700, -63.59904041930798257454, -63.58158489649751743400, 248512.21908866314333863556, 0.99923553066716652715 }, + { 248575.56515735003631561995, -63.59904041929794260568, -63.58158489648748457057, 248512.21909045605571009219, 0.99923553066715220528 }, + { 248575.56501938513247296214, -63.59903955892717419829, -63.58158403677445846824, 248512.21158473053947091103, 0.99923553071334769715 }, + { 248574.11260137573117390275, -63.59909262487922632090, -63.58163710212379271525, 248512.67536870032199658453, 0.99923552785888392069 } + },{ + { 0, -1 },{ -2, -2 }, + { 248515.52773222429095767438, -116.44291541236518128244, -116.39055416434335654685, 248452.22805491264443844557, 0.99923590400821504787 }, + { 248515.52763759149820543826, -116.44291541237451781399, -116.39055416435273571096, 248452.22805559608968906105, 0.99923590407101092747 }, + { 248515.52758369332877919078, -116.44291626924928095832, -116.39055502319511958831, 248452.22057304141344502568, 0.99923590411705243142 }, + { 248514.07922688819235190749, -116.44286383106521043374, -116.39050258320843056481, 248452.68231273870333097875, 0.99923590134832673826 } + },{ + { 0, -1 },{ 0, -2 }, + { 110575.06481433614681009203, -180.00000000000000000000, -180.00000000000000000000, 110569.48860416181560140103, 0.99984871368918792900 }, + { 110575.06460189135395921767, 180.00000000000000000000, 180.00000000000000000000, 110569.48860883565794210881, 0.99984871370166705784 }, + { 110575.06481286860071122646, 180.00000000000000000000, 180.00000000000000000000, 110569.48860883565794210881, 0.99984871370166705784 }, + { 110573.82008000080531928688, 180.00000000000000000000, 180.00000000000000000000, 110569.49123749321734067053, 0.99984871370886085895 } + },{ + { 0, -1 },{ 2, -2 }, + { 248515.52773222429095767438, 116.44291541236518128244, 116.39055416434335654685, 248452.22805491264443844557, 0.99923590400821504787 }, + { 248515.52763759149820543826, 116.44291541237451781399, 116.39055416435273571096, 248452.22805559608968906105, 0.99923590407101092747 }, + { 248515.52758369332877919078, 116.44291626924930938003, 116.39055502319511958831, 248452.22057304164627566934, 0.99923590411705243142 }, + { 248514.07922688819235190749, 116.44286383106521043374, 116.39050258320843056481, 248452.68231273870333097875, 0.99923590134832673826 } + },{ + { 0, 1 },{ 2, 0 }, + { 248575.56516798117081634700, 116.40095958069201742546, 116.41841510350248256600, 248512.21908866314333863556, 0.99923553066716652715 }, + { 248575.56515735003631561995, 116.40095958070207871060, 116.41841510351252964028, 248512.21909045602660626173, 0.99923553066715220528 }, + { 248575.56501938513247296214, 116.40096044107282580171, 116.41841596322554153176, 248512.21158473062678240240, 0.99923553071334780817 }, + { 248574.11260137573117390275, 116.40090737512078078453, 116.41836289787615044133, 248512.67536870026378892362, 0.99923552785888392069 } + },{ + { 0, 1 },{ 2, 2 }, + { 248515.52773222429095767438, 63.55708458763482582299, 63.60944583565664345315, 248452.22805491264443844557, 0.99923590400821504787 }, + { 248515.52763759149820543826, 63.55708458762548218601, 63.60944583564726428904, 248452.22805559608968906105, 0.99923590407101092747 }, + { 248515.52758369332877919078, 63.55708373075069061997, 63.60944497680485909541, 248452.22057304115151055157, 0.99923590411705243142 }, + { 248514.07922688819235190749, 63.55713616893478246084, 63.60949741679156232976, 248452.68231273847050033510, 0.99923590134832684928 } + },{ + { 0, 1 },{ 0, 2 }, + { 110575.06481433614681009203, 0.00000000000000000000, 0.00000000000000000000, 110569.48860416181560140103, 0.99984871368918792900 }, + { 110575.06460189135395921767, 0.00000000000000000000, 0.00000000000000000000, 110569.48860883565794210881, 0.99984871370166705784 }, + { 110575.06481286860071122646, 0.00000000000000000000, 0.00000000000000000000, 110569.48860883565794210881, 0.99984871370166705784 }, + { 110573.82008000080531928688, 0.00000000000000002350, 0.00000000000000002350, 110569.49123749321734067053, 0.99984871370886085895 } + },{ + { 0, 1 },{ -2, 2 }, + { 248515.52773222429095767438, -63.55708458763482582299, -63.60944583565664345315, 248452.22805491264443844557, 0.99923590400821504787 }, + { 248515.52763759149820543826, -63.55708458762548218601, -63.60944583564726428904, 248452.22805559608968906105, 0.99923590407101092747 }, + { 248515.52758369332877919078, -63.55708373075070483083, -63.60944497680488041169, 248452.22057304150075651705, 0.99923590411705254244 }, + { 248514.07922688819235190749, -63.55713616893478246084, -63.60949741679156943519, 248452.68231273873243480921, 0.99923590134832684928 } + },{ + { 0, 1 },{ -2, 0 }, + { 248575.56516798117081634700, -116.40095958069201742546, -116.41841510350248256600, 248512.21908866314333863556, 0.99923553066716652715 }, + { 248575.56515735003631561995, -116.40095958070207871060, -116.41841510351252964028, 248512.21909045602660626173, 0.99923553066715220528 }, + { 248575.56501938513247296214, -116.40096044107282580171, -116.41841596322554153176, 248512.21158473062678240240, 0.99923553071334780817 }, + { 248574.11260137573117390275, -116.40090737512078078453, -116.41836289787615044133, 248512.67536870026378892362, 0.99923552785888392069 } + },{ + { 0, 1 },{ -2, -2 }, + { 399491.95531813317211344838, -146.13617668361155210732, -146.11871581833622713020, 399229.04036820423789322376, 0.99802588852441009859 }, + { 399491.95525925338733941317, -146.13617668363974644308, -146.11871581836444988767, 399229.04037646006327122450, 0.99802588850630413742 }, + { 399491.95420239900704473257, -146.13617768143444664020, -146.11871681681645895878, 399229.03571708971867337823, 0.99802588855242924115 }, + { 399486.91562757542124018073, -146.13670310972554489126, -146.11924224446559605894, 399226.58732164406683295965, 0.99802591281687325075 } + },{ + { 0, 1 },{ 0, -2 }, + { 331723.84192993369651958346, -180.00000000000000000000, -180.00000000000000000000, 331573.30333569750655442476, 0.99863870153788791839 }, + { 331723.84185956208966672421, 180.00000000000000000000, 180.00000000000000000000, 331573.30334328504977747798, 0.99863870152539924163 }, + { 331723.84192803525365889072, 180.00000000000000000000, 180.00000000000000000000, 331573.30334328504977747798, 0.99863870152539924163 }, + { 331720.09633564797695726156, 180.00000000000000000000, 180.00000000000000000000, 331573.30672345001948997378, 0.99863870151614875237 } + },{ + { 0, 1 },{ 2, -2 }, + { 399491.95531813317211344838, 146.13617668361155210732, 146.11871581833622713020, 399229.04036820423789322376, 0.99802588852441009859 }, + { 399491.95525925338733941317, 146.13617668363974644308, 146.11871581836444988767, 399229.04037646006327122450, 0.99802588850630413742 }, + { 399491.95420239900704473257, 146.13617768143444664020, 146.11871681681645895878, 399229.03571708971867337823, 0.99802588855242924115 }, + { 399486.91562757542124018073, 146.13670310972554489126, 146.11924224446559605894, 399226.58732164406683295965, 0.99802591281687325075 } + }, + { + { -1, -1 },{ 2, 0 }, + { 351772.23553088010521605611, 71.69677339271241578444, 71.67058676207953737958, 351592.72256732499226927757, 0.99846922689201267342 }, + { 351772.23552330053644254804, 71.69677339270522509196, 71.67058676207236089795, 351592.72256738768192008138, 0.99846922689200567902 }, + { 351772.23547190619865432382, 71.69677274795321864076, 71.67058611830732672843, 351592.71064292185474187136, 0.99846922699591911243 }, + { 351771.13000385620398446918, 71.69688960494077889507, 71.67070297450321447741, 351594.87308142206165939569, 0.99846920815167106156 } + }, { + { -1, -1 },{ 2, 2 }, + { 470675.27496387914288789034, 45.18799532476352709409, 45.21418997011227247640, 470245.32092262554215267301, 0.99726004843767979136 }, + { 470675.27491378918057307601, 45.18799532474472613330, 45.21418997009345730476, 470245.32093124865787103772, 0.99726004841255500022 }, + { 470675.27385581465205177665, 45.18799424651773222195, 45.21418889088008796762, 470245.31203990190988406539, 0.99726004851631100401 }, + { 470669.97387331607751548290, 45.18767381182056652733, 45.21386845703356982540, 470242.67608062457293272018, 0.99726007931332938394 } + }, { + { -1, -1 },{ 0, 2 }, + { 349898.53698544885264709592, 18.54804530050607525027, 18.55677506382081531910, 349721.87727315956726670265, 0.99848548653821667109 }, + { 349898.53691851865733042359, 18.54804530047409016902, 18.55677506378881247429, 349721.87728093314217403531, 0.99848548652432367323 }, + { 349898.53644461580552160740, 18.54804465014367664821, 18.55677441312981201804, 349721.87595040485030040145, 0.99848548653585678103 }, + { 349894.27001174906035885215, 18.54754137243966738424, 18.55627113576925424354, 349720.85020991315832361579, 0.99848549544738174344 } + }, { + { -1, -1 },{ -2, 2 }, + { 349898.53698544885264709592, -18.54804530050607525027, -18.55677506382081531910, 349721.87727315956726670265, 0.99848548653821667109 }, + { 349898.53691851865733042359, -18.54804530047409016902, -18.55677506378881247429, 349721.87728093314217403531, 0.99848548652432367323 }, + { 349898.53644461580552160740, -18.54804465014367664821, -18.55677441312981201804, 349721.87595040485030040145, 0.99848548653585678103 }, + { 349894.27001174906035885215, -18.54754137243966738424, -18.55627113576928266525, 349720.85020991315832361579, 0.99848549544738174344 } + }, { + { -1, -1 },{ -2, 0 }, + { 156899.56829134028521366417, -45.19676732164486310239, -45.18804022935886877121, 156883.63778222308610565960, 0.99969540695122460772 }, + { 156899.56827460310887545347, -45.19676732162573529195, -45.18804022933975517162, 156883.63778401838499121368, 0.99969540695121617002 }, + { 156899.56792193598812445998, -45.19676624219880523015, -45.18803915024161454994, 156883.63480984271154738963, 0.99969540696276681935 }, + { 156897.79947260793414898217, -45.19644594033049145310, -45.18771884804953486992, 156882.75281389255542308092, 0.99969541038810816325 } + }, { + { -1, -1 },{ -2, -2 }, + { 156876.14940188667969778180, -134.82952991582811819171, -134.80335129773999369718, 156860.22615479407249949872, 0.99969549952259184611 }, + { 156876.14925185780157335103, -134.82952991584656388113, -134.80335129775846780831, 156860.22615983051946386695, 0.99969549954768643918 }, + { 156876.14903264911845326424, -134.82953099167991695140, -134.80335237457535413341, 156860.22319510785746388137, 0.99969549955919845274 }, + { 156874.38594904550700448453, -134.82985169207830722371, -134.80367307400518939176, 156859.34477911840076558292, 0.99969550299904519353 } + }, { + { -1, -1 },{ 0, -2 }, + { 156876.14940188667969778180, 134.82952991582811819171, 134.80335129773999369718, 156860.22615479407249949872, 0.99969549952259184611 }, + { 156876.14925185780157335103, 134.82952991584656388113, 134.80335129775846780831, 156860.22615983051946386695, 0.99969549954768643918 }, + { 156876.14903264911845326424, 134.82953099167994537311, 134.80335237457538255512, 156860.22319510785746388137, 0.99969549955919856377 }, + { 156874.38594904550700448453, 134.82985169207830722371, 134.80367307400518939176, 156859.34477911840076558292, 0.99969550299904519353 } + }, { + { -1, -1 },{ 2, -2 }, + { 351676.50043935602298006415, 108.36087395536006283692, 108.28232205125480902552, 351497.13544799503870308399, 0.99847006808788085763 }, + { 351676.50037266127765178680, 108.36087395536665667350, 108.28232205126143128382, 351497.13543194788508117199, 0.99847006821303718738 }, + { 351676.50038040406070649624, 108.36087459655153963922, 108.28232269539883247944, 351497.12354394816793501377, 0.99847006831660412018 }, + { 351675.39839278126601129770, 108.36075825022818719390, 108.28220634670809374711, 351499.26940269087208434939, 0.99847004976658149111 } + }, { + { -1, 1 },{ 2, 0 }, + { 351772.23553088010521605611, 108.30322660728758421556, 108.32941323792046262042, 351592.72256732499226927757, 0.99846922689201267342 }, + { 351772.23552330053644254804, 108.30322660729477490804, 108.32941323792763910205, 351592.72256738756550475955, 0.99846922689200567902 }, + { 351772.23547190619865432382, 108.30322725204678135924, 108.32941388169267327157, 351592.71064292197115719318, 0.99846922699591911243 }, + { 351771.13000385620398446918, 108.30311039505922110493, 108.32929702549677131174, 351594.87308142217807471752, 0.99846920815167106156 } + }, { + { -1, 1 },{ 2, 2 }, + { 351676.50043935602298006415, 71.63912604463993716308, 71.71767794874519097448, 351497.13544799503870308399, 0.99847006808788085763 }, + { 351676.50037266127765178680, 71.63912604463332911564, 71.71767794873858292704, 351497.13543194829253479838, 0.99847006821303718738 }, + { 351676.50038040406070649624, 71.63912540344847457163, 71.71767730460115330970, 351497.12354394729482010007, 0.99847006831660423121 }, + { 351675.39839278126601129770, 71.63924174977181280610, 71.71779365329189204203, 351499.26940269029000774026, 0.99847004976658149111 } + }, { + { -1, 1 },{ 0, 2 }, + { 156876.14940188667969778180, 45.17047008417186759743, 45.19664870225999919739, 156860.22615479407249949872, 0.99969549952259184611 }, + { 156876.14925185780157335103, 45.17047008415342190801, 45.19664870224154640255, 156860.22615983063587918878, 0.99969549954768632816 }, + { 156876.14903264911845326424, 45.17046900832006883775, 45.19664762542461744488, 156860.22319510774104855955, 0.99969549955919845274 }, + { 156874.38594904550700448453, 45.17014830792169988172, 45.19632692599481060824, 156859.34477911831345409155, 0.99969550299904519353 } + }, { + { -1, 1 },{ -2, 2 }, + { 156876.14940188667969778180, -45.17047008417186759743, -45.19664870225999919739, 156860.22615479407249949872, 0.99969549952259184611 }, + { 156876.14925185780157335103, -45.17047008415342190801, -45.19664870224154640255, 156860.22615983063587918878, 0.99969549954768632816 }, + { 156876.14903264911845326424, -45.17046900832009015403, -45.19664762542463876116, 156860.22319510785746388137, 0.99969549955919856377 }, + { 156874.38594904550700448453, -45.17014830792169988172, -45.19632692599484613538, 156859.34477911848807707429, 0.99969550299904519353 } + }, { + { -1, 1 },{ -2, 0 }, + { 156899.56829134028521366417, -134.80323267835512979218, -134.81195977064112412336, 156883.63778222308610565960, 0.99969540695122460772 }, + { 156899.56827460310887545347, -134.80323267837425760263, -134.81195977066025193380, 156883.63778401838499121368, 0.99969540695121617002 }, + { 156899.56792193598812445998, -134.80323375780119476985, -134.81196084975837834463, 156883.63480984274065122008, 0.99969540696276681935 }, + { 156897.79947260793414898217, -134.80355405966952275776, -134.81228115195048644637, 156882.75281389255542308092, 0.99969541038810816325 } + }, { + { -1, 1 },{ -2, -2 }, + { 349898.53698544885264709592, -161.45195469949391053888, -161.44322493617917757547, 349721.87727315956726670265, 0.99848548653821667109 }, + { 349898.53691851865733042359, -161.45195469952594180540, -161.44322493621118042029, 349721.87728093314217403531, 0.99848548652432367323 }, + { 349898.53644461580552160740, -161.45195534985634822078, -161.44322558687019864010, 349721.87595040485030040145, 0.99848548653585678103 }, + { 349894.27001174906035885215, -161.45245862756033261576, -161.44372886423073509832, 349720.85020991315832361579, 0.99848549544738174344 } + }, { + { -1, 1 },{ 0, -2 }, + { 349898.53698544885264709592, 161.45195469949391053888, 161.44322493617917757547, 349721.87727315956726670265, 0.99848548653821667109 }, + { 349898.53691851865733042359, 161.45195469952594180540, 161.44322493621118042029, 349721.87728093314217403531, 0.99848548652432367323 }, + { 349898.53644461580552160740, 161.45195534985634822078, 161.44322558687019864010, 349721.87595040485030040145, 0.99848548653585678103 }, + { 349894.27001174906035885215, 161.45245862756033261576, 161.44372886423073509832, 349720.85020991315832361579, 0.99848549544738174344 } + }, { + { -1, 1 },{ 2, -2 }, + { 470675.27496387914288789034, 134.81200467523646580048, 134.78581002988772752360, 470245.32092262554215267301, 0.99726004843767979136 }, + { 470675.27491378918057307601, 134.81200467525528097212, 134.78581002990657111695, 470245.32093124854145571589, 0.99726004841255500022 }, + { 470675.27385581465205177665, 134.81200575348228198891, 134.78581110911991913781, 470245.31203990190988406539, 0.99726004851631100401 }, + { 470669.97387331607751548290, 134.81232618817941215639, 134.78613154296644438546, 470242.67608062474755570292, 0.99726007931332960599 } + }, { + { 1, 1 },{ 2, 0 }, + { 156899.56829134028521366417, 134.80323267835512979218, 134.81195977064112412336, 156883.63778222308610565960, 0.99969540695122460772 }, + { 156899.56827460310887545347, 134.80323267837425760263, 134.81195977066025193380, 156883.63778401838499121368, 0.99969540695121617002 }, + { 156899.56792193598812445998, 134.80323375780122319156, 134.81196084975840676634, 156883.63480984268244355917, 0.99969540696276681935 }, + { 156897.79947260793414898217, 134.80355405966952275776, 134.81228115195048644637, 156882.75281389255542308092, 0.99969541038810816325 } + }, { + { 1, 1 },{ 2, 2 }, + { 156876.14940188667969778180, 45.17047008417186759743, 45.19664870225999919739, 156860.22615479407249949872, 0.99969549952259184611 }, + { 156876.14925185780157335103, 45.17047008415342190801, 45.19664870224154640255, 156860.22615983063587918878, 0.99969549954768632816 }, + { 156876.14903264911845326424, 45.17046900832006883775, 45.19664762542461744488, 156860.22319510774104855955, 0.99969549955919845274 }, + { 156874.38594904550700448453, 45.17014830792169988172, 45.19632692599481060824, 156859.34477911831345409155, 0.99969550299904519353 } + }, { + { 1, 1 },{ 0, 2 }, + { 156876.14940188667969778180, -45.17047008417186759743, -45.19664870225999919739, 156860.22615479407249949872, 0.99969549952259184611 }, + { 156876.14925185780157335103, -45.17047008415342190801, -45.19664870224154640255, 156860.22615983063587918878, 0.99969549954768632816 }, + { 156876.14903264911845326424, -45.17046900832009015403, -45.19664762542463876116, 156860.22319510785746388137, 0.99969549955919856377 }, + { 156874.38594904550700448453, -45.17014830792169988172, -45.19632692599484613538, 156859.34477911848807707429, 0.99969550299904519353 } + }, { + { 1, 1 },{ -2, 2 }, + { 351676.50043935602298006415, -71.63912604463993716308, -71.71767794874519097448, 351497.13544799503870308399, 0.99847006808788085763 }, + { 351676.50037266127765178680, -71.63912604463332911564, -71.71767794873858292704, 351497.13543194829253479838, 0.99847006821303718738 }, + { 351676.50038040406070649624, -71.63912540344847457163, -71.71767730460118173141, 351497.12354394828435033560, 0.99847006831660412018 }, + { 351675.39839278126601129770, -71.63924174977181280610, -71.71779365329184940947, 351499.26940268895123153925, 0.99847004976658171316 } + }, { + { 1, 1 },{ -2, 0 }, + { 351772.23553088010521605611, -108.30322660728758421556, -108.32941323792046262042, 351592.72256732499226927757, 0.99846922689201267342 }, + { 351772.23552330053644254804, -108.30322660729477490804, -108.32941323792763910205, 351592.72256738756550475955, 0.99846922689200567902 }, + { 351772.23547190619865432382, -108.30322725204673872668, -108.32941388169263063901, 351592.71064292272785678506, 0.99846922699591933448 }, + { 351771.13000385620398446918, -108.30311039505922110493, -108.32929702549677131174, 351594.87308142217807471752, 0.99846920815167106156 } + }, { + { 1, 1 },{ -2, -2 }, + { 470675.27496387914288789034, -134.81200467523646580048, -134.78581002988772752360, 470245.32092262554215267301, 0.99726004843767979136 }, + { 470675.27491378918057307601, -134.81200467525528097212, -134.78581002990657111695, 470245.32093124854145571589, 0.99726004841255500022 }, + { 470675.27385581465205177665, -134.81200575348222514549, -134.78581110911991913781, 470245.31203990196809172630, 0.99726004851631100401 }, + { 470669.97387331607751548290, -134.81232618817941215639, -134.78613154296644438546, 470242.67608062474755570292, 0.99726007931332960599 } + }, { + { 1, 1 },{ 0, -2 }, + { 349898.53698544885264709592, -161.45195469949391053888, -161.44322493617917757547, 349721.87727315956726670265, 0.99848548653821667109 }, + { 349898.53691851865733042359, -161.45195469952594180540, -161.44322493621118042029, 349721.87728093314217403531, 0.99848548652432367323 }, + { 349898.53644461580552160740, -161.45195534985634822078, -161.44322558687019864010, 349721.87595040485030040145, 0.99848548653585678103 }, + { 349894.27001174906035885215, -161.45245862756033261576, -161.44372886423073509832, 349720.85020991315832361579, 0.99848549544738174344 } + }, { + { 1, 1 },{ 2, -2 }, + { 349898.53698544885264709592, 161.45195469949391053888, 161.44322493617917757547, 349721.87727315956726670265, 0.99848548653821667109 }, + { 349898.53691851865733042359, 161.45195469952594180540, 161.44322493621118042029, 349721.87728093314217403531, 0.99848548652432367323 }, + { 349898.53644461580552160740, 161.45195534985634822078, 161.44322558687019864010, 349721.87595040485030040145, 0.99848548653585678103 }, + { 349894.27001174906035885215, 161.45245862756033261576, 161.44372886423073509832, 349720.85020991315832361579, 0.99848549544738174344 } + }, { + { 1, -1 },{ 2, 0 }, + { 156899.56829134028521366417, 45.19676732164486310239, 45.18804022935886877121, 156883.63778222308610565960, 0.99969540695122460772 }, + { 156899.56827460310887545347, 45.19676732162573529195, 45.18804022933975517162, 156883.63778401838499121368, 0.99969540695121617002 }, + { 156899.56792193598812445998, 45.19676624219878391386, 45.18803915024158612823, 156883.63480984268244355917, 0.99969540696276681935 }, + { 156897.79947260793414898217, 45.19644594033049145310, 45.18771884804951355363, 156882.75281389255542308092, 0.99969541038810816325 } + }, { + { 1, -1 },{ 2, 2 }, + { 349898.53698544885264709592, 18.54804530050607525027, 18.55677506382081531910, 349721.87727315956726670265, 0.99848548653821667109 }, + { 349898.53691851865733042359, 18.54804530047409016902, 18.55677506378881247429, 349721.87728093314217403531, 0.99848548652432367323 }, + { 349898.53644461580552160740, 18.54804465014367664821, 18.55677441312981201804, 349721.87595040485030040145, 0.99848548653585678103 }, + { 349894.27001174906035885215, 18.54754137243966738424, 18.55627113576925424354, 349720.85020991315832361579, 0.99848549544738174344 } + }, { + { 1, -1 },{ 0, 2 }, + { 349898.53698544885264709592, -18.54804530050607525027, -18.55677506382081531910, 349721.87727315956726670265, 0.99848548653821667109 }, + { 349898.53691851865733042359, -18.54804530047409016902, -18.55677506378881247429, 349721.87728093314217403531, 0.99848548652432367323 }, + { 349898.53644461580552160740, -18.54804465014367664821, -18.55677441312981201804, 349721.87595040485030040145, 0.99848548653585678103 }, + { 349894.27001174906035885215, -18.54754137243966738424, -18.55627113576928266525, 349720.85020991315832361579, 0.99848549544738174344 } + }, { + { 1, -1 },{ -2, 2 }, + { 470675.27496387914288789034, -45.18799532476352709409, -45.21418997011227247640, 470245.32092262554215267301, 0.99726004843767979136 }, + { 470675.27491378918057307601, -45.18799532474472613330, -45.21418997009345730476, 470245.32093124865787103772, 0.99726004841255500022 }, + { 470675.27385581465205177665, -45.18799424651773932737, -45.21418889088011638933, 470245.31203990196809172630, 0.99726004851631100401 }, + { 470669.97387331607751548290, -45.18767381182056652733, -45.21386845703356271997, 470242.67608062445651739836, 0.99726007931332938394 } + }, { + { 1, -1 },{ -2, 0 }, + { 351772.23553088010521605611, -71.69677339271241578444, -71.67058676207953737958, 351592.72256732499226927757, 0.99846922689201267342 }, + { 351772.23552330053644254804, -71.69677339270522509196, -71.67058676207236089795, 351592.72256738768192008138, 0.99846922689200567902 }, + { 351772.23547190619865432382, -71.69677274795323285161, -71.67058611830736936099, 351592.71064292214578017592, 0.99846922699591911243 }, + { 351771.13000385620398446918, -71.69688960494077889507, -71.67070297450322868826, 351594.87308142206165939569, 0.99846920815167106156 } + }, { + { 1, -1 },{ -2, -2 }, + { 351676.50043935602298006415, -108.36087395536006283692, -108.28232205125480902552, 351497.13544799503870308399, 0.99847006808788085763 }, + { 351676.50037266127765178680, -108.36087395536665667350, -108.28232205126143128382, 351497.13543194788508117199, 0.99847006821303718738 }, + { 351676.50038040406070649624, -108.36087459655152542837, -108.28232269539881826859, 351497.12354394845897331834, 0.99847006831660412018 }, + { 351675.39839278126601129770, -108.36075825022818719390, -108.28220634670809374711, 351499.26940269087208434939, 0.99847004976658149111 } + }, { + { 1, -1 },{ 0, -2 }, + { 156876.14940188667969778180, -134.82952991582811819171, -134.80335129773999369718, 156860.22615479407249949872, 0.99969549952259184611 }, + { 156876.14925185780157335103, -134.82952991584656388113, -134.80335129775846780831, 156860.22615983051946386695, 0.99969549954768643918 }, + { 156876.14903264911845326424, -134.82953099167991695140, -134.80335237457535413341, 156860.22319510785746388137, 0.99969549955919845274 }, + { 156874.38594904550700448453, -134.82985169207830722371, -134.80367307400518939176, 156859.34477911840076558292, 0.99969550299904519353 } + }, { + { 1, -1 },{ 2, -2 }, + { 156876.14940188667969778180, 134.82952991582811819171, 134.80335129773999369718, 156860.22615479407249949872, 0.99969549952259184611 }, + { 156876.14925185780157335103, 134.82952991584656388113, 134.80335129775846780831, 156860.22615983051946386695, 0.99969549954768643918 }, + { 156876.14903264911845326424, 134.82953099167994537311, 134.80335237457538255512, 156860.22319510785746388137, 0.99969549955919856377 }, + { 156874.38594904550700448453, 134.82985169207830722371, 134.80367307400518939176, 156859.34477911840076558292, 0.99969550299904519353 } + }, { + // near pole + {90, -45}, {90, -80}, + {3900195.49395913071930408478, -180.00000000000000000000, -180.00000000000000000000, 3662502.04478993499651551247, 0.81922976250863166481}, + {3900195.49395686946809291840, 180.00000000000000000000, 180.00000000000000000000, 3662502.06126507185399532318, 0.81922976508736944368}, + {3900195.49053949490189552307, 180.00000000000000000000, 180.00000000000000000000, 3662502.06126507185399532318, 0.81922976508736944368}, + {3900203.61653685756027698517, 180.00000000000000000000, 180.00000000000000000000, 3662507.91531699104234576225, 0.81923068138101373670} + }, { + // pole, same lon + {90, -45}, {90, -90}, + {5017021.35133497882634401321, -180.00000000000000000000, -180.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172}, + {5017021.35133314039558172226, 180.00000000000000000000, 180.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172}, + {5017021.34791153203696012497, 180.00000000000000000000, 180.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172}, + {5017017.85355509258806705475, 180.00000000000000000000, 180.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172} + }, { + // pole + {90, -45}, {0, -90}, + {5017021.35133497882634401321, -180.00000000000000000000, -90.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172}, + {5017021.35133314039558172226, 180.00000000000000000000, -90.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172}, + {5017021.34791153203696012497, 180.00000000000000000000, -90.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172}, + {5017017.85355509258806705475, 180.00000000000000000000, -90.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172} + }, { + // near pole + {90, 45}, {90, 80}, + {3900195.49395913071930408478, 0.00000000000000000000, 0.00000000000000000000, 3662502.04478993499651551247, 0.81922976250863166481}, + {3900195.49395686946809291840, 0.00000000000000000000, 0.00000000000000000000, 3662502.06126507185399532318, 0.81922976508736944368}, + {3900195.49053949490189552307, 0.00000000000000000000, 0.00000000000000000000, 3662502.06126507185399532318, 0.81922976508736944368}, + {3900203.61653685756027698517, 0.00000000000000000076, 0.00000000000000000071, 3662507.91531699104234576225, 0.81923068138101373670} + }, { + // pole, same lon + {90, 45}, {90, 90}, + {5017021.35133497882634401321, 0.00000000000000000000, 0.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172}, + {5017021.35133314039558172226, 0.00000000000000000000, 0.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172}, + {5017021.34791153203696012497, 0.00000000000000000000, 0.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172}, + {5017017.85355509258806705475, 0.00000000000000000000, 0.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172} + }, { + // pole + {90, 45}, {0, 90}, + {5017021.35133497882634401321, -0.00000000000000000000, -90.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172}, + {5017021.35133314039558172226, -0.00000000000000496992, -90.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172}, + {5017021.34791153203696012497, 0.00000000000000000000, -90.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172}, + {5017017.85355509258806705475, 0.00000000000000000000, -90.00000000000000000000, 4517590.87884893082082271576, 0.70710678118654746172} + }, { + // pole + {0, -90}, {90, -45}, + {5017021.35133497882634401321, 90.00000000000000000000, 0.00000000000000000000, 4517590.87884893082082271576, 0.70778496454077310940}, + {5017021.35133314039558172226, 90.00000000000000000000, 0.00000000000000496992, 4517590.87884893082082271576, 0.70778494508412304054}, + {5017021.34791153203696012497, 90.00000000000000000000, 0.00000000000000000000, 4517590.87884893082082271576, 0.70778494508412304054}, + {5017017.85355509258806705475, 90.00000000000000000000, 0.00000000000000000000, 4517590.87884893082082271576, 0.70777827352623101653} + }, { + // pole + {0, 90}, {90, 45}, + {5017021.35133497882634401321, 90.00000000000000000000, -180.00000000000000000000, 4517590.87884893082082271576, 0.70778496454077310940}, + {5017021.35133314039558172226, 90.00000000000000000000, 180.00000000000000000000, 4517590.87884893082082271576, 0.70778494508412304054}, + {5017021.34791153203696012497, 90.00000000000001421085, 180.00000000000000000000, 4517590.87884893082082271576, 0.70778494508412304054}, + {5017017.85355509258806705475, 90.00000000000000000000, 180.00000000000000000000, 4517590.87884893082082271576, 0.70777827352623101653} + }, { + {90, -45}, {90, 45}, + {9969888.75595548748970031738, 0.00000000000000000000, 0.00000000000000000000, 6361290.27546359039843082428, 0.00431189731318673553}, + {9969888.75595730356872081757, 0.00000000000000000000, 0.00000000000000000000, 6361290.36011654324829578400, 0.00431188406305459994}, + {9969888.73915978334844112396, 0.00000000000000000000, 0.00000000000000000000, 6361290.36011654324829578400, 0.00431188406305459994}, + {9969881.64984572120010852814, 0.00000000000000001848, 0.00000000000000001176, 6361314.54906367603689432144, 0.00430809793699618842} + }, { + {90, 45}, {90, -45}, + {9969888.75595548748970031738, -180.00000000000000000000, -180.00000000000000000000, 6361290.27546359039843082428, 0.00431189731318673553}, + {9969888.75595730356872081757, 180.00000000000000000000, 180.00000000000000000000, 6361290.36011654324829578400, 0.00431188406305459994}, + {9969888.73915978334844112396, 180.00000000000000000000, 180.00000000000000000000, 6361290.36011654324829578400, 0.00431188406305459994}, + {9969881.64984572120010852814, 180.00000000000000000000, 180.00000000000000000000, 6361314.54906367603689432144, 0.00430809793699618842} + }, { + // pole, same lon + {90, 0}, {90, 90}, + {10001965.72931272350251674652, 0.00000000000000000000, 0.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001965.72931179217994213104, 0.00000000000000000000, 0.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001965.71749142371118068695, 0.00000000000000000000, 0.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001958.67847795411944389343, 0.00000000000000000000, 0.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000} + }, { + // pole + {90, 0}, {0, 90}, + {10001965.72931272350251674652, -0.00000000000000000000, -90.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001965.72931179217994213104, -0.00000000000000352016, -90.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001965.71749142371118068695, 0.00000000000000000000, -90.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001958.67847795411944389343, 0.00000000000000000000, -90.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000} + }, { + // pole, different lon + {0, 0}, {1, 90}, + {10001965.72931272350251674652, 0.00000000000000000000, 1.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001965.72931179217994213104, 0.00000000000000006144, 1.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001965.71749142371118068695, 0.00000000000000000000, 0.99999999999998867573, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001958.67847795411944389343, 0.00000000000000000000, 0.99999999999998867573, 6378136.99999999906867742538, 0.00000000000000000000} + }, { + // pole, different lon + {0, 0}, {-1, 90}, + {10001965.72931272350251674652, -0.00000000000000000000, -1.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001965.72931179217994213104, -0.00000000000000006144, -1.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001965.71749142371118068695, 0.00000000000000000000, -1.00000000000001421085, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001958.67847795411944389343, 0.00000000000000000000, -0.99999999999998867573, 6378136.99999999906867742538, 0.00000000000000000000} + }, { + // pole, different lon + {0, 0}, {1, -90}, + {10001965.72931272350251674652, -180.00000000000000000000, 179.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001965.72931179217994213104, 180.00000000000000000000, 179.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001965.71749142371118068695, 180.00000000000000000000, 179.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001958.67847795411944389343, 180.00000000000000000000, 179.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000} + }, { + // pole, different lon + {0, 0}, {-1, -90}, + {10001965.72931272350251674652, -180.00000000000000000000, -179.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001965.72931179217994213104, -180.00000000000000000000, -179.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001965.71749142371118068695, 180.00000000000000000000, -179.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000}, + {10001958.67847795411944389343, 180.00000000000000000000, -179.00000000000000000000, 6378136.99999999906867742538, 0.00000000000000000000} + } + /*, { + // antipodal + {-90, -45}, {90, 45}, + {20003931.45862544700503349304, -180.00000000000000000000, 0.00000000000000000000, 33675.52452803074265830219, -0.99472900658949181540}, + {19987083.06974205747246742249, 90.00000000000000000000, 90.00000000000000000000, 00000.00000000078240703623, -1.00000000000000000000}, + {00000000.00000000000000000000, 0.00000000000000000000, 0.00000000000000000000, 000000.00000000000000000000, 1.00000000000000000000}, + {20020712.84987257421016693115, 0.00000000000000000000, 0.00000000000000000000, 6361314.54906367603689432144, 0.00430809793699618842} + },{ + // antipodal + {-90, 45}, {90, -45}, + {20003931.45862544700503349304, 0.00000000000000000000, -180.00000000000000000000, 33675.52452803074265830219, -0.99472900658949181540}, + {19987083.06974205747246742249, 90.00000000000000000000, 90.00000000000000000000, -000000.00000000078240703623, -1.00000000000000000000}, + {00000000.00000000000000000000, 0.00000000000000000000, 0.00000000000000000000, 000000.00000000000000000000, 1.00000000000000000000}, + {20020712.84987257421016693115, 180.00000000000000000000, 0.00000000000000000000, 33590.79639541531651047990, -1.00525773151080621837} + } + // pi = 3.1415926535897931 + // r2d = 57.295779513082323 + // commented out because of inconsistencies + /*, { + {0.26387320519564444 * 57.295779513082323, 0.84008767903244352 * 57.295779513082323}, + {0.26387320679785603 * 57.295779513082323, 0.84008767099694759 * 57.295779513082323}, + {0.051647212499179529, 172.39749230932208, 172.39749237768564, 0.051647212499179536, 1.0000000000000000}, + {0.051647209427812361, 172.39750897806516, 172.39750904523200, 0.051638407375539180, 0.99999999999999734}, + // TODO: This is wrong + {0.00000000000000000, 0.00000000000000000, 0.00000000000000000, 0.00000000000000000, 1.0000000000000000}, + {0.00000000000000000, 0.00000000000000000, 0.00000000000000000, -0.051193490763866173, 1.0000000000000000} + }, { + {0.26387320519564444 * 57.295779513082323, 0.84008767903244352 * 57.295779513082323}, + {(0.26387320679785603 - 3.1415926535897931) * 57.295779513082323, -0.84008767099694759 * 57.295779513082323}, + {20003931.407432225, -1.3045327945402774e-05, -179.99998695467218, 30010.522036068141, -0.99475954491334551}, + {20003669.536724485, -7.5912543895164619, -172.40874567755344, 29487.136123182696, -0.99480541226332386}, + // TODO: This is wrong + {0.00000000000000000, 0.00000000000000000, 0.00000000000000000, 0.00000000000000000, 1.0000000000000000}, + {20018879.436128609, 0.00000000000000000, 180.00000000000000, 29935.015234617360, -0.99477272997811228} + }*/ +}; + +size_t const expected_size = sizeof(expected) / sizeof(expected_results); + +#endif // BOOST_GEOMETRY_TEST_INVERSE_CASES_HPP diff --git a/src/boost/libs/geometry/test/formulas/inverse_cases_antipodal.hpp b/src/boost/libs/geometry/test/formulas/inverse_cases_antipodal.hpp new file mode 100644 index 000000000..e66046dd5 --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/inverse_cases_antipodal.hpp @@ -0,0 +1,342 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2018 Adeel Ahmad, Islamabad, Pakistan. + +// Contributed and/or modified by Adeel Ahmad, as part of Google Summer of Code 2018 program. + +// 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) + +#ifndef BOOST_GEOMETRY_TEST_INVERSE_CASES_ANTIPODAL_HPP +#define BOOST_GEOMETRY_TEST_INVERSE_CASES_ANTIPODAL_HPP + +#include "inverse_cases.hpp" + +struct expected_results_antipodal +{ + coordinates p1; + coordinates p2; + expected_result karney; +}; + +/* + These values are collected from GeodTest which is associated with GeographicLib: + https://zenodo.org/record/32156 + + The conversion to C++ array format is done using this Python script: + https://github.com/adl1995/boost-geometry-extra/blob/master/geographiclib-dataset-parse-inverse.py + + Geodesic scale (M12) is absent from the GeodTest dataset, so it is manually generated + using GeographicLib using this C++ script: + https://github.com/adl1995/boost-geometry-extra/blob/master/geographicLib-direct-antipodal.cpp +*/ +expected_results_antipodal expected_antipodal[] = +{ + { + { 0, 31.394417440639 }, { 179.615601631202912322, -31.275540610835465807 }, + { 19980218.4055399, 34.266322930672, 145.782701113414306756, 49490.8807994496209, -0.996116451012525883079717914370121434 } + },{ + { 0, 29.788792273749 }, { 178.569451327813675741, -29.558013672069422725 }, + { 19887224.5407334, 74.302205994192, 106.156240654579267308, 97043.7545600593058, -0.998624031147844926081802441331092268 } + },{ + { 0, 46.471843094141 }, { 179.083144618009561276, -46.284166405924629853 }, + { 19944337.8863917, 63.693680310665, 116.699978859005570535, 53139.140576552365, -0.997597309645591900917338534782174975 } + },{ + { 0, 63.016506345929 }, { 179.862869954071637855, -63.02943882703369735 }, + { 20000925.7533636, 153.393656073038, 26.619056019474552953, 12713.9284725111772, -1.00381317792143387457315384381217882 } + },{ + { 0, 19.796231412719 }, { 179.546498474461283862, -19.470586923091672503 }, + { 19956338.1330537, 28.272934411318, 151.789094611690988249, 87191.1749625132931, -0.997015409027664833985227232915349305 } + },{ + { 0, 6.373459459035 }, { 179.240009269347556917, -6.204887833274217382 }, + { 19946581.6983394, 56.859050230583, 123.169200847008284851, 53958.8698005263939, -0.999349049081101004077254401636309922 } + },{ + { 0, 66.380766469414 }, { 179.632633596894388233, -66.27177494016956425 }, + { 19986277.7696849, 38.646950203356, 141.550919825824399405, 22198.215635049214, -0.996949176054954366854587988200364634 } + },{ + { 0, 16.483421185231 }, { 179.731567273052604726, -16.818424446748042212 }, + { 19962737.9842573, 163.431254767325, 16.598399455529231288, 95318.4104529881431, -1.00272210232979741562076014815829694 } + },{ + { 0, 4.215702155486 }, { 179.093771177769992874, -4.051917290690976764 }, + { 19932517.393764, 65.543168480886, 114.482669479963380006, 55205.4553703842317, -0.999655858425056553784315838129259646 } + },{ + { 0, 40.71372085907 }, { 179.404612926861498984, -41.047052242159400671 }, + { 19951133.3595356, 143.672151631634, 36.54002600969304553, 70931.1530155553621, -1.00414169574077272173440178448799998 } + },{ + { 0, 15.465481491654 }, { 179.020726605204181801, -14.622355549425900341 }, + { 19877383.8879911, 36.289185640976, 143.875673907461159912, 156419.0806764376957, -0.997639074397169589580869342171354219 } + },{ + { 0, 17.586197343531 }, { 179.722490735835379144, -17.731394230364437075 }, + { 19982280.4639115, 157.929615091529, 22.089021105298661023, 69727.5357849255557, -1.00280451698301242835498214844847098 } + },{ + { 0, 5.7442768247 }, { 178.85894724576868462, -6.039853564481335581 }, + { 19902873.7431814, 116.146983678305, 63.91482549951374061, 87149.6188944111673, -1.00039332893096744037109147029696032 } + },{ + { 0, 32.002904282111 }, { 179.744925422107715439, -32.297934520693132807 }, + { 19967670.3104795, 163.052160078191, 17.004175883388454943, 78311.3164829640582, -1.00449903445302446414189034840092063 } + },{ + { 0, 55.902716926362 }, { 179.300685189522463007, -55.934320218634018206 }, + { 19970525.337607, 98.927641063414, 81.374264168520557301, 23554.0093185709067, -1.00072788779083454713259015989024192 } + },{ + { 0, 22.69939784398 }, { 179.294173474584020749, -22.654875407651067149 }, + { 19959286.1903172, 74.253870776761, 105.811588890213155275, 22369.7179951557679, -0.998972181419003457669703038845909759 } + },{ + { 0, 41.312328471121 }, { 179.817186837717804928, -40.954523601529804886 }, + { 19962690.5721867, 11.277616109847, 168.784288786443902199, 77252.6121237260201, -0.994825151471527391322524636052548885 } + },{ + { 0, 27.927415327453 }, { 179.636508875679110143, -27.607314264234172721 }, + { 19961296.8828333, 23.166421459647, 156.905194492817275222, 83096.5801709291101, -0.995959692767656723511038308060960844 } + },{ + { 0, 41.567228741451 }, { 179.931812964300204608, -42.103039532074194347 }, + { 19944253.4454809, 176.66609526064, 3.361859685835349219, 96859.08180779197, -1.00513607140487626345759508694754913 } + },{ + { 0, 37.384208978567 }, { 179.225180174670992261, -36.916085670712060029 }, + { 19928705.5911445, 39.072534864532, 141.212743814390850106, 92667.7834060578402, -0.995955516859159284415170532156480476 } + },{ + { 0, 59.011868682852 }, { 179.424923485514312807, -58.82705468054708336 }, + { 19970442.3788306, 44.970301291063, 135.333817989802309531, 38071.1136293083857, -0.996658942892707400140750451100757346 } + },{ + { 0, 35.515406087737 }, { 179.50369572149476218, -35.119747127350258822 }, + { 19948918.9139751, 28.528972431952, 151.622257906284404073, 84564.0387217601751, -0.995562861799169418475230486365035176 } + },{ + { 0, 58.170252463184 }, { 179.254737571455023977, -58.372261836268550805 }, + { 19961407.0813807, 128.021116291844, 52.399129705193347143, 43715.3070711393309, -1.00285273713280753682397516968194395 } + },{ + { 0, 34.012183807959 }, { 179.83713352180447672, -34.29640782899529639 }, + { 19970955.843065, 168.944519134772, 11.093048811826875835, 76493.5814538538151, -1.0047652354558671561335359001532197 } + },{ + { 0, 45.510762948553 }, { 178.981682578823726535, -45.582753595227824235 }, + { 19940248.3450143, 99.886784003837, 80.542330522982505877, 48555.1946627894972, -1.00083807750906350619857221317943186 } + },{ + { 0, 4.19841765451 }, { 179.398024428225540172, -4.198416896099783242 }, + { 19970496.5132933, 89.561550657928, 90.438456568689151881, 14.8790480103109, -0.999994104810285944218151144013972953 } + },{ + { 0, 40.890119148103 }, { 179.6557148951668192, -41.553556264538302258 }, + { 19926563.5817492, 165.437641169967, 14.713597527941311478, 111805.7305227545923, -1.00492294933406567380984597548376769 } + },{ + { 0, 28.096672787686 }, { 178.606868012231657724, -28.472055035513955205 }, + { 19883901.8482359, 115.174366374632, 65.257367020445564176, 107880.4353518862363, -1.00170803073331593502359737613005564 } + },{ + { 0, 6.50572154271 }, { 178.926013840891647541, -6.411745140559297675 }, + { 19917276.4101551, 79.069492719523, 100.985091481519557845, 57073.3242952680707, -0.999736666933808471036115861352300271 } + },{ + { 0, .468835109567 }, { 178.325942223692180692, -.281751687044281805 }, + { 19849380.7342734, 80.234636214474, 99.77243368342786593, 123845.4568822078908, -0.999801437209140719808431185811059549 } + },{ + { 0, 1.682746325049 }, { 179.717131561406935483, -.677647430701204515 }, + { 19890026.0274781, 10.076182752451, 169.927471515299313238, 177917.2104306563981, -0.999538055691262194990542866435134783 } + },{ + { 0, 10.711305126218 }, { 179.874050163405229937, -10.349315378531556046 }, + { 19962987.2134077, 7.528253696796, 172.480576051850009046, 104175.1095378254456, -0.998071853755238880268052525934763253 } + },{ + { 0, 53.374321544652 }, { 179.729445806011012057, -53.196257519024042184 }, + { 19980478.1457438, 23.324715976877, 156.777734080146664812, 41907.8869272231053, -0.995333596277707566279957518418086693 } + },{ + { 0, 39.680221664519 }, { 179.87506206720154785, -39.256187213040660911 }, + { 19956191.7841809, 7.075406493429, 172.967624741991546131, 86943.8110669895148, -0.994801087909667924868983845954062417 } + },{ + { 0, 1.377666714083 }, { 178.994542525209058878, -1.415358715570225495 }, + { 19925401.4931301, 95.29199069739, 84.7178724483824156, 45800.9140624827059, -0.99999803170512457928253979844157584 } + },{ + { 0, 48.751426624188 }, { 179.661697715070846977, -48.688146707479475147 }, + { 19988599.1160495, 40.252328570137, 139.808452951157199824, 26322.3790862461568, -0.995999245724129789181233718409202993 } + },{ + { 0, 59.443039048494 }, { 179.247605418616998285, -59.454371825393424121 }, + { 19969935.9534732, 93.052184108221, 87.331416513795326158, 25342.4691896499534, -1.00020727848897084122370415570912883 } + },{ + { 0, 4.122408476235 }, { 179.749430572914989772, -4.689124208743755363 }, + { 19938291.6332293, 167.73479753304, 12.274635577599782826, 127855.6475863583497, -1.00068600902837667732114823593292385 } + },{ + { 0, 46.422470082432 }, { 178.857408435141563774, -46.390934261324541952 }, + { 19931980.7029341, 86.67365350297, 93.852683224054943377, 56114.680046867064, -0.999607096116300386512421027873642743 } + },{ + { 0, 32.614423729024 }, { 179.460593512880455451, -32.01874745886238612 }, + { 19926887.3785175, 24.943814520557, 155.229917137448282531, 112355.3319340873104, -0.995562150676871926435751447570510209 } + },{ + { 0, 3.242895277973 }, { 179.556428318080663113, -3.001106476068264917 }, + { 19964490.4789049, 30.247458779683, 149.760178923092147784, 80929.0418317066044, -0.999474184270344845337774586369050667 } + },{ + { 0, 6.29069210113 }, { 178.556859259685624933, -6.354208910915346725 }, + { 19877160.8505733, 94.34299459284, 85.750059038253282986, 94127.1566760840083, -0.999976397350904933070125935046235099 } + },{ + { 0, 18.232086569498 }, { 179.658073278238477245, -18.87394850776853555 }, + { 19927978.7462175, 164.41905055334, 15.640779355822506503, 129771.1882449660559, -1.00293460439063886191490837518358603 } + },{ + { 0, 12.049849333181 }, { 179.761046682699610657, -11.201990279782499264 }, + { 19908004.4552909, 9.418096768309, 170.610608272305604585, 157761.5040571466343, -0.997761474497510958414636661473196 } + },{ + { 0, 40.289465276136 }, { 179.644208494155329095, -40.370034926441385999 }, + { 19985674.936106, 143.092606818963, 36.958610382613096419, 36200.8933724688593, -1.00414965876091266672176516294712201 } + },{ + { 0, 2.197784650379 }, { 179.961199531084784854, -1.353440827124394777 }, + { 19910509.7517973, 1.542117609437, 178.458582198505846426, 160403.6285079348996, -0.999488724639301051588802238256903365 } + },{ + { 0, 1.966575272177 }, { 179.699817324905962184, -3.101125282483752618 }, + { 19875595.6267266, 170.112968791865, 9.89572776349855838, 192355.7206665719908, -1.00015463589804554089823795948177576 } + },{ + { 0, 25.078832492684 }, { 178.600804840925824646, -24.897833702325682511 }, + { 19887997.7953866, 77.264585323781, 103.101167809583406892, 92442.9124509225839, -0.998981189838600847075156252685701475 } + },{ + { 0, 31.740361941314 }, { 179.553485210731879874, -31.909206787477701871 }, + { 19972325.3556069, 143.930820896999, 36.145242998351638503, 54883.4113710054145, -1.00379461628115951299378139083273709 } + },{ + { 0, .05479250563 }, { 178.822647462220726609, .836079031223269324 }, + { 19858049.4780499, 41.349430623518, 138.645259065012502544, 169078.442370111714, -0.9997793696948588104689292777038645 } + },{ + { 0, 36.685139871608 }, { 179.366667224014334712, -36.6833040833258687 }, + { 19968965.6773632, 89.167975517493, 90.921025521408327068, 13327.2156799476918, -0.999916537946348604748436628142371774 } + },{ + { 0, 3.451199399671 }, { 179.107509334399258305, -3.459003521120242021 }, + { 19938203.3838544, 91.541212417048, 88.476282464773035164, 32316.1747698810781, -1.00000397484395819880376166111091152 } + },{ + { 0, 27.692898794247 }, { 178.512356615673144314, -27.666009301228316555 }, + { 19883493.6699045, 88.406440883665, 92.036345087713397961, 94128.7880896190836, -0.999736458322951659916100197733612731 } + },{ + { 0, 17.363238291869 }, { 179.567921315455829491, -17.288872648596950413 }, + { 19980749.7638027, 39.697196316589, 140.321938237586060826, 46975.9359427664379, -0.997687691981715030209443284547887743 } + },{ + { 0, 37.006775102539 }, { 179.191103068859169842, -37.156365616364686838 }, + { 19949309.9180043, 116.455543532607, 63.771817992036617793, 45856.1961421018701, -1.00221962858918423044940482213860378 } + },{ + { 0, 45.572883540957 }, { 179.224707765088686272, -45.94675931323086696 }, + { 19940027.8586414, 137.627256708444, 42.723991162977357301, 74208.4359612889496, -1.00380887786447159371050474874209613 } + },{ + { 0, 43.63393981955 }, { 178.878236417027994157, -43.642335115130514773 }, + { 19931045.2914508, 91.203625101465, 89.268780774643462256, 55253.5406349861764, -1.00002974153150514524668324156664312 } + },{ + { 0, 38.4995307019 }, { 179.143856004445269342, -39.042223438550921467 }, + { 19918391.2222193, 141.232864609445, 39.117947060740562295, 102217.2563106863077, -1.00388164115732947401227193040540442 } + },{ + { 0, 27.55015339382 }, { 179.596220103573824099, -27.587412128122249651 }, + { 19986004.7358853, 137.025135713548, 42.992898351962011956, 33938.7346646670654, -1.00316044390281167153489150223322213 } + },{ + { 0, 1.54507498314 }, { 179.567115633151308577, -1.448861185025252004 }, + { 19978593.3191777, 36.816106412092, 143.185763012309022403, 56320.5800276739168, -0.999770499462467210349814195069484413 } + },{ + { 0, 45.217063644222 }, { 179.807382581661125, -45.086424050571516283 }, + { 19987042.0782465, 18.114645812265, 161.928120141429818658, 45544.2915061261936, -0.994974179414854997816064496873877943 } + },{ + { 0, 13.473522450751 }, { 179.726941062277208626, -13.570372758027936877 }, + { 19987364.078382, 156.839609002403, 23.170293747820406391, 65329.9068132034472, -1.00219093189506569530067281448282301 } + },{ + { 0, 6.287741997374 }, { 179.071252372259552052, -6.743450924917895817 }, + { 19912159.8245954, 132.954797451112, 47.100789519677419746, 104772.4027498097375, -1.00071252411103017720961361192166805 } + },{ + { 0, 7.639709001531 }, { 179.616156296978583335, -7.48702643786017917 }, + { 19976374.3699535, 29.731916588299, 150.279582966919438164, 69224.6591757209539, -0.998789792086741234911073661351110786 } + },{ + { 0, 5.893688050348 }, { 179.586212000450856399, -4.888408917114795625 }, + { 19886907.2520668, 14.653438882877, 165.371181401863458848, 177183.5330818593022, -0.998794647031120752522781458537792787 } + },{ + { 0, 61.997076235476 }, { 179.605779116829636081, -62.19593758437129915 }, + { 19976288.2901729, 149.562797049254, 30.65850204223272625, 36696.2853801462176, -1.00373071432437144245852778112748638 } + },{ + { 0, 50.507637741656 }, { 179.893569206021038536, -50.721890799900161112 }, + { 19979542.5263293, 171.564028344478, 8.4746613464253591, 50644.5234828162697, -1.00508881632281776852266830246662721 } + },{ + { 0, 7.484475238477 }, { 178.638400003000590878, -6.926155588124333461 }, + { 19867425.2906303, 57.020570370985, 123.087267812322270238, 132929.2775641349633, -0.999097042677338120775232255255104974 } + },{ + { 0, 56.851165323215 }, { 179.587046628550073045, -56.875248360744638525 }, + { 19988235.9960515, 112.345749045605, 67.744017057185404441, 9971.0934553515518, -1.00182859249871403228837607457535341 } + },{ + { 0, 10.692273150738 }, { 178.709520715733071393, -10.851727623036704339 }, + { 19893210.3050033, 102.824601316946, 77.308514969817191459, 83032.7122948051111, -1.00034345584508432835946223349310458 } + },{ + { 0, 46.694739303788 }, { 179.926838145841924189, -46.948618153686522669 }, + { 19975447.9283188, 174.663684259477, 5.361568174833475454, 59614.5876209460645, -1.00520484875201732144489596976200119 } + },{ + { 0, 15.804386137005 }, { 178.367587635209819128, -15.522042847777054984 }, + { 19855850.8800526, 74.932089158884, 105.357235560913450667, 123350.4326645237628, -0.999091578546475345135036150168161839 } + },{ + { 0, 4.371450175299 }, { 179.780887420199549421, -4.566109732313098407 }, + { 19979071.1035552, 164.163592252794, 15.840695025950408814, 84137.2115482558728, -1.00076323969894742660358133434783667 } + },{ + { 0, 30.894388279688 }, { 179.375426183521944524, -30.871308884744172663 }, + { 19968681.8321577, 77.35154610481, 102.709506078439532936, 14048.0277985734058, -0.998975176336422854284080585784977302 } + },{ + { 0, 9.541166838639 }, { 178.432934555386452839, -10.09982228112793472 }, + { 19848553.7844137, 118.441353539081, 61.736686215549403663, 144831.1911566651614, -1.00060548620110489892454097571317106 } + },{ + { 0, 8.489292700054 }, { 179.906698338023119097, -8.559237750032113623 }, + { 19995477.1669578, 171.963952699866, 8.037517851139094467, 72192.60793572974, -1.00152068486306466965629624610301107 } + },{ + { 0, 19.562401114224 }, { 178.838724116996037606, -20.05038360490599475 }, + { 19893208.1788508, 126.362762598128, 53.875560227496658204, 112181.7524188837615, -1.00185202668802775249901060306001455 } + },{ + { 0, 42.260350252749 }, { 179.807860448877064601, -42.79985897702184353 }, + { 19942715.0054774, 170.703419847646, 9.377654670896439828, 96336.3477142010769, -1.00508642406443549077721399953588843 } + },{ + { 0, 24.511403144656 }, { 178.957598444862223515, -24.616808725039883945 }, + { 19924809.5184876, 102.913211410163, 77.297538210434837096, 55403.453072179318, -1.0008408309188838725134473861544393 } + },{ + { 0, 20.844284170708 }, { 179.069258863637226633, -20.321320573298341477 }, + { 19909084.6340808, 44.172784008084, 136.01627115731728436, 111009.0987238994608, -0.997389183621778974142557672166731209 } + },{ + { 0, 2.426010809098 }, { 178.236397468862000784, -2.513715200833756776 }, + { 19840940.6924189, 94.315194952561, 85.734896842737189557, 130002.6104886615638, -0.999825249844991659209370027383556589 } + },{ + { 0, 6.600682554664 }, { 179.646475458013797028, -7.699164822656561787 }, + { 19878412.28273, 168.167678684515, 11.861035812918738552, 187426.3958525886692, -1.00098284856064978498579876031726599 } + },{ + { 0, 23.372339802326 }, { 179.499422665106094027, -24.239465200482591299 }, + { 19899498.4582543, 161.197647943542, 18.932355367478826536, 151863.2545535951091, -1.00347666868431395492677893344080076 } + },{ + { 0, 16.194668264095 }, { 179.115193814080201851, -17.129419031459576897 }, + { 19874825.6683239, 148.942349959054, 31.225656401221968078, 166033.3161394594622, -1.00222032222233647935638600756647065 } + },{ + { 0, 1.528726471528 }, { 178.791047180477802091, -1.282203000582034597 }, + { 19897803.9939987, 69.212891442493, 110.802928803578167132, 85252.8333849204133, -0.999827144228156883265512533398577943 } + },{ + { 0, 6.297249676078 }, { 178.623258703845895437, -5.709470001196540278 }, + { 19864042.0495193, 56.274639904925, 123.817184177744186806, 137475.1283083659258, -0.999190450178399580671850799262756482 } + },{ + { 0, 17.393540327984 }, { 179.330156510680163326, -17.431100690958209424 }, + { 19962624.6302607, 107.855062015266, 72.181322855288535245, 19320.5501845044839, -1.00091841779689127989172447996679693 } + },{ + { 0, 46.284685151236 }, { 179.852534804091121255, -46.176234945675219984 }, + { 19990422.3478916, 14.758013867151, 165.271681964991897184, 42614.1796365710104, -0.994894592261839960656288894824683666 } + },{ + { 0, 14.924320176299 }, { 179.195663739713760883, -14.125476432252858442 }, + { 19891861.8615337, 31.446544793174, 148.678916887199611191, 149419.6596309045804, -0.997620142585332936313591289945179597 } + },{ + { 0, 23.668824656069 }, { 179.409875478773990359, -24.107855233601412399 }, + { 19938736.4442268, 148.091483667618, 32.02919257641173958, 97771.7687385830819, -1.00323262872000595891108787327539176 } + },{ + { 0, 46.986276695896 }, { 179.92040916864362177, -47.301644191214905832 }, + { 19968596.0414782, 174.796708941456, 5.234240076649939638, 66113.7417494369769, -1.00519095452608087093437916337279603 } + },{ + { 0, 65.946144289524 }, { 179.808282612725835525, -65.871840130833632868 }, + { 19993734.5109736, 25.375428509648, 154.703163938350061652, 18355.2254271672769, -0.996436935914610577569305860379245132 } + },{ + { 0, 10.950298933293 }, { 179.624609619829763098, -10.787771536605316781 }, + { 19975919.5586889, 28.779018914489, 151.238005588662201946, 70291.1998404303581, -0.998272071834115148902810688014142215 } + },{ + { 0, 13.609869340778 }, { 179.035623147420893383, -14.023624108675206222 }, + { 19913213.8514358, 129.616021271129, 50.506400999466711623, 97596.7664002074776, -1.00146664642314031645753402699483559 } + },{ + { 0, 48.701427557433 }, { 179.385565054218238481, -48.735316652259656533 }, + { 19972955.2699173, 102.875149183407, 77.294384444682547869, 18461.7742226227697, -1.00114676855429074464609584538266063 } + },{ + { 0, 31.519172055785 }, { 179.555251675378549409, -31.140142027808697534 }, + { 19952318.3772514, 26.247105619999, 153.865822276646938125, 86354.7117605101002, -0.995739948399825047786748655198607594 } + },{ + { 0, 31.863784754278 }, { 179.722489476483407524, -31.826935359797657785 }, + { 19993324.8682601, 29.572313410211, 150.440607907359037187, 41427.6181613499234, -0.995888009001147267440501309465616941 } + },{ + { 0, 76.434608546092 }, { 179.918287057674124459, -76.48787937532808951 }, + { 19997750.023578, 167.428385412814, 12.621032110142724567, 9619.5267710862108, -1.00233963893091582164629471662919968 } + },{ + { 0, 73.114273316483 }, { 179.576736605988553624, -73.098788070892914568 }, + { 19992866.6147806, 78.154765899661, 102.085693546950923465, 8580.6475692800946, -0.999384143308475469957841141876997426 } + },{ + { 0, 1.125639056292 }, { 178.426819580880619395, -.694775021853292564 }, + { 19852573.5442848, 67.184842289382, 112.831314850896246589, 132932.8743502563937, -0.999732957962833457266071945923613384 } + } +}; + +size_t const expected_size_antipodal = sizeof(expected_antipodal) / sizeof(expected_results_antipodal); + +#endif // BOOST_GEOMETRY_TEST_INVERSE_CASES_ANTIPODAL_HPP diff --git a/src/boost/libs/geometry/test/formulas/inverse_cases_small_angles.hpp b/src/boost/libs/geometry/test/formulas/inverse_cases_small_angles.hpp new file mode 100644 index 000000000..6fe9557c7 --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/inverse_cases_small_angles.hpp @@ -0,0 +1,106 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2018 Adeel Ahmad, Islamabad, Pakistan. + +// Contributed and/or modified by Adeel Ahmad, as part of Google Summer of Code 2018 program. + +// 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) + +#ifndef BOOST_GEOMETRY_TEST_INVERSE_CASES_SMALL_ANGLES_HPP +#define BOOST_GEOMETRY_TEST_INVERSE_CASES_SMALL_ANGLES_HPP + +#include "inverse_cases.hpp" + +struct expected_results_small_angles +{ + coordinates p1; + coordinates p2; + expected_result karney; +}; + +/* + These values are collected from GeodTest which is associated with GeographicLib: + https://zenodo.org/record/32156 + + The conversion to C++ array format is done using this Python script: + https://github.com/adl1995/boost-geometry-extra/blob/master/geographiclib-dataset-parse-inverse.py + + Geodesic scale (M12) is absent from the GeodTest dataset, so it is manually generated + using GeographicLib using this C++ script: + https://github.com/adl1995/boost-geometry-extra/blob/master/geographicLib-direct-small_angles.cpp +*/ +expected_results_small_angles expected_small_angles[] = +{ + { + { 180, 0 },{ 0, 0 }, + { 20003931.45862544700503349304, -0.00000000000000000000, 180.00000000000000000000, 67125.61229850351810455322266, -1.00000000000000000000 }, + },{ + { 180, 0 },{ 1e-300, 0 }, + { 20003931.45862544700503349304, -0.00000000000000000000, 180.00000000000000000000, 67125.61229850351810455322266, -1.00000000000000000000 }, + },{ + { 180, 0 },{ 1e-200, 0 }, + { 20003931.45862544700503349304, -0.00000000000000000000, 180.00000000000000000000, 67125.61229850351810455322266, -1.00000000000000000000 }, + },{ + { 180, 0 },{ 1e-100, 0 }, + { 20003931.45862544700503349304, -0.00000000000000000000, 180.00000000000000000000, 67125.61229850351810455322266, -1.00000000000000000000 }, + },{ + { 180, 0 },{ 1e-50, 0 }, + { 20003931.45862544700503349304, -0.00000000000000000000, 180.00000000000000000000, 67125.61229850351810455322266, -1.00000000000000000000 }, + },{ + { 180, 0 },{ 1e-20, 0 }, + { 20003931.45862544700503349304, -0.00000000000000000000, 180.00000000000000000000, 67125.61229850351810455322266, -1.00000000000000000000 }, + },{ + { 180, 0 },{ 1e-10, 0 }, + { 20003931.45862544700503349304, -9.501793528220011062168943853e-09, -179.9999999904981962117744843, 67125.61229850351810455322266, -1 }, + },{ + { 0, 1e-100 },{ 170, 1e-200}, + { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 }, + },{ + { 0, 1e-300 },{ 170, 1e-50}, + { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 }, + },{ + { 0, 1e-300 },{ 170, 1e-10}, + { 18924313.43485650792717933655, 89.99999999939157646622334141, 90.00000000060019544889655663, 1041298.80855225014965981245, -0.9864919282563420210863114335 }, + },{ + { 0, 1e-100 },{ 170, 1e-50}, + { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 }, + },{ + { 0, 1e-200 },{ 170, 1e-50}, + { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 }, + },{ + { 0, 0.0 },{ 170, 1e-10}, + { 18924313.43485650792717933655, 89.99999999939157646622334141, 90.00000000060019544889655663, 1041298.80855225014965981245, -0.9864919282563420210863114335 }, + },{ + { 0, 1e-20 },{ 170, 1e-100}, + { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 }, + },{ + { 0, 1e-100 },{ 170, 0.0}, + { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 }, + },{ + { 0, 1e-10 },{ 170, 1e-300}, + { 18924313.43485650792717933655, 89.99999999939980455110344337, 90.00000000060842353377665859, 1041298.80855225014965981245, -0.9864919282563420210863114335 }, + },{ + { 0, 1e-300 },{ 170, 1e-100}, + { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 }, + },{ + { 0, 1e-200 },{ 170, 1e-100}, + { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 }, + },{ + { 0, 1e-10 },{ 170, 1e-50}, + { 18924313.43485650792717933655, 89.99999999939980455110344337, 90.00000000060842353377665859, 1041298.80855225014965981245, -0.9864919282563420210863114335 }, + },{ + { 0, 0.0 },{ 170, 1e-200}, + { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 }, + },{ + { 0, 0.0 },{ 170, 1e-10}, + { 18924313.43485650792717933655, 89.99999999939157646622334141, 90.00000000060019544889655663, 1041298.80855225014965981245, -0.9864919282563420210863114335 }, + } +}; + + +size_t const expected_size_small_angles = sizeof(expected_small_angles) / sizeof(expected_results_small_angles); + +#endif // BOOST_GEOMETRY_TEST_INVERSE_CASES_SMALL_ANGLES_HPP diff --git a/src/boost/libs/geometry/test/formulas/inverse_karney.cpp b/src/boost/libs/geometry/test/formulas/inverse_karney.cpp new file mode 100644 index 000000000..f7004b64d --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/inverse_karney.cpp @@ -0,0 +1,104 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016-2019 Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Copyright (c) 2018 Adeel Ahmad, Islamabad, Pakistan. + +// Contributed and/or modified by Adeel Ahmad, as part of Google Summer of Code 2018 program + +// 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) + + +#include + +#include "test_formula.hpp" +#include "inverse_cases.hpp" +#include "inverse_cases_antipodal.hpp" +#include "inverse_cases_small_angles.hpp" + +#include + +#include + +template +void check_inverse(std::string const& name, + Result const& results, + bg::formula::result_inverse const& result, + expected_result const& expected, + expected_result const& reference, + double reference_error) +{ + std::stringstream ss; + ss << "(" << results.p1.lon << " " << results.p1.lat << ")->(" << results.p2.lon << " " << results.p2.lat << ")"; + + check_one(name + "_d " + ss.str(), + result.distance, expected.distance, reference.distance, reference_error); + check_one(name + "_a " + ss.str(), + result.azimuth, expected.azimuth, reference.azimuth, reference_error, true); + check_one(name + "_ra " + ss.str(), + result.reverse_azimuth, expected.reverse_azimuth, reference.reverse_azimuth, reference_error, true); + check_one(name + "_rl " + ss.str(), + result.reduced_length, expected.reduced_length, reference.reduced_length, reference_error); + check_one(name + "_gs " + ss.str(), + result.geodesic_scale, expected.geodesic_scale, reference.geodesic_scale, reference_error); +} + +void test_all(expected_results const& results) +{ + double lon1d = results.p1.lon; + double lat1d = results.p1.lat; + double lon2d = results.p2.lon; + double lat2d = results.p2.lat; + + // WGS84 + bg::srs::spheroid spheroid(6378137.0, 6356752.3142451793); + + bg::formula::result_inverse result_k; + + typedef bg::formula::karney_inverse ka_t; + result_k = ka_t::apply(lon1d, lat1d, lon2d, lat2d, spheroid); + check_inverse("karney", results, result_k, results.vincenty, results.reference, 0.0000001); +} + +template +void test_karney(ExpectedResults const& results) +{ + double lon1d = results.p1.lon; + double lat1d = results.p1.lat; + double lon2d = results.p2.lon; + double lat2d = results.p2.lat; + + // WGS84 + bg::srs::spheroid spheroid(6378137.0, 6356752.3142451793); + + bg::formula::result_inverse result; + + typedef bg::formula::karney_inverse ka_t; + result = ka_t::apply(lon1d, lat1d, lon2d, lat2d, spheroid); + check_inverse("karney", results, result, results.karney, results.karney, 0.0000001); +} + +int test_main(int, char*[]) +{ + for (size_t i = 0; i < expected_size; ++i) + { + test_all(expected[i]); + } + + for (size_t i = 0; i < expected_size_antipodal; ++i) + { + test_karney(expected_antipodal[i]); + } + + for (size_t i = 0; i < expected_size_small_angles; ++i) + { + test_karney(expected_small_angles[i]); + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/formulas/test_formula.hpp b/src/boost/libs/geometry/test/formulas/test_formula.hpp new file mode 100644 index 000000000..9e41bfcae --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/test_formula.hpp @@ -0,0 +1,97 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016-2019 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) + +#ifndef BOOST_GEOMETRY_TEST_FORMULA_HPP +#define BOOST_GEOMETRY_TEST_FORMULA_HPP + +#include + +#include + +void normalize_deg(double & deg) +{ + while (deg > 180.0) + deg -= 360.0; + while (deg <= -180.0) + deg += 360.0; +} + + +#define BOOST_GEOMETRY_CHECK_CLOSE( L, R, T, M ) BOOST_TEST_TOOL_IMPL( 0, \ + ::boost::test_tools::check_is_close_t(), M, CHECK, CHECK_MSG, (L)(R)(::boost::math::fpc::percent_tolerance(T)) ) + + +void check_one(std::string const& name, double result, double expected) +{ + std::string id = name.empty() ? "" : (name + " : "); + + double eps = std::numeric_limits::epsilon(); + double abs_result = bg::math::abs(result); + double abs_expected = bg::math::abs(expected); + double res_max = (std::max)(abs_result, abs_expected); + double res_min = (std::min)(abs_result, abs_expected); + if (res_min <= eps) // including 0 + { + bool is_close = abs_result <= 30 * eps && abs_expected <= 30 * eps; + BOOST_CHECK_MESSAGE((is_close), + id << std::setprecision(20) << "result {" << result << "} different than expected {" << expected << "}."); + } + else if (res_max > 100 * eps) + { + BOOST_GEOMETRY_CHECK_CLOSE(result, expected, 0.1, + id << std::setprecision(20) << "result {" << result << "} different than expected {" << expected << "}."); + } + else if (res_max > 10 * eps) + { + BOOST_GEOMETRY_CHECK_CLOSE(result, expected, 10, + id << std::setprecision(20) << "result {" << result << "} different than expected {" << expected << "}."); + } + else if (res_max > eps) + { + BOOST_GEOMETRY_CHECK_CLOSE(result, expected, 1000, + id << std::setprecision(20) << "result {" << result << "} different than expected {" << expected << "}."); + } +} + +void check_one(std::string const& name, + double result, double expected, double reference, double reference_error, + bool normalize = false, bool check_reference_only = false) +{ + std::string id = name.empty() ? "" : (name + " : "); + + if (normalize) + { + normalize_deg(result); + normalize_deg(expected); + normalize_deg(reference); + } + + if (! check_reference_only) + { + check_one(name, result, expected); + } + + // NOTE: in some cases it probably will be necessary to normalize + // the differences between the result and expected result + double ref_diff = bg::math::abs(result - reference); + double ref_max = (std::max)(bg::math::abs(result), bg::math::abs(reference)); + bool is_ref_close = ref_diff <= reference_error || ref_diff <= reference_error * ref_max; + BOOST_CHECK_MESSAGE((is_ref_close), + id << std::setprecision(20) << "result {" << result << "} and reference {" << reference << "} not close enough."); +} + +void check_one(double result, double expected, double reference, double reference_error, + bool normalize = false, bool check_reference_only = false) +{ + check_one("", result, expected, reference, reference_error, normalize, check_reference_only); +} + +#endif // BOOST_GEOMETRY_TEST_FORMULA_HPP diff --git a/src/boost/libs/geometry/test/formulas/vertex_longitude.cpp b/src/boost/libs/geometry/test/formulas/vertex_longitude.cpp new file mode 100644 index 000000000..1aadc4a35 --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/vertex_longitude.cpp @@ -0,0 +1,154 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017 Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, 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) + +#include + +#include "test_formula.hpp" +#include "vertex_longitude_cases.hpp" + +#include +#include +#include +#include +#include + +#include + +#include + +#define BOOST_GEOMETRY_TEST_DEBUG + +namespace bg = boost::geometry; + +template +CT test_vrt_lon_sph(CT lon1r, + CT lat1r, + CT lon2r, + CT lat2r) +{ + CT a1 = bg::formula::spherical_azimuth(lon1r, lat1r, lon2r, lat2r); + + typedef bg::model::point > point; + + bg::model::segment segment(point(lon1r, lat1r), + point(lon2r, lat2r)); + bg::model::box box; + bg::envelope(segment, box); + + CT vertex_lat; + CT lat_sum = lat1r + lat2r; + if (lat_sum > CT(0)) + { + vertex_lat = bg::get_as_radian(box); + } else { + vertex_lat = bg::get_as_radian(box); + } + + bg::strategy::azimuth::spherical<> azimuth; + + return bg::formula::vertex_longitude + :: + apply(lon1r, lat1r, + lon2r, lat2r, + vertex_lat, + a1, + azimuth); +} + +template +< + template class FormulaPolicy, + typename CT + > +CT test_vrt_lon_geo(CT lon1r, + CT lat1r, + CT lon2r, + CT lat2r) +{ + // WGS84 + bg::srs::spheroid spheroid(6378137.0, 6356752.3142451793); + + typedef FormulaPolicy formula; + CT a1 = formula::apply(lon1r, lat1r, lon2r, lat2r, spheroid).azimuth; + + typedef bg::model::point > geo_point; + + bg::model::segment segment(geo_point(lon1r, lat1r), + geo_point(lon2r, lat2r)); + bg::model::box box; + bg::envelope(segment, box); + + CT vertex_lat; + CT lat_sum = lat1r + lat2r; + if (lat_sum > CT(0)) + { + vertex_lat = bg::get_as_radian(box); + } else { + vertex_lat = bg::get_as_radian(box); + } + + bg::strategy::azimuth::geographic<> azimuth_geographic; + + return bg::formula::vertex_longitude + ::apply(lon1r, lat1r, + lon2r, lat2r, + vertex_lat, + a1, + azimuth_geographic); + +} + +void test_all(expected_results const& results) +{ + double const d2r = bg::math::d2r(); + + double lon1r = results.p1.lon * d2r; + double lat1r = results.p1.lat * d2r; + double lon2r = results.p2.lon * d2r; + double lat2r = results.p2.lat * d2r; + + if(lon1r > lon2r) + { + std::swap(lon1r, lon2r); + std::swap(lat1r, lat2r); + } + + double res_an = test_vrt_lon_geo + (lon1r, lat1r, lon2r, lat2r); + double res_th = test_vrt_lon_geo + (lon1r, lat1r, lon2r, lat2r); + double res_vi = test_vrt_lon_geo + (lon1r, lat1r, lon2r, lat2r); + double res_sh = test_vrt_lon_sph(lon1r, lat1r, lon2r, lat2r); + + bg::math::normalize_longitude(res_an); + bg::math::normalize_longitude(res_th); + bg::math::normalize_longitude(res_vi); + bg::math::normalize_longitude(res_sh); + + check_one(res_an, results.andoyer * d2r, res_vi, 0.001); + check_one(res_th, results.thomas * d2r, res_vi, 0.01);//in some tests thomas gives low accuracy + check_one(res_vi, results.vincenty * d2r, res_vi, 0.0000001); + check_one(res_sh, results.spherical * d2r, res_vi, 1); +} + +int test_main(int, char*[]) +{ + + for (size_t i = 0; i < expected_size; ++i) + { + test_all(expected[i]); + } + + return 0; +} + diff --git a/src/boost/libs/geometry/test/formulas/vertex_longitude_cases.hpp b/src/boost/libs/geometry/test/formulas/vertex_longitude_cases.hpp new file mode 100644 index 000000000..2357c2b18 --- /dev/null +++ b/src/boost/libs/geometry/test/formulas/vertex_longitude_cases.hpp @@ -0,0 +1,457 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017 Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, 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) + +#ifndef BOOST_GEOMETRY_TEST_VERTEX_LONGITUDE_CASES_HPP +#define BOOST_GEOMETRY_TEST_VERTEX_LONGITUDE_CASES_HPP + +struct coordinates +{ + double lon; + double lat; +}; + +struct expected_result +{ + double lon; + double lat; +}; + +struct expected_results +{ + coordinates p1; + coordinates p2; + double andoyer; + double thomas; + double vincenty; + double spherical; +}; + +expected_results expected[] = +{ + { //ascenting segments (wrt pole) + { 1, 1 },{ 100, 2 }, + 66.25553538, + 66.25594187, + 66.25594273, + 66.39744208 + },{ + { 1, 1 },{ 90, 2 }, + 64.09051435, + 64.09082287, + 64.09082352, + 64.24414382 + },{ + { 0, 1 },{ 50, 1 }, + 24.99994265, + 24.99999906, + 25, + 25 + },{ + { 0, 1 },{ 50, 1.1 }, + 30.79039009, + 30.79049758, + 30.79049828, + 30.83209056 + },{ + { 0, 1 },{ 50, 1.2 }, + 35.95625867, + 35.95640445, + 35.95640493, + 36.0343576 + },{ + { 0, 1 },{ 50, 1.3 }, + 40.52204781, + 40.52222064, + 40.52222094, + 40.63120292 + },{ + { 0, 1 },{ 50, 1.4 }, + 44.53768967, + 44.53788045, + 44.53788061, + 44.6729585 + },{ + { 0, 1 },{ 50, 1.5 }, + 48.06382018, + 48.0640219, + 48.06402195, + 48.22088385 + },{ + { 0, 1 },{ 50, 1.6 }, + 50, + 50, + 50, + 50 + },{ //descending segment (wrt pole) + { 50, 1 },{ 0, 1.1 }, + 19.20950181, + 19.20950054, + 19.20950172, + 19.16790944 + },{ + { 50, 1 },{ 0, 1.2 }, + 14.04365003, + 14.04359367, + 14.04359507, + 13.9656424 + },{ + { 50, 1 },{ 0, 1.3 }, + 9.477883847, + 9.477777483, + 9.477779056, + 9.368797077 + },{ + { 50, 1 },{ 0, 1.4 }, + 5.462267984, + 5.462117673, + 5.462119386, + 5.327041497 + },{ + { 50, 1 },{ 0, 1.5 }, + 1.936164363, + 1.935976226, + 1.93597805, + 1.779116148 + },{ + { 3, 5 },{ 150, 0}, + 60.29182988, + 60.29785309, + 60.29785255, + 60 + },{ + { 3, 5 },{ 150, 0.5}, + 63.11344576, + 63.11900045, + 63.11899891, + 62.87000766 + },{ + { 3, 5 },{ 150, 1}, + 65.51880171, + 65.52391866, + 65.52391623, + 65.31813729 + },{ + { 3, 5 },{ 150, 5}, + 76.49727275, + 76.50000657, + 76.5, + 76.5 + },{ //segments parallel to equator + { 0, 1 },{ 4, 1 }, + 1.999999973, + 1.999999925, + 2, + 2 + },{ + { 0, 1 },{ 10, 1 }, + 4.999999569, + 4.999999812, + 5, + 5 + },{ + { 0, 1 },{ 60, 1 }, + 29.9998978, + 29.99999887, + 30, + 30 + },{ + { 0, 1 },{ 90, 1 }, + 44.99960266, + 45.22272756,//thomas low accuracy + 45, + 45 + },{ + { 0, 1 },{ 120, 1 }, + 59.99878311, + 59.99999778, + 60, + 60 + },{ + { 0, 1 },{ 180, 1 }, + 90, + 90, + 90, + 90 + },{ + { 0, 1 },{ 270, 1 }, + -44.99960266, + -45.08931472,//thomas low accuracy + -45, + -45 + },{ + { 0, 1 },{ 290, 1 }, + -34.9998314, + -34.99999868, + -35, + -35 + },{ + { 0, 1 },{ 150, 1 }, + 74.99598515, + 74.99999794, + 75, + 75 + },{ + { 0, 1 },{ 180, 1 }, + 90, + 90, + 90, + 90 + },{ //in equator vertex is any point on segment + { 1, 0 },{ 10, 0 }, + 1, + 1, + 1, + 1 + },{// one point on equator (descending) + { 150, 0},{ 3, 1 }, + 60.29513726, + 60.30158943, + 60.3015947, + 60 + },{// one point on equator (ascending) + { 3, 0 },{ 150, 1}, + 92.69840523, + 92.6984053, + 92.6984053, + 93 + },{ //meridian + { 1, 1 },{ 1, 2 }, + 1, + 1, + 1, + 1 + },{ //nearly meridian + { 1, 1 },{ 1.001, 2 }, + 1.001, + 1.001, + 1.001, + 1.001 + },{ //vertex is a segment's endpoint + { 1, 1 },{ 10, 2 }, + 10, + 10, + 10, + 10 + },{ + { 10, 1 },{ 1, 2 }, + 1, + 1, + 1, + 1 + },{ //South hemisphere, ascending + { 0, -1 },{ 50, -1.4 }, + 44.53768958, + 44.53788035, + 44.53788052, + 44.6729585 + },{ //South hemisphere, descending + { 0, -1.5 },{ 50, -1 }, + 1.936164356, + 1.935976219, + 1.935978042, + 1.779116148 + },{ //South hemisphere, same latitude + { 0, -1 },{ 50, -1 }, + 24.99994261, + 24.99999901, + 24.99999995, + 25 + },{//Both hemispheres, vertex on the northern + //A desc vertex north + { 3, 5 },{ 150, -3}, + 27.357069, + 27.36422922, + 27.36423549, + 26.74999989 + },{//B asc vertex north + { 3, -3 },{ 150, 5}, + 125.6403436, + 125.6357677, + 125.6357659, + 126.2500001 + },{//C desc vertex south + { 3, -5 },{ 150, 3}, + 27.3570679, + 27.36422812, + 27.36423439, + 26.74999989 + },{//D asc vertex south + { 3, 3 },{ 150, -5}, + 125.6403423, + 125.6357664, + 125.6357645, + 126.2500001 + },{//E asc vertex south + { 3, 3 },{ 184, -5}, + -88.00743796, + -88.0660268, + -88.0558747, + -88.49315894 + },{ + { 3, 5 },{ 150, -3.5}, + 17.96722293, + 17.97322407, + 17.97323051, + 17.3742464 + },{ + { 3, 5 },{ 150, -1}, + 52.9706038, + 52.97759463, + 52.9775964, + 52.56504545 + },{ //Both hemispheres, vertex on the southern + { 3, 3},{ 5, -5}, + 5, + 5, + 5, + 5 + },{ + { 3, -5 },{ 150, 1}, //symmetric to { 3, 5 },{ 150, -1} + 52.97060093, + 52.97759176, + 52.97759353, + 52.56504545 + },{// fix p1 lon, lat and p2 lon and vary p2 lat + { 3, 5 },{ 150, 1}, + 65.51880171, + 65.52391866, + 65.52391623, + 65.31813729 + },{ + { 3, 5 },{ 150, 0}, + 60.29182988, + 60.29785309, + 60.29785255, + 60 + },{ + { 3, 5 },{ 150, -0.1}, + 59.66911673, + 59.67523649, + 59.67523616, + 59.36690727 + },{ + { 3, 5 },{ 150, -1}, + 52.9706038, + 52.97759463, + 52.9775964, + 52.56504545 + },{ + { 3, 5 },{ 150, -4.15}, + 4.481947557, + 4.485467841, + 4.485473295, + 3.981178967 + },{ + { 3, 5 },{ 150, -4.2}, + 3, + 3, + 3, + 3 + },{//symmetry of geodesics: + // (i) case A same as C and B same as D + // (ii) longitude diff between vertex and p2 in A, C equals + // longitude diff between vertex and p1 in B, D by symmetry + // case (A) + { 0, 5 },{ 30, 5.5}, + 25.06431998, + 25.0644277, + 25.06442787, + 25.13253724 + },{// case (B) + { 0, 5.5 },{ 30, 5}, + 4.935667094, + 4.935571216, + 4.93557213, + 4.867462762 + },{// case (C) + { 0, -5 },{ 30, -5.5}, + 25.06431885, + 25.06442657, + 25.06442674, + 25.13253724 + },{// case (D) + { 0, -5.5 },{ 30, -5}, + 4.935666841, + 4.935570963, + 4.935571877, + 4.867462762 + },{//crossing meridian + { -10, 1 },{ 50, 1.1}, + 24.68113946, + 24.68127641, + 24.68127733, + 24.71605263 + },{ + { 350, 1 },{ 50, 1.1}, + 24.68113946, + 24.68127641, + 24.68127733, + 24.71605263 + },{//crossing antimeridian + { 130, 1 },{ 190, 1.1}, + 164.6811395, + 164.6812764, + 164.6812773, + 164.7160526 + },{ + { 130, 1 },{ -170, 1.1}, + 164.6811395, + 164.6812764, + 164.6812773, + 164.7160526 + },{//crossing meridian both hemispheres + { -10, -5 },{ 150, 1}, + 55.61285835, + 55.62727853, + 55.62725182, + 55.19943725 + },{ + { 350, -5 },{ 150, 1}, + 55.6243632, + 55.6272619, + 55.627257, + 55.1994373 + },{//crossing anti-meridian both hemispheres + { 90, -5 },{ 210, 1}, + 109.4997596, + 109.5011987, + 109.5012031, + 109.1354089 + },{ + { 90, -5 },{ -150, 1}, + 109.4997596, + 109.5011987, + 109.5012031, + 109.1354089 + },{ + { -150, -5 },{ 90, 1}, + -169.4997596, + -169.5011987, + -169.5012031, + -169.1354089 + },{ + { 90, 1 },{ 210, -5}, + -169.5008004, + -169.5012037, + -169.501204, + -169.1354089 + },{ + { 0, 1 },{ 120, -5}, + 100.4991996, + 100.4987963, + 100.498796, + 100.8645911 + } +}; + +size_t const expected_size = sizeof(expected) / sizeof(expected_results); + +#endif // BOOST_GEOMETRY_TEST_VERTEX_LONGITUDE_CASES_HPP diff --git a/src/boost/libs/geometry/test/from_wkt.hpp b/src/boost/libs/geometry/test/from_wkt.hpp new file mode 100644 index 000000000..2d5f7bac6 --- /dev/null +++ b/src/boost/libs/geometry/test/from_wkt.hpp @@ -0,0 +1,28 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Tests + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +// Copyright (c) 2013-2015 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 +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_GEOMETRY_TEST_FROM_WKT_HPP +#define BOOST_GEOMETRY_TEST_FROM_WKT_HPP + +#include + +#include + +template +inline Geometry from_wkt(std::string const& wkt) +{ + Geometry result; + boost::geometry::read_wkt(wkt, result); + return result; +} + +#endif // BOOST_GEOMETRY_TEST_FROM_WKT_HPP diff --git a/src/boost/libs/geometry/test/geometries/Jamfile b/src/boost/libs/geometry/test/geometries/Jamfile new file mode 100644 index 000000000..89a2b3ccb --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/Jamfile @@ -0,0 +1,40 @@ +# Boost.Geometry +# +# Copyright (c) 2007-2019 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2019 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2019 Mateusz Loskot, London, UK. +# Copyright (c) 2014-2019 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-geometries + : + [ run adapted.cpp : : : : geometries_adapted ] + [ run boost_array_as_point.cpp : : : : geometries_boost_array_as_point ] + [ run boost_fusion.cpp : : : : geometries_boost_fusion ] + [ run boost_polygon.cpp : : : : geometries_boost_polygon ] + [ run boost_range.cpp : : : : geometries_boost_range ] + [ run boost_tuple.cpp : : : : geometries_boost_tuple ] + [ run box.cpp : : : : geometries_box ] + #[ compile-fail custom_linestring.cpp + # : # requirements + # TEST_FAIL_CLEAR + # : # target name + # geometries_custom_linestring_test_fail_clear + #] + [ run custom_linestring.cpp : : : : geometries_custom_linestring ] + [ run initialization.cpp : : : : geometries_initialization ] + [ run linestring.cpp : : : : geometries_linestring ] + [ run multi_linestring.cpp : : : : geometries_multi_linestring ] + [ run multi_point.cpp : : : : geometries_multi_point ] + [ run multi_polygon.cpp : : : : geometries_multi_polygon ] + [ run point.cpp : : : : geometries_point ] + [ run point_xy.cpp : : : : geometries_point_xy ] + [ run point_xyz.cpp : : : : geometries_point_xyz ] + [ run polygon.cpp : : : : geometries_polygon ] + [ run ring.cpp : : : : geometries_ring ] + [ run segment.cpp : : : : geometries_segment ] + [ run infinite_line.cpp : : : : geometries_infinite_line ] + ; diff --git a/src/boost/libs/geometry/test/geometries/adapted.cpp b/src/boost/libs/geometry/test/geometries/adapted.cpp new file mode 100644 index 000000000..173314396 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/adapted.cpp @@ -0,0 +1,112 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#include +#include + +#include + +#include +#include + +#include + +#define BOOST_GEOMETRY_TEST_RING + + + +#if defined(BOOST_GEOMETRY_TEST_RING) + + #include + #include + + BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(std::vector) + BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(std::deque) + +#elif defined(BOOST_GEOMETRY_TEST_MULTI_POINT) + + #include + #include + + BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED(std::vector) + BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED(std::deque) + +#else + + #include + #include + + BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) + BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + +#endif + + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +// ---------------------------------------------------------------------------- + +template +void test_geometry(G const& geometry, std::size_t expected_size = 0) +{ +#if defined(BOOST_GEOMETRY_TEST_RING) + BOOST_CONCEPT_ASSERT( (bg::concepts::ConstRing) ); +#elif defined(BOOST_GEOMETRY_TEST_MULTI_POINT) + BOOST_CONCEPT_ASSERT( (bg::concepts::ConstMultiPoint) ); +#else + BOOST_CONCEPT_ASSERT( (bg::concepts::ConstLinestring) ); +#endif + + typedef typename bg::point_type::type P; + typedef typename bg::coordinate_type

::type C; + boost::ignore_unused(); + + // Check range-like behaviour + BOOST_CHECK_EQUAL(boost::size(geometry), expected_size); +} + +template +void test_all() +{ + test_geometry(std::vector

()); + test_geometry(std::deque

()); + //test_geometry(std::list

()); + + /*** + double vertices[][3] = { + {-1, -1, 1}, {1, -1, 1}, {1, 1, 1}, {-1, 1, 1}, + {-1, -1, -1}, {1, -1, -1}, {1, 1, -1}, {-1, 1, -1} + }; + + test_geometry(vertices, 8); + ***/ +} + +int test_main(int, char* []) +{ + test_all(); + test_all >(); + test_all >(); + test_all >(); + test_all >(); + test_all >(); + + test_all >(); + test_all >(); + test_all >(); + + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/boost_array_as_point.cpp b/src/boost/libs/geometry/test/geometries/boost_array_as_point.cpp new file mode 100644 index 000000000..1cd49bf60 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/boost_array_as_point.cpp @@ -0,0 +1,50 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010 Alfredo Correa +// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#include +#include +#include +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +#ifndef BOOST_NO_CXX11_HDR_ARRAY +#include +BOOST_GEOMETRY_REGISTER_STD_ARRAY_CS(cs::cartesian) +#endif //BOOST_NO_CXX11_HDR_ARRAY + +int test_main(int, char* []) +{ + bg::model::point p1(1,2,3); + double p2[3] = {4,5,6}; + boost::tuple p3(7,8,9); + boost::array p4 = {{10,11,12}}; + std::clog << bg::distance(p1, p2) << std::endl; + std::clog << bg::distance(p2, p3) << std::endl; + std::clog << bg::distance(p3, p4) << std::endl; + +#ifndef BOOST_NO_CXX11_HDR_ARRAY +#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST + std::array p5 = {13,14,15}; +#else + std::array p5; p5[0] = 13; p5[1] = 14; p5[2] = 15; +#endif // BOOST_NO_CXX11_HDR_INITIALIZER_LIST + std::clog << bg::distance(p4, p5) << std::endl; +#endif //BOOST_NO_CXX11_HDR_ARRAY + + return 0; +} + diff --git a/src/boost/libs/geometry/test/geometries/boost_fusion.cpp b/src/boost/libs/geometry/test/geometries/boost_fusion.cpp new file mode 100644 index 000000000..38a4a05ff --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/boost_fusion.cpp @@ -0,0 +1,71 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright Akira Takahashi 2011 + +// 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) + +#include + +#include + +#include +#include +#include +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_FUSION_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +struct for_fusion_2d +{ + float x,y; +}; +struct for_fusion_3d +{ + double x,y,z; +}; + +BOOST_FUSION_ADAPT_STRUCT(for_fusion_2d, (float, x) (float, y)) +BOOST_FUSION_ADAPT_STRUCT(for_fusion_3d, (double, x) (double, y) (double, z)) + + +void test_2d() +{ + bg::model::point p1(1, 2); + double p2[2] = {3, 4}; + boost::tuple p3(5,6); + + for_fusion_2d pf = {7, 8}; + + BOOST_CHECK_CLOSE(bg::distance(p1, pf), 8.4852813742385695, 0.01); + BOOST_CHECK_CLOSE(bg::distance(p2, pf), 5.6568542494923806, 0.01); + BOOST_CHECK_CLOSE(bg::distance(p3, pf), 2.82843, 0.01); +} + +void test_3d() +{ + bg::model::point p1(1, 2, 3); + double p2[3] = {4, 5, 6}; + boost::tuple p3(7, 8, 9); + + for_fusion_3d pf = {10, 11, 12}; + + BOOST_CHECK_CLOSE(bg::distance(p1, pf), 15.58845726811, 0.01); + BOOST_CHECK_CLOSE(bg::distance(p2, pf), 10.392304845413, 0.01); + BOOST_CHECK_CLOSE(bg::distance(p3, pf), 5.196152, 0.01); +} + +int test_main(int, char* []) +{ + test_2d(); + test_3d(); + return 0; +} + diff --git a/src/boost/libs/geometry/test/geometries/boost_polygon.cpp b/src/boost/libs/geometry/test/geometries/boost_polygon.cpp new file mode 100644 index 000000000..c535b22d1 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/boost_polygon.cpp @@ -0,0 +1,174 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +// geometry::num_points does not accept the ring_proxy for adaptation, like +// centroid and probably many more algorithms. TODO: fix that. Until then we +// define it such that num_points is not called. +#define BOOST_GEOMETRY_EMPTY_INPUT_NO_THROW + +#include + + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +template +void fill_polygon_with_two_holes(boost::polygon::polygon_with_holes_data& boost_polygon_polygon) +{ + std::vector > point_vector; + point_vector.push_back(boost::polygon::point_data(0, 0)); + point_vector.push_back(boost::polygon::point_data(0, 10)); + point_vector.push_back(boost::polygon::point_data(10, 10)); + point_vector.push_back(boost::polygon::point_data(10, 0)); + point_vector.push_back(boost::polygon::point_data(0, 0)); + boost_polygon_polygon.set(point_vector.begin(), point_vector.end()); + + + std::vector > holes; + holes.resize(2); + + { + std::vector > point_vector; + point_vector.push_back(boost::polygon::point_data(1, 1)); + point_vector.push_back(boost::polygon::point_data(2, 1)); + point_vector.push_back(boost::polygon::point_data(2, 2)); + point_vector.push_back(boost::polygon::point_data(1, 2)); + point_vector.push_back(boost::polygon::point_data(1, 1)); + holes[0].set(point_vector.begin(), point_vector.end()); + } + + { + std::vector > point_vector; + point_vector.push_back(boost::polygon::point_data(3, 3)); + point_vector.push_back(boost::polygon::point_data(4, 3)); + point_vector.push_back(boost::polygon::point_data(4, 4)); + point_vector.push_back(boost::polygon::point_data(3, 4)); + point_vector.push_back(boost::polygon::point_data(3, 3)); + holes[1].set(point_vector.begin(), point_vector.end()); + } + boost_polygon_polygon.set_holes(holes.begin(), holes.end()); +} + + +template +void test_coordinate_type() +{ + // 1a: Check if Boost.Polygon's point fulfills Boost.Geometry's point concept + bg::concepts::check >(); + + // 1b: use a Boost.Polygon point in Boost.Geometry, calc. distance with two point types + boost::polygon::point_data boost_polygon_point(1, 2); + + typedef bg::model::point bg_point_type; + bg_point_type boost_geometry_point(3, 4); + BOOST_CHECK_EQUAL(bg::distance(boost_polygon_point, boost_geometry_point), + 2 * std::sqrt(2.0)); + + // 2a: Check if Boost.Polygon's box fulfills Boost.Geometry's box concept + bg::concepts::check >(); + + // 2b: use a Boost.Polygon rectangle in Boost.Geometry, compare with boxes + boost::polygon::rectangle_data boost_polygon_box; + bg::model::box boost_geometry_box; + + bg::assign_values(boost_polygon_box, 0, 1, 5, 6); + bg::assign_values(boost_geometry_box, 0, 1, 5, 6); + T boost_polygon_area = bg::area(boost_polygon_box); + T boost_geometry_area = bg::area(boost_geometry_box); + T boost_polygon_area_by_boost_polygon = boost::polygon::area(boost_polygon_box); + BOOST_CHECK_EQUAL(boost_polygon_area, boost_geometry_area); + BOOST_CHECK_EQUAL(boost_polygon_area, boost_polygon_area_by_boost_polygon); + + // 3a: Check if Boost.Polygon's polygon fulfills Boost.Geometry's ring concept + bg::concepts::check >(); + + // 3b: use a Boost.Polygon polygon (ring) + boost::polygon::polygon_data boost_polygon_ring; + { + // Filling it is a two-step process using Boost.Polygon + std::vector > point_vector; + point_vector.push_back(boost::polygon::point_data(0, 0)); + point_vector.push_back(boost::polygon::point_data(0, 3)); + point_vector.push_back(boost::polygon::point_data(4, 0)); + point_vector.push_back(boost::polygon::point_data(0, 0)); + boost_polygon_ring.set(point_vector.begin(), point_vector.end()); + } + + // Boost-geometry ring + bg::model::ring boost_geometry_ring; + { + boost_geometry_ring.push_back(bg_point_type(0, 0)); + boost_geometry_ring.push_back(bg_point_type(0, 3)); + boost_geometry_ring.push_back(bg_point_type(4, 0)); + boost_geometry_ring.push_back(bg_point_type(0, 0)); + } + boost_polygon_area = bg::area(boost_polygon_ring); + boost_geometry_area = bg::area(boost_geometry_ring); + boost_polygon_area_by_boost_polygon = boost::polygon::area(boost_polygon_ring); + BOOST_CHECK_EQUAL(boost_polygon_area, boost_geometry_area); + BOOST_CHECK_EQUAL(boost_polygon_area, boost_polygon_area_by_boost_polygon); + + // Check mutable ring + std::string wkt = "POLYGON((0 0,0 10,10 10,10 0,0 0))"; + bg::read_wkt(wkt, boost_polygon_ring); + bg::read_wkt(wkt, boost_geometry_ring); + boost_polygon_area = bg::area(boost_polygon_ring); + boost_geometry_area = bg::area(boost_geometry_ring); + boost_polygon_area_by_boost_polygon = boost::polygon::area(boost_polygon_ring); + BOOST_CHECK_EQUAL(boost_polygon_area, boost_geometry_area); + BOOST_CHECK_EQUAL(boost_polygon_area, boost_polygon_area_by_boost_polygon); + + // 4a: Boost.Polygon's polygon with holes + boost::polygon::polygon_with_holes_data boost_polygon_polygon; + fill_polygon_with_two_holes(boost_polygon_polygon); + + // Using Boost.Polygon + boost_polygon_area = bg::area(boost_polygon_polygon); + boost_polygon_area_by_boost_polygon = boost::polygon::area(boost_polygon_polygon); + BOOST_CHECK_EQUAL(boost_polygon_area, boost_polygon_area_by_boost_polygon); + + wkt = "POLYGON((0 0,0 10,10 10,10 0,0 0),(1 1,2 1,2 2,1 2,1 1),(3 3,4 3,4 4,3 4,3 3))"; + + bg::model::polygon boost_geometry_polygon; + bg::read_wkt(wkt, boost_geometry_polygon); + + boost_geometry_area = bg::area(boost_geometry_polygon); + BOOST_CHECK_EQUAL(boost_polygon_area, boost_geometry_area); + + bg::clear(boost_polygon_polygon); + bg::read_wkt(wkt, boost_polygon_polygon); + boost_geometry_area = bg::area(boost_polygon_polygon); + BOOST_CHECK_EQUAL(boost_polygon_area, boost_geometry_area); + + std::ostringstream out; + out << bg::wkt(boost_polygon_polygon); + BOOST_CHECK_EQUAL(wkt, out.str()); + +} + +int test_main(int, char* []) +{ + test_coordinate_type(); + //test_coordinate_type(); // compiles, but "BOOST_CHECK_EQUAL" fails + test_coordinate_type(); + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/boost_polygon_overlay.cpp b/src/boost/libs/geometry/test/geometries/boost_polygon_overlay.cpp new file mode 100644 index 000000000..f7db77353 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/boost_polygon_overlay.cpp @@ -0,0 +1,122 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include + + +#include +#include +#include +#include +#include +#include +#include + +#include + +template +void test_overlay_using_boost_polygon(std::string const& case_id, std::string const& wkt_p, std::string const& wkt_q) +{ + typedef boost::polygon::polygon_set_data polygon_set; + + polygon_set p, q; + polygon_set out_i, out_u; + + { + // Read polygons, conveniently using Boost.Geometry + typedef boost::geometry::model::multi_polygon + < + boost::polygon::polygon_with_holes_data + > mp_type; + mp_type mp, mq; + + bg::read_wkt(wkt_p, mp); + bg::read_wkt(wkt_q, mq); + + p.insert(mp.begin(), mp.end()); + q.insert(mq.begin(), mq.end()); + } + + { + using namespace boost::polygon::operators; + out_i = p & q; + out_u = p | q; + } + + double area_p = boost::polygon::area(p); + double area_q = boost::polygon::area(q); + double area_i = boost::polygon::area(out_i); + double area_u = boost::polygon::area(out_u); + + double sum = area_p + area_q - area_u - area_i; + BOOST_CHECK_MESSAGE(abs(sum) < 0.001, + "Overlay error\n" + << "Boost.Polygon " << case_id + << " area p: " << area_p + << " area q: " << area_q + << " area i: " << area_i + << " area u: " << area_u + << " sum: " << sum + ); +} + + +template +void test_overlay_using_boost_geometry(std::string const& case_id, std::string const& wkt_p, std::string const& wkt_q) +{ + typedef boost::geometry::model::multi_polygon + < + boost::geometry::model::polygon + < + boost::geometry::model::d2::point_xy + > + > mp_type; + + // Read it using Boost.Geometry + mp_type p, q, out_i, out_u; + + boost::geometry::read_wkt(wkt_p, p); + boost::geometry::read_wkt(wkt_q, q); + + boost::geometry::intersection(p, q, out_i); + boost::geometry::union_(p, q, out_u); + + double area_p = boost::geometry::area(p); + double area_q = boost::geometry::area(q); + double area_i = boost::geometry::area(out_i); + double area_u = boost::geometry::area(out_u); + + double sum = area_p + area_q - area_u - area_i; + BOOST_CHECK_MESSAGE(abs(sum) < 0.001, + "Overlay error\n" + << "Boost.Geometry " << case_id + << " area p: " << area_p + << " area q: " << area_q + << " area i: " << area_i + << " area u: " << area_u + << " sum: " << sum + ); +} + +template +void test_overlay(std::string const& case_id, std::string const& wkt_p, std::string const& wkt_q) +{ + test_overlay_using_boost_polygon(case_id, wkt_p, wkt_q); + test_overlay_using_boost_geometry(case_id, wkt_p, wkt_q); +} + + +int test_main(int, char* []) +{ + test_overlay("case 1", "MULTIPOLYGON(((100 900,0 800,100 800,100 900)),((200 700,100 800,100 700,200 700)),((500 400,400 400,400 300,500 400)),((600 300,500 200,600 200,600 300)),((600 700,500 800,500 700,600 700)),((700 500,600 500,600 400,700 500)),((900 300,800 400,800 300,900 300)))", + "MULTIPOLYGON(((200 900,100 1000,100 800,200 800,200 900)),((400 500,300 600,300 500,400 500)),((500 900,400 800,500 800,500 900)),((600 800,500 700,600 700,600 800)),((700 500,600 400,700 400,700 500)),((1000 1000,900 900,1000 900,1000 1000)))"); + test_overlay("case 2", "MULTIPOLYGON(((200 400,100 400,100 300,200 400)),((300 100,200 100,200 0,300 0,300 100)),((600 700,500 700,500 600,600 700)),((700 300,600 300,600 200,700 300)),((800 500,700 600,700 500,800 500)),((900 800,800 700,900 700,900 800)),((1000 200,900 100,1000 100,1000 200)),((1000 800,900 900,900 800,1000 800)))", + "MULTIPOLYGON(((200 800,100 800,100 700,200 700,200 800)),((400 200,300 100,400 100,400 200)),((400 800,300 700,400 700,400 800)),((700 100,600 0,700 0,700 100)),((700 200,600 200,600 100,700 200)),((900 200,800 200,800 0,900 0,900 200)),((1000 300,900 200,1000 200,1000 300)))"); + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/boost_range.cpp b/src/boost/libs/geometry/test/geometries/boost_range.cpp new file mode 100644 index 000000000..d2a2ff5d9 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/boost_range.cpp @@ -0,0 +1,123 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#include + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#ifdef BOOST_GEOMETRY_TEST_QUARANTINED +struct not_two +{ + template + bool operator()(P const& p) const + { + return boost::geometry::get<0>(p) != 2.0; + } +}; + +struct sum_not_five +{ + template + bool operator()(P const& p1, P const& p2) const + { + return boost::geometry::get<0>(p1) + boost::geometry::get<0>(p2) != 5.0; + } +}; +#endif + + +template +void test_range_adaptor() +{ + bg::model::linestring

ls; + bg::read_wkt("LINESTRING(1 1,2 2,3 3,4 4)", ls); + + { + std::ostringstream out; + out << bg::wkt(ls); + BOOST_CHECK_EQUAL(out.str(), "LINESTRING(1 1,2 2,3 3,4 4)"); + } + + { + std::ostringstream out; + out << bg::wkt(ls | boost::adaptors::reversed); + BOOST_CHECK_EQUAL(out.str(), "LINESTRING(4 4,3 3,2 2,1 1)"); + } + + { + std::ostringstream out; + out << bg::wkt(ls | boost::adaptors::strided(2)); + BOOST_CHECK_EQUAL(out.str(), "LINESTRING(1 1,3 3)"); + } + + { + std::ostringstream out; + out << bg::wkt(ls | boost::adaptors::sliced(1,3)); + BOOST_CHECK_EQUAL(out.str(), "LINESTRING(2 2,3 3)"); + } + +#ifdef BOOST_GEOMETRY_TEST_QUARANTINED +// range filter adaptor does not support boost::size() +// This makes it in practice not applicable, boost::geometry calls boost::size +// in most if not all algorithms + { + std::ostringstream out; + out << bg::wkt(ls | boost::adaptors::filtered(not_two())); + BOOST_CHECK_EQUAL(out.str(), "LINESTRING(1 1,3 3,4 4)"); + } + + { + std::ostringstream out; + out << bg::wkt(ls | boost::adaptors::adjacent_filtered(sum_not_five())); + BOOST_CHECK_EQUAL(out.str(), "LINESTRING(1 1,3 3,4 4)"); + } + + { + bg::model::linestring

ls2; + bg::read_wkt("LINESTRING(1 1,1 1,2 2,3 3,3 3,4 4)", ls2); + std::ostringstream out; + + + // uniqued needs == operator, equals + //out << bg::wkt(ls | boost::adaptors::uniqued); + //BOOST_CHECK_EQUAL(out.str(), "LINESTRING(1 1,2 2,3 3,4 4)"); + } +#endif +} + +template +void test_all() +{ + test_range_adaptor

(); +} + + + +int test_main(int, char* []) +{ + test_all >(); + test_all >(); + + return 0; + } + diff --git a/src/boost/libs/geometry/test/geometries/boost_tuple.cpp b/src/boost/libs/geometry/test/geometries/boost_tuple.cpp new file mode 100644 index 000000000..b6db1f02b --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/boost_tuple.cpp @@ -0,0 +1,39 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. + +// 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) + + +#include +#include +#include +#include +#include + +#include + + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +template +void test_all() +{ + P p1, p2; + bg::distance(p1, p2); +} + +int test_main(int, char* []) +{ + test_all >(); + test_all >(); + test_all >(); + test_all >(); + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/box.cpp b/src/boost/libs/geometry/test/geometries/box.cpp new file mode 100644 index 000000000..5e1fdaae5 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/box.cpp @@ -0,0 +1,105 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include + +#include + + +#include +#include +#include +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +template +bg::model::box

create_box() +{ + P p1; + P p2; + bg::assign_values(p1, 1, 2, 5); + bg::assign_values(p2, 3, 4, 6); + return bg::model::box

(p1, p2); +} + +template +void check_box(B& to_check, + T min_x, T min_y, T min_z, + T max_x, T max_y, T max_z) +{ + BOOST_CHECK_EQUAL(bg::get<0>(to_check.min_corner()), min_x); + BOOST_CHECK_EQUAL(bg::get<1>(to_check.min_corner()), min_y); + BOOST_CHECK_EQUAL(bg::get<2>(to_check.min_corner()), min_z); + BOOST_CHECK_EQUAL(bg::get<0>(to_check.max_corner()), max_x); + BOOST_CHECK_EQUAL(bg::get<1>(to_check.max_corner()), max_y); + BOOST_CHECK_EQUAL(bg::get<2>(to_check.max_corner()), max_z); +} + +template +void test_construction() +{ + typedef typename bg::coordinate_type

::type T; + + bg::model::box

b1 = bg::make_zero >(); + check_box(b1, T(),T(),T(),T(),T(),T()); + + bg::model::box

b2(create_box

()); + check_box(b2, 1,2,5,3,4,6); + + bg::model::box

b3 = bg::make_inverse >(); + check_box(b3, boost::numeric::bounds::highest(), + boost::numeric::bounds::highest(), + boost::numeric::bounds::highest(), + boost::numeric::bounds::lowest(), + boost::numeric::bounds::lowest(), + boost::numeric::bounds::lowest()); +} + +template +void test_assignment() +{ + bg::model::box

b(create_box

()); + bg::set<0>(b.min_corner(), 10); + bg::set<1>(b.min_corner(), 20); + bg::set<2>(b.min_corner(), 30); + bg::set<0>(b.max_corner(), 40); + bg::set<1>(b.max_corner(), 50); + bg::set<2>(b.max_corner(), 60); + check_box(b, 10,20,30,40,50,60); +} + +template +void test_all() +{ + test_construction

(); + test_assignment

(); +} + +int test_main(int, char* []) +{ + test_all(); + test_all(); + test_all(); + test_all(); + test_all >(); + test_all >(); + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/concepts/check.cpp b/src/boost/libs/geometry/test/geometries/concepts/check.cpp new file mode 100644 index 000000000..07b344295 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/concepts/check.cpp @@ -0,0 +1,76 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#include +#include + +struct ro_point +{ + float x, y; +}; + + +struct rw_point +{ + float x, y; +}; + + +namespace boost { namespace geometry { namespace traits { + +template <> struct tag { typedef point_tag type; }; +template <> struct coordinate_type { typedef float type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; +template <> struct dimension { enum { value = 2 }; }; + +template <> struct access +{ + static float get(ro_point const& p) { return p.x; } +}; + +template <> struct access +{ + static float get(ro_point const& p) { return p.y; } +}; + + + + +template <> struct tag { typedef point_tag type; }; +template <> struct coordinate_type { typedef float type; }; +template <> struct coordinate_system { typedef bg::cs::cartesian type; }; +template <> struct dimension { enum { value = 2 }; }; + +template <> struct access +{ + static float get(rw_point const& p) { return p.x; } + static void set(rw_point& p, float value) { p.x = value; } +}; + +template <> struct access +{ + static float get(rw_point const& p) { return p.y; } + static void set(rw_point& p, float value) { p.y = value; } +}; + + +}}} // namespace bg::traits + + +int main() +{ + bg::concepts::check(); + bg::concepts::check(); +} diff --git a/src/boost/libs/geometry/test/geometries/custom_linestring.cpp b/src/boost/libs/geometry/test/geometries/custom_linestring.cpp new file mode 100644 index 000000000..66feef665 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/custom_linestring.cpp @@ -0,0 +1,128 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#include + +#include +#include +#include +#include +#include + + +#include +#include +#include +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + +//#define TEST_FAIL_CLEAR +//#define TEST_FAIL_APPEND + + + +// ---------------------------------------------------------------------------- +// First custom linestring, requires ONLY one traits: to register itself as a linestring +template +struct custom_linestring1 : std::vector

{}; + +namespace boost { namespace geometry { namespace traits { + template + struct tag< custom_linestring1

> { typedef linestring_tag type; }; +}}} // namespace bg::traits + +// ---------------------------------------------------------------------------- +// Second custom linestring, decides to implement all edit operations itself +// by specializing the "use_std" traits to false. +// It should therefore implement the traits:: clear / append_point +template +struct custom_linestring2 : std::deque

// std::pair::const_iterator, typename std::vector

::const_iterator> +{ +}; + +namespace boost { namespace geometry { namespace traits { + template + struct tag< custom_linestring2

> { typedef linestring_tag type; }; + +#if ! defined(TEST_FAIL_CLEAR) + template + struct clear< custom_linestring2

> + { + // does not use std::vector

.clear() but something else. + static inline void apply(custom_linestring2

& ls) { ls.resize(0); } + }; +#endif + +}}} // namespace bg::traits + +// ---------------------------------------------------------------------------- + +template +void test_linestring() +{ + BOOST_CONCEPT_ASSERT( (bg::concepts::Linestring) ); + BOOST_CONCEPT_ASSERT( (bg::concepts::ConstLinestring) ); + + G geometry; + typedef typename bg::point_type::type P; + + bg::clear(geometry); + BOOST_CHECK_EQUAL(boost::size(geometry), 0u); + + bg::append(geometry, bg::make_zero

()); + BOOST_CHECK_EQUAL(boost::size(geometry), 1u); + + //std::cout << geometry << std::endl; + + bg::clear(geometry); + BOOST_CHECK_EQUAL(boost::size(geometry), 0u); + + + //P p = boost::range::front(geometry); +} + +template +void test_all() +{ + test_linestring >(); + test_linestring >(); + test_linestring >(); + + test_linestring >(); + test_linestring >(); + + test_linestring >(); + test_linestring >(); + //test_linestring >(); +} + +int test_main(int, char* []) +{ + test_all(); + test_all >(); + test_all >(); + test_all >(); + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/infinite_line.cpp b/src/boost/libs/geometry/test/geometries/infinite_line.cpp new file mode 100755 index 000000000..a69b43137 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/infinite_line.cpp @@ -0,0 +1,90 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2019 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2019. +// Modifications copyright (c) 2019, 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) + +#include + +#include +#include +#include +#include + +namespace +{ + // Boost.Test does not support BOOST_CHECK_CLOSE for integral types + template + bool is_small(T const& value) + { + static long double const epsilon = 1.0e-5; + return bg::math::abs(value) < epsilon; + } +} + +template +void verify_point_on_line(bg::model::infinite_line const& line, + C const& x, C const& y) +{ + BOOST_CHECK_MESSAGE(is_small(line.a * x + line.b * y + line.c), + "Point is not located on the line"); +} + +template +void test_make() +{ + typedef bg::model::infinite_line line_type; + + // Horizontal through origin + line_type line = bg::detail::make::make_infinite_line(0, 0, 10, 0); + verify_point_on_line(line, 0, 0); + verify_point_on_line(line, 10, 0); + + // Horizontal line above origin + line = bg::detail::make::make_infinite_line(0, 5, 10, 5); + verify_point_on_line(line, 0, 5); + verify_point_on_line(line, 10, 5); + + // Vertical through origin + line = bg::detail::make::make_infinite_line(0, 0, 0, 10); + verify_point_on_line(line, 0, 0); + verify_point_on_line(line, 0, 10); + + // Vertical line left from origin + line = bg::detail::make::make_infinite_line(5, 0, 5, 10); + verify_point_on_line(line, 5, 0); + verify_point_on_line(line, 5, 10); + + // Diagonal through origin + line = bg::detail::make::make_infinite_line(0, 0, 8, 10); + verify_point_on_line(line, 0, 0); + verify_point_on_line(line, 8, 10); + + // Diagonal not through origin + line = bg::detail::make::make_infinite_line(5, 2, -8, 10); + verify_point_on_line(line, 5, 2); + verify_point_on_line(line, -8, 10); +} + + +template +void test_all() +{ + test_make(); +} + +int test_main(int, char* []) +{ + test_all(); + test_all(); + test_all(); + test_all(); + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/initialization.cpp b/src/boost/libs/geometry/test/geometries/initialization.cpp new file mode 100644 index 000000000..23dd11f52 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/initialization.cpp @@ -0,0 +1,252 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2014-2015 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 +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +typedef std::pair pt_pair_t; +BOOST_GEOMETRY_REGISTER_POINT_2D(pt_pair_t, float, bg::cs::cartesian, first, second) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +template +void test_default() +{ + typedef bg::model::multi_point

mpt; + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + typedef bg::model::ring

ring; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + // multi_point() + mpt mptd; + BOOST_CHECK(bg::num_points(mptd) == 0); + // linestring() + ls lsd; + BOOST_CHECK(bg::num_points(lsd) == 0); + // multi_linestring() + mls mlsd; + BOOST_CHECK(bg::num_points(mlsd) == 0); + // ring() + ring rd; + BOOST_CHECK(bg::num_points(rd) == 0); + // polygon() + poly pd; + BOOST_CHECK(bg::num_points(pd) == 0); + // multi_polygon() + mpoly mpd; + BOOST_CHECK(bg::num_points(mpd) == 0); +} + +template +void test_boost_assign_2d() +{ + typedef bg::model::multi_point

mpt; + typedef bg::model::linestring

ls; + typedef bg::model::ring

ring; + + // using Boost.Assign + mpt mpt2 = boost::assign::list_of(P(0, 0))(P(1, 0)); + BOOST_CHECK(bg::num_points(mpt2) == 2); + mpt2 = boost::assign::list_of(P(0, 0))(P(1, 0)); + BOOST_CHECK(bg::num_points(mpt2) == 2); + + // using Boost.Assign + ls ls2 = boost::assign::list_of(P(0, 0))(P(1, 0))(P(1, 1)); + BOOST_CHECK(bg::num_points(ls2) == 3); + ls2 = boost::assign::list_of(P(0, 0))(P(1, 0))(P(1, 1)); + BOOST_CHECK(bg::num_points(ls2) == 3); + + // using Boost.Assign + ring r2 = boost::assign::list_of(P(0, 0))(P(0, 1))(P(1, 1))(P(1, 0))(P(0, 0)); + BOOST_CHECK(bg::num_points(r2) == 5); + r2 = boost::assign::list_of(P(0, 0))(P(0, 1))(P(1, 1))(P(1, 0))(P(0, 0)); + BOOST_CHECK(bg::num_points(r2) == 5); +} + +void test_boost_assign_pair_2d() +{ + typedef std::pair pt; + + test_boost_assign_2d(); + + typedef bg::model::multi_point mpt; + + // using Boost.Assign + mpt mpt2 = boost::assign::pair_list_of(0, 0)(1, 0); + BOOST_CHECK(bg::num_points(mpt2) == 2); + mpt2 = boost::assign::pair_list_of(0, 0)(1, 0); + BOOST_CHECK(bg::num_points(mpt2) == 2); +} + +void test_boost_assign_tuple_2d() +{ + typedef boost::tuple pt; + + test_boost_assign_2d(); + + typedef bg::model::multi_point mpt; + + // using Boost.Assign + mpt mpt2 = boost::assign::tuple_list_of(0, 0)(1, 0); + BOOST_CHECK(bg::num_points(mpt2) == 2); + mpt2 = boost::assign::tuple_list_of(0, 0)(1, 0); + BOOST_CHECK(bg::num_points(mpt2) == 2); +} + +template +void test_initializer_list_2d() +{ +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) && !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) + + typedef bg::model::multi_point

mpt; + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + typedef bg::model::ring

ring; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + // multi_point(initializer_list) + mpt mpt1 = {{0, 0}, {1, 0}, {2, 0}}; + BOOST_CHECK(bg::num_geometries(mpt1) == 3); + BOOST_CHECK(bg::num_points(mpt1) == 3); + // multi_point::operator=(initializer_list) + mpt1 = {{0, 0}, {1, 0}, {2, 0}, {3, 0}}; + BOOST_CHECK(bg::num_points(mpt1) == 4); + + // linestring(initializer_list) + ls ls1 = {{0, 0}, {1, 0}, {2, 0}}; + BOOST_CHECK(bg::num_geometries(ls1) == 1); + BOOST_CHECK(bg::num_points(ls1) == 3); + // linestring::operator=(initializer_list) + ls1 = {{0, 0}, {1, 0}, {2, 0}, {3, 0}}; + BOOST_CHECK(bg::num_points(ls1) == 4); + + // multi_linestring(initializer_list) + mls mls1 = {{{0, 0}, {1, 0}, {2, 0}}, {{3, 0}, {4, 0}}}; + BOOST_CHECK(bg::num_geometries(mls1) == 2); + BOOST_CHECK(bg::num_points(mls1) == 5); + // multi_linestring::operator=(initializer_list) + mls1 = {{{0, 0}, {1, 0}, {2, 0}}, {{3, 0}, {4, 0}, {5, 0}}}; + BOOST_CHECK(bg::num_points(mls1) == 6); + + // ring(initializer_list) + ring r1 = {{0, 0}, {0, 1}, {1, 1}, {1, 0}, {0, 0}}; + BOOST_CHECK(bg::num_geometries(r1) == 1); + BOOST_CHECK(bg::num_points(r1) == 5); + // ring::operator=(initializer_list) + r1 = {{0, 0}, {0, 1}, {1, 2}, {2, 1}, {1, 0}, {0, 0}}; + BOOST_CHECK(bg::num_points(r1) == 6); + + // polygon(initializer_list) + poly p1 = {{{0, 0}, {0, 9}, {9, 9}, {9, 0}, {0, 0}}, {{1, 1}, {2, 1}, {2, 2}, {1, 2}, {1, 1}}}; + BOOST_CHECK(bg::num_geometries(p1) == 1); + BOOST_CHECK(bg::num_points(p1) == 10); + BOOST_CHECK(boost::size(bg::interior_rings(p1)) == 1); + // polygon::operator=(initializer_list) + p1 = {{{0, 0}, {0, 8}, {8, 9}, {9, 8}, {8, 0}, {0, 0}}, {{1, 1}, {2, 1}, {2, 2}, {1, 2}, {1, 1}}}; + BOOST_CHECK(bg::num_points(p1) == 11); + BOOST_CHECK(boost::size(bg::interior_rings(p1)) == 1); + p1 = {{{0, 0}, {0, 9}, {9, 9}, {9, 0}, {0, 0}}}; + BOOST_CHECK(bg::num_points(p1) == 5); + BOOST_CHECK(boost::size(bg::interior_rings(p1)) == 0); + // polygon(initializer_list) + poly p2 = {{{0, 0}, {0, 9}, {9, 9}, {9, 0}, {0, 0}}}; + BOOST_CHECK(bg::num_geometries(p2) == 1); + BOOST_CHECK(bg::num_points(p2) == 5); + BOOST_CHECK(boost::size(bg::interior_rings(p1)) == 0); + // polygon::operator=(initializer_list) + p2 = {{{0, 0}, {0, 8}, {8, 9}, {9, 8}, {8, 0}, {0, 0}}}; + BOOST_CHECK(bg::num_points(p2) == 6); + + // multi_polygon(initializer_list) + mpoly mp1 = {{{{0, 0}, {0, 1}, {1, 1}, {1, 0}, {0, 0}}}, {{{2, 2}, {2, 3}, {3, 3}, {3, 2}, {2, 2}}}}; + BOOST_CHECK(bg::num_geometries(mp1) == 2); + BOOST_CHECK(bg::num_points(mp1) == 10); + // multi_polygon::operator=(initializer_list) + mp1 = {{{{0, 0}, {0, 1}, {1, 2}, {2, 1}, {1, 0}, {0, 0}}}, {{{2, 2}, {2, 3}, {3, 3}, {3, 2}, {2, 2}}}}; + BOOST_CHECK(bg::num_points(mp1) == 11); + +#endif +} + +template +void test_all_2d() +{ + test_default

(); + test_boost_assign_2d

(); + test_initializer_list_2d

(); +} + +template +struct test_point +{ + test_point(T = T(), T = T()) {} +}; + +template +struct test_range +{ + test_range() {} + template + test_range(It, It) {} +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) + test_range(std::initializer_list) {} + //test_range & operator=(std::initializer_list) { return *this; } +#endif +}; + +void test_sanity_check() +{ + typedef test_point P; + typedef test_range

R; + typedef std::vector

V; + +#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) && !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) + { + R r = {{1, 1},{2, 2},{3, 3}}; + r = {{1, 1},{2, 2},{3, 3}}; + + V v = {{1, 1},{2, 2},{3, 3}}; + v = {{1, 1},{2, 2},{3, 3}}; + } +#endif + { + R r = boost::assign::list_of(P(1, 1))(P(2, 2))(P(3, 3)); + r = boost::assign::list_of(P(1, 1))(P(2, 2))(P(3, 3)); + + V v = boost::assign::list_of(P(1, 1))(P(2, 2))(P(3, 3)); + //v = boost::assign::list_of(P(1, 1))(P(2, 2))(P(3, 3)); + v.empty(); + } +} + +int test_main(int, char* []) +{ + test_all_2d< bg::model::point >(); + test_all_2d< bg::model::d2::point_xy >(); + + test_boost_assign_pair_2d(); + test_boost_assign_tuple_2d(); + + test_sanity_check(); + + return 0; +} + diff --git a/src/boost/libs/geometry/test/geometries/linestring.cpp b/src/boost/libs/geometry/test/geometries/linestring.cpp new file mode 100644 index 000000000..3f32eee7e --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/linestring.cpp @@ -0,0 +1,136 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2020 Digvijay Janartha, Hamirpur, India. + +// 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) + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST +#include +#endif//BOOST_NO_CXX11_HDR_INITIALIZER_LIST + + +template +bg::model::linestring

create_linestring() +{ + bg::model::linestring

l1; + P p1; + bg::assign_values(p1, 1, 2, 3); + bg::append(l1, p1); + return l1; +} + +template +void check_linestring(L& to_check, T x, T y, T z) +{ + BOOST_CHECK_EQUAL(bg::get<0>(to_check[0]), x); + BOOST_CHECK_EQUAL(bg::get<1>(to_check[0]), y); + BOOST_CHECK_EQUAL(bg::get<2>(to_check[0]), z); +} + +template +void test_default_constructor() +{ + bg::model::linestring

l1(create_linestring

()); + check_linestring(l1, 1, 2, 3); +} + +template +void test_copy_constructor() +{ + bg::model::linestring

l1 = create_linestring

(); + check_linestring(l1, 1, 2, 3); +} + +template +void test_copy_assignment() +{ + bg::model::linestring

l1(create_linestring

()), l2; + l2 = l1; + check_linestring(l2, 1, 2, 3); +} + +template +void test_concept() +{ + typedef bg::model::linestring

L; + + BOOST_CONCEPT_ASSERT( (bg::concepts::ConstLinestring) ); + BOOST_CONCEPT_ASSERT( (bg::concepts::Linestring) ); + + typedef typename bg::coordinate_type::type T; + typedef typename bg::point_type::type LP; + boost::ignore_unused(); +} + +template +void test_all() +{ + test_default_constructor

(); + test_copy_constructor

(); + test_copy_assignment

(); + test_concept

(); +} + +template +void test_custom_linestring(std::initializer_list

IL) +{ + bg::model::linestring

l1(IL); + std::ostringstream out; + out << bg::dsv(l1); + BOOST_CHECK_EQUAL(out.str(), "((1, 2), (2, 3), (3, 4))"); +} + +template +void test_custom() +{ +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST + std::initializer_list

IL = {P(1, 2), P(2, 3), P(3, 4)}; + test_custom_linestring

(IL); +#endif//BOOST_NO_CXX11_HDR_INITIALIZER_LIST +} + +template +void test_cs() +{ + test_all >(); + test_all >(); + test_all >(); + + test_custom >(); +} + + +int test_main(int, char* []) +{ + test_cs(); + test_cs >(); + test_cs >(); + test_cs >(); + + test_custom >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/multi_linestring.cpp b/src/boost/libs/geometry/test/geometries/multi_linestring.cpp new file mode 100644 index 000000000..74ac3f5f7 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/multi_linestring.cpp @@ -0,0 +1,159 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2020 Digvijay Janartha, Hamirpur, India. + +// 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) + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST +#include +#endif//BOOST_NO_CXX11_HDR_INITIALIZER_LIST + +template +bg::model::linestring

create_linestring() +{ + bg::model::linestring

l1; + P p1(1, 2); + bg::append(l1, p1); + return l1; +} + +template +bg::model::multi_linestring create_multi_linestring() +{ + bg::model::multi_linestring ml1; + L l1(create_linestring

()); + ml1.push_back(l1); + ml1.push_back(l1); + return ml1; +} + +template +void check_multi_linestring(ML& to_check, L l1) +{ + ML cur; + cur.push_back(l1); + cur.push_back(l1); + + std::ostringstream out1, out2; + out1 << bg::dsv(to_check); + out2 << bg::dsv(cur); + BOOST_CHECK_EQUAL(out1.str(), out2.str()); +} + +template +void test_default_constructor() +{ + bg::model::multi_linestring ml1(create_multi_linestring()); + check_multi_linestring(ml1, L(create_linestring

())); +} + +template +void test_copy_constructor() +{ + bg::model::multi_linestring ml1 = create_multi_linestring(); + check_multi_linestring(ml1, L(create_linestring

())); +} + +template +void test_copy_assignment() +{ + bg::model::multi_linestring ml1(create_multi_linestring()), ml2; + ml2 = ml1; + check_multi_linestring(ml2, L(create_linestring

())); +} + +template +void test_concept() +{ + typedef bg::model::multi_linestring ML; + + BOOST_CONCEPT_ASSERT( (bg::concepts::ConstMultiLinestring) ); + BOOST_CONCEPT_ASSERT( (bg::concepts::MultiLinestring) ); + + typedef typename bg::coordinate_type::type T; + typedef typename bg::point_type::type PML; + boost::ignore_unused(); +} + +template +void test_all() +{ + typedef bg::model::linestring

L; + + test_default_constructor(); + test_copy_constructor(); + test_copy_assignment(); + test_concept(); +} + +template +void test_custom_multi_linestring(bg::model::linestring

IL) +{ + typedef bg::model::linestring

L; + + std::initializer_list LIL = {IL}; + bg::model::multi_linestring ml1(LIL); + std::ostringstream out; + out << bg::dsv(ml1); + BOOST_CHECK_EQUAL(out.str(), "(((1, 1), (2, 2), (3, 3), (0, 0), (0, 2), (0, 3)))"); +} + +template +void test_custom() +{ +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST + std::initializer_list

IL1 = {P(1, 1), P(2, 2), P(3, 3)}; + std::initializer_list

IL2 = {P(0, 0), P(0, 2), P(0, 3)}; + bg::model::linestring

l1; + bg::append(l1, IL1); + bg::append(l1, IL2); + test_custom_multi_linestring

(l1); +#endif//BOOST_NO_CXX11_HDR_INITIALIZER_LIST +} + +template +void test_cs() +{ + test_all >(); + test_all >(); + test_all >(); + + test_custom >(); +} + + +int test_main(int, char* []) +{ + test_cs(); + test_cs >(); + test_cs >(); + test_cs >(); + + test_custom >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/multi_point.cpp b/src/boost/libs/geometry/test/geometries/multi_point.cpp new file mode 100644 index 000000000..b10af2281 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/multi_point.cpp @@ -0,0 +1,135 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2020 Digvijay Janartha, Hamirpur, India. + +// 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) + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST +#include +#endif//BOOST_NO_CXX11_HDR_INITIALIZER_LIST + +template +bg::model::multi_point

create_multi_point() +{ + bg::model::multi_point

mp1; + P p1; + bg::assign_values(p1, 1, 2, 3); + bg::append(mp1, p1); + return mp1; +} + +template +void check_multi_point(L& to_check, T x, T y, T z) +{ + BOOST_CHECK_EQUAL(bg::get<0>(to_check[0]), x); + BOOST_CHECK_EQUAL(bg::get<1>(to_check[0]), y); + BOOST_CHECK_EQUAL(bg::get<2>(to_check[0]), z); +} + +template +void test_default_constructor() +{ + bg::model::multi_point

mp1(create_multi_point

()); + check_multi_point(mp1, 1, 2, 3); +} + +template +void test_copy_constructor() +{ + bg::model::multi_point

mp1 = create_multi_point

(); + check_multi_point(mp1, 1, 2, 3); +} + +template +void test_copy_assignment() +{ + bg::model::multi_point

mp1(create_multi_point

()), mp2; + mp2 = mp1; + check_multi_point(mp2, 1, 2, 3); +} + +template +void test_concept() +{ + typedef bg::model::multi_point

MP; + + BOOST_CONCEPT_ASSERT( (bg::concepts::ConstMultiPoint) ); + BOOST_CONCEPT_ASSERT( (bg::concepts::MultiPoint) ); + + typedef typename bg::coordinate_type::type T; + typedef typename bg::point_type::type MPP; + boost::ignore_unused(); +} + +template +void test_all() +{ + test_default_constructor

(); + test_copy_constructor

(); + test_copy_assignment

(); + test_concept

(); +} + +template +void test_custom_multi_point(std::initializer_list

IL) +{ + bg::model::multi_point

mp1(IL); + std::ostringstream out; + out << bg::dsv(mp1); + BOOST_CHECK_EQUAL(out.str(), "((0, 0), (1, 2), (2, 0))"); +} + +template +void test_custom() +{ +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST + std::initializer_list

IL = {P(0, 0), P(1, 2), P(2, 0)}; + test_custom_multi_point

(IL); +#endif//BOOST_NO_CXX11_HDR_INITIALIZER_LIST +} + +template +void test_cs() +{ + test_all >(); + test_all >(); + test_all >(); + + test_custom >(); +} + + +int test_main(int, char* []) +{ + test_cs(); + test_cs >(); + test_cs >(); + test_cs >(); + + test_custom >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/multi_polygon.cpp b/src/boost/libs/geometry/test/geometries/multi_polygon.cpp new file mode 100644 index 000000000..f0c474db5 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/multi_polygon.cpp @@ -0,0 +1,166 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2020 Digvijay Janartha, Hamirpur, India. + +// 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) + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST +#include +#endif//BOOST_NO_CXX11_HDR_INITIALIZER_LIST + +template +bg::model::polygon

create_polygon() +{ + bg::model::polygon

pl1; + P p1; + P p2; + P p3; + bg::assign_values(p1, 1, 2); + bg::assign_values(p2, 2, 0); + bg::assign_values(p3, 0, 0); + + bg::append(pl1, p1); + bg::append(pl1, p2); + bg::append(pl1, p3); + bg::append(pl1, p1); + return pl1; +} + +template +bg::model::multi_polygon create_multi_polygon() +{ + bg::model::multi_polygon mpl1; + PL pl1(create_polygon

()); + mpl1.push_back(pl1); + mpl1.push_back(pl1); + return mpl1; +} + +template +void check_multi_polygon(MPL& to_check, PL pl1) +{ + MPL cur; + cur.push_back(pl1); + cur.push_back(pl1); + + std::ostringstream out1, out2; + out1 << bg::dsv(to_check); + out2 << bg::dsv(cur); + BOOST_CHECK_EQUAL(out1.str(), out2.str()); +} + +template +void test_default_constructor() +{ + bg::model::multi_polygon mpl1(create_multi_polygon()); + check_multi_polygon(mpl1, PL(create_polygon

())); +} + +template +void test_copy_constructor() +{ + bg::model::multi_polygon mpl1 = create_multi_polygon(); + check_multi_polygon(mpl1, PL(create_polygon

())); +} + +template +void test_copy_assignment() +{ + bg::model::multi_polygon mpl1(create_multi_polygon()), mpl2; + mpl2 = mpl1; + check_multi_polygon(mpl2, PL(create_polygon

())); +} + +template +void test_concept() +{ + typedef bg::model::multi_polygon MPL; + + BOOST_CONCEPT_ASSERT( (bg::concepts::ConstMultiPolygon) ); + BOOST_CONCEPT_ASSERT( (bg::concepts::MultiPolygon) ); + + typedef typename bg::coordinate_type::type T; + typedef typename bg::point_type::type PMPL; + boost::ignore_unused(); +} + +template +void test_all() +{ + typedef bg::model::polygon

PL; + + test_default_constructor(); + test_copy_constructor(); + test_copy_assignment(); + test_concept(); +} + +template +void test_custom_multi_polygon(bg::model::polygon

IL) +{ + typedef bg::model::polygon

PL; + + std::initializer_list PIL = {IL}; + bg::model::multi_polygon mpl1(PIL); + std::ostringstream out; + out << bg::dsv(mpl1); + BOOST_CHECK_EQUAL(out.str(), "((((3, 3), (3, 0), (0, 0), (0, 3), (3, 3))))"); +} + +template +void test_custom() +{ +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST + std::initializer_list

IL = {P(3, 3), P(3, 0), P(0, 0), P(0, 3), P(3, 3)}; + bg::model::ring

r1(IL); + std::initializer_list > RIL = {r1}; + test_custom_multi_polygon

(RIL); +#endif//BOOST_NO_CXX11_HDR_INITIALIZER_LIST +} + +template +void test_cs() +{ + test_all >(); + test_all >(); + test_all >(); + + test_custom >(); +} + + +int test_main(int, char* []) +{ + test_cs(); + test_cs >(); + test_cs >(); + test_cs >(); + + test_custom >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/point.cpp b/src/boost/libs/geometry/test/geometries/point.cpp new file mode 100644 index 000000000..23a4151a4 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/point.cpp @@ -0,0 +1,101 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2020 Digvijay Janartha, Hamirpur, India. + +// 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) + + +#include + +#include +#include +#include +#include + +#include + + +template +bg::model::point create_point() +{ + T t1 = 1; + T t2 = 2; + T t3 = 3; + return bg::model::point(t1, t2, t3); +} + +template +void check_point(P& to_check, T x, T y, T z) +{ + BOOST_CHECK_EQUAL(bg::get<0>(to_check), x); + BOOST_CHECK_EQUAL(bg::get<1>(to_check), y); + BOOST_CHECK_EQUAL(bg::get<2>(to_check), z); +} + +template +void test_default_constructor() +{ + bg::model::point p(create_point()); + check_point(p, 1, 2, 3); +} + +template +void test_copy_constructor() +{ + bg::model::point p = create_point(); + check_point(p, 1, 2, 3); +} + +template +void test_copy_assignment() +{ + bg::model::point p(create_point()); + bg::set<0>(p, 4); + bg::set<1>(p, 5); + bg::set<2>(p, 6); + check_point(p, 4, 5, 6); +} + +template +void test_concept() +{ + typedef bg::model::point P; + + // Compilation tests, all things should compile. + BOOST_CONCEPT_ASSERT( (bg::concepts::ConstPoint

) ); + BOOST_CONCEPT_ASSERT( (bg::concepts::Point

) ); + + typedef typename bg::coordinate_type

::type T1; + boost::ignore_unused(); +} + +template +void test_all() +{ + test_default_constructor(); + test_copy_constructor(); + test_copy_assignment(); + test_concept(); +} + +template +void test_cs() +{ + test_all(); + test_all(); + test_all(); +} + + +int test_main(int, char* []) +{ + test_cs(); + test_cs >(); + test_cs >(); + test_cs >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/point_xy.cpp b/src/boost/libs/geometry/test/geometries/point_xy.cpp new file mode 100644 index 000000000..791940140 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/point_xy.cpp @@ -0,0 +1,75 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2020 Digvijay Janartha, Hamirpur, India. + +// 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) + + +#include + +#include +#include +#include + +#include + + +template +bg::model::d2::point_xy create_point_xy() +{ + T t1 = 1; + T t2 = 2; + return bg::model::d2::point_xy(t1, t2); +} + +template +void check_point_xy(P& to_check, T x, T y) +{ + BOOST_CHECK_EQUAL(bg::get<0>(to_check), x); + BOOST_CHECK_EQUAL(bg::get<1>(to_check), y); + BOOST_CHECK_EQUAL(to_check.x(), x); + BOOST_CHECK_EQUAL(to_check.y(), y); +} + +template +void test_default_constructor() +{ + bg::model::d2::point_xy p(create_point_xy()); + check_point_xy(p, 1, 2); +} + +template +void test_copy_constructor() +{ + bg::model::d2::point_xy p(create_point_xy()); + check_point_xy(p, 1, 2); +} + +template +void test_copy_assignment() +{ + bg::model::d2::point_xy p(create_point_xy()); + bg::set<0>(p, 4); + bg::set<1>(p, 5); + check_point_xy(p, 4, 5); +} + +template +void test_all() +{ + test_default_constructor(); + test_copy_constructor(); + test_copy_assignment(); +} + +int test_main(int, char* []) +{ + test_all(); + test_all(); + test_all(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/point_xyz.cpp b/src/boost/libs/geometry/test/geometries/point_xyz.cpp new file mode 100644 index 000000000..f52484a2a --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/point_xyz.cpp @@ -0,0 +1,79 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2020 Digvijay Janartha, Hamirpur, India. + +// 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) + + +#include + +#include +#include +#include + +#include + + +template +bg::model::d3::point_xyz create_point_xyz() +{ + T t1 = 1; + T t2 = 2; + T t3 = 3; + return bg::model::d3::point_xyz(t1, t2, t3); +} + +template +void check_point_xyz(P& to_check, T x, T y, T z) +{ + BOOST_CHECK_EQUAL(bg::get<0>(to_check), x); + BOOST_CHECK_EQUAL(bg::get<1>(to_check), y); + BOOST_CHECK_EQUAL(bg::get<2>(to_check), z); + BOOST_CHECK_EQUAL(to_check.x(), x); + BOOST_CHECK_EQUAL(to_check.y(), y); + BOOST_CHECK_EQUAL(to_check.z(), z); +} + +template +void test_default_constructor() +{ + bg::model::d3::point_xyz p(create_point_xyz()); + check_point_xyz(p, 1, 2, 3); +} + +template +void test_copy_constructor() +{ + bg::model::d3::point_xyz p = create_point_xyz(); + check_point_xyz(p, 1, 2, 3); +} + +template +void test_copy_assignment() +{ + bg::model::d3::point_xyz p(create_point_xyz()); + bg::set<0>(p, 4); + bg::set<1>(p, 5); + bg::set<2>(p, 6); + check_point_xyz(p, 4, 5, 6); +} + +template +void test_all() +{ + test_default_constructor(); + test_copy_constructor(); + test_copy_assignment(); +} + +int test_main(int, char* []) +{ + test_all(); + test_all(); + test_all(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/polygon.cpp b/src/boost/libs/geometry/test/geometries/polygon.cpp new file mode 100644 index 000000000..bf9aeb337 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/polygon.cpp @@ -0,0 +1,152 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2020 Digvijay Janartha, Hamirpur, India. + +// 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) + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST +#include +#endif//BOOST_NO_CXX11_HDR_INITIALIZER_LIST + +template +bg::model::polygon

create_polygon() +{ + bg::model::polygon

pl1; + P p1; + P p2; + P p3; + bg::assign_values(p1, 1, 2); + bg::assign_values(p2, 2, 0); + bg::assign_values(p3, 0, 0); + + bg::append(pl1, p1); + bg::append(pl1, p2); + bg::append(pl1, p3); + bg::append(pl1, p1); + return pl1; +} + +template +void check_polygon(PL& to_check, P p1, P p2, P p3) +{ + PL cur; + bg::append(cur, p1); + bg::append(cur, p2); + bg::append(cur, p3); + bg::append(cur, p1); + + std::ostringstream out1, out2; + out1 << bg::dsv(to_check); + out2 << bg::dsv(cur); + BOOST_CHECK_EQUAL(out1.str(), out2.str()); +} + +template +void test_default_constructor() +{ + bg::model::polygon

pl1(create_polygon

()); + check_polygon(pl1, P(1, 2), P(2, 0), P(0, 0)); +} + +template +void test_copy_constructor() +{ + bg::model::polygon

pl1 = create_polygon

(); + check_polygon(pl1, P(1, 2), P(2, 0), P(0, 0)); +} + +template +void test_copy_assignment() +{ + bg::model::polygon

pl1(create_polygon

()), pl2; + pl2 = pl1; + check_polygon(pl2, P(1, 2), P(2, 0), P(0, 0)); +} + +template +void test_concept() +{ + typedef bg::model::polygon

PL; + + BOOST_CONCEPT_ASSERT( (bg::concepts::ConstPolygon) ); + BOOST_CONCEPT_ASSERT( (bg::concepts::Polygon) ); + + typedef typename bg::coordinate_type::type T; + typedef typename bg::point_type::type PPL; + boost::ignore_unused(); +} + +template +void test_all() +{ + test_default_constructor

(); + test_copy_constructor

(); + test_copy_assignment

(); + test_concept

(); +} + +template +void test_custom_polygon(bg::model::ring

IL) +{ +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST + std::initializer_list > RIL = {IL}; + bg::model::polygon

pl1(RIL); + std::ostringstream out; + out << bg::dsv(pl1); + BOOST_CHECK_EQUAL(out.str(), "(((3, 3), (3, 0), (0, 0), (0, 3), (3, 3)))"); +#endif//BOOST_NO_CXX11_HDR_INITIALIZER_LIST +} + +template +void test_custom() +{ + std::initializer_list

IL = {P(3, 3), P(3, 0), P(0, 0), P(0, 3), P(3, 3)}; + bg::model::ring

r1(IL); + test_custom_polygon

(r1); +} + +template +void test_cs() +{ + test_all >(); + test_all >(); + test_all >(); + + test_custom >(); +} + + +int test_main(int, char* []) +{ + test_cs(); + test_cs >(); + test_cs >(); + test_cs >(); + + test_custom >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/ring.cpp b/src/boost/libs/geometry/test/geometries/ring.cpp new file mode 100644 index 000000000..e74378090 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/ring.cpp @@ -0,0 +1,155 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2020 Digvijay Janartha, Hamirpur, India. + +// 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) + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST +#include +#endif//BOOST_NO_CXX11_HDR_INITIALIZER_LIST + +template +bg::model::ring

create_ring() +{ + bg::model::ring

r1; + P p1; + P p2; + P p3; + P p4; + bg::assign_values(p1, 2, 2); + bg::assign_values(p2, 2, 0); + bg::assign_values(p3, 0, 0); + bg::assign_values(p4, 0, 2); + + bg::append(r1, p1); + bg::append(r1, p2); + bg::append(r1, p3); + bg::append(r1, p4); + bg::append(r1, p1); + return r1; +} + +template +void check_point(P& to_check, T x, T y) +{ + BOOST_CHECK_EQUAL(bg::get<0>(to_check), x); + BOOST_CHECK_EQUAL(bg::get<1>(to_check), y); +} + +template +void check_ring(R& to_check, P p1, P p2, P p3, P p4) +{ + check_point(to_check[0], bg::get<0>(p1), bg::get<1>(p1)); + check_point(to_check[1], bg::get<0>(p2), bg::get<1>(p2)); + check_point(to_check[2], bg::get<0>(p3), bg::get<1>(p3)); + check_point(to_check[3], bg::get<0>(p4), bg::get<1>(p4)); + check_point(to_check[4], bg::get<0>(p1), bg::get<1>(p1)); +} + +template +void test_default_constructor() +{ + bg::model::ring

r1(create_ring

()); + check_ring(r1, P(2, 2), P(2, 0), P(0, 0), P(0, 2)); +} + +template +void test_copy_constructor() +{ + bg::model::ring

r1 = create_ring

(); + check_ring(r1, P(2, 2), P(2, 0), P(0, 0), P(0, 2)); +} + +template +void test_copy_assignment() +{ + bg::model::ring

r1(create_ring

()), r2; + r2 = r1; + check_ring(r2, P(2, 2), P(2, 0), P(0, 0), P(0, 2)); +} + +template +void test_concept() +{ + typedef bg::model::ring

R; + + BOOST_CONCEPT_ASSERT( (bg::concepts::ConstRing) ); + BOOST_CONCEPT_ASSERT( (bg::concepts::Ring) ); + + typedef typename bg::coordinate_type::type T; + typedef typename bg::point_type::type PR; + boost::ignore_unused(); +} + +template +void test_all() +{ + test_default_constructor

(); + test_copy_constructor

(); + test_copy_assignment

(); + test_concept

(); +} + +template +void test_custom_ring(bg::model::ring

IL) +{ + bg::model::ring

r1(IL); + std::ostringstream out; + out << bg::dsv(r1); + BOOST_CHECK_EQUAL(out.str(), "((3, 3), (3, 0), (0, 0), (0, 3), (3, 3))"); +} + +template +void test_custom() +{ +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST + std::initializer_list

IL = {P(3, 3), P(3, 0), P(0, 0), P(0, 3), P(3, 3)}; + test_custom_ring

(IL); +#endif//BOOST_NO_CXX11_HDR_INITIALIZER_LIST +} + +template +void test_cs() +{ + test_all >(); + test_all >(); + test_all >(); + + test_custom >(); +} + + +int test_main(int, char* []) +{ + test_cs(); + test_cs >(); + test_cs >(); + test_cs >(); + + test_custom >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/geometries/segment.cpp b/src/boost/libs/geometry/test/geometries/segment.cpp new file mode 100644 index 000000000..dcbb2ed18 --- /dev/null +++ b/src/boost/libs/geometry/test/geometries/segment.cpp @@ -0,0 +1,104 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include + +#include + +#include + +#include + +#include +#include + + +#include +#include + +#include + + +#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +template +void test_all() +{ + typedef bg::model::referring_segment

S; + + P p1; + P p2; + S s(p1, p2); + BOOST_CHECK_EQUAL(&s.first, &p1); + BOOST_CHECK_EQUAL(&s.second, &p2); + + // Compilation tests, all things should compile. + BOOST_CONCEPT_ASSERT( (bg::concepts::ConstSegment) ); + BOOST_CONCEPT_ASSERT( (bg::concepts::Segment) ); + + typedef typename bg::coordinate_type::type T; + typedef typename bg::point_type::type SP; + boost::ignore_unused(); + + //std::cout << sizeof(typename coordinate_type::type) << std::endl; + + typedef bg::model::referring_segment

refseg_t; + //BOOST_CONCEPT_ASSERT( (concepts::ConstSegment) ); + + refseg_t seg(p1, p2); + + typedef typename bg::coordinate_type::type CT; + typedef typename bg::point_type::type CSP; + boost::ignore_unused(); +} + + + +template +void test_custom() +{ + S seg; + bg::set<0,0>(seg, 1); + bg::set<0,1>(seg, 2); + bg::set<1,0>(seg, 3); + bg::set<1,1>(seg, 4); + std::ostringstream out; + out << bg::dsv(seg); + BOOST_CHECK_EQUAL(out.str(), "((1, 2), (3, 4))"); +} + + +int test_main(int, char* []) +{ + test_all(); + test_all(); + test_all(); + //test_all(); + test_all >(); + test_all >(); + test_all >(); + + test_custom(); + test_custom > >(); + test_custom >(); + test_custom(); + + return 0; +} + diff --git a/src/boost/libs/geometry/test/geometry_test_common.hpp b/src/boost/libs/geometry/test/geometry_test_common.hpp new file mode 100644 index 000000000..87ec3d979 --- /dev/null +++ b/src/boost/libs/geometry/test/geometry_test_common.hpp @@ -0,0 +1,202 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + + +#ifndef GEOMETRY_TEST_GEOMETRY_TEST_COMMON_HPP +#define GEOMETRY_TEST_GEOMETRY_TEST_COMMON_HPP + +#include + +// Determine debug/release mode +// (it would be convenient if Boost.Config or Boost.Test would define this) +// Note that they might be combined (e.g. for optimize+no inline) +#if defined (BOOST_CLANG) || defined(BOOST_GCC) +#if defined(__OPTIMIZE__) + #define BOOST_GEOMETRY_COMPILER_MODE_RELEASE +#endif +#if defined(__NO_INLINE__) +#define BOOST_GEOMETRY_COMPILER_MODE_DEBUG +#endif +#endif + +#if defined(BOOST_MSVC) +#if defined(_DEBUG) +#define BOOST_GEOMETRY_COMPILER_MODE_DEBUG +#else +#define BOOST_GEOMETRY_COMPILER_MODE_RELEASE +#endif +#endif + + +#if defined(BOOST_MSVC) +// We deliberately mix float/double's so turn off warnings +#pragma warning( disable : 4244 ) +// For (new since Boost 1.40) warning in Boost.Test on putenv/posix +#pragma warning( disable : 4996 ) + +//#pragma warning( disable : 4305 ) +#endif // defined(BOOST_MSVC) + +#include +#include +#include +#include + +#include + +// Include some always-included-for-testing files +#if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST) + +// Until Boost.Test fixes it, silence warning issued by clang: +#ifdef __clang__ +# pragma clang diagnostic push +// warning: unused variable 'check_is_close' [-Wunused-variable] +# pragma clang diagnostic ignored "-Wunused-variable" +// warnings when -Wconversion is set +# pragma clang diagnostic ignored "-Wsign-conversion" +# pragma clang diagnostic ignored "-Wshorten-64-to-32" +#endif + +# include +#ifndef BOOST_TEST_MODULE +# include +//# include +# include +#endif + +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + +#endif + + +#if defined(HAVE_TTMATH) +# include +#endif + +#if defined(HAVE_CLN) || defined(HAVE_GMP) +# include +#endif + + +#if defined(HAVE_GMP) +# include +#endif +#if defined(HAVE_CLN) +# include +#endif + +// For all tests: +// - do NOT use "using namespace boost::geometry" to make clear what is Boost.Geometry +// - use bg:: as short alias +#include +#include +#include +#include +#include +namespace bg = boost::geometry; + + +template +inline T1 if_typed_tt(T1 value_tt, T2 value) +{ +#if defined(HAVE_TTMATH) + return boost::is_same::type::value ? value_tt : value; +#else + boost::ignore_unused(value_tt); + return value; +#endif +} + +template +inline T if_typed(T value_typed, T value) +{ + return boost::is_same::value ? value_typed : value; +} + +template +inline std::string type_for_assert_message() +{ + bool const ccw = + bg::point_order::value == bg::counterclockwise + || bg::point_order::value == bg::counterclockwise; + bool const open = + bg::closure::value == bg::open + || bg::closure::value == bg::open; + + std::ostringstream out; + out << string_from_type::type>::name() + << (ccw ? " ccw" : "") + << (open ? " open" : ""); + return out.str(); +} + +struct geographic_policy +{ + template + static inline CoordinateType apply(CoordinateType const& value) + { + return value; + } +}; + +struct mathematical_policy +{ + template + static inline CoordinateType apply(CoordinateType const& value) + { + return 90 - value; + } + +}; + +typedef double default_test_type; + +#if defined(BOOST_GEOMETRY_USE_RESCALING) +#define BG_IF_RESCALED(a, b) a +#else +#define BG_IF_RESCALED(a, b) b +#endif + +#if defined(BOOST_GEOMETRY_USE_KRAMER_RULE) +#define BG_IF_KRAMER(a, b) a +#else +#define BG_IF_KRAMER(a, b) b +#endif + +inline void BoostGeometryWriteTestConfiguration() +{ + std::cout << std::endl << "Test configuration:" << std::endl; +#if defined(BOOST_GEOMETRY_USE_RESCALING) + std::cout << " - Using rescaling" << std::endl; +#endif +#if defined(BOOST_GEOMETRY_USE_KRAMER_RULE) + std::cout << " - Using Kramer rule" << std::endl; +#else + std::cout << " - Using general form" << std::endl; +#endif +#if defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + std::cout << " - Testing only one type" << std::endl; +#endif +#if defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER) + std::cout << " - Testing only one order" << std::endl; +#endif +#if defined(BOOST_GEOMETRY_TEST_FAILURES) + std::cout << " - Including failing test cases" << std::endl; +#endif + std::cout << " - Default test type: " << string_from_type::name() << std::endl; + std::cout << std::endl; +} + +#endif // GEOMETRY_TEST_GEOMETRY_TEST_COMMON_HPP diff --git a/src/boost/libs/geometry/test/headers/Jamfile b/src/boost/libs/geometry/test/headers/Jamfile new file mode 100644 index 000000000..4f245dd48 --- /dev/null +++ b/src/boost/libs/geometry/test/headers/Jamfile @@ -0,0 +1,61 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2018 Mateusz Loskot +# +# 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) + +import os ; +import path ; +import regex ; + +rule generate_self_contained_headers ( headers_subpath ) +{ + # This rule is based on script copied from similar rule in Boost.GIL + # On CI services, test the self-contained headers on-demand only to avoid build timeouts + # CI environment is common for Travis CI, AppVeyor, CircleCI, etc. + # For example: + # if ! [ os.environ CI ] || [ os.environ TEST_HEADERS ] { + # alias self_contained_headers : [ generate_self_contained_headers ] ; + # } + + local targets ; + + # NOTE: All '/' in test names are replaced with '-' because apparently + # test scripts have a problem with test names containing slashes. + + local top_headers_path = [ path.make $(BOOST_ROOT)/libs/geometry/include/boost/geometry ] ; + + for local file in [ path.glob-tree $(top_headers_path)/$(headers_subpath) : *.hpp ] + { + local rel_file = [ path.relative-to $(top_headers_path) $(file) ] ; + local target_name = [ regex.replace h/$(rel_file) "/" "-" ] ; + local target_name = [ regex.replace $(target_name) "\.hpp" "" ] ; + targets += [ + compile $(BOOST_ROOT)/libs/geometry/test/headers/main.cpp + : "BOOST_GEOMETRY_TEST_HEADER=$(rel_file)" $(file) + : $(target_name) + ] ; + } + + return $(targets) ; +} + +# TODO: Review sorting to get as close as possible from general to specific + +# Core +alias core : [ generate_self_contained_headers core ] ; +alias util : [ generate_self_contained_headers util ] ; +alias policies : [ generate_self_contained_headers policies ] ; +alias geometries : [ generate_self_contained_headers geometries ] ; +alias concepts : [ generate_self_contained_headers concepts ] ; +alias arithmetic : [ generate_self_contained_headers arithmetic ] ; +alias formulas : [ generate_self_contained_headers formulas ] ; +alias iterators : [ generate_self_contained_headers iterators ] ; +alias strategies : [ generate_self_contained_headers strategies ] ; +alias srs : [ generate_self_contained_headers srs ] ; +alias algorithms : [ generate_self_contained_headers algorithms ] ; +alias views : [ generate_self_contained_headers views ] ; +# Even though index is a separate submodule test headers here +alias index : [ generate_self_contained_headers index ] ; diff --git a/src/boost/libs/geometry/test/headers/main.cpp b/src/boost/libs/geometry/test/headers/main.cpp new file mode 100644 index 000000000..c4ba97796 --- /dev/null +++ b/src/boost/libs/geometry/test/headers/main.cpp @@ -0,0 +1,19 @@ +// +// Copyright (c) 2018 Mateusz Loskot +// Copyright (c) 2007-2015 Andrey Semashev +// +// Distributed under 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) + +// This file contains a test boilerplate for checking that every public header +// is self-contained and does not have any missing #include-s. + +#define BOOST_GEOMETRY_TEST_INCLUDE_HEADER() + +#include BOOST_GEOMETRY_TEST_INCLUDE_HEADER() + +int main() +{ + return 0; +} diff --git a/src/boost/libs/geometry/test/io/Jamfile b/src/boost/libs/geometry/test/io/Jamfile new file mode 100644 index 000000000..28fbba1a9 --- /dev/null +++ b/src/boost/libs/geometry/test/io/Jamfile @@ -0,0 +1,17 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2016. +# Modifications copyright (c) 2016 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) + +build-project wkt ; +build-project svg ; diff --git a/src/boost/libs/geometry/test/io/dsv/Jamfile b/src/boost/libs/geometry/test/io/dsv/Jamfile new file mode 100644 index 000000000..eaebe1c72 --- /dev/null +++ b/src/boost/libs/geometry/test/io/dsv/Jamfile @@ -0,0 +1,16 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# Copyright (c) 2015 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-io-dsv + : + [ run dsv_multi.cpp : : : : dsv_multi ] + ; + diff --git a/src/boost/libs/geometry/test/io/dsv/dsv_multi.cpp b/src/boost/libs/geometry/test/io/dsv/dsv_multi.cpp new file mode 100644 index 000000000..0b4bd8f28 --- /dev/null +++ b/src/boost/libs/geometry/test/io/dsv/dsv_multi.cpp @@ -0,0 +1,99 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. + +// 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) + + +#include + +#include + +#include +#include +#include + +template +void test_dsv(std::string const& wkt, std::string const& expected, bool json = false) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + std::ostringstream out; + if (json) + { + out << bg::dsv(geometry, ", ", "[", "]", ", ", "[ ", " ]", ", "); + } + else + { + out << bg::dsv(geometry); + } + BOOST_CHECK_EQUAL(out.str(), expected); +} + + +template +void test_all() +{ + using namespace boost::geometry; + typedef model::point point_type; + typedef model::multi_point mpoint; + typedef model::multi_linestring > mline; + typedef model::multi_polygon > mpoly; + + test_dsv + ( + "multipoint((1 2),(3 4))", + "((1, 2), (3, 4))" + ); + test_dsv + ( + "multilinestring((1 1,2 2,3 3),(4 4,5 5,6 6))", + "(((1, 1), (2, 2), (3, 3)), ((4, 4), (5, 5), (6, 6)))" + ); + test_dsv + ( + // Multi with 2 poly's, first has hole, second is triangle + "multipolygon(((0 0,0 4,4 4,4 0,0 0),(1 1,1 2,2 2,2 1,1 1)),((5 5,6 5,5 6,5 5)))", + "((((0, 0), (0, 4), (4, 4), (4, 0), (0, 0)), ((1, 1), (1, 2), (2, 2), (2, 1), (1, 1))), (((5, 5), (6, 5), (5, 6), (5, 5))))" + ); + + // http://geojson.org/geojson-spec.html#id5 + test_dsv + ( + "multipoint((1 2),(3 4))", + "[ [1, 2], [3, 4] ]", + true + ); + + // http://geojson.org/geojson-spec.html#id6 + test_dsv + ( + "multilinestring((1 1,2 2,3 3),(4 4,5 5,6 6))", + "[ [ [1, 1], [2, 2], [3, 3] ], [ [4, 4], [5, 5], [6, 6] ] ]", + true + ); + + // http://geojson.org/geojson-spec.html#id7 + test_dsv + ( + "multipolygon(((0 0,0 4,4 4,4 0,0 0),(1 1,1 2,2 2,2 1,1 1)),((5 5,6 5,5 6,5 5)))", + "[ [ [ [0, 0], [0, 4], [4, 4], [4, 0], [0, 0] ], [ [1, 1], [1, 2], [2, 2], [2, 1], [1, 1] ] ], [ [ [5, 5], [6, 5], [5, 6], [5, 5] ] ] ]", + true + ); + +} + + +int test_main(int, char* []) +{ + test_all(); + test_all(); + + return 0; +} + diff --git a/src/boost/libs/geometry/test/io/svg/Jamfile b/src/boost/libs/geometry/test/io/svg/Jamfile new file mode 100644 index 000000000..ed406ffd4 --- /dev/null +++ b/src/boost/libs/geometry/test/io/svg/Jamfile @@ -0,0 +1,15 @@ +# Boost.Geometry +# +# Copyright (c) 2016 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) + +test-suite boost-geometry-io-svg + : + [ run svg.cpp : : : : io_svg ] + ; + diff --git a/src/boost/libs/geometry/test/io/svg/svg.cpp b/src/boost/libs/geometry/test/io/svg/svg.cpp new file mode 100644 index 000000000..10e8b4fee --- /dev/null +++ b/src/boost/libs/geometry/test/io/svg/svg.cpp @@ -0,0 +1,157 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2016-2017 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) + +#ifdef TEST_WITH_SVG +#include +#endif + +#include +#include + +#include + +#include + +#include +#include + +#include +#include + +#include +#include + +#include + + +template +inline void push_back_square(R & rng, T const& mi, T const& ma) +{ + typedef typename bg::point_type::type P; + rng.push_back(P(mi, mi)); + rng.push_back(P(mi, ma)); + rng.push_back(P(ma, ma)); + rng.push_back(P(ma, mi)); + rng.push_back(P(mi, mi)); +} + +template +void test_all() +{ + typedef bg::model::box

box; + typedef bg::model::segment

segment; + typedef bg::model::linestring

linestring; + typedef bg::model::ring

ring; + typedef bg::model::polygon

polygon; + + typedef bg::model::multi_point

multi_point; + typedef bg::model::multi_linestring multi_linestring; + typedef bg::model::multi_polygon multi_polygon; + + P pt(0, 0); + box b(P(10, 10), P(20, 20)); + segment s(P(30, 30), P(40, 40)); + + linestring ls; + push_back_square(ls, 50, 60); + + ring r; + push_back_square(r, 70, 80); + + polygon po; + push_back_square(po.outer(), 90, 120); + po.inners().resize(1); + push_back_square(po.inners()[0], 100, 110); + bg::correct(po); + + multi_point m_pt; + m_pt.push_back(pt); + + multi_linestring m_ls; + m_ls.push_back(ls); + + multi_polygon m_po; + m_po.push_back(po); + + boost::variant var; + linestring lsv; + push_back_square(lsv, 130, 140); + var = lsv; + + std::string style = "fill-opacity:0.5;fill:rgb(200,0,0);stroke:rgb(200,0,0);stroke-width:3"; + std::string m_style = "fill-opacity:0.5;fill:rgb(0,200,0);stroke:rgb(0,200,0);stroke-width:1"; + + { +#ifdef TEST_WITH_SVG + std::ofstream os("test1.svg", std::ios::trunc); +#else + std::stringstream os; +#endif + os << "" + << "" + << ""; + + os << bg::svg(pt, style); + os << bg::svg(b, style); + os << bg::svg(s, style); + os << bg::svg(ls, style); + os << bg::svg(r, style); + os << bg::svg(po, style); + os << bg::svg(m_pt, m_style); + os << bg::svg(m_ls, m_style); + os << bg::svg(m_po, m_style); + os << bg::svg(var, style); + + os << ""; + } + + { +#ifdef TEST_WITH_SVG + std::ofstream os("test2.svg", std::ios::trunc); +#else + std::stringstream os; +#endif + bg::svg_mapper

mapper(os, 500, 500); + mapper.add(pt); + mapper.add(b); + mapper.add(s); + mapper.add(ls); + mapper.add(r); + mapper.add(po); + mapper.add(m_pt); + mapper.add(m_ls); + mapper.add(m_po); + mapper.add(var); + + mapper.map(pt, style); + mapper.map(b, style); + mapper.map(s, style); + mapper.map(ls, style); + mapper.map(r, style); + mapper.map(po, style); + mapper.map(m_pt, m_style); + mapper.map(m_ls, m_style); + mapper.map(m_po, m_style); + mapper.map(var, m_style); + } +} + +int test_main(int, char* []) +{ + test_all< boost::geometry::model::d2::point_xy >(); + test_all< boost::geometry::model::d2::point_xy >(); + +#if defined(HAVE_TTMATH) + test_all< boost::geometry::model::d2::point_xy >(); +#endif + + return 0; +} diff --git a/src/boost/libs/geometry/test/io/wkt/Jamfile b/src/boost/libs/geometry/test/io/wkt/Jamfile new file mode 100644 index 000000000..898e8e94d --- /dev/null +++ b/src/boost/libs/geometry/test/io/wkt/Jamfile @@ -0,0 +1,17 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# Copyright (c) 2015 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-io-wkt + : + [ run wkt.cpp : : : : io_wkt ] + [ run wkt_multi.cpp : : : : io_wkt_multi ] + ; + diff --git a/src/boost/libs/geometry/test/io/wkt/wkt.cpp b/src/boost/libs/geometry/test/io/wkt/wkt.cpp new file mode 100644 index 000000000..2955fbba3 --- /dev/null +++ b/src/boost/libs/geometry/test/io/wkt/wkt.cpp @@ -0,0 +1,299 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014. +// Modifications copyright (c) 2014 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. + +// 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) + +#include +#include + +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template +void check_wkt(G const& geometry, std::string const& expected) +{ + std::ostringstream out; + out << bg::wkt(geometry); + BOOST_CHECK_EQUAL(boost::to_upper_copy(out.str()), + boost::to_upper_copy(expected)); +} + +template +void test_wkt(std::string const& wkt, std::string const& expected, + std::size_t n, double len = 0, double ar = 0, double peri = 0) +{ + G geometry; + + bg::read_wkt(wkt, geometry); + + /* + std::cout << "n=" << bg::num_points(geometry) + << " dim=" << bg::topological_dimension::value + << " length=" << bg::length(geometry) + << " area=" << bg::area(geometry) + << " perimeter=" << bg::perimeter(geometry) + << std::endl << "\t\tgeometry=" << dsv(geometry) + << std::endl; + */ + + BOOST_CHECK_EQUAL(bg::num_points(geometry), n); + if (n > 0) + { + BOOST_CHECK_CLOSE(double(bg::length(geometry)), len, 0.0001); + BOOST_CHECK_CLOSE(double(bg::area(geometry)), ar, 0.0001); + BOOST_CHECK_CLOSE(double(bg::perimeter(geometry)), peri, 0.0001); + } + + check_wkt(geometry, expected); + check_wkt(boost::variant(geometry), expected); +} + +template +void test_wkt(std::string const& wkt, + std::size_t n, double len = 0, double ar = 0, double peri = 0) +{ + test_wkt(wkt, wkt, n, len, ar, peri); +} + +template +void test_relaxed_wkt(std::string const& wkt, std::string const& expected) +{ + std::string e; + G geometry; + bg::read_wkt(wkt, geometry); + std::ostringstream out; + out << bg::wkt(geometry); + + BOOST_CHECK_EQUAL(boost::to_upper_copy(out.str()), boost::to_upper_copy(expected)); +} + + + + +template +void test_wrong_wkt(std::string const& wkt, std::string const& start) +{ + std::string e("no exception"); + G geometry; + try + { + bg::read_wkt(wkt, geometry); + } + catch(bg::read_wkt_exception const& ex) + { + e = ex.what(); + boost::to_lower(e); + } + catch(...) + { + e = "other exception"; + } + + bool check = true; + +#if defined(HAVE_TTMATH) + // For ttmath we skip bad lexical casts + typedef typename bg::coordinate_type::type ct; + + if (boost::is_same::type::value + && boost::starts_with(start, "bad lexical cast")) + { + check = false; + } +#endif + + if (check) + { + BOOST_CHECK_MESSAGE(boost::starts_with(e, start), " Expected:" + << start << " Got:" << e << " with WKT: " << wkt); + } +} + +template +void test_wkt_output_iterator(std::string const& wkt) +{ + G geometry; + bg::read_wkt(wkt, std::back_inserter(geometry)); +} + + + +#ifndef GEOMETRY_TEST_MULTI +template +void test_order_closure() +{ + using namespace boost::geometry; + typedef bg::model::point Pt; + typedef bg::model::polygon PCWC; + typedef bg::model::polygon PCWO; + typedef bg::model::polygon PCCWC; + typedef bg::model::polygon PCCWO; + + { + std::string wkt_cwc = "POLYGON((0 0,0 2,2 2,2 0,0 0))"; + std::string wkt_cwo = "POLYGON((0 0,0 2,2 2,2 0))"; + std::string wkt_ccwc = "POLYGON((0 0,2 0,2 2,0 2,0 0))"; + std::string wkt_ccwo = "POLYGON((0 0,2 0,2 2,0 2))"; + + test_wkt(wkt_cwc, 5, 0, 4, 8); + test_wkt(wkt_cwc, 4, 0, 4, 8); + test_wkt(wkt_cwo, wkt_cwc, 4, 0, 4, 8); + test_wkt(wkt_ccwc, 5, 0, 4, 8); + test_wkt(wkt_ccwc, 4, 0, 4, 8); + test_wkt(wkt_ccwo, wkt_ccwc, 4, 0, 4, 8); + } + { + std::string wkt_cwc = "POLYGON((0 0,0 3,3 3,3 0,0 0),(1 1,2 1,2 2,1 2,1 1))"; + std::string wkt_cwo = "POLYGON((0 0,0 3,3 3,3 0),(1 1,2 1,2 2,1 2))"; + std::string wkt_ccwc = "POLYGON((0 0,3 0,3 3,0 3,0 0),(1 1,1 2,2 2,2 1,1 1))"; + std::string wkt_ccwo = "POLYGON((0 0,3 0,3 3,0 3),(1 1,1 2,2 2,2 1,1 1))"; + + test_wkt(wkt_cwc, 10, 0, 8, 16); + test_wkt(wkt_cwc, 8, 0, 8, 16); + test_wkt(wkt_cwo, wkt_cwc, 8, 0, 8, 16); + test_wkt(wkt_ccwc, 10, 0, 8, 16); + test_wkt(wkt_ccwc, 8, 0, 8, 16); + test_wkt(wkt_ccwo, wkt_ccwc, 8, 0, 8, 16); + } +} + +template +void test_all() +{ + using namespace boost::geometry; + typedef bg::model::point P; + + test_wkt

("POINT(1 2)", 1); + test_wkt >("LINESTRING(1 1,2 2,3 3)", 3, 2 * sqrt(2.0)); + test_wkt >("POLYGON((0 0,0 4,4 4,4 0,0 0)" + ",(1 1,1 2,2 2,2 1,1 1),(1 1,1 2,2 2,2 1,1 1))", 15, 0, 18, 24); + + // Non OGC: a box defined by a polygon + //test_wkt >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 4, 0, 1, 4); + test_wkt >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 5, 0, 1, 4); + + // We accept empty sequences as well (much better than EMPTY)... + // ...or even POINT() (see below) + test_wkt >("LINESTRING()", 0, 0); + test_wkt >("POLYGON(())", 0); + // ... or even with empty holes + test_wkt >("POLYGON((),(),())", 0); + // which all make no valid geometries, but they can exist. + + // These WKT's are incomplete or abnormal but they are considered OK + test_relaxed_wkt

("POINT(1)", "POINT(1 0)"); + test_relaxed_wkt

("POINT()", "POINT(0 0)"); + test_relaxed_wkt >("LINESTRING(1,2,3)", + "LINESTRING(1 0,2 0,3 0)"); + test_relaxed_wkt

("POINT ( 1 2) ", "POINT(1 2)"); + test_relaxed_wkt

("POINT M ( 1 2)", "POINT(1 2)"); + test_relaxed_wkt >("BOX(1 1,2 2)", "POLYGON((1 1,1 2,2 2,2 1,1 1))"); + + test_relaxed_wkt >("LINESTRING EMPTY", "LINESTRING()"); + + test_relaxed_wkt >("POLYGON( ( ) , ( ) , ( ) )", + "POLYGON((),(),())"); + + // Wrong WKT's + test_wrong_wkt

("POINT(1 2", "expected ')'"); + test_wrong_wkt

("POINT 1 2)", "expected '('"); + test_wrong_wkt

("POINT(1 2,)", "expected ')'"); + test_wrong_wkt

("POINT(1 2)foo", "too many tokens at 'foo'"); + test_wrong_wkt

("POINT(1 2 3)", "expected ')'"); + test_wrong_wkt

("POINT(a 2 3)", "bad lexical cast"); + test_wrong_wkt

("POINT 2 3", "expected '('"); + test_wrong_wkt

("POINT Z (1 2 3)", "z only allowed"); + + test_wrong_wkt

("PIONT (1 2)", "should start with 'point'"); + + test_wrong_wkt >("LINESTRING())", "too many tokens"); + + test_wrong_wkt >("POLYGON((1 1,1 4,4 4,4 1,1 1)" + ",((2 2,2 3,3 3,3 2,2 2))", "bad lexical cast"); + + test_wrong_wkt >("BOX(1 1,2 2,3 3)", "box should have 2"); + test_wrong_wkt >("BOX(1 1,2 2) )", "too many tokens"); + + if ( BOOST_GEOMETRY_CONDITION(boost::is_floating_point::type::value + || ! boost::is_fundamental::type::value ) ) + { + test_wkt

("POINT(1.1 2.1)", 1); + } + + // Deprecated: + // test_wkt_output_iterator >("LINESTRING(1 1,2 2,3 3)"); + // test_wkt_output_iterator >("POLYGON((1 1,2 2,3 3))"); + + test_order_closure(); +} +#endif + +int test_main(int, char* []) +{ + test_all(); + test_all(); + +#if defined(HAVE_TTMATH) + test_all(); +#endif + + return 0; +} + +/* + +Results can be checked in PostGIS by query below, +or by MySQL (but replace length by glength and remove the perimeter) + +Note: +- PostGIS gives "3" for a numpoints of a multi-linestring of 6 points in total (!) + --> "npoints" should be taken for all geometries +- SQL Server 2008 gives "6" + select geometry::STGeomFromText('MULTILINESTRING((1 1,2 2,3 3),(4 4,5 5,6 6))',0).STNumPoints() +- MySQL gives "NULL" + +select 1 as code,'np p' as header,npoints(geomfromtext('POINT(1 2)')) as contents +union select 2,'length point', length(geomfromtext('POINT(1 2)')) +union select 3,'peri point', perimeter(geomfromtext('POINT(1 2)')) +union select 4,'area point',area(geomfromtext('POINT(1 2)')) + + +union select 5,'# ls',npoints(geomfromtext('LINESTRING(1 1,2 2,3 3)')) +union select 6,'length ls',length(geomfromtext('LINESTRING(1 1,2 2,3 3)')) +union select 7,'peri ls',perimeter(geomfromtext('LINESTRING(1 1,2 2,3 3)')) +union select 8,'aera ls',area(geomfromtext('LINESTRING(1 1,2 2,3 3)')) + +union select 9,'# poly',npoints(geomfromtext('POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 2,2 2,2 1,1 1),(1 1,1 2,2 2,2 1,1 1))')) +union select 10,'length poly',length(geomfromtext('POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 2,2 2,2 1,1 1),(1 1,1 2,2 2,2 1,1 1))')) +union select 11,'peri poly',perimeter(geomfromtext('POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 2,2 2,2 1,1 1),(1 1,1 2,2 2,2 1,1 1))')) +union select 12,'area poly',area(geomfromtext('POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 2,2 2,2 1,1 1),(1 1,1 2,2 2,2 1,1 1))')) + +*/ diff --git a/src/boost/libs/geometry/test/io/wkt/wkt_multi.cpp b/src/boost/libs/geometry/test/io/wkt/wkt_multi.cpp new file mode 100644 index 000000000..814717456 --- /dev/null +++ b/src/boost/libs/geometry/test/io/wkt/wkt_multi.cpp @@ -0,0 +1,126 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 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. + +// 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) + +//#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include + +template +void test_all(); + + +// Include the single test +#define GEOMETRY_TEST_MULTI +#include "io/wkt/wkt.cpp" + +template +void test_order_closure() +{ + using namespace boost::geometry; + typedef bg::model::point Pt; + typedef bg::model::polygon PCWC; + typedef bg::model::polygon PCWO; + typedef bg::model::polygon PCCWC; + typedef bg::model::polygon PCCWO; + typedef bg::model::multi_polygon MPCWC; + typedef bg::model::multi_polygon MPCWO; + typedef bg::model::multi_polygon MPCCWC; + typedef bg::model::multi_polygon MPCCWO; + + std::string wkt_cwc = "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)),((0 0,0 -3,-3 -3,-3 0,0 0),(-1 -1,-2 -1,-2 -2,-1 -2,-1 -1)))"; + std::string wkt_cwo = "MULTIPOLYGON(((0 0,0 2,2 2,2 0)),((0 0,0 -3,-3 -3,-3 0),(-1 -1,-2 -1,-2 -2,-1 -2)))"; + std::string wkt_ccwc = "MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)),((0 0,-3 0,-3 -3,0 -3,0 0),(-1 -1,-1 -2,-2 -2,-2 -1,-1 -1)))"; + std::string wkt_ccwo = "MULTIPOLYGON(((0 0,2 0,2 2,0 2)),((0 0,-3 0,-3 -3,0 -3),(-1 -1,-1 -2,-2 -2,-2 -1)))"; + + test_wkt(wkt_cwc, wkt_cwc, 15, 0, 12, 24); + test_wkt(wkt_cwc, wkt_cwc, 12, 0, 12, 24); + test_wkt(wkt_cwo, wkt_cwc, 12, 0, 12, 24); + test_wkt(wkt_ccwc, wkt_ccwc, 15, 0, 12, 24); + test_wkt(wkt_ccwc, wkt_ccwc, 12, 0, 12, 24); + test_wkt(wkt_ccwo, wkt_ccwc, 12, 0, 12, 24); +} + +template +void test_all() +{ + using namespace boost::geometry; + typedef bg::model::point P; + + test_wkt >("multipoint((1 2),(3 4))", 2); + test_wkt > >("multilinestring((1 1,2 2,3 3),(4 4,5 5,6 6))", 6, 4 * sqrt(2.0)); + test_wkt > >("multipolygon(((0 0,0 2,2 2,2 0,0 0),(1 1,1 2,2 2,2 1,1 1)),((0 0,0 4,4 4,4 0,0 0)))", 15, 0, 21, 28); + + // Support for the official alternative syntax for multipoint + // (provided by Aleksey Tulinov): + test_relaxed_wkt >("multipoint(1 2,3 4)", "multipoint((1 2),(3 4))"); + + test_wrong_wkt > >( + "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0),(1 1,1 2,2 2,2 1,1 1)),(0 0,0 4,4 4,4 0,0 0)))", + "expected '('"); + + test_wrong_wkt > >( + "MULTILINESTRING ((10 10, 20 20, 10 40), (40 40, 30 30, 40 20, 30 10)), (0 0, 1 1)", + "too many tokens at ','"); + + test_wrong_wkt >( + "MULTIPOINT((8 9), 10 11)", + "expected '(' at '10'"); + test_wrong_wkt >( + "MULTIPOINT(12 13, (14 15))", + "bad lexical cast: source type value could not be interpreted as target at '(' in 'multipoint(12 13, (14 15))'"); + test_wrong_wkt >( + "MULTIPOINT((16 17), (18 19)", + "expected ')' in 'multipoint((16 17), (18 19)'"); + test_wrong_wkt >( + "MULTIPOINT(16 17), (18 19)", + "too many tokens at ',' in 'multipoint(16 17), (18 19)'"); + + test_order_closure(); +} + +/* + +... see comments in "wkt.cpp" + +union select 13,'# mpoint',npoints(geomfromtext('MULTIPOINT((1 2),(3 4))')) +union select 14,'length mpoint',length(geomfromtext('MULTIPOINT((1 2),(3 4))')) +union select 15,'peri mpoint',perimeter(geomfromtext('MULTIPOINT((1 2),(3 4))')) +union select 16,'area mpoint',area(geomfromtext('MULTIPOINT((1 2),(3 4))')) + +union select 17,'# mls',npoints(geomfromtext('MULTILINESTRING((1 1,2 2,3 3),(4 4,5 5,6 6))')) +union select 18,'length mls',length(geomfromtext('MULTILINESTRING((1 1,2 2,3 3),(4 4,5 5,6 6))')) +union select 19,'peri mls',perimeter(geomfromtext('MULTILINESTRING((1 1,2 2,3 3),(4 4,5 5,6 6))')) +union select 20,'area mls',area(geomfromtext('MULTILINESTRING((1 1,2 2,3 3),(4 4,5 5,6 6))')) + +union select 21,'# mpoly',npoints(geomfromtext('MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0),(1 1,1 2,2 2,2 1,1 1)),((0 0,0 4,4 4,4 0,0 0)))')) +union select 22,'length mpoly',length(geomfromtext('MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0),(1 1,1 2,2 2,2 1,1 1)),((0 0,0 4,4 4,4 0,0 0)))')) +union select 23,'peri mpoly',perimeter(geomfromtext('MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0),(1 1,1 2,2 2,2 1,1 1)),((0 0,0 4,4 4,4 0,0 0)))')) +union select 24,'area mpoly',area(geomfromtext('MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0),(1 1,1 2,2 2,2 1,1 1)),((0 0,0 4,4 4,4 0,0 0)))')) + +*/ diff --git a/src/boost/libs/geometry/test/iterators/Jamfile b/src/boost/libs/geometry/test/iterators/Jamfile new file mode 100644 index 000000000..c9b54e961 --- /dev/null +++ b/src/boost/libs/geometry/test/iterators/Jamfile @@ -0,0 +1,25 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2014, 2015. +# Modifications copyright (c) 2014-2015, 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-iterators + : + [ run closing_iterator.cpp : : : : iterators_closing_iterator ] + [ run concatenate_iterator.cpp : : : : iterators_concatenate_iterator ] + [ run ever_circling_iterator.cpp : : : : iterators_ever_circling_iterator ] + [ run flatten_iterator.cpp : : : : iterators_flatten_iterator ] + [ run point_iterator.cpp : : : : iterators_point_iterator ] + [ run segment_iterator.cpp : : : : iterators_segment_iterator ] + ; diff --git a/src/boost/libs/geometry/test/iterators/closing_iterator.cpp b/src/boost/libs/geometry/test/iterators/closing_iterator.cpp new file mode 100644 index 000000000..9ac43634b --- /dev/null +++ b/src/boost/libs/geometry/test/iterators/closing_iterator.cpp @@ -0,0 +1,174 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include + +#include + + +// The closing iterator should also work on normal std:: containers +void test_empty_non_geometry() +{ + std::vector v; + + typedef bg::closing_iterator + < + std::vector const + > closing_iterator; + + + closing_iterator it(v); + closing_iterator end(v, true); + + std::ostringstream out; + for (; it != end; ++it) + { + out << *it; + } + BOOST_CHECK_EQUAL(out.str(), ""); +} + +void test_non_geometry() +{ + std::vector v; + v.push_back(1); + v.push_back(2); + v.push_back(3); + + typedef bg::closing_iterator + < + std::vector const + > closing_iterator; + + + closing_iterator it(v); + closing_iterator end(v, true); + + std::ostringstream out; + for (; it != end; ++it) + { + out << *it; + } + BOOST_CHECK_EQUAL(out.str(), "1231"); +} + +void test_transformed_non_geometry() +{ + std::vector v; + v.push_back(-1); + v.push_back(-2); + v.push_back(-3); + + typedef boost::transformed_range + < + std::negate, + std::vector + > transformed_range; + + typedef bg::closing_iterator + < + transformed_range const + > closing_iterator; + + transformed_range v2 = v | boost::adaptors::transformed(std::negate()); + closing_iterator it(v2); + closing_iterator end(v2, true); + + std::ostringstream out; + for (; it != end; ++it) + { + out << *it; + } + BOOST_CHECK_EQUAL(out.str(), "1231"); +} + + + + + +template +void test_geometry(std::string const& wkt) +{ + Geometry geometry; + bg::read_wkt(wkt, geometry); + typedef bg::closing_iterator closing_iterator; + + + // 1. Test normal behaviour + { + closing_iterator it(geometry); + closing_iterator end(geometry, true); + + std::ostringstream out; + for (; it != end; ++it) + { + out << " " << bg::get<0>(*it) << bg::get<1>(*it); + } + BOOST_CHECK_EQUAL(out.str(), " 11 14 44 41 11"); + + // Check compilations, it is (since Oct 2010) random access + it--; + --it; + it += 2; + it -= 2; + } + + // 2: check copy behaviour + { + typedef typename boost::range_iterator::type normal_iterator; + Geometry copy; + + std::copy( + closing_iterator(geometry), + closing_iterator(geometry, true), + std::back_inserter(copy)); + + std::ostringstream out; + for (normal_iterator cit = boost::begin(copy); cit != boost::end(copy); ++cit) + { + out << " " << bg::get<0>(*cit) << bg::get<1>(*cit); + } + BOOST_CHECK_EQUAL(out.str(), " 11 14 44 41 11"); + } +} + + +template +void test_all() +{ + test_empty_non_geometry(); + test_non_geometry(); + test_transformed_non_geometry(); + test_geometry >("POLYGON((1 1,1 4,4 4,4 1))"); +} + + +int test_main(int, char* []) +{ + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/iterators/concatenate_iterator.cpp b/src/boost/libs/geometry/test/iterators/concatenate_iterator.cpp new file mode 100644 index 000000000..15de3082a --- /dev/null +++ b/src/boost/libs/geometry/test/iterators/concatenate_iterator.cpp @@ -0,0 +1,259 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_concatenate_iterator +#endif + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include "test_iterator_common.hpp" + +#include + +using namespace boost::assign; + + +struct test_concatenate_iterator +{ + template + < + typename ConcatenateIterator, + typename ConstConcatenateIterator, + typename Container + > + static inline + void test_using_max_element(ConcatenateIterator first, + ConcatenateIterator beyond, + ConstConcatenateIterator const_first, + ConstConcatenateIterator const_beyond, + Container const& c, + std::size_t other_size, + bool second_container) + { + typedef typename std::iterator_traits + < + ConcatenateIterator + >::value_type value_type; + + if ( c.size() == 0 ) + { + return; + } + + ConcatenateIterator c_first = first; + if ( second_container ) + { + std::size_t counter(0); + while ( counter != other_size ) + { + ++counter; + c_first++; + } + } + + ConcatenateIterator it_max = std::max_element(first, beyond); + ConstConcatenateIterator const_it_max = + std::max_element(const_first, const_beyond); + + BOOST_CHECK( it_max == const_it_max ); + BOOST_CHECK( *it_max == *const_it_max ); + + value_type old_value = *c_first; + value_type new_value = *it_max + 1; + + *c_first = *it_max + 1; + BOOST_CHECK( *c.begin() == new_value ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "modified element of "; + std::cout << (second_container ? "2nd" : "1st"); + std::cout << " container:" << std::endl; + print_container(std::cout, c.begin(), c.end(), + (second_container ? "second :" : "first :")) + << std::endl; + print_container(std::cout, first, beyond, "combined:") << std::endl; +#endif + + *c_first = old_value; + BOOST_CHECK( *c.begin() == old_value ); + } + + + template + static inline void apply(Container1& c1, Container2& c2, + std::string const& case_id, + std::string const& containers_id) + { + boost::ignore_unused(case_id, containers_id); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::stringstream sstream; + sstream << case_id << " [" << containers_id << "]"; + + std::cout << "case id: " << sstream.str() << std::endl; +#endif + typedef typename Container1::const_iterator const_iterator1; + typedef typename Container2::const_iterator const_iterator2; + typedef typename Container1::iterator iterator1; + typedef typename Container2::iterator iterator2; + + typedef boost::geometry::concatenate_iterator + < + const_iterator1, const_iterator2, + typename Container1::value_type const + > const_concat_iterator; + + typedef boost::geometry::concatenate_iterator + < + iterator1, iterator2, typename Container1::value_type + > concat_iterator; + + typedef typename std::iterator_traits + < + concat_iterator + >::value_type value_type; + + // test constructors/assignment operators + concat_iterator begin(c1.begin(), c1.end(), c2.begin(), c2.begin()); + concat_iterator end(c1.end(), c2.begin(), c2.end()); + const_concat_iterator const_begin(begin); + const_concat_iterator const_end(end); + const_begin = begin; + const_end = end; + + concat_iterator begin2(c1.end(), c1.end(), c2.begin(), c2.begin()); + const_concat_iterator const_begin2(c1.end(), c1.end(), + c2.begin(), c2.begin()); + + BOOST_CHECK( c1.empty() || *begin == *c1.begin() ); + BOOST_CHECK( c1.empty() || *const_begin == *c1.begin() ); + + BOOST_CHECK( c2.empty() || *begin2 == *c2.begin() ); + BOOST_CHECK( c2.empty() || *const_begin2 == *c2.begin() ); + + + // test copying, dereferencing and element equality + std::vector combined; + std::copy(c1.begin(), c1.end(), std::back_inserter(combined)); + std::copy(c2.begin(), c2.end(), std::back_inserter(combined)); + test_equality(begin, end, combined); + + combined.clear(); + std::copy(begin, end, std::back_inserter(combined)); + test_equality(begin, end, combined); + test_equality(const_begin, const_end, combined); + + combined.clear(); + std::copy(const_begin, const_end, std::back_inserter(combined)); + test_equality(begin, end, combined); + test_equality(const_begin, const_end, combined); + + // test sizes (and std::distance) + test_size(begin, end, combined); + test_size(const_begin, const_end, combined); + + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + print_container(std::cout, c1.begin(), c1.end(), "first :") + << std::endl; + print_container(std::cout, c2.begin(), c2.end(), "second :") + << std::endl; + print_container(std::cout, begin, end, "combined:") + << std::endl; + + if ( begin != end ) + { + std::cout << "min element: " + << *std::min_element(begin, end) + << std::endl; + std::cout << "max element: " + << *std::max_element(const_begin, const_end) + << std::endl; + } +#endif + + // perform reversals (std::reverse) + test_using_reverse(begin, end, combined); + + // test std::max_element, dereferencing and value assigment + test_using_max_element(begin, end, const_begin, const_end, + c1, c2.size(), false); + test_using_max_element(begin, end, const_begin, const_end, + c2, c1.size(), true); + + // test std::count_if / std::remove_if + test_using_remove_if(begin, end, combined); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "====================" << std::endl << std::endl; +#endif + } +}; + + +template +inline void test_concatenation_of_containers(Container1& c1, Container2& c2, + std::string const& containers_id) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl + << " TESTING CONTAINERS COMBINATION: " + << containers_id << std::endl + << "************************************" << std::endl + << std::endl; +#endif + + c1.clear(); + c2.clear(); + test_concatenate_iterator::apply(c1, c2, "empty_both", containers_id); + + c2 += 10,11,12,13,14,15,16,17,18,19,20; + test_concatenate_iterator::apply(c1, c2, "empty_first", containers_id); + + c2.clear(); + c1 += 0,1,2,3,4,5,6; + test_concatenate_iterator::apply(c1, c2, "empty_second", containers_id); + + c1.clear(); + c2.clear(); + c1 += 0,1,2,3,4,5,6; + c2 += 10,11,12,13,14,15,16,17,18,19,20; + test_concatenate_iterator::apply(c1, c2, "non_empty", containers_id); +} + + +BOOST_AUTO_TEST_CASE( test_concatenate_iterator_all ) +{ + std::vector v, vv; + std::list l, ll; + + test_concatenation_of_containers(v, vv, "VV"); + test_concatenation_of_containers(v, l, "VL"); + test_concatenation_of_containers(l, v, "LV"); + test_concatenation_of_containers(l, ll, "LL"); +} diff --git a/src/boost/libs/geometry/test/iterators/ever_circling_iterator.cpp b/src/boost/libs/geometry/test/iterators/ever_circling_iterator.cpp new file mode 100644 index 000000000..835a7b5a3 --- /dev/null +++ b/src/boost/libs/geometry/test/iterators/ever_circling_iterator.cpp @@ -0,0 +1,143 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include + +#include + + +template +void test_geometry(G const& geo) +{ + typedef typename boost::range_iterator::type iterator_type; + + + // Run 3 times through the geometry + std::size_t n = boost::size(geo) * 3; + + { + std::ostringstream out; + bg::ever_circling_iterator it(boost::begin(geo), boost::end(geo)); + for (std::size_t i = 0; i < n; ++i, ++it) + { + out << bg::get<0>(*it); + } + BOOST_CHECK_EQUAL(out.str(), "123451234512345"); + } + + { + std::ostringstream out; + // Start somewhere + bg::ever_circling_iterator it( + boost::begin(geo), boost::end(geo), boost::begin(geo) + 1); + for (std::size_t i = 0; i < n; ++i, ++it) + { + out << bg::get<0>(*it); + } + BOOST_CHECK_EQUAL(out.str(), "234512345123451"); + } + + { + std::ostringstream out; + + // Navigate to somewhere + bg::ever_circling_iterator it(boost::begin(geo), boost::end(geo)); + for (std::size_t i = 0; i < n; ++i, ++it) + { + std::size_t const m = boost::size(geo); + it.moveto(boost::begin(geo) + m - (i % m) - 1); + out << bg::get<0>(*it); + } + BOOST_CHECK_EQUAL(out.str(), "543215432154321"); + } + + // Check the range_iterator-one + { + std::ostringstream out; + bg::ever_circling_range_iterator it(geo); + for (std::size_t i = 0; i < n; ++i, ++it) + { + out << bg::get<0>(*it); + } + BOOST_CHECK_EQUAL(out.str(), "123451234512345"); + } +} + +template +void test_geometry(std::string const& wkt) +{ + G geo; + bg::read_wkt(wkt, geo); + test_geometry(geo); +} + + +template +P transform_point(P const& p) +{ + P result; + bg::set<0>(result, bg::get<0>(p) + 1); + bg::set<1>(result, bg::get<1>(p) + 1); + return result; +} + +template +struct transformed_geometry_type +{ + typedef typename bg::point_type::type point_type; + typedef boost::transformed_range type; +}; + +template +void test_transformed_geometry(G const& geo) +{ + typedef typename bg::point_type::type point_type; + test_geometry(geo | boost::adaptors::transformed(&transform_point)); +} + +template +void test_transformed_geometry(std::string const& wkt) +{ + G geo; + bg::read_wkt(wkt, geo); + test_transformed_geometry(geo); +} + + +BOOST_GEOMETRY_REGISTER_LINESTRING(transformed_geometry_type< bg::model::linestring< bg::model::d2::point_xy > >::type) + +template +void test_all() +{ + test_geometry >("linestring(1 1,2 2,3 3,4 4,5 5)"); + test_transformed_geometry >("linestring(0 0,1 1,2 2,3 3,4 4)"); +} + +int test_main(int, char* []) +{ + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/iterators/flatten_iterator.cpp b/src/boost/libs/geometry/test/iterators/flatten_iterator.cpp new file mode 100644 index 000000000..9f989594e --- /dev/null +++ b/src/boost/libs/geometry/test/iterators/flatten_iterator.cpp @@ -0,0 +1,368 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_flatten_iterator +#endif + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "test_iterator_common.hpp" + +#include + +using namespace boost::assign; + + +template +struct access_begin +{ + typedef typename boost::mpl::if_ + < + typename boost::is_const::type, + typename InnerContainer::const_iterator, + typename InnerContainer::iterator + >::type return_type; + + static inline return_type apply(InnerContainer& inner) + { + return inner.begin(); + } +}; + + +template +struct access_end +{ + typedef typename boost::mpl::if_ + < + typename boost::is_const::type, + typename InnerContainer::const_iterator, + typename InnerContainer::iterator + >::type return_type; + + static inline return_type apply(InnerContainer& inner) + { + return inner.end(); + } +}; + + +template +inline std::size_t number_of_elements(NestedContainer const& c) +{ + std::size_t num_elements(0); + for (typename NestedContainer::const_iterator outer = c.begin(); + outer != c.end(); ++outer) + { + num_elements += outer->size(); + } + return num_elements; +} + + +struct test_flatten_iterator +{ + template + < + typename FlattenIterator, + typename ConstFlattenIterator, + typename NestedContainer + > + static inline + void test_using_max_element(FlattenIterator first, + FlattenIterator beyond, + ConstFlattenIterator const_first, + ConstFlattenIterator const_beyond, + NestedContainer const& c) + { + typedef typename std::iterator_traits + < + FlattenIterator + >::value_type value_type; + + typedef typename NestedContainer::const_iterator const_outer_iterator; + typedef typename NestedContainer::value_type inner_container; + typedef typename inner_container::const_iterator const_inner_iterator; + + if ( first == beyond ) + { + return; + } + + FlattenIterator it_max = std::max_element(first, beyond); + ConstFlattenIterator const_it_max = + std::max_element(const_first, const_beyond); + + BOOST_CHECK( it_max == const_it_max ); + BOOST_CHECK( *it_max == *const_it_max ); + + value_type old_value = *const_first; + value_type new_value = *it_max + 1; + + *first = *it_max + 1; + const_outer_iterator outer = c.begin(); + while ( outer->begin() == outer->end() ) + { + ++outer; + } + const_inner_iterator inner = outer->begin(); + + BOOST_CHECK( *inner == new_value ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "modified 1st element of 1st non-empty " + << "inner container:" << std::endl; + print_nested_container(std::cout, c.begin(), c.end(), "nested :") + << std::endl; + print_container(std::cout, first, beyond, "flattened:") << std::endl; +#endif + + *first = old_value; + BOOST_CHECK( *inner == old_value ); + } + + template + static inline void apply(NestedContainer& c, + std::string const& case_id, + std::string const& container_id) + { + boost::ignore_unused(case_id, container_id); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::stringstream sstream; + sstream << case_id << " [" << container_id << "]"; + + std::cout << "case id: " << sstream.str() << std::endl; +#endif + typedef typename NestedContainer::const_iterator const_outer_iterator; + typedef typename NestedContainer::iterator outer_iterator; + typedef typename NestedContainer::value_type inner_container; + + typedef typename inner_container::const_iterator const_inner_iterator; + typedef typename inner_container::iterator inner_iterator; + + typedef boost::geometry::flatten_iterator + < + const_outer_iterator, + const_inner_iterator, + typename inner_container::value_type const, + access_begin, + access_end + > const_flatten_iterator; + + typedef boost::geometry::flatten_iterator + < + outer_iterator, + inner_iterator, + typename inner_container::value_type, + access_begin, + access_end + > flatten_iterator; + + typedef typename std::iterator_traits + < + flatten_iterator + >::value_type value_type; + + flatten_iterator begin(c.begin(), c.end()); + flatten_iterator end(c.end()); + const_flatten_iterator const_begin(begin); + const_flatten_iterator const_end(end); + const_begin = begin; + const_end = end; + + // test copying, dereferencing and element equality + std::vector combined; + for (const_outer_iterator outer = c.begin(); + outer != c.end(); ++outer) + { + std::copy(outer->begin(), outer->end(), + std::back_inserter(combined)); + } + test_equality(begin, end, combined); + test_equality(const_begin, const_end, combined); + + combined.clear(); + std::copy(begin, end, std::back_inserter(combined)); + test_equality(begin, end, combined); + test_equality(const_begin, const_end, combined); + + combined.clear(); + std::copy(const_begin, const_end, std::back_inserter(combined)); + test_equality(begin, end, combined); + test_equality(const_begin, const_end, combined); + + // test sizes (and std::distance) + test_size(begin, end, combined); + test_size(const_begin, const_end, combined); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + print_nested_container(std::cout, c.begin(), c.end(), "nested :") + << std::endl; + print_container(std::cout, begin, end, "flattened :") + << std::endl; + + if ( begin != end ) + { + std::cout << "min element: " + << *std::min_element(begin, end) + << std::endl; + std::cout << "max element: " + << *std::max_element(const_begin, const_end) + << std::endl; + } +#endif + + // perform reversals (std::reverse) + test_using_reverse(begin, end, combined); + + // test std::max_element, dereferencing and value assigment + test_using_max_element(begin, end, const_begin, const_end, c); + + // test std::count_if / std::remove_if + test_using_remove_if(begin, end, combined); +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "====================" << std::endl << std::endl; +#endif + } +}; + + + +// the actual test cases -- START +template +struct test_case_per_container; + +template<> +struct test_case_per_container<0> +{ + template + static inline void apply(std::string const& case_id, + std::string const& container_id) + { + NestedContainer c; + test_flatten_iterator::apply(c, case_id, container_id); + } +}; + +template<> +struct test_case_per_container<1> +{ + template + static inline void apply(std::string const& case_id, + std::string const& container_id) + { + NestedContainer c; + for (int i = 0; i < 5; ++i) + { + c += typename NestedContainer::value_type(); + } + test_flatten_iterator::apply(c, case_id, container_id); + } +}; + +template<> +struct test_case_per_container<2> +{ + template + static inline void apply(std::string const& case_id, + std::string const& container_id) + { + NestedContainer c; + typename NestedContainer::value_type ic[4]; + + ic[0] += 5,4,3,2,1; + ic[1] += 6,7,8; + ic[2] += 9; + ic[3] += 9,8,7,6,5; + c += ic[0],ic[1],ic[2],ic[3]; + + test_flatten_iterator::apply(c, case_id, container_id); + } +}; + +template<> +struct test_case_per_container<3> +{ + template + static inline void apply(std::string const& case_id, + std::string const& container_id) + { + NestedContainer c; + typename NestedContainer::value_type ic[20]; + + ic[2] += 5,4,3,2,1; + ic[3] += 6,7,8; + ic[8] += 9; + ic[9] += 9,8,7,6,5; + ic[14] += 4,3,2,1; + for (std::size_t i = 0; i < 20; ++i) + { + c += ic[i]; + } + + test_flatten_iterator::apply(c, case_id, container_id); + } +}; +// the actual test cases -- END + + + +template +inline void test_case_all_containers(std::string const& case_id) +{ + typedef typename std::vector > VV; + typedef typename std::vector > VL; + typedef typename std::list > LV; + typedef typename std::list > LL; + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; +#endif + test_case_per_container::template apply(case_id, "VV"); + test_case_per_container::template apply(case_id, "VL"); + test_case_per_container::template apply(case_id, "LV"); + test_case_per_container::template apply(case_id, "LL"); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "********************************************************" + << std::endl << std::endl; +#endif +} + + + +BOOST_AUTO_TEST_CASE( test_flatten_iterator_all ) +{ + test_case_all_containers<0>("empty"); + test_case_all_containers<1>("case1"); + test_case_all_containers<2>("case2"); + test_case_all_containers<3>("case3"); +} diff --git a/src/boost/libs/geometry/test/iterators/point_iterator.cpp b/src/boost/libs/geometry/test/iterators/point_iterator.cpp new file mode 100644 index 000000000..346021420 --- /dev/null +++ b/src/boost/libs/geometry/test/iterators/point_iterator.cpp @@ -0,0 +1,881 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// 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 + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_point_iterator +#endif + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#include +#include + +#include +#include + +#include + +#include +#include + +// At the end because of conflicts with Boost.QVM +#include + + +namespace bg = ::boost::geometry; +namespace ba = ::boost::assign; + +typedef bg::model::point point_type; +typedef bg::model::point point_type_3d; +typedef bg::model::linestring linestring_type; +typedef bg::model::polygon polygon_type; //ccw, open + +// multi geometries +typedef bg::model::multi_point multi_point_type; +typedef bg::model::multi_point multi_point_type_3d; +typedef bg::model::multi_linestring multi_linestring_type; +typedef bg::model::multi_polygon multi_polygon_type; + +typedef boost::tuple tuple_point_type; +typedef boost::tuple tuple_point_type_3d; +typedef std::vector tuple_multi_point_type; +typedef std::vector tuple_multi_point_type_3d; + +template +struct vector_as_multipoint : std::vector {}; + +template +struct vector_as_linestring : std::vector {}; + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_MULTI_POINT(tuple_multi_point_type) +BOOST_GEOMETRY_REGISTER_MULTI_POINT(tuple_multi_point_type_3d) + +BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED(vector_as_multipoint) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(vector_as_linestring) + + + +template +inline Geometry from_wkt(std::string const& wkt) +{ + Geometry geometry; + boost::geometry::read_wkt(wkt, geometry); + return geometry; +} + + +// this function is implemented because std::max_element() requires ForwardIterator +// but bg::point_iterator<> is InputIterator since it returns non-true reference +template +inline boost::optional::value_type> +max_value(InputIt first, InputIt last, Pred pred) +{ + typedef typename std::iterator_traits::value_type value_type; + if (first != last) + { + value_type found = *first++; + for (; first != last; ) + { + value_type current = *first++; + if (pred(current, found)) + found = current; + } + return found; + } + return boost::none; +} + + +template +inline std::ostream& print_point_range(std::ostream& os, + Iterator first, + Iterator beyond, + std::string const& header) +{ + os << header << "("; + for (Iterator it = first; it != beyond; ++it) + { + os << " " << bg::dsv(*it); + } + os << " )"; + return os; +} + + +template +< + typename Geometry, + bool Enable = true, + bool IsConst = boost::is_const::value +> +struct test_iterator_concepts +{ + typedef bg::point_iterator iterator; + BOOST_CONCEPT_ASSERT((boost::BidirectionalIteratorConcept)); + BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIteratorConcept)); + BOOST_CONCEPT_ASSERT((boost_concepts::LvalueIteratorConcept)); + BOOST_CONCEPT_ASSERT + ((boost_concepts::BidirectionalTraversalConcept)); +}; + +template +struct test_iterator_concepts + : test_iterator_concepts +{ + typedef bg::point_iterator iterator; + BOOST_CONCEPT_ASSERT + ((boost::Mutable_BidirectionalIteratorConcept)); + BOOST_CONCEPT_ASSERT + ((boost_concepts::WritableIteratorConcept)); + BOOST_CONCEPT_ASSERT + ((boost_concepts::SwappableIteratorConcept)); +}; + +template +struct test_iterator_concepts +{}; + + + +struct equals +{ + template + static inline std::size_t number_of_elements(Iterator begin, + Iterator end) + { + std::size_t size = std::distance(begin, end); + + std::size_t num_elems(0); + for (Iterator it = begin; it != end; ++it) + { + ++num_elems; + } + BOOST_CHECK(size == num_elems); + + num_elems = 0; + for (Iterator it = end; it != begin; --it) + { + ++num_elems; + } + BOOST_CHECK(size == num_elems); + + return num_elems; + } + + template + static inline bool apply(Iterator1 begin1, Iterator1 end1, + Iterator2 begin2, Iterator2 end2) + { + std::size_t num_points1 = number_of_elements(begin1, end1); + std::size_t num_points2 = number_of_elements(begin2, end2); + + if (num_points1 != num_points2) + { + return false; + } + + Iterator1 it1 = begin1; + Iterator2 it2 = begin2; + for (; it1 != end1; ++it1, ++it2) + { + if (! bg::equals(*it1, *it2)) + { + return false; + } + } + return true; + } +}; + + +template +struct test_assignment +{ + template + static inline void apply(Iterator it, ConstIterator cit, + Value const& value1, Value const& value2) + { +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "== before assignment ==" << std::endl; + std::cout << "value1: " << bg::wkt(value1) << std::endl; + std::cout << "value2: " << bg::wkt(value2) << std::endl; + std::cout << "*it : " << bg::wkt(*it) << std::endl; + std::cout << "*cit : " << bg::wkt(*cit) << std::endl; +#endif + + BOOST_CHECK(bg::equals(*it, value1)); + BOOST_CHECK(! bg::equals(*it, value2)); + BOOST_CHECK(bg::equals(*cit, value1)); + BOOST_CHECK(! bg::equals(*cit, value2)); + + *it = value2; + BOOST_CHECK(bg::equals(*it, value2)); + BOOST_CHECK(! bg::equals(*it, value1)); + BOOST_CHECK(bg::equals(*cit, value2)); + BOOST_CHECK(! bg::equals(*cit, value1)); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "== after 1st assignment ==" << std::endl; + std::cout << "value1: " << bg::wkt(value1) << std::endl; + std::cout << "value2: " << bg::wkt(value2) << std::endl; + std::cout << "*it : " << bg::wkt(*it) << std::endl; + std::cout << "*cit : " << bg::wkt(*cit) << std::endl; +#endif + + *it = value1; + BOOST_CHECK(bg::equals(*it, value1)); + BOOST_CHECK(! bg::equals(*it, value2)); + BOOST_CHECK(bg::equals(*cit, value1)); + BOOST_CHECK(! bg::equals(*cit, value2)); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "== after 2nd assignment ==" << std::endl; + std::cout << "value1: " << bg::wkt(value1) << std::endl; + std::cout << "value2: " << bg::wkt(value2) << std::endl; + std::cout << "*it : " << bg::wkt(*it) << std::endl; + std::cout << "*cit : " << bg::wkt(*cit) << std::endl; + std::cout << std::endl; +#endif + } +}; + +template <> +struct test_assignment +{ + template + static inline void apply(Iterator, ConstIterator, + Value const&, Value const&) + { + } +}; + + +template +< + typename Geometry, + typename PointRange, + bool EnableConceptChecks = true +> +struct test_point_iterator_of_geometry +{ + typedef typename bg::point_type::type point_type; + + template + static inline void base_test(G& geometry, + PointRange const& point_range, + std::string const& header) + { + typedef bg::point_iterator point_iterator; + + test_iterator_concepts(); + + point_iterator begin = bg::points_begin(geometry); + point_iterator end = bg::points_end(geometry); + + BOOST_CHECK(std::size_t(std::distance(begin, end)) + == + bg::num_points(geometry)); + + BOOST_CHECK(equals::apply(begin, end, + bg::points_begin(point_range), + bg::points_end(point_range)) + ); + + boost::ignore_unused(header); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << header << " geometry: " << bg::wkt(geometry) << std::endl; + print_point_range(std::cout, begin, end, "point range: "); + std::cout << std::endl; + + typedef bg::point_iterator point_range_iterator; + + print_point_range(std::cout, + bg::points_begin(point_range), + bg::points_end(point_range), + "expected point range: "); + std::cout << std::endl; +#endif + } + + template + struct test_reverse + { + template + static inline void apply(Iterator first, Iterator last, + G const& geometry) + { + boost::ignore_unused(geometry); + + std::reverse(first, last); +#ifdef BOOST_GEOMETRY_TEST_DEBUG + print_point_range(std::cout, first, last, "reversed:\n") + << std::endl; + std::cout << bg::wkt(geometry) << std::endl; + std::cout << std::endl; +#endif + + std::reverse(first, last); +#ifdef BOOST_GEOMETRY_TEST_DEBUG + print_point_range(std::cout, first, last, "re-reversed:\n") + << std::endl; + std::cout << bg::wkt(geometry) << std::endl; + std::cout << std::endl; + std::cout << std::endl; +#endif + } + }; + + template + struct test_reverse + { + template + static inline void apply(Iterator, Iterator, G const&) + { + } + }; + + static inline void apply(Geometry geometry, + PointRange const& point_range, + point_type const& zero_point) + { + base_test(geometry, point_range, "non-const"); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; +#endif + + base_test(geometry, point_range, "const"); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; +#endif + + // testing construction of const and non-const iterator + typedef bg::point_iterator point_iterator; + typedef bg::point_iterator const_point_iterator; + + point_iterator begin = bg::points_begin(geometry); + point_iterator end = bg::points_end(geometry); + + const_point_iterator const_begin = bg::points_begin(geometry); + const_point_iterator const_end = bg::points_end(geometry); + + // same for reverse iterator + typedef bg::point_reverse_iterator point_reverse_iterator; + typedef bg::point_reverse_iterator + < + Geometry const + > const_point_reverse_iterator; + + point_reverse_iterator rbegin = bg::points_rbegin(geometry); + point_reverse_iterator rend = bg::points_rend(geometry); + + const_point_reverse_iterator const_rbegin = bg::points_rbegin(geometry); + const_point_reverse_iterator const_rend = bg::points_rend(geometry); + + // testing assignment of non-const to const iterator + const_begin = begin; + const_end = end; + + // testing assignment of non-const to const reverse_iterator + const_rbegin = rbegin; + const_rend = rend; + + // testing equality/inequality comparison + BOOST_CHECK(begin == const_begin); + BOOST_CHECK(end == const_end); + if (begin != end) + { + BOOST_CHECK(begin != const_end); + BOOST_CHECK(const_begin != end); + } + + // testing equality/inequality comparison for reverse_iterator + BOOST_CHECK(rbegin == const_rbegin); + BOOST_CHECK(rend == const_rend); + if (rbegin != rend) + { + BOOST_CHECK(rbegin != const_rend); + BOOST_CHECK(const_rbegin != rend); + } + + if (begin != end) + { + BOOST_CHECK(rbegin != rend); + + point_reverse_iterator rlast(rend); + --rlast; + BOOST_CHECK(bg::equals(*begin, *rlast)); + + point_iterator last(end); + --last; + BOOST_CHECK(bg::equals(*rbegin, *last)); + } + + // testing dereferencing/assignment + + bool const is_reference = boost::is_reference + < + typename std::iterator_traits::reference + >::value; + + if (begin != end) + { + if (BOOST_GEOMETRY_CONDITION(is_reference)) + { + point_type p = *begin; + point_type q = zero_point; + + test_assignment::apply(begin, const_begin, p, q); + + *begin = q; + test_assignment::apply(begin, const_begin, q, p); + + *begin = p; + } + } + + // test with algorithms +#ifdef BOOST_GEOMETRY_TEST_DEBUG + print_point_range(std::cout, begin, end, "original:\n") << std::endl; + print_point_range(std::cout, rbegin, rend, "reverse traversal:\n") + << std::endl; + std::cout << bg::wkt(geometry) << std::endl; + std::cout << std::endl; +#endif + test_reverse::apply(begin, end, geometry); + + typedef typename std::iterator_traits + < + point_iterator + >::value_type point; + if (const_begin != const_end) + { + boost::optional + pt_max = max_value(const_begin, const_end, bg::less()); + + BOOST_CHECK(bool(pt_max)); // to avoid warnings +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "max point: " << bg::dsv(*pt_max) << std::endl; +#endif + } +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << std::endl; + std::cout << std::endl; +#endif + } + + static inline void apply(Geometry geometry, PointRange const& point_range) + { + apply(geometry, point_range, bg::make_zero()); + } +}; + + +//====================================================================== +//====================================================================== + + +BOOST_AUTO_TEST_CASE( test_linestring_point_iterator ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** LINESTRING ***" << std::endl; +#endif + + typedef tuple_multi_point_type TMP; + typedef linestring_type L; + + typedef test_point_iterator_of_geometry tester; + + tester::apply(from_wkt("LINESTRING()"), + TMP() + ); + + tester::apply(from_wkt("LINESTRING(3 3,4 4,5 5)"), + ba::tuple_list_of(3,3)(4,4)(5,5) + ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; +#endif +} + + +//====================================================================== +//====================================================================== + + +BOOST_AUTO_TEST_CASE( test_polygon_point_iterator ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** POLYGON ***" << std::endl; +#endif + + typedef tuple_multi_point_type TMP; + typedef polygon_type P; + + typedef test_point_iterator_of_geometry tester; + + tester::apply(from_wkt

("POLYGON()"), + TMP() + ); + + tester::apply(from_wkt

("POLYGON(())"), + TMP() + ); + + tester::apply(from_wkt

("POLYGON((1 1,9 1,9 9,1 9),(5 5,6 5,6 6,5 6))"), + ba::tuple_list_of(1,1)(9,1)(9,9)(1,9)(5,5)(6,5)(6,6)(5,6) + ); + + tester::apply(from_wkt

("POLYGON((3 3,4 4,5 5),(),(),(),(6 6,7 7,8 8),(),(),(9 9),())"), + ba::tuple_list_of(3,3)(4,4)(5,5)(6,6)(7,7)(8,8)(9,9) + ); + + tester::apply(from_wkt

("POLYGON((),(3 3,4 4,5 5),(),(),(6 6,7 7,8 8),(),(),(9 9),())"), + ba::tuple_list_of(3,3)(4,4)(5,5)(6,6)(7,7)(8,8)(9,9) + ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; +#endif +} + + +//====================================================================== +//====================================================================== + + +BOOST_AUTO_TEST_CASE( test_multipoint_point_iterator ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** MULTIPOINT ***" << std::endl; +#endif + + typedef tuple_multi_point_type TMP; + typedef multi_point_type MP; + + typedef test_point_iterator_of_geometry tester; + + tester::apply(from_wkt("MULTIPOINT()"), + TMP() + ); + + tester::apply(from_wkt("MULTIPOINT(3 3,4 4,5 5)"), + ba::tuple_list_of(3,3)(4,4)(5,5) + ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; +#endif +} + + +//====================================================================== +//====================================================================== + + +BOOST_AUTO_TEST_CASE( test_multipoint_3d_point_iterator ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** MULTIPOINT 3D ***" << std::endl; +#endif + + typedef tuple_multi_point_type_3d TMP; + typedef multi_point_type_3d MP; + + typedef test_point_iterator_of_geometry tester; + + tester::apply(from_wkt("MULTIPOINT()"), + TMP() + ); + + tester::apply(from_wkt("MULTIPOINT(3 3 3,4 4 4,5 5 5)"), + ba::tuple_list_of(3,3,3)(4,4,4)(5,5,5) + ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; +#endif +} + + +//====================================================================== +//====================================================================== + + +BOOST_AUTO_TEST_CASE( test_multilinestring_point_iterator ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** MULTILINESTRING ***" << std::endl; +#endif + + typedef tuple_multi_point_type TMP; + typedef multi_linestring_type ML; + + typedef test_point_iterator_of_geometry tester; + + tester::apply(from_wkt("MULTILINESTRING()"), + TMP() + ); + + tester::apply(from_wkt("MULTILINESTRING(())"), + TMP() + ); + + tester::apply(from_wkt("MULTILINESTRING((),(),())"), + TMP() + ); + + tester::apply(from_wkt("MULTILINESTRING((1 1,2 2,3 3),(3 3,4 4,5 5),(6 6))"), + ba::tuple_list_of(1,1)(2,2)(3,3)(3,3)(4,4)(5,5)(6,6) + ); + + tester::apply(from_wkt("MULTILINESTRING((),(),(1 1,2 2,3 3),(),(),(3 3,4 4,5 5),(),(6 6),(),(),())"), + ba::tuple_list_of(1,1)(2,2)(3,3)(3,3)(4,4)(5,5)(6,6) + ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; +#endif +} + + +//====================================================================== +//====================================================================== + + +BOOST_AUTO_TEST_CASE( test_multipolygon_point_iterator ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** MULTIPOLYGON ***" << std::endl; +#endif + + typedef tuple_multi_point_type TMP; + typedef multi_polygon_type MPL; + + typedef test_point_iterator_of_geometry tester; + + tester::apply(from_wkt("MULTIPOLYGON()"), + TMP() + ); + + tester::apply(from_wkt("MULTIPOLYGON( () )"), + TMP() + ); + + tester::apply(from_wkt("MULTIPOLYGON( (()) )"), + TMP() + ); + + tester::apply(from_wkt("MULTIPOLYGON( ((),()) )"), + TMP() + ); + + tester::apply(from_wkt("MULTIPOLYGON(((3 3,4 4,5 5),(6 6,7 7,8 8),(9 9)),((1 1,2 2,10 10),(11 11,12 12)))"), + ba::tuple_list_of(3,3)(4,4)(5,5)(6,6)(7,7)(8,8)(9,9)\ + (1,1)(2,2)(10,10)(11,11)(12,12) + ); + + tester::apply(from_wkt("MULTIPOLYGON(((3 3,4 4,5 5),(),(),(),(6 6,7 7,8 8),(),(),(9 9),()),((),(1 1,2 2,10 10),(),(),(),(11 11,12 12),(),(),(13 13),()))"), + ba::tuple_list_of(3,3)(4,4)(5,5)(6,6)(7,7)(8,8)(9,9)\ + (1,1)(2,2)(10,10)(11,11)(12,12)(13,13) + ); + + tester::apply(from_wkt("MULTIPOLYGON(((3 3,4 4,5 5),(),(),(),(6 6,7 7,8 8),(),(),(9 9),()),((),(1 1,2 2,10 10),(),(),(),(11 11,12 12),(),(),(13 13),()),((),(),()))"), + ba::tuple_list_of(3,3)(4,4)(5,5)(6,6)(7,7)(8,8)(9,9)\ + (1,1)(2,2)(10,10)(11,11)(12,12)(13,13) + ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; +#endif +} + + +//====================================================================== +//====================================================================== + + +BOOST_AUTO_TEST_CASE( test_multipoint_of_point_pointers ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** MULTIPOINT OF POINT POINTERS ***" << std::endl; +#endif + + typedef tuple_multi_point_type TMP; + typedef vector_as_multipoint MP; + + MP multipoint; + for (int i = 1; i < 10; i++) + { + test::test_point_xy* p = new test::test_point_xy; + p->x = i; + p->y = -i; + multipoint.push_back(p); + } + + test::test_point_xy* zero = new test::test_point_xy; + zero->x = 0; + zero->y = 0; + + typedef test_point_iterator_of_geometry tester; + + tester::apply(multipoint, + ba::tuple_list_of(1,-1)(2,-2)(3,-3)(4,-4)(5,-5)(6,-6)\ + (7,-7)(8,-8)(9,-9), + zero + ); + + for (unsigned int i = 0; i < multipoint.size(); i++) + { + delete multipoint[i]; + } + delete zero; +} + + +//====================================================================== +//====================================================================== + + +BOOST_AUTO_TEST_CASE( test_linestring_of_point_pointers ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** LINESTRING OF POINT POINTERS ***" << std::endl; +#endif + + typedef tuple_multi_point_type TMP; + typedef vector_as_linestring L; + + L linestring; + for (int i = 1; i < 10; i++) + { + test::test_point_xy* p = new test::test_point_xy; + p->x = i; + p->y = -i; + linestring.push_back(p); + } + + test::test_point_xy* zero = new test::test_point_xy; + zero->x = 0; + zero->y = 0; + + typedef test_point_iterator_of_geometry tester; + + tester::apply(linestring, + ba::tuple_list_of(1,-1)(2,-2)(3,-3)(4,-4)(5,-5)(6,-6)\ + (7,-7)(8,-8)(9,-9), + zero + ); + + for (unsigned int i = 0; i < linestring.size(); i++) + { + delete linestring[i]; + } + delete zero; +} + + +//====================================================================== +//====================================================================== + + +BOOST_AUTO_TEST_CASE( test_multipoint_copy_on_dereference ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** MULTIPOINT WITH COPY-ON-DEREFERENCE ITERATOR ***" + << std::endl; +#endif + + typedef tuple_multi_point_type TMP; + typedef multipoint_copy_on_dereference MP; + + typedef test_point_iterator_of_geometry + < + MP, TMP, false // no concept checks + > tester; + + // bg::read_wkt does not work for this multipoint type so we have + // to initialize the multipoint manually + MP multipoint; + for (int i = 1; i < 10; ++i) + { + multipoint.push_back(point_type(i, -i)); + } + + tester::apply(multipoint, + // from_wkt("MULTIPOINT(1 -1,2 -2,3 -3,4 -4,5 -5,6 -6, 7 -7,8 -8,9 -9)"), + ba::tuple_list_of(1,-1)(2,-2)(3,-3)(4,-4)(5,-5)(6,-6)\ + (7,-7)(8,-8)(9,-9) + ); +} + + +//====================================================================== +//====================================================================== + + +BOOST_AUTO_TEST_CASE( test_linestring_copy_on_dereference ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** LINESTRING WITH COPY-ON-DEREFERENCE ITERATOR ***" + << std::endl; +#endif + + typedef tuple_multi_point_type TMP; + typedef linestring_copy_on_dereference L; + + typedef test_point_iterator_of_geometry + < + L, TMP, false // no concept checks + > tester; + + tester::apply(from_wkt("LINESTRING(1 -1,2 -2,3 -3,4 -4,5 -5,6 -6, 7 -7,8 -8,9 -9)"), + ba::tuple_list_of(1,-1)(2,-2)(3,-3)(4,-4)(5,-5)(6,-6)\ + (7,-7)(8,-8)(9,-9) + ); +} diff --git a/src/boost/libs/geometry/test/iterators/segment_iterator.cpp b/src/boost/libs/geometry/test/iterators/segment_iterator.cpp new file mode 100644 index 000000000..f867a524d --- /dev/null +++ b/src/boost/libs/geometry/test/iterators/segment_iterator.cpp @@ -0,0 +1,752 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#ifndef BOOST_TEST_MODULE +#define BOOST_TEST_MODULE test_segment_iterator +#endif + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include + +#include + +#include + +#include +#include + +namespace ba = ::boost::assign; +namespace bg = ::boost::geometry; +namespace bgm = bg::model; + +typedef bgm::point point_type; +typedef bgm::linestring linestring_type; +typedef bgm::ring ring_cw_closed_type; +typedef bgm::ring ring_cw_open_type; +typedef bgm::polygon polygon_cw_closed_type; +typedef bgm::polygon polygon_cw_open_type; + +// multi-geometries +typedef bgm::multi_linestring multi_linestring_type; +typedef bgm::multi_polygon multi_polygon_cw_closed_type; +typedef bgm::multi_polygon multi_polygon_cw_open_type; + +// tuple-based geometries +typedef boost::tuple tuple_point_type; +typedef std::vector tuple_linestring_type; +typedef std::vector tuple_multi_linestring_type; + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_LINESTRING(tuple_linestring_type) +BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING(tuple_multi_linestring_type) + +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) + + +template +inline Geometry from_wkt(std::string const& wkt) +{ + Geometry geometry; + boost::geometry::read_wkt(wkt, geometry); + return geometry; +} + +template +inline std::ostream& print_geometry_range(std::ostream& os, + Iterator first, + Iterator beyond, + std::string const& header) +{ + os << header << "("; + for (Iterator it = first; it != beyond; ++it) + { + os << " " << bg::dsv(*it); + } + os << " )"; + return os; +} + +template +struct test_iterator_concepts +{ + typedef bg::segment_iterator iterator; + BOOST_CONCEPT_ASSERT(( boost::BidirectionalIteratorConcept )); + BOOST_CONCEPT_ASSERT(( boost_concepts::ReadableIteratorConcept )); + BOOST_CONCEPT_ASSERT + (( boost_concepts::BidirectionalTraversalConcept )); +}; + +struct equals +{ + template + static inline std::size_t number_of_elements(Iterator begin, + Iterator end) + { + std::size_t size = std::distance(begin, end); + + std::size_t num_elems(0); + for (Iterator it = begin; it != end; ++it) + { + ++num_elems; + } + BOOST_CHECK(size == num_elems); + + num_elems = 0; + for (Iterator it = end; it != begin; --it) + { + ++num_elems; + } + BOOST_CHECK(size == num_elems); + + return num_elems; + } + + template + static inline bool apply(Iterator1 begin1, Iterator1 end1, + Iterator2 begin2, Iterator2 end2) + { + std::size_t num_points1 = number_of_elements(begin1, end1); + std::size_t num_points2 = number_of_elements(begin2, end2); + + if (num_points1 != num_points2) + { + return false; + } + + Iterator1 it1 = begin1; + Iterator2 it2 = begin2; + for (; it1 != end1; ++it1, ++it2) + { + if (! bg::equals(*it1, *it2)) + { + return false; + } + } + return true; + } +}; + + +template +struct test_segment_iterator_of_geometry +{ + template + static inline void base_test(G const& geometry, + SegmentRange const& segment_range, + std::string const& header, + bool check_num_segments) + { + boost::ignore_unused(header); + + typedef bg::segment_iterator segment_iterator; + + test_iterator_concepts(); + + segment_iterator begin = bg::segments_begin(geometry); + segment_iterator end = bg::segments_end(geometry); + + if (check_num_segments) + { + BOOST_CHECK(std::size_t(std::distance(begin, end)) + == + bg::num_segments(geometry)); + } + + BOOST_CHECK(equals::apply(begin, end, + bg::segments_begin(segment_range), + bg::segments_end(segment_range)) + ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::string closure + = ( + (bg::closure::value == bg::closed) + ? "closed" + : "open" + ); + + std::cout << header << " geometry (WKT): " + << bg::wkt(geometry) << std::endl; + std::cout << header << " geometry (DSV): " + << bg::dsv(geometry) << std::endl; + std::cout << "geometry's closure: " << closure << std::endl; + print_geometry_range(std::cout, begin, end, "segment range: "); + + std::cout << std::endl; + + print_geometry_range(std::cout, + bg::segments_begin(segment_range), + bg::segments_end(segment_range), + "expected segment range: "); + std::cout << std::endl; +#endif + + // testing dereferencing + typedef typename std::iterator_traits + < + segment_iterator + >::value_type value_type; + + if (bg::segments_begin(geometry) != bg::segments_end(geometry)) + { + value_type first_segment = *bg::segments_begin(geometry); + + boost::ignore_unused(first_segment); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + typedef bg::model::segment + < + bg::model::point + > other_segment; + other_segment other_seg; + // convert is used as a workaround for geometries whose + // point is a pointer. WKT does not seem to work for + // segment iterators created this way. + bg::convert(first_segment, other_seg); + std::cout << "first segment in geometry: " + << bg::wkt(other_seg) + << std::endl; + std::cout << "first segment in geometry (DSV): " + << bg::dsv(first_segment) + << std::endl; + + std::cout << std::endl << std::endl; +#endif + } + + // test copying all segments to a vector + std::vector segments; + std::copy(bg::segments_begin(geometry), + bg::segments_end(geometry), + std::back_inserter(segments)); + + BOOST_CHECK(std::size_t( std::distance(bg::segments_begin(geometry), + bg::segments_end(geometry)) ) + == + segments.size()); + } + + static inline void apply(Geometry geometry, + SegmentRange const& segment_range, + bool check_num_segments = true) + { + base_test(geometry, segment_range, "const", + check_num_segments); + } +}; + +//====================================================================== +//====================================================================== + +template +struct dual_tester +{ + template + static inline void apply(OpenGeometry const& open_g, + ExpectedResult expected, + bool check_num_segments = true) + { + typedef test_segment_iterator_of_geometry + < + OpenGeometry, ExpectedResult + > otester; + + typedef test_segment_iterator_of_geometry + < + ClosedGeometry, ExpectedResult + > ctester; + + otester::apply(open_g, expected, check_num_segments); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; +#endif + + ClosedGeometry closed_g; + + bg::convert(open_g, closed_g); + + ctester::apply(closed_g, expected, check_num_segments); + } +}; + +//====================================================================== +//====================================================================== + +BOOST_AUTO_TEST_CASE( test_linestring_segment_iterator ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** LINESTRING ***" << std::endl; +#endif + + typedef tuple_multi_linestring_type TML; + typedef linestring_type G; + + typedef test_segment_iterator_of_geometry tester; + + tester::apply(from_wkt("LINESTRING(0 0,1 1,2 2,3 3,4 4)"), + ba::list_of + ( ba::tuple_list_of(0,0)(1,1) ) + ( ba::tuple_list_of(1,1)(2,2) ) + ( ba::tuple_list_of(2,2)(3,3) ) + ( ba::tuple_list_of(3,3)(4,4) ) + ); + + // linestring with no points + tester::apply(from_wkt("LINESTRING()"), + ba::list_of() + ); + + // linestring with a single point + tester::apply(from_wkt("LINESTRING(1 0)"), + ba::list_of + ( ba::tuple_list_of(1,0)(1,0) ), + false + ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; +#endif +} + +//====================================================================== +//====================================================================== + +BOOST_AUTO_TEST_CASE( test_ring_segment_iterator ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** RING ***" << std::endl; +#endif + + typedef tuple_multi_linestring_type TML; + typedef ring_cw_open_type OG; + typedef ring_cw_closed_type CG; + + typedef dual_tester tester; + + tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,10 0))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,10) ) + ( ba::tuple_list_of(0,10)(10,10) ) + ( ba::tuple_list_of(10,10)(10,0) ) + ( ba::tuple_list_of(10,0)(0,0) ) + ); + + // open ring with no points + tester::apply(from_wkt("POLYGON(())"), + ba::list_of() + ); + + // open ring with a single point (one segment) + tester::apply(from_wkt("POLYGON((0 0))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,0) ), + false + ); + + // open ring with a two points (two segments) + tester::apply(from_wkt("POLYGON((0 0,0 10))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,10) ) + ( ba::tuple_list_of(0,10)(0,0) ) + ); + + // open ring with a three points (three segments) + tester::apply(from_wkt("POLYGON((0 0,0 10,10 10))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,10) ) + ( ba::tuple_list_of(0,10)(10,10) ) + ( ba::tuple_list_of(10,10)(0,0) ) + ); + + tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,10) ) + ( ba::tuple_list_of(0,10)(10,10) ) + ( ba::tuple_list_of(10,10)(10,0) ) + ( ba::tuple_list_of(10,0)(0,0) ) + ); + + // closed ring with no points + tester::apply(from_wkt("POLYGON(())"), + ba::list_of() + ); + + // closed ring with a single point (one segment) + tester::apply(from_wkt("POLYGON((0 0))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,0) ), + false + ); + + // closed ring with two points (one segment) + tester::apply(from_wkt("POLYGON((0 0,0 0))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,0) ) + ); + + // closed ring with three points (two segments) + tester::apply(from_wkt("POLYGON((0 0,0 10,0 0))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,10) ) + ( ba::tuple_list_of(0,10)(0,0) ) + ); + + // closed ring with four points (three segments) + tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,0 0))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,10) ) + ( ba::tuple_list_of(0,10)(10,10) ) + ( ba::tuple_list_of(10,10)(0,0) ) + ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; +#endif +} + +//====================================================================== +//====================================================================== + +BOOST_AUTO_TEST_CASE( test_polygon_segment_iterator ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** POLYGON ***" << std::endl; +#endif + + typedef tuple_multi_linestring_type TML; + typedef polygon_cw_open_type OG; + typedef polygon_cw_closed_type CG; + + typedef dual_tester tester; + + tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,10 0),(1 1,9 1,9 9,1 9))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,10) ) + ( ba::tuple_list_of(0,10)(10,10) ) + ( ba::tuple_list_of(10,10)(10,0) ) + ( ba::tuple_list_of(10,0)(0,0) ) + ( ba::tuple_list_of(1,1)(9,1) ) + ( ba::tuple_list_of(9,1)(9,9) ) + ( ba::tuple_list_of(9,9)(1,9) ) + ( ba::tuple_list_of(1,9)(1,1) ) + ); + + // open polygon with no points + tester::apply(from_wkt("POLYGON(())"), + ba::list_of() + ); + + // open polygons with single-point rings + tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,10 0),(1 1))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,10) ) + ( ba::tuple_list_of(0,10)(10,10) ) + ( ba::tuple_list_of(10,10)(10,0) ) + ( ba::tuple_list_of(10,0)(0,0) ) + ( ba::tuple_list_of(1,1)(1,1) ), + false + ); + + tester::apply(from_wkt("POLYGON((0 0),(1 1,9 1,9 9,1 9))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,0) ) + ( ba::tuple_list_of(1,1)(9,1) ) + ( ba::tuple_list_of(9,1)(9,9) ) + ( ba::tuple_list_of(9,9)(1,9) ) + ( ba::tuple_list_of(1,9)(1,1) ), + false + ); + + + tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0),(1 1,9 1,9 9,1 9,1 1))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,10) ) + ( ba::tuple_list_of(0,10)(10,10) ) + ( ba::tuple_list_of(10,10)(10,0) ) + ( ba::tuple_list_of(10,0)(0,0) ) + ( ba::tuple_list_of(1,1)(9,1) ) + ( ba::tuple_list_of(9,1)(9,9) ) + ( ba::tuple_list_of(9,9)(1,9) ) + ( ba::tuple_list_of(1,9)(1,1) ) + ); + + // closed polygons with no points + tester::apply(from_wkt("POLYGON(())"), + ba::list_of() + ); + tester::apply(from_wkt("POLYGON((),())"), + ba::list_of() + ); + tester::apply(from_wkt("POLYGON((),(),())"), + ba::list_of() + ); + + // closed polygons with single-point rings + tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0),(1 1))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,10) ) + ( ba::tuple_list_of(0,10)(10,10) ) + ( ba::tuple_list_of(10,10)(10,0) ) + ( ba::tuple_list_of(10,0)(0,0) ) + ( ba::tuple_list_of(1,1)(1,1) ), + false + ); + + tester::apply(from_wkt("POLYGON((0 0),(1 1,9 1,9 9,1 9,1 1))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,0) ) + ( ba::tuple_list_of(1,1)(9,1) ) + ( ba::tuple_list_of(9,1)(9,9) ) + ( ba::tuple_list_of(9,9)(1,9) ) + ( ba::tuple_list_of(1,9)(1,1) ), + false + ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; +#endif +} + +//====================================================================== +//====================================================================== + +BOOST_AUTO_TEST_CASE( test_multi_linestring_segment_iterator ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** MULTILINESTRING ***" << std::endl; +#endif + + typedef tuple_multi_linestring_type TML; + typedef multi_linestring_type G; + + typedef test_segment_iterator_of_geometry tester; + + tester::apply(from_wkt("MULTILINESTRING((0 0,1 1,2 2,3 3,4 4),(5 5,6 6,7 7,8 8),(9 9,10 10))"), + ba::list_of + ( ba::tuple_list_of(0,0)(1,1) ) + ( ba::tuple_list_of(1,1)(2,2) ) + ( ba::tuple_list_of(2,2)(3,3) ) + ( ba::tuple_list_of(3,3)(4,4) ) + ( ba::tuple_list_of(5,5)(6,6) ) + ( ba::tuple_list_of(6,6)(7,7) ) + ( ba::tuple_list_of(7,7)(8,8) ) + ( ba::tuple_list_of(9,9)(10,10) ) + ); + + // empty multi-linestrings + tester::apply(from_wkt("MULTILINESTRING()"), + ba::list_of() + ); + tester::apply(from_wkt("MULTILINESTRING(())"), + ba::list_of() + ); + tester::apply(from_wkt("MULTILINESTRING((),())"), + ba::list_of() + ); + + // multi-linestring with a linestring with one point + tester::apply(from_wkt("MULTILINESTRING((0 0,1 1,2 2,3 3,4 4),(5 5),(9 9,10 10))"), + ba::list_of + ( ba::tuple_list_of(0,0)(1,1) ) + ( ba::tuple_list_of(1,1)(2,2) ) + ( ba::tuple_list_of(2,2)(3,3) ) + ( ba::tuple_list_of(3,3)(4,4) ) + ( ba::tuple_list_of(5,5)(5,5) ) + ( ba::tuple_list_of(9,9)(10,10) ), + false + ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; +#endif +} + +//====================================================================== +//====================================================================== + +BOOST_AUTO_TEST_CASE( test_multi_polygon_segment_iterator ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** MULTIPOLYGON ***" << std::endl; +#endif + + typedef tuple_multi_linestring_type TML; + typedef multi_polygon_cw_open_type OG; + typedef multi_polygon_cw_closed_type CG; + + typedef dual_tester tester; + + tester::apply(from_wkt("MULTIPOLYGON(((0 0,0 10,10 10,10 0),(1 1,9 1,9 9,1 9)),((20 0,20 10,30 10,30 0),(21 1,29 1,29 9,21 9)))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,10) ) + ( ba::tuple_list_of(0,10)(10,10) ) + ( ba::tuple_list_of(10,10)(10,0) ) + ( ba::tuple_list_of(10,0)(0,0) ) + ( ba::tuple_list_of(1,1)(9,1) ) + ( ba::tuple_list_of(9,1)(9,9) ) + ( ba::tuple_list_of(9,9)(1,9) ) + ( ba::tuple_list_of(1,9)(1,1) ) + ( ba::tuple_list_of(20,0)(20,10) ) + ( ba::tuple_list_of(20,10)(30,10) ) + ( ba::tuple_list_of(30,10)(30,0) ) + ( ba::tuple_list_of(30,0)(20,0) ) + ( ba::tuple_list_of(21,1)(29,1) ) + ( ba::tuple_list_of(29,1)(29,9) ) + ( ba::tuple_list_of(29,9)(21,9) ) + ( ba::tuple_list_of(21,9)(21,1) ) + ); + + tester::apply(from_wkt("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(1 1,9 1,9 9,1 9,1 1)),((20 0,20 10,30 10,30 0,20 0),(21 1,29 1,29 9,21 9,21 1)))"), + ba::list_of + ( ba::tuple_list_of(0,0)(0,10) ) + ( ba::tuple_list_of(0,10)(10,10) ) + ( ba::tuple_list_of(10,10)(10,0) ) + ( ba::tuple_list_of(10,0)(0,0) ) + ( ba::tuple_list_of(1,1)(9,1) ) + ( ba::tuple_list_of(9,1)(9,9) ) + ( ba::tuple_list_of(9,9)(1,9) ) + ( ba::tuple_list_of(1,9)(1,1) ) + ( ba::tuple_list_of(20,0)(20,10) ) + ( ba::tuple_list_of(20,10)(30,10) ) + ( ba::tuple_list_of(30,10)(30,0) ) + ( ba::tuple_list_of(30,0)(20,0) ) + ( ba::tuple_list_of(21,1)(29,1) ) + ( ba::tuple_list_of(29,1)(29,9) ) + ( ba::tuple_list_of(29,9)(21,9) ) + ( ba::tuple_list_of(21,9)(21,1) ) + ); + + // test empty closed multi-polygons + tester::apply(from_wkt("MULTIPOLYGON()"), + ba::list_of() + ); + tester::apply(from_wkt("MULTIPOLYGON((()))"), + ba::list_of() + ); + tester::apply(from_wkt("MULTIPOLYGON(((),()))"), + ba::list_of() + ); + tester::apply(from_wkt("MULTIPOLYGON(((),(),()))"), + ba::list_of() + ); + tester::apply(from_wkt("MULTIPOLYGON(((),(),()),(()))"), + ba::list_of() + ); + tester::apply(from_wkt("MULTIPOLYGON(((),(),()),((),()))"), + ba::list_of() + ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl << std::endl; +#endif +} + +//====================================================================== +//====================================================================== + +BOOST_AUTO_TEST_CASE( test_linestring_of_point_pointers ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** LINESTRING OF POINT POINTERS ***" << std::endl; +#endif + + typedef tuple_multi_linestring_type TML; + typedef std::vector L; + + std::vector linestring; + for (int i = 1; i < 10; i++) + { + test::test_point_xy* p = new test::test_point_xy; + p->x = i; + p->y = -i; + linestring.push_back(p); + } + + test::test_point_xy* zero = new test::test_point_xy; + zero->x = 0; + zero->y = 0; + delete zero; + + typedef test_segment_iterator_of_geometry tester; + + tester::apply(linestring, + ba::list_of + ( ba::tuple_list_of(1,-1)(2,-2) ) + ( ba::tuple_list_of(2,-2)(3,-3) ) + ( ba::tuple_list_of(3,-3)(4,-4) ) + ( ba::tuple_list_of(4,-4)(5,-5) ) + ( ba::tuple_list_of(5,-5)(6,-6) ) + ( ba::tuple_list_of(6,-6)(7,-7) ) + ( ba::tuple_list_of(7,-7)(8,-8) ) + ( ba::tuple_list_of(8,-8)(9,-9) ) + ); + + for (unsigned int i = 0; i < linestring.size(); i++) + { + delete linestring[i]; + } +} + +//====================================================================== +//====================================================================== + +BOOST_AUTO_TEST_CASE( test_linestring_copy_on_dereference ) +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << "*** LINESTRING WITH COPY-ON-DEREFERENCE ITERATOR ***" + << std::endl; +#endif + + typedef tuple_multi_linestring_type TML; + typedef linestring_copy_on_dereference L; + + typedef test_segment_iterator_of_geometry tester; + + tester::apply(from_wkt("LINESTRING(1 -1,2 -2,3 -3,4 -4,5 -5,6 -6, 7 -7,8 -8,9 -9)"), + ba::list_of + ( ba::tuple_list_of(1,-1)(2,-2) ) + ( ba::tuple_list_of(2,-2)(3,-3) ) + ( ba::tuple_list_of(3,-3)(4,-4) ) + ( ba::tuple_list_of(4,-4)(5,-5) ) + ( ba::tuple_list_of(5,-5)(6,-6) ) + ( ba::tuple_list_of(6,-6)(7,-7) ) + ( ba::tuple_list_of(7,-7)(8,-8) ) + ( ba::tuple_list_of(8,-8)(9,-9) ) + ); +} diff --git a/src/boost/libs/geometry/test/iterators/test_iterator_common.hpp b/src/boost/libs/geometry/test/iterators/test_iterator_common.hpp new file mode 100644 index 000000000..05b84a463 --- /dev/null +++ b/src/boost/libs/geometry/test/iterators/test_iterator_common.hpp @@ -0,0 +1,206 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + +#ifndef GEOMETRY_TEST_ITERATORS_TEST_ITERATOR_COMMON_HPP +#define GEOMETRY_TEST_ITERATORS_TEST_ITERATOR_COMMON_HPP + +#include +#include +#include +#include +#include + +#include + +// helper functions for testing the concatenate and flatten iterators + +template +inline std::ostream& print_container(std::ostream& os, + Iterator begin, Iterator end, + std::string const& header) +{ + std::cout << header; + for (Iterator it = begin; it != end; ++it) + { + os << " " << *it; + } + return os; +} + + +template +inline std::ostream& print_nested_container(std::ostream& os, + Iterator begin, Iterator end, + std::string const& header) +{ + typedef typename std::iterator_traits::value_type inner_container; + typedef typename inner_container::const_iterator inner_iterator; + + std::cout << header; + for (Iterator outer = begin; outer != end; ++outer) + { + os << " ("; + for (inner_iterator inner = outer->begin(); + inner != outer->end(); ++inner) + { + if ( inner != outer->begin() ) + { + os << " "; + } + os << *inner; + } + os << ") "; + } + return os; +} + + +template +struct is_odd +{ + inline bool operator()(T const& t) const + { + return t % 2 != 0; + } +}; + + +template +struct is_even +{ + inline bool operator()(T const& t) const + { + return !is_odd()(t); + } +}; + + + + +template +inline void test_size(CombinedIterator first, CombinedIterator beyond, + CombinedContainer const& combined) +{ + std::size_t size = static_cast(std::distance(first, beyond)); + BOOST_CHECK( combined.size() == size ); + + size = 0; + for (CombinedIterator it = first; it != beyond; ++it) + { + ++size; + } + BOOST_CHECK( combined.size() == size ); + + size = 0; + for (CombinedIterator it = beyond; it != first; --it) + { + ++size; + } + BOOST_CHECK( combined.size() == size ); +} + + + +template +inline void test_equality(CombinedIterator first, CombinedIterator beyond, + CombinedContainer const& combined) +{ + typedef typename CombinedContainer::const_iterator iterator; + + iterator it = combined.begin(); + for (CombinedIterator cit = first; cit != beyond; ++cit, ++it) + { + BOOST_CHECK( *cit == *it ); + } + + if ( combined.begin() != combined.end() ) + { + BOOST_CHECK( first != beyond ); + iterator it = combined.end(); + CombinedIterator cit = beyond; + for (--cit, --it; cit != first; --cit, --it) + { + BOOST_CHECK( *cit == *it ); + } + BOOST_CHECK( cit == first && it == combined.begin() ); + BOOST_CHECK( *cit == *it ); + } + else + { + BOOST_CHECK( first == beyond ); + } +} + + + +template +inline void test_using_remove_if(CombinedIterator first, + CombinedIterator beyond, + CombinedContainer& combined) +{ + typedef typename std::iterator_traits + < + CombinedIterator + >::value_type value_type; + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl; + std::cout << "odd elements removed:" << std::endl; + print_container(std::cout, first, beyond, "before:") << std::endl; +#endif + typename std::iterator_traits::difference_type + num_even = std::count_if(first, beyond, is_even()); + + CombinedIterator new_beyond = + std::remove_if(first, beyond, is_odd()); + + std::size_t new_size = std::distance(first, new_beyond); + + for (CombinedIterator it = first; it != new_beyond; ++it) + { + BOOST_CHECK( !is_odd()(*it) ); + } + BOOST_CHECK( new_size == static_cast(num_even) ); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + print_container(std::cout, first, new_beyond, "after :") << std::endl; +#endif + + combined.erase(std::remove_if(combined.begin(), combined.end(), + is_odd()), + combined.end()); + test_equality(first, new_beyond, combined); +} + + +template +inline void test_using_reverse(CombinedIterator first, + CombinedIterator beyond, + CombinedContainer& combined) +{ + std::reverse(first, beyond); + std::reverse(combined.begin(), combined.end()); + test_equality(first, beyond, combined); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + print_container(std::cout, first, beyond, "reversed:") << std::endl; +#endif + + std::reverse(first, beyond); + std::reverse(combined.begin(), combined.end()); + test_equality(first, beyond, combined); + +#ifdef BOOST_GEOMETRY_TEST_DEBUG + print_container(std::cout, first, beyond, "re-reversed:") << std::endl; +#endif +} + + +#endif // GEOMETRY_TEST_ITERATORS_TEST_ITERATOR_COMMON_HPP diff --git a/src/boost/libs/geometry/test/minimal.cpp b/src/boost/libs/geometry/test/minimal.cpp new file mode 100644 index 000000000..58bdeabc2 --- /dev/null +++ b/src/boost/libs/geometry/test/minimal.cpp @@ -0,0 +1,83 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2018, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + +// Licensed under the Boost Software License version 1.0. +// http://www.boost.org/users/license.html + + +#include + +#include +#include + + +int test_main(int, char* []) +{ + typedef bg::model::point point; + typedef bg::model::box box; + typedef bg::model::linestring linestring; + typedef bg::model::multi_linestring mlinestring; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon mpolygon; + + point p; + linestring ls; + mlinestring mls; + polygon po; + mpolygon mpo; + + bg::read_wkt("POINT(0 0)", p); + bg::read_wkt("LINESTRING(0 0,7 7,7 9)", ls); + bg::read_wkt("MULTILINESTRING((0 0,7 7,7 9),(7 9, 9 9))", mls); + bg::read_wkt("POLYGON((0 0,0 5,5 5,5 0,0 0),(1 1,4 1,4 4,1 4,1 1))", po); + bg::read_wkt("MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0),(1 1,4 1,4 4,1 4,1 1)),((2 2,2 3,3 3,3 2,2 2)))", mpo); + + BOOST_CHECK_CLOSE(bg::perimeter(po), 32.0, 0.0001); + BOOST_CHECK_CLOSE(bg::area(mpo), 17.0, 0.0001); + BOOST_CHECK_CLOSE(bg::length(mls), 13.899494936611665, 0.0001); + + BOOST_CHECK(bg::covered_by(p, po)); + BOOST_CHECK(!bg::crosses(ls, mls)); + BOOST_CHECK(!bg::equals(ls, mls)); + BOOST_CHECK(bg::intersects(ls, po)); + BOOST_CHECK(bg::relate(p, ls, bg::de9im::mask("F0F******"))); + BOOST_CHECK(bg::relation(mls, mpo).str() == "101F00212"); + BOOST_CHECK(bg::within(po, mpo)); + BOOST_CHECK(!bg::touches(mls, po)); + + mpolygon res; + bg::intersection(po, mpo, res); + BOOST_CHECK_CLOSE(bg::area(res), 16.0, 0.0001); + bg::clear(res); + bg::union_(po, mpo, res); + BOOST_CHECK_CLOSE(bg::area(res), 17.0, 0.0001); + bg::clear(res); + bg::difference(mpo, po, res); + BOOST_CHECK_CLOSE(bg::area(res), 1.0, 0.0001); + bg::clear(res); + bg::sym_difference(mpo, po, res); + BOOST_CHECK_CLOSE(bg::area(res), 1.0, 0.0001); + + BOOST_CHECK(bg::is_simple(ls)); + BOOST_CHECK(bg::is_valid(mpo)); + + point c; + bg::centroid(mpo, c); + BOOST_CHECK_CLOSE(bg::distance(p, c), 3.5355339059327378, 0.0001); + BOOST_CHECK_CLOSE(bg::distance(mls, mpo), 0.0, 0.0001); + BOOST_CHECK_CLOSE(bg::distance(po, mpo), 0.0, 0.0001); + + box b; + bg::envelope(mls, b); + BOOST_CHECK_CLOSE(bg::area(b), 81.0, 0.0001); + + polygon h; + bg::convex_hull(mls, h); + BOOST_CHECK_CLOSE(bg::area(h), 9.0, 0.0001); + + return 0; +} + diff --git a/src/boost/libs/geometry/test/policies/Jamfile b/src/boost/libs/geometry/test/policies/Jamfile new file mode 100644 index 000000000..fd3afcf2d --- /dev/null +++ b/src/boost/libs/geometry/test/policies/Jamfile @@ -0,0 +1,16 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +# Copyright (c) 2009-2015 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 +# http://www.boost.org/LICENSE_1_0.txt) + +test-suite boost-geometry-policies + : + [ run compare.cpp : : : : policies_compare ] + [ run rescale_policy.cpp : : : : policies_rescale_policy ] + ; diff --git a/src/boost/libs/geometry/test/policies/compare.cpp b/src/boost/libs/geometry/test/policies/compare.cpp new file mode 100644 index 000000000..60c4021d5 --- /dev/null +++ b/src/boost/libs/geometry/test/policies/compare.cpp @@ -0,0 +1,256 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle 2017. +// Modifications copyright (c) 2017, 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) + +#include + +#include + +#include +#include + +#include + +#include + +#include +#include +#include + +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + +template +inline std::string coordinates(Container const& points) +{ + std::ostringstream out; + for (typename boost::range_const_iterator::type it = boost::begin(points); + it != boost::end(points); + ++it) + { + out << bg::dsv(*it); + } + return out.str(); +} + +template +void test_2d_compare() +{ + P p1 = bg::make

(3, 1); + P p2 = bg::make

(3, 1); + P p3 = bg::make

(1, 3); + P p4 = bg::make

(5, 2); + P p5 = bg::make

(3, 2); + + // Test in all dimensions + { + bg::equal_to

et; + bg::less

lt; + bg::greater

gt; + + BOOST_CHECK_EQUAL(et(p1, p2), true); + BOOST_CHECK_EQUAL(et(p1, p3), false); + BOOST_CHECK_EQUAL(et(p1, p4), false); + BOOST_CHECK_EQUAL(et(p1, p5), false); + BOOST_CHECK_EQUAL(et(p3, p4), false); + + BOOST_CHECK_EQUAL(lt(p1, p2), false); + BOOST_CHECK_EQUAL(lt(p1, p3), false); + BOOST_CHECK_EQUAL(lt(p1, p4), true); + BOOST_CHECK_EQUAL(lt(p1, p5), true); + BOOST_CHECK_EQUAL(lt(p3, p4), true); + + BOOST_CHECK_EQUAL(gt(p1, p2), false); + BOOST_CHECK_EQUAL(gt(p1, p3), true); + BOOST_CHECK_EQUAL(gt(p1, p4), false); + BOOST_CHECK_EQUAL(gt(p1, p5), false); + BOOST_CHECK_EQUAL(gt(p3, p4), false); + } + + + // Test in dimension 0, X + { + bg::equal_to et; + bg::less lt; + bg::greater gt; + + BOOST_CHECK_EQUAL(et(p1, p2), true); + BOOST_CHECK_EQUAL(et(p1, p3), false); + BOOST_CHECK_EQUAL(et(p1, p4), false); + BOOST_CHECK_EQUAL(et(p1, p5), true); + BOOST_CHECK_EQUAL(et(p3, p4), false); + + BOOST_CHECK_EQUAL(lt(p1, p2), false); + BOOST_CHECK_EQUAL(lt(p1, p3), false); + BOOST_CHECK_EQUAL(lt(p1, p4), true); + BOOST_CHECK_EQUAL(lt(p1, p5), false); + BOOST_CHECK_EQUAL(lt(p3, p4), true); + + BOOST_CHECK_EQUAL(gt(p1, p2), false); + BOOST_CHECK_EQUAL(gt(p1, p3), true); + BOOST_CHECK_EQUAL(gt(p1, p4), false); + BOOST_CHECK_EQUAL(gt(p1, p5), false); + BOOST_CHECK_EQUAL(gt(p3, p4), false); + } + + // Test in dimension 1, Y + { + bg::equal_to et; + bg::less lt; + bg::greater gt; + + BOOST_CHECK_EQUAL(et(p1, p2), true); + BOOST_CHECK_EQUAL(et(p1, p3), false); + BOOST_CHECK_EQUAL(et(p1, p4), false); + BOOST_CHECK_EQUAL(et(p1, p5), false); + BOOST_CHECK_EQUAL(et(p3, p4), false); + + BOOST_CHECK_EQUAL(lt(p1, p2), false); + BOOST_CHECK_EQUAL(lt(p1, p3), true); + BOOST_CHECK_EQUAL(lt(p1, p4), true); + BOOST_CHECK_EQUAL(lt(p1, p5), true); + BOOST_CHECK_EQUAL(lt(p3, p4), false); + + BOOST_CHECK_EQUAL(gt(p1, p2), false); + BOOST_CHECK_EQUAL(gt(p1, p3), false); + BOOST_CHECK_EQUAL(gt(p1, p4), false); + BOOST_CHECK_EQUAL(gt(p1, p5), false); + BOOST_CHECK_EQUAL(gt(p3, p4), true); + } +} + + +template +void test_2d_sort() +{ + std::vector

v; + v.push_back(bg::make

(3, 1)); + v.push_back(bg::make

(2, 3)); + v.push_back(bg::make

(2, 2)); + v.push_back(bg::make

(1, 3)); + + // Sort on coordinates in order x,y,z + std::sort(v.begin(), v.end(), bg::less

()); + std::string s = coordinates(v); + BOOST_CHECK_EQUAL(s, "(1, 3)(2, 2)(2, 3)(3, 1)"); + + // Reverse sort + std::sort(v.begin(), v.end(), bg::greater

()); + s = coordinates(v); + BOOST_CHECK_EQUAL(s, "(3, 1)(2, 3)(2, 2)(1, 3)"); + + // Sort backwards on coordinates in order x,y,z + //std::sort(v.begin(), v.end(), bg::greater

()); + //std::string s = coordinates(v); + //BOOST_CHECK_EQUAL(s, "(1, 3)(2, 2)(2, 3)(3, 1)"); + + // Refill to remove duplicate coordinates + v.clear(); + v.push_back(bg::make

(4, 1)); + v.push_back(bg::make

(3, 2)); + v.push_back(bg::make

(2, 3)); + v.push_back(bg::make

(1, 4)); + + // Sort ascending on only x-coordinate + std::sort(v.begin(), v.end(), bg::less()); + s = coordinates(v); + BOOST_CHECK_EQUAL(s, "(1, 4)(2, 3)(3, 2)(4, 1)"); + + // Sort ascending on only y-coordinate + std::sort(v.begin(), v.end(), bg::less()); + s = coordinates(v); + BOOST_CHECK_EQUAL(s, "(4, 1)(3, 2)(2, 3)(1, 4)"); + + // Sort descending on only x-coordinate + std::sort(v.begin(), v.end(), bg::greater()); + s = coordinates(v); + //BOOST_CHECK_EQUAL(s, "(4, 1)(3, 2)(2, 3)(1, 4)"); + + // Sort descending on only y-coordinate + std::sort(v.begin(), v.end(), bg::greater()); + s = coordinates(v); + BOOST_CHECK_EQUAL(s, "(1, 4)(2, 3)(3, 2)(4, 1)"); + + // Make non-unique vector + v.push_back(bg::make

(4, 1)); + v.push_back(bg::make

(3, 2)); + v.push_back(bg::make

(2, 3)); + v.push_back(bg::make

(1, 4)); + v.push_back(bg::make

(1, 5)); + std::sort(v.begin(), v.end(), bg::less

()); + s = coordinates(v); + BOOST_CHECK_EQUAL(s, "(1, 4)(1, 4)(1, 5)(2, 3)(2, 3)(3, 2)(3, 2)(4, 1)(4, 1)"); + + + std::vector

v2; + std::unique_copy(v.begin(), v.end(), std::back_inserter(v2), bg::equal_to

()); + s = coordinates(v2); + BOOST_CHECK_EQUAL(s, "(1, 4)(1, 5)(2, 3)(3, 2)(4, 1)"); +} + + +template +void test_spherical() +{ + //typedef typename bg::coordinate_type

::type ct; + + std::vector

v; + v.push_back(bg::make

( 180.00, 70.56)); + v.push_back(bg::make

( 179.73, 71.56)); // east + v.push_back(bg::make

( 177.47, 71.23)); // less east + v.push_back(bg::make

(-178.78, 72.78)); // further east, = west, this is the most left point + v.push_back(bg::make

(-180.00, 73.12)); + + // Sort on coordinates in order x,y,z + std::sort(v.begin(), v.end(), bg::less

()); + std::string s = coordinates(v); + BOOST_CHECK_EQUAL(s, "(-178.78, 72.78)(177.47, 71.23)(179.73, 71.56)(180, 70.56)(-180, 73.12)"); + + // Sort ascending on only y-coordinate + std::sort(v.begin(), v.end(), bg::less()); + s = coordinates(v); + BOOST_CHECK_EQUAL(s, "(180, 70.56)(177.47, 71.23)(179.73, 71.56)(-178.78, 72.78)(-180, 73.12)"); + + // Sort ascending on only x-coordinate + std::sort(v.begin(), v.end(), bg::less()); + s = coordinates(v); + BOOST_CHECK((s == "(-178.78, 72.78)(177.47, 71.23)(179.73, 71.56)(180, 70.56)(-180, 73.12)" + || s == "(-178.78, 72.78)(177.47, 71.23)(179.73, 71.56)(-180, 73.12)(180, 70.56)")); + + // Sort ascending on only x-coordinate, but override with std-comparison, + // (so this is the normal sorting behaviour that would have been used + // if it would not have been spherical) + //std::sort(v.begin(), v.end(), bg::less >()); + //s = coordinates(v); + //BOOST_CHECK_EQUAL(s, "(-178.78, 70.78)(177.47, 71.23)(179.73, 71.56)"); +} + + +int test_main(int, char* []) +{ + test_2d_compare >(); + test_2d_compare >(); + + test_2d_sort >(); + test_2d_sort >(); + test_2d_sort >(); + test_2d_sort >(); + + test_spherical > >(); + test_spherical > >(); + test_spherical > >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/policies/rescale_policy.cpp b/src/boost/libs/geometry/test/policies/rescale_policy.cpp new file mode 100644 index 000000000..c91f31988 --- /dev/null +++ b/src/boost/libs/geometry/test/policies/rescale_policy.cpp @@ -0,0 +1,133 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + + +#include + + +template +< + typename RescalePolicy, + typename Geometry1, + typename Geometry2 +> +void test_one(std::string const& wkt1, std::string const& wkt2, + std::string const& expected_coordinates) +{ + Geometry1 geometry1; + bg::read_wkt(wkt1, geometry1); + + Geometry2 geometry2; + bg::read_wkt(wkt2, geometry2); + + RescalePolicy rescale_policy + = bg::get_rescale_policy(geometry1, geometry2); + + typedef typename bg::point_type::type point_type; + typedef typename bg::robust_point_type + < + point_type, RescalePolicy + >::type robust_point_type; + + { + robust_point_type robust_point; + bg::recalculate(robust_point, *bg::points_begin(geometry1), rescale_policy); + + std::ostringstream out; + out << bg::get<0>(robust_point) << " " << bg::get<1>(robust_point); + BOOST_CHECK_EQUAL(expected_coordinates, out.str()); + } + + { + // Assuming Geometry1 is a polygon: + typedef bg::model::polygon polygon_type; + polygon_type geometry_out; + bg::recalculate(geometry_out, geometry1, rescale_policy); + robust_point_type p = *bg::points_begin(geometry_out); + + std::ostringstream out; + out << bg::get<0>(p) << " " << bg::get<1>(p); + BOOST_CHECK_EQUAL(expected_coordinates, out.str()); + } +} + + + +static std::string simplex_normal[2] = + {"POLYGON((0 1,2 5,5 3,0 1))", + "POLYGON((3 0,0 3,4 5,3 0))"}; + +static std::string simplex_large[2] = + {"POLYGON((0 1000,2000 5000,5000 3000,0 1000))", + "POLYGON((3000 0,0 3000,4000 5000,3000 0))"}; + + +template +void test_rescale(std::string const& expected_normal, std::string const& expected_large) +{ + typedef bg::model::polygon

polygon; + + typedef typename boost::mpl::if_c + < + Rescale, + typename bg::rescale_policy_type

::type , + bg::detail::no_rescale_policy + >::type rescale_policy_type; + + test_one( + simplex_normal[0], simplex_normal[1], + expected_normal); + test_one( + simplex_large[0], simplex_large[1], + expected_large); +} + +template +void test_all(std::string const& expected_normal, std::string const& expected_large) +{ + typedef bg::model::d2::point_xy point_type; + test_rescale(expected_normal, expected_large); + //test_rescale(); +} + + +int test_main(int, char* []) +{ + test_all("-5000000 -3000000", "-5000000 -3000000"); + test_all("-5000000 -3000000", "-5000000 -3000000"); + test_all("0 1", "0 1000"); + test_all("0 1", "0 1000"); + // test_all(); // compiles but overflows + + return 0; +} + diff --git a/src/boost/libs/geometry/test/robustness/common/common_settings.hpp b/src/boost/libs/geometry/test/robustness/common/common_settings.hpp new file mode 100644 index 000000000..2d4153a47 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/common/common_settings.hpp @@ -0,0 +1,32 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Robustness Test +// +// Copyright (c) 2009-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef BOOST_GEOMETRY_COMMON_SETTINGS_HPP +#define BOOST_GEOMETRY_COMMON_SETTINGS_HPP + +struct common_settings +{ + bool svg; + bool wkt; + bool also_difference; + double tolerance; + + int field_size; + bool triangular; + + common_settings() + : svg(false) + , wkt(false) + , also_difference(false) + , tolerance(1.0e-6) + , field_size(10) + , triangular(false) + {} +}; + +#endif // BOOST_GEOMETRY_COMMON_SETTINGS_HPP diff --git a/src/boost/libs/geometry/test/robustness/common/make_square_polygon.hpp b/src/boost/libs/geometry/test/robustness/common/make_square_polygon.hpp new file mode 100644 index 000000000..a40eda790 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/common/make_square_polygon.hpp @@ -0,0 +1,46 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Robustness Test +// +// Copyright (c) 2009-2012 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef BOOST_GEOMETRY_TEST_ROBUSTNESS_MAKE_SQUARE_POLYGON_HPP +#define BOOST_GEOMETRY_TEST_ROBUSTNESS_MAKE_SQUARE_POLYGON_HPP + +#include + +template +inline void make_square_polygon(Polygon& polygon, Generator& generator, Settings const& settings) +{ + using namespace boost::geometry; + + typedef typename point_type::type point_type; + typedef typename coordinate_type::type coordinate_type; + + coordinate_type x, y; + x = generator(); + y = generator(); + + typename ring_type::type& ring = exterior_ring(polygon); + + point_type p; + set<0>(p, x); set<1>(p, y); append(ring, p); + set<0>(p, x); set<1>(p, y + 1); append(ring, p); + set<0>(p, x + 1); set<1>(p, y + 1); append(ring, p); + set<0>(p, x + 1); set<1>(p, y); append(ring, p); + set<0>(p, x); set<1>(p, y); append(ring, p); + + if (settings.triangular) + { + // Remove a point, generator says which + int c = generator() % 4; + if (c >= 1 && c <= 3) + { + ring.erase(ring.begin() + c); + } + } +} + +#endif // BOOST_GEOMETRY_TEST_ROBUSTNESS_MAKE_SQUARE_POLYGON_HPP diff --git a/src/boost/libs/geometry/test/robustness/convex_hull/Jamfile b/src/boost/libs/geometry/test/robustness/convex_hull/Jamfile new file mode 100644 index 000000000..20521d548 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/convex_hull/Jamfile @@ -0,0 +1,18 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# Robustness Test - convex_hull +# +# Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands. + +# 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) + + +project random_multi_points + : requirements + . + ../../../../program_options/build//boost_program_options + static + ; + +exe random_multi_points : random_multi_points.cpp ; diff --git a/src/boost/libs/geometry/test/robustness/convex_hull/random_multi_points.cpp b/src/boost/libs/geometry/test/robustness/convex_hull/random_multi_points.cpp new file mode 100644 index 000000000..93662ca9d --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/convex_hull/random_multi_points.cpp @@ -0,0 +1,224 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Robustness Test - convex_hull + +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR +#define BOOST_GEOMETRY_NO_BOOST_TEST + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +struct settings_type +{ + bool svg; + bool wkt; + + settings_type() + : svg(false) + , wkt(false) + {} +}; + +namespace bg = boost::geometry; + +template +void create_svg(std::string const& filename, Geometry1 const& points, Geometry2 const& hull) +{ + typedef typename boost::geometry::point_type::type point_type; + + boost::geometry::model::box box; + bg::envelope(hull, box); + bg::buffer(box, box, 1.0); + + std::ofstream svg(filename.c_str()); + boost::geometry::svg_mapper mapper(svg, 800, 800); + mapper.add(box); + + mapper.map(hull, "opacity:0.8;fill:none;stroke:rgb(255,0,255);stroke-width:4;stroke-dasharray:1,7;stroke-linecap:round"); + mapper.map(points, "fill-opacity:0.5;fill:rgb(0,0,255);", 5); +} + + +template +inline void make_multi_point(MultiPoint& mp, Generator& generator, int pcount) +{ + typedef typename bg::point_type::type point_type; + typedef typename bg::coordinate_type::type coordinate_type; + + for(int i = 0; i < pcount; i++) + { + coordinate_type x, y; + x = generator(); + y = generator(); + + point_type p; + bg::set<0>(p, x); + bg::set<1>(p, y); + + mp.push_back(p); + } +} + +template +bool check_hull(MultiPoint const& mp, Polygon const& poly) +{ + for(typename boost::range_iterator::type it = boost::begin(mp); + it != boost::end(mp); + ++it) + { + if (! bg::covered_by(*it, poly)) + { + return false; + } + } + return true; +} + + +template +void test_random_multi_points(MultiPoint& result, int& index, + Generator& generator, + int pcount, settings_type const& settings) +{ + typedef typename bg::point_type::type point_type; + + MultiPoint mp; + bg::model::polygon hull; + + make_multi_point(mp, generator, pcount); + bg::convex_hull(mp, hull); + // Check if each point lies in the hull + bool correct = check_hull(mp, hull); + if (! correct) + { + std::cout << "ERROR! " << std::endl + << bg::wkt(mp) << std::endl + << bg::wkt(hull) << std::endl + << std::endl; + ; + } + + if (settings.svg || ! correct) + { + std::ostringstream out; + out << "random_mp_" << index++ << "_" << pcount << ".svg"; + create_svg(out.str(), mp, hull); + } + if (settings.wkt) + { + std::cout + << "input: " << bg::wkt(mp) << std::endl + << "output: " << bg::wkt(hull) << std::endl + << std::endl; + ; + } +} + + +template +void test_all(int seed, int count, int field_size, int pcount, settings_type const& settings) +{ + boost::timer t; + + typedef boost::minstd_rand base_generator_type; + + base_generator_type generator(seed); + + boost::uniform_int<> random_coordinate(0, field_size - 1); + boost::variate_generator > + coordinate_generator(generator, random_coordinate); + + typedef bg::model::multi_point + < + bg::model::d2::point_xy + > mp; + + int index = 0; + for(int i = 0; i < count; i++) + { + mp p; + test_random_multi_points(p, index, coordinate_generator, pcount, settings); + } + std::cout + << "points: " << index + << " type: " << typeid(T).name() + << " time: " << t.elapsed() << std::endl; +} + +int main(int argc, char** argv) +{ + try + { + namespace po = boost::program_options; + po::options_description description("=== random_multi_points ===\nAllowed options"); + + std::string type = "double"; + int count = 1; + int seed = static_cast(std::time(0)); + int pcount = 3; + int field_size = 10; + settings_type settings; + + description.add_options() + ("help", "Help message") + ("seed", po::value(&seed), "Initialization seed for random generator") + ("count", po::value(&count)->default_value(1), "Number of tests") + ("number", po::value(&pcount)->default_value(30), "Number of points") + ("size", po::value(&field_size)->default_value(10), "Size of the field") + ("type", po::value(&type)->default_value("double"), "Type (int,float,double)") + ("wkt", po::value(&settings.wkt)->default_value(false), "Create a WKT of the inputs, for all tests") + ("svg", po::value(&settings.svg)->default_value(false), "Create a SVG for all tests") + ; + + po::variables_map varmap; + po::store(po::parse_command_line(argc, argv, description), varmap); + po::notify(varmap); + + if (varmap.count("help")) + { + std::cout << description << std::endl; + return 1; + } + + if (type == "float") + { + test_all(seed, count, field_size, pcount, settings); + } + else if (type == "double") + { + test_all(seed, count, field_size, pcount, settings); + } + else if (type == "int") + { + test_all(seed, count, field_size, pcount, settings); + } + + } + catch(std::exception const& e) + { + std::cout << "Exception " << e.what() << std::endl; + } + catch(...) + { + std::cout << "Other exception" << std::endl; + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/robustness/overlay/areal_areal/Jamfile b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/Jamfile new file mode 100644 index 000000000..96e42656d --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/Jamfile @@ -0,0 +1,28 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2013 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2013 Mateusz Loskot, London, UK. +# Copyright (c) 2013 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 +# http://www.boost.org/LICENSE_1_0.txt) + +project boost-geometry-robustness-overlay-areal_areal + : + requirements + . + /boost/program_options//boost_program_options + ; + +exe interior_triangles : interior_triangles.cpp ; +exe intersection_pies : intersection_pies.cpp ; +exe intersection_stars : intersection_stars.cpp ; +exe intersects : intersects.cpp ; +exe random_ellipses_stars : random_ellipses_stars.cpp ; +exe recursive_polygons : recursive_polygons.cpp ; +exe star_comb : star_comb.cpp ; + +exe ticket_9081 : ticket_9081.cpp ; + diff --git a/src/boost/libs/geometry/test/robustness/overlay/areal_areal/general_intersection_precision.cpp b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/general_intersection_precision.cpp new file mode 100755 index 000000000..6413f2d18 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/general_intersection_precision.cpp @@ -0,0 +1,224 @@ +// Boost.Geometry +// Robustness Test + +// Copyright (c) 2019 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + +// Basic case. Union should deliver 22.0 +static std::string case_a[2] = + { + "MULTIPOLYGON(((0 0,0 4,2 4,2 3,4 3,4 0,0 0)))", + "MULTIPOLYGON(((2 7,4 7,4 3,2 3,2 7)))" + }; + +// Case with an interior ring. Union should deliver 73.0 +static std::string case_b[2] = + { + "MULTIPOLYGON(((0 0,0 4,2 4,2 3,4 3,4 0,0 0)))", + "MULTIPOLYGON(((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4 3,4 7,2 7)))" + }; + +static std::string case_c[2] = + { + "MULTIPOLYGON(((0 0,0 4,2 4,2 3,4 3,4 0,0 0)))", + "MULTIPOLYGON(((1 1,0 1,0 3,1 3,1 1)))" + }; + +template +bool test_overlay(std::string const& caseid, + Geometry const& g1, Geometry const& g2, + double expected_area, + bool do_output) +{ + + typedef typename boost::range_value::type geometry_out; + typedef bg::detail::overlay::overlay + < + Geometry, Geometry, + bg::detail::overlay::do_reverse::value>::value, + OverlayType == bg::overlay_difference + ? ! bg::detail::overlay::do_reverse::value>::value + : bg::detail::overlay::do_reverse::value>::value, + bg::detail::overlay::do_reverse::value>::value, + geometry_out, + OverlayType + > overlay; + + typedef typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy_type; + + strategy_type strategy; + + typedef typename bg::rescale_overlay_policy_type + < + Geometry, + Geometry + >::type rescale_policy_type; + + rescale_policy_type robust_policy + = bg::get_rescale_policy(g1, g2); + + Geometry result; + bg::detail::overlay::overlay_null_visitor visitor; + overlay::apply(g1, g2, robust_policy, std::back_inserter(result), + strategy, visitor); + + const double detected_area = bg::area(result); + if (std::fabs(detected_area - expected_area) > 0.01) + { + if (do_output) + { + std::cout << "ERROR: " << caseid << std::setprecision(18) + << " detected=" << detected_area + << " expected=" << expected_area << std::endl + << " " << bg::wkt(g1) << std::endl + << " " << bg::wkt(g2) << std::endl; + } + return false; + } + return true; +} + +template +void update(Ring& ring, double x, double y, std::size_t index) +{ + if (index >= ring.size()) + { + return; + } + bg::set<0>(ring[index], bg::get<0>(ring[index]) + x); + bg::set<1>(ring[index], bg::get<1>(ring[index]) + y); + if (index == 0) + { + ring.back() = ring.front(); + } +} + +template +std::size_t test_case(std::size_t& error_count, + std::size_t case_index, std::size_t i, std::size_t j, + std::size_t min_vertex_index, std::size_t max_vertex_index, + double x, double y, double expectation, + MultiPolygon const& poly1, MultiPolygon const& poly2, + bool do_output) +{ + std::size_t n = 0; + for (std::size_t k = min_vertex_index; k <= max_vertex_index; k++, ++n) + { + MultiPolygon poly2_adapted = poly2; + + switch (case_index) + { + case 2 : + update(bg::interior_rings(poly2_adapted.front()).front(), x, y, k); + break; + default : + update(bg::exterior_ring(poly2_adapted.front()), x, y, k); + break; + } + + std::ostringstream out; + out << "case_" << i << "_" << j << "_" << k; + if (! test_overlay(out.str(), poly1, poly2_adapted, expectation, do_output)) + { + if (error_count == 0) + { + // First failure is always reported + test_overlay(out.str(), poly1, poly2_adapted, expectation, true); + } + error_count++; + } + } + return n; +} + +template +std::size_t test_all(std::size_t case_index, std::size_t min_vertex_index, + std::size_t max_vertex_index, + double expectation, bool do_output) +{ + typedef bg::model::point point_type; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + + const std::string& first = case_a[0]; + + const std::string& second + = case_index == 1 ? case_a[1] + : case_index == 2 ? case_b[1] + : case_index == 3 ? case_c[1] + : ""; + + multi_polygon poly1; + bg::read_wkt(first, poly1); + + multi_polygon poly2; + bg::read_wkt(second, poly2); + + std::size_t error_count = 0; + std::size_t n = 0; + for (double factor = 1.0; factor > 1.0e-10; factor /= 10.0) + { + std::size_t i = 0; + double const bound = 1.0e-5 * factor; + double const step = 1.0e-6 * factor; + for (double x = -bound; x <= bound; x += step, ++i) + { + std::size_t j = 0; + for (double y = -bound; y <= bound; y += step, ++j, ++n) + { + n += test_case(error_count, + case_index, i, j, + min_vertex_index, max_vertex_index, + x, y, expectation, + poly1, poly2, do_output); + } + } + } + + std::cout << case_index + << " #cases: " << n << " #errors: " << error_count << std::endl; + BOOST_CHECK_EQUAL(error_count, 0u); + + return error_count; +} + +int test_main(int argc, char** argv) +{ + typedef double coordinate_type; + + const double factor = argc > 1 ? atof(argv[1]) : 2.0; + const bool do_output = argc > 2 && atol(argv[2]) == 1; + + std::cout << std::endl << " -> TESTING " + << string_from_type::name() + << " " << factor + << std::endl; + + test_all(1, 0, 3, 22.0, do_output); + test_all(2, 0, 3, 73.0, do_output); + test_all(3, 1, 2, 2.0, do_output); + test_all(3, 1, 2, 14.0, do_output); + + return 0; + } + + diff --git a/src/boost/libs/geometry/test/robustness/overlay/areal_areal/interior_triangles.cpp b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/interior_triangles.cpp new file mode 100644 index 000000000..baf945dd9 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/interior_triangles.cpp @@ -0,0 +1,162 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2009-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include +#include +#include +#include + +#define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR +#define BOOST_GEOMETRY_NO_BOOST_TEST +#define BOOST_GEOMETRY_TIME_OVERLAY + +#include + +#include +#include +#include +#include +#include +#include + +template +inline void make_polygon(Polygon& polygon, int count_x, int count_y, int index, int offset) +{ + typedef typename bg::point_type::type point_type; + bg::exterior_ring(polygon).push_back(point_type(0, 0)); + bg::exterior_ring(polygon).push_back(point_type(0, count_y * 10)); + bg::exterior_ring(polygon).push_back(point_type(count_x * 10 + 10, count_y * 10)); + bg::exterior_ring(polygon).push_back(point_type(count_x * 10 + 10, 0)); + bg::exterior_ring(polygon).push_back(point_type(0, 0)); + + for(int j = 0; j < count_x; ++j) + { + for(int k = 0; k < count_y; ++k) + { + polygon.inners().push_back(typename Polygon::inner_container_type::value_type()); + polygon.inners().back().push_back(point_type(offset + j * 10 + 1, k * 10 + 1)); + polygon.inners().back().push_back(point_type(offset + j * 10 + 7, k * 10 + 5 + index)); + polygon.inners().back().push_back(point_type(offset + j * 10 + 5 + index, k * 10 + 7)); + polygon.inners().back().push_back(point_type(offset + j * 10 + 1, k * 10 + 1)); + } + } + bg::correct(polygon); +} + + + +template +void test_star_comb(int count_x, int count_y, int offset, p_q_settings const& settings) +{ + Polygon p, q; + + make_polygon(p, count_x, count_y, 0, 0); + make_polygon(q, count_x, count_y, 1, offset); + + std::ostringstream out; + out << "interior_triangles"; + test_overlay_p_q + < + Polygon, + typename bg::coordinate_type::type + >(out.str(), p, q, settings); +} + + +template +void test_all(int count, int count_x, int count_y, int offset, p_q_settings const& settings) +{ + boost::timer t; + + typedef bg::model::polygon + < + bg::model::d2::point_xy, Clockwise, Closed + > polygon; + + + for(int i = 0; i < count; i++) + { + test_star_comb(count_x, count_y, offset, settings); + } + std::cout + << " type: " << string_from_type::name() + << " time: " << t.elapsed() << std::endl; +} + +int main(int argc, char** argv) +{ + try + { + namespace po = boost::program_options; + po::options_description description("=== interior_triangles ===\nAllowed options"); + + int offset = 0; + int count = 1; + int count_x = 10; + int count_y = 10; + bool ccw = false; + bool open = false; + p_q_settings settings; + + description.add_options() + ("help", "Help message") + ("count", po::value(&count)->default_value(1), "Number of tests") + ("count_x", po::value(&count_x)->default_value(10), "Triangle count in x-direction") + ("count_y", po::value(&count_y)->default_value(10), "Triangle count in y-direction") + ("offset", po::value(&offset)->default_value(0), "Offset of second triangle in x-direction") + ("diff", po::value(&settings.also_difference)->default_value(false), "Include testing on difference") + ("ccw", po::value(&ccw)->default_value(false), "Counter clockwise polygons") + ("open", po::value(&open)->default_value(false), "Open polygons") + ("wkt", po::value(&settings.wkt)->default_value(false), "Create a WKT of the inputs, for all tests") + ("svg", po::value(&settings.svg)->default_value(false), "Create a SVG for all tests") + ; + + po::variables_map varmap; + po::store(po::parse_command_line(argc, argv, description), varmap); + po::notify(varmap); + + if (varmap.count("help")) + { + std::cout << description << std::endl; + return 1; + } + + if (ccw && open) + { + test_all(count, count_x, count_y, offset, settings); + } + else if (ccw) + { + test_all(count, count_x, count_y, offset, settings); + } + else if (open) + { + test_all(count, count_x, count_y, offset, settings); + } + else + { + test_all(count, count_x, count_y, offset, settings); + } + +#if defined(HAVE_TTMATH) + // test_all(seed, count, max, svg, level); +#endif + } + catch(std::exception const& e) + { + std::cout << "Exception " << e.what() << std::endl; + } + catch(...) + { + std::cout << "Other exception" << std::endl; + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/robustness/overlay/areal_areal/intersection_pies.cpp b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/intersection_pies.cpp new file mode 100644 index 000000000..dce301c12 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/intersection_pies.cpp @@ -0,0 +1,300 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2009-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +#define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR +#define BOOST_GEOMETRY_NO_BOOST_TEST + +#include + +#include +#include + +template +inline void make_pie(Polygon& polygon, + int count, int offset, int offset_y, double factor1, int total_segment_count = 36) +{ + typedef typename bg::point_type::type p; + typedef typename bg::select_most_precise + < + typename bg::coordinate_type::type, + long double + >::type coordinate_type; + + // Create pie + coordinate_type cx = 2500.0; + coordinate_type cy = 2500.0 + offset_y; + + bg::exterior_ring(polygon).push_back(bg::make

(int(cx), int(cy))); + + coordinate_type const dx = 5000.0; + coordinate_type const dy = 5000.0; + + coordinate_type const half = 0.5; + coordinate_type const two = 2.0; + + coordinate_type const a = coordinate_type(factor1) * half * dx; + coordinate_type const b = coordinate_type(factor1) * half * dy; + + coordinate_type const pi = boost::math::constants::pi(); + coordinate_type const delta = pi * two / total_segment_count; + coordinate_type angle = coordinate_type(offset) * delta; + for (int i = 0; i < count; i++, angle += delta) + { + coordinate_type const s = sin(angle); + coordinate_type const c = cos(angle); + coordinate_type const x = cx + a * s; + coordinate_type const y = cy + b * c; + bg::exterior_ring(polygon).push_back(bg::make

(int(x), int(y))); + } + bg::exterior_ring(polygon).push_back(bg::make

(int(cx), int(cy))); + bg::correct(polygon); +} + + +/* +sql server + +TWO INNERS +1a) select geometry::STGeomFromText('POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,5 5,4 6,4 4),(6 6,5 5,6 4,6 6)) ', 0).STIsValid(); -> valid +same: +1b) POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,5 5,6 4,6 6,5 5,4 6,4 4)) -> valid + +I-E tangency IET +2a) select geometry::STGeomFromText('POLYGON((0 0,0 10,10 10,10 0,0 0),(5 0,6 1,4 1,5 0))', 0).STIsValid(); -> valid +same by Self tangency ST +2b) select geometry::STGeomFromText('POLYGON((0 0,0 10,10 10,10 0,5 0,6 1,4 1,5 0, 0 0))', 0).STIsValid(); -> valid + +Two inners all tangent +3a) POLYGON((0 0,0 10,10 10,10 0,0 0),(5 0,6 1,4 1,5 0),(5 1,6 2,4 2,5 1)) -> valid + +postgis: +1a) select ST_IsValid(ST_GeomFromText('POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,5 5,4 6,4 4),(6 6,5 5,6 4,6 6))', 0)); -> valid +1b) POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,5 5,6 4,6 6,5 5,4 6,4 4)) -> NOT valid + +2a) POLYGON((0 0,0 10,10 10,10 0,0 0),(5 0,6 1,4 1,5 0)) -> valid +2b) POLYGON((0 0,0 10,10 10,10 0,5 0,6 1,4 1,5 0, 0 0)) -> NOT valid (?) + +3a) POLYGON((0 0,0 10,10 10,10 0,0 0),(5 0,6 1,4 1,5 0),(5 1,6 2,4 2,5 1)) -> valid + + +*/ + +template +inline void holify(Polygon& polygon) +{ + typedef typename bg::point_type::type point_type; + + Polygon p; + bg::exterior_ring(p).push_back(bg::make(0, 0)); + bg::exterior_ring(p).push_back(bg::make(0, 5000)); + bg::exterior_ring(p).push_back(bg::make(5000, 5000)); + bg::exterior_ring(p).push_back(bg::make(5000, 0)); + bg::exterior_ring(p).push_back(bg::make(0, 0)); + bg::interior_rings(p).push_back(bg::exterior_ring(polygon)); + bg::correct(p); + + polygon = p; +} + +template +inline void holify_multi(MultiPolygon& multi_polygon) +{ + typedef typename bg::point_type::type point_type; + + typename boost::range_value::type p; + + bg::exterior_ring(p).push_back(bg::make(0, 0)); + bg::exterior_ring(p).push_back(bg::make(0, 5000)); + bg::exterior_ring(p).push_back(bg::make(5000, 5000)); + bg::exterior_ring(p).push_back(bg::make(5000, 0)); + bg::exterior_ring(p).push_back(bg::make(0, 0)); + + for (int i = 0; i < multi_polygon.size(); i++) + { + bg::interior_rings(p).push_back(bg::exterior_ring(multi_polygon[i])); + } + + bg::correct(p); + + multi_polygon.clear(); + multi_polygon.push_back(p); +} + + + +template +void test_pie(int total_segment_count, T factor_p, T factor_q, + bool multi, bool single_selftangent, p_q_settings const& settings) +{ + boost::timer t; + typedef bg::model::d2::point_xy point_type; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + + int good_count = 0; + int bad_count = 0; + + for (int a = 2; a < total_segment_count; a++) + { + polygon p; + make_pie(p, a, 0, 0, factor_p, total_segment_count); + + //holify(p); + + for (int b = 2; b < total_segment_count; b++) + { + for (int offset = 1; offset < total_segment_count; offset++) + { + //for (int y = 0; y <= 2500; y += 500) + int y = 0; + { + polygon q; + make_pie(q, b, offset, y, factor_q, total_segment_count); + + if (! multi) + { + //holify(q); + + std::ostringstream out; + out << "pie_" << a << "_" << b << "_" << offset << "_" << y; + if (test_overlay_p_q(out.str(), p, q, settings)) + { + good_count++; + } + else + { + bad_count++; + } + } + else + { + int left = total_segment_count - b - 2; + //std::cout << a << " " << b << " " << left << std::endl; + for (int c = 2; c < left; c++) + { + polygon q2; + make_pie(q2, c, offset + b + 1, y, factor_q, total_segment_count); + + std::ostringstream out; + out << "pie_" << a << "_" << b << "_" << offset << "_" << y + << "_" << c + ; + + bool good = false; + + // Represent as either multi-polygon, or as single-self-touching-polygon (INVALID) + if (single_selftangent) + { + polygon q1 = q; + for (unsigned int i = 1; i < q2.outer().size(); i++) + { + q1.outer().push_back(q2.outer()[i]); + } + //holify(q1); + good = test_overlay_p_q(out.str(), p, q1, settings); + } + else + { + multi_polygon mq; + mq.push_back(q); + mq.push_back(q2); + //holify_multi(mq); + good = test_overlay_p_q(out.str(), p, mq, settings); + } + + if (good) + { + good_count++; + } + else + { + bad_count++; + } + } + } + } + } + } + } + std::cout + << "Time: " << t.elapsed() << std::endl + << "Good: " << good_count << std::endl + << "Bad: " << bad_count << std::endl; +} + + +template +void test_all(bool multi, bool single_selftangent, p_q_settings const& settings) +{ + test_pie(24, 0.55, 0.45, multi, single_selftangent, settings); +} + +int main(int argc, char** argv) +{ + try + { + namespace po = boost::program_options; + po::options_description description("=== intersection_pies ===\nAllowed options"); + + p_q_settings settings; + bool multi = false; + bool ccw = false; + bool open = false; + bool single_selftangent = false; // keep false, true does not work! + + description.add_options() + ("help", "Help message") + ("multi", po::value(&multi)->default_value(false), "Multiple tangencies at one point") + ("diff", po::value(&settings.also_difference)->default_value(false), "Include testing on difference") + ("ccw", po::value(&ccw)->default_value(false), "Counter clockwise polygons") + ("open", po::value(&open)->default_value(false), "Open polygons") + ("wkt", po::value(&settings.wkt)->default_value(false), "Create a WKT of the inputs, for all tests") + ("svg", po::value(&settings.svg)->default_value(false), "Create a SVG for all tests") + ; + + po::variables_map varmap; + po::store(po::parse_command_line(argc, argv, description), varmap); + po::notify(varmap); + + if (varmap.count("help")) + { + std::cout << description << std::endl; + return 1; + } + + // template par's are: CoordinateType, Clockwise, Closed + if (ccw && open) + { + test_all(multi, single_selftangent, settings); + } + else if (ccw) + { + test_all(multi, single_selftangent, settings); + } + else if (open) + { + test_all(multi, single_selftangent, settings); + } + else + { + test_all(multi, single_selftangent, settings); + } + //test_all(); + } + catch(std::exception const& e) + { + std::cout << "Exception " << e.what() << std::endl; + } + catch(...) + { + std::cout << "Other exception" << std::endl; + } + return 0; +} diff --git a/src/boost/libs/geometry/test/robustness/overlay/areal_areal/intersection_stars.cpp b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/intersection_stars.cpp new file mode 100644 index 000000000..0592e2af3 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/intersection_stars.cpp @@ -0,0 +1,182 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2009-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#define BOOST_GEOMETRY_NO_BOOST_TEST + + +#include + +#include +#include + +template +inline void make_star(Polygon& polygon, + int count, double factor1, double factor2, long double offset = 0) +{ + typedef typename bg::point_type::type p; + typedef typename bg::select_most_precise + < + typename bg::coordinate_type::type, + long double + >::type coordinate_type; + + // Create star + coordinate_type cx = 25.0; + coordinate_type cy = 25.0; + + coordinate_type dx = 50.0; + coordinate_type dy = 50.0; + + coordinate_type half = 0.5; + coordinate_type two = 2.0; + + coordinate_type a1 = coordinate_type(factor1) * half * dx; + coordinate_type b1 = coordinate_type(factor1) * half * dy; + coordinate_type a2 = coordinate_type(factor2) * half * dx; + coordinate_type b2 = coordinate_type(factor2) * half * dy; + + coordinate_type pi = boost::math::constants::pi(); + coordinate_type delta = pi * two / coordinate_type(count - 1); + coordinate_type angle = coordinate_type(offset) * delta; + for (int i = 0; i < count - 1; i++, angle += delta) + { + bool even = i % 2 == 0; + coordinate_type s = sin(angle); + coordinate_type c = cos(angle); + coordinate_type x = cx + (even ? a1 : a2) * s; + coordinate_type y = cy + (even ? b1 : b2) * c; + bg::exterior_ring(polygon).push_back(bg::make

(x, y)); + + } + bg::exterior_ring(polygon).push_back(bg::exterior_ring(polygon).front()); +} + + +template +void test_star(int count, int min_points, int max_points, T rotation, p_q_settings const& settings) +{ + boost::timer t; + typedef bg::model::d2::point_xy point_type; + typedef bg::model::polygon polygon; + + int n = 0; + for (int c = 0; c < count; c++) + { + for (int i = min_points; i <= max_points; i++) + { + std::ostringstream out; + out << "_" << string_from_type::name() << "_" + << string_from_type::name() << "_" + << i << "_int"; + + polygon p; + make_star(p, i * 2 + 1, 0.5, 1.0); + polygon q; + make_star(q, i * 2 + 1, 0.5, 1.0, rotation); + + if (! test_overlay_p_q + < + polygon, + CalculationType + >(out.str(), p, q, settings)) + { + return; + } + n++; + } + } + std::cout + << "polygons: " << n + << " type: " << string_from_type::name() + << " time: " << t.elapsed() << std::endl; +} + +template +void test_type(int count, int min_points, int max_points, T rotation, p_q_settings const& settings) +{ + test_star(count, min_points, max_points, rotation, settings); +} + +template +void test_all(std::string const& type, int count, int min_points, int max_points, T rotation, p_q_settings settings) +{ + if (type == "float") + { + settings.tolerance = 1.0e-3; + test_type(count, min_points, max_points, rotation, settings); + } + else if (type == "double") + { + test_type(count, min_points, max_points, rotation, settings); + } +#if defined(HAVE_TTMATH) + else if (type == "ttmath") + { + test_type(count, min_points, max_points, rotation, settings); + } +#endif +} + +int main(int argc, char** argv) +{ + try + { + namespace po = boost::program_options; + po::options_description description("=== recursive_polygons ===\nAllowed options"); + + int count = 1; + //int seed = static_cast(std::time(0)); + std::string type = "float"; + int min_points = 9; + int max_points = 9; + bool ccw = false; + bool open = false; + double rotation = 1.0e-13; + p_q_settings settings; + + description.add_options() + ("help", "Help message") + //("seed", po::value(&seed), "Initialization seed for random generator") + ("count", po::value(&count)->default_value(1), "Number of tests") + ("diff", po::value(&settings.also_difference)->default_value(false), "Include testing on difference") + ("min_points", po::value(&min_points)->default_value(9), "Minimum number of points") + ("max_points", po::value(&max_points)->default_value(9), "Maximum number of points") + ("rotation", po::value(&rotation)->default_value(1.0e-13), "Rotation angle") + ("ccw", po::value(&ccw)->default_value(false), "Counter clockwise polygons") + ("open", po::value(&open)->default_value(false), "Open polygons") + ("type", po::value(&type)->default_value("float"), "Type (float,double)") + ("wkt", po::value(&settings.wkt)->default_value(false), "Create a WKT of the inputs, for all tests") + ("svg", po::value(&settings.svg)->default_value(false), "Create a SVG for all tests") + ; + + po::variables_map varmap; + po::store(po::parse_command_line(argc, argv, description), varmap); + po::notify(varmap); + + if (varmap.count("help")) + { + std::cout << description << std::endl; + return 1; + } + + test_all(type, count, min_points, max_points, rotation, settings); + } + catch(std::exception const& e) + { + std::cout << "Exception " << e.what() << std::endl; + } + catch(...) + { + std::cout << "Other exception" << std::endl; + } + return 0; +} diff --git a/src/boost/libs/geometry/test/robustness/overlay/areal_areal/intersects.cpp b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/intersects.cpp new file mode 100644 index 000000000..6ad26d22a --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/intersects.cpp @@ -0,0 +1,173 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include +#include +#include +#include + +#define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR +#define BOOST_GEOMETRY_NO_BOOST_TEST +//#define BOOST_GEOMETRY_TIME_OVERLAY + +#include + +#include +#include +#include +#include +#include +#include + + +template +inline void make_polygon(MultiPolygon& mp, int count_x, int count_y, int index, int width_x) +{ + typedef typename bg::point_type::type point_type; + + for(int j = 0; j < count_x; ++j) + { + for(int k = 0; k < count_y; ++k) + { + mp.push_back(typename MultiPolygon::value_type()); + mp.back().outer().push_back(point_type(width_x + j * 10 + 1, k * 10 + 1)); + mp.back().outer().push_back(point_type(width_x + j * 10 + width_x, k * 10 + 5 + index)); + mp.back().outer().push_back(point_type(width_x + j * 10 + 5 + index, k * 10 + 7)); + mp.back().outer().push_back(point_type(width_x + j * 10 + 1, k * 10 + 1)); + } + } +} + + + +template +void test_intersects(int count_x, int count_y, int width_x, p_q_settings const& settings) +{ + MultiPolygon mp; + + make_polygon(mp, count_x, count_y, 0, width_x); + + bool const b = bg::intersects(mp); + if (b) + { + std::cout << " YES"; + } + + if(settings.svg) + { + typedef typename bg::coordinate_type::type coordinate_type; + typedef typename bg::point_type::type point_type; + std::ostringstream filename; + filename << "intersects_" + << string_from_type::name() + << ".svg"; + + std::ofstream svg(filename.str().c_str()); + bg::svg_mapper mapper(svg, 500, 500); + mapper.add(mp); + mapper.map(mp, "fill-opacity:0.5;fill:rgb(153,204,0);" + "stroke:rgb(153,204,0);stroke-width:3"); + } +} + + +template +void test_all(int count, int count_x, int count_y, int width_x, p_q_settings const& settings) +{ + boost::timer t; + + typedef bg::model::polygon + < + bg::model::d2::point_xy, Clockwise, Closed + > polygon; + typedef bg::model::multi_polygon + < + polygon + > multi_polygon; + + + for(int i = 0; i < count; i++) + { + test_intersects(count_x, count_y, width_x, settings); + } + std::cout + << " type: " << string_from_type::name() + << " time: " << t.elapsed() << std::endl; +} + +int main(int argc, char** argv) +{ + try + { + namespace po = boost::program_options; + po::options_description description("=== intersects ===\nAllowed options"); + + int width_x = 7; + int count = 1; + int count_x = 10; + int count_y = 10; + bool ccw = false; + bool open = false; + p_q_settings settings; + + description.add_options() + ("help", "Help message") + ("count", po::value(&count)->default_value(1), "Number of tests") + ("count_x", po::value(&count_x)->default_value(10), "Triangle count in x-direction") + ("count_y", po::value(&count_y)->default_value(10), "Triangle count in y-direction") + ("width_x", po::value(&width_x)->default_value(7), "Width of triangle in x-direction") + ("ccw", po::value(&ccw)->default_value(false), "Counter clockwise polygons") + ("open", po::value(&open)->default_value(false), "Open polygons") + ("wkt", po::value(&settings.wkt)->default_value(false), "Create a WKT of the inputs, for all tests") + ("svg", po::value(&settings.svg)->default_value(false), "Create a SVG for all tests") + ; + + po::variables_map varmap; + po::store(po::parse_command_line(argc, argv, description), varmap); + po::notify(varmap); + + if (varmap.count("help")) + { + std::cout << description << std::endl; + return 1; + } + + if (ccw && open) + { + test_all(count, count_x, count_y, width_x, settings); + } + else if (ccw) + { + test_all(count, count_x, count_y, width_x, settings); + } + else if (open) + { + test_all(count, count_x, count_y, width_x, settings); + } + else + { + test_all(count, count_x, count_y, width_x, settings); + } + +#if defined(HAVE_TTMATH) + // test_all(seed, count, max, svg, level); +#endif + } + catch(std::exception const& e) + { + std::cout << "Exception " << e.what() << std::endl; + } + catch(...) + { + std::cout << "Other exception" << std::endl; + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/robustness/overlay/areal_areal/random_ellipses_stars.cpp b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/random_ellipses_stars.cpp new file mode 100644 index 000000000..f5b930e55 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/random_ellipses_stars.cpp @@ -0,0 +1,251 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2009-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR +#define BOOST_GEOMETRY_NO_BOOST_TEST + + +#include + +#include +#include +#include +#include +#include +#include + + +struct star_params +{ + int count; // points of ellipse, not of star + double factor_1; + double factor_2; + double center_x; + double center_y; + double rotation; + star_params(int c, double f1, double f2, double x, double y, double r = 0) + : count(c) + , factor_1(f1) + , factor_2(f2) + , center_x(x) + , center_y(y) + , rotation(r) + {} +}; + + + +template +inline void make_star(Polygon& polygon, star_params const& p) +{ + typedef typename bg::point_type::type P; + typedef typename bg::select_most_precise + < + typename bg::coordinate_type::type, + long double + >::type coordinate_type; + + // Create star + coordinate_type cx = 25.0; + coordinate_type cy = 25.0; + + coordinate_type dx = 50.0; + coordinate_type dy = 50.0; + + coordinate_type half = 0.5; + coordinate_type two = 2.0; + + coordinate_type a1 = coordinate_type(p.factor_1) * half * dx; + coordinate_type b1 = coordinate_type(p.factor_1) * half * dy; + coordinate_type a2 = coordinate_type(p.factor_2) * half * dx; + coordinate_type b2 = coordinate_type(p.factor_2) * half * dy; + + coordinate_type pi = boost::math::constants::pi(); + coordinate_type delta = pi * two / coordinate_type(p.count - 1); + coordinate_type angle = coordinate_type(p.rotation) * delta; + for (int i = 0; i < p.count - 1; i++, angle += delta) + { + bool even = i % 2 == 0; + coordinate_type s = sin(angle); + coordinate_type c = cos(angle); + coordinate_type x = p.center_x + cx + (even ? a1 : a2) * s; + coordinate_type y = p.center_y + cy + (even ? b1 : b2) * c; + bg::exterior_ring(polygon).push_back(bg::make

(x, y)); + + } + bg::exterior_ring(polygon).push_back(bg::exterior_ring(polygon).front()); + bg::correct(polygon); +} + + +template +void test_star_ellipse(int seed, int index, star_params const& par_p, + star_params const& par_q, p_q_settings const& settings) +{ + typedef bg::model::d2::point_xy point_type; + typedef bg::model::polygon polygon; + + polygon p, q; + make_star(p, par_p); + make_star(q, par_q); + + std::ostringstream out; + out << "rse_" << seed << "_" << index; + test_overlay_p_q(out.str(), p, q, settings); +} + +template +void test_type(int seed, int count, p_q_settings const& settings) +{ + boost::timer t; + + typedef boost::minstd_rand base_generator_type; + + //boost::uniform_real<> random_factor(0.5, 1.2); + //boost::uniform_real<> random_location(-10.0, 10.0); + //boost::uniform_int<> random_points(5, 20); + + // This set (next 4 lines) are now solved for the most part + // 2009-12-03, 3 or 4 errors in 1000000 calls + // 2009-12-07, no errors in 1000000 calls + //boost::uniform_real<> random_factor(1.0 - 1e-3, 1.0 + 1e-3); + //boost::uniform_real<> random_location(-1e-3, 1e-3); + //boost::uniform_real<> random_rotation(-1e-3, 1e-3); + //boost::uniform_int<> random_points(3, 3); + + // 2009-12-08, still errors, see notes + // 2009-12-09, (probably) solved by order on side + // 2010-01-16: solved (no errors in 1000000 calls) + //boost::uniform_real<> random_factor(1.0 - 1e-3, 1.0 + 1e-3); + //boost::uniform_real<> random_location(-1e-3, -1e-3); + //boost::uniform_real<> random_rotation(-1e-3, 1e-3); + //boost::uniform_int<> random_points(3, 4); + + // This set (next 4 lines) are now solved ("distance-zero"/"merge iiii" problem) + // 2009-12-03: 5,50 -> 2:1 000 000 wrong (2009-12-03) + // 2010-01-16: solved (no errors in 10000000 calls) + boost::uniform_real<> random_factor(0.3, 1.2); + boost::uniform_real<> random_location(-20.0, +20.0); // -25.0, +25.0 + boost::uniform_real<> random_rotation(0, 0.5); + boost::uniform_int<> random_points(5, 15); + + base_generator_type generator(seed); + + boost::variate_generator > + factor_generator(generator, random_factor); + + boost::variate_generator > + location_generator(generator, random_location); + + boost::variate_generator > + rotation_generator(generator, random_rotation); + + boost::variate_generator > + int_generator(generator, random_points); + + for(int i = 0; i < count; i++) + { + test_star_ellipse(seed, i + 1, + star_params(int_generator() * 2 + 1, + factor_generator(), factor_generator(), + location_generator(), location_generator(), rotation_generator()), + star_params(int_generator() * 2 + 1, + factor_generator(), factor_generator(), + location_generator(), location_generator(), rotation_generator()), + settings); + } + std::cout + << "type: " << string_from_type::name() + << " time: " << t.elapsed() << std::endl; +} + +template +void test_all(std::string const& type, int seed, int count, p_q_settings settings) +{ + if (type == "float") + { + test_type(seed, count, settings); + } + else if (type == "double") + { + test_type(seed, count, settings); + } +#if defined(HAVE_TTMATH) + else if (type == "ttmath") + { + test_type(seed, count, settings); + } +#endif +} + + +int main(int argc, char** argv) +{ + try + { + namespace po = boost::program_options; + po::options_description description("=== random_ellipses_stars ===\nAllowed options"); + + int count = 1; + int seed = static_cast(std::time(0)); + std::string type = "float"; + bool ccw = false; + bool open = false; + p_q_settings settings; + + description.add_options() + ("help", "Help message") + ("seed", po::value(&seed), "Initialization seed for random generator") + ("count", po::value(&count)->default_value(1), "Number of tests") + ("diff", po::value(&settings.also_difference)->default_value(false), "Include testing on difference") + ("ccw", po::value(&ccw)->default_value(false), "Counter clockwise polygons") + ("open", po::value(&open)->default_value(false), "Open polygons") + ("type", po::value(&type)->default_value("float"), "Type (float,double)") + ("wkt", po::value(&settings.wkt)->default_value(false), "Create a WKT of the inputs, for all tests") + ("svg", po::value(&settings.svg)->default_value(false), "Create a SVG for all tests") + ; + + po::variables_map varmap; + po::store(po::parse_command_line(argc, argv, description), varmap); + po::notify(varmap); + + if (varmap.count("help")) + { + std::cout << description << std::endl; + return 1; + } + + if (ccw && open) + { + test_all(type, seed, count, settings); + } + else if (ccw) + { + test_all(type, seed, count, settings); + } + else if (open) + { + test_all(type, seed, count, settings); + } + else + { + test_all(type, seed, count, settings); + } + } + catch(std::exception const& e) + { + std::cout << "Exception " << e.what() << std::endl; + } + catch(...) + { + std::cout << "Other exception" << std::endl; + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/robustness/overlay/areal_areal/recursive_polygons.cpp b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/recursive_polygons.cpp new file mode 100644 index 000000000..9baf4248b --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/recursive_polygons.cpp @@ -0,0 +1,218 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Robustness Test + +// Copyright (c) 2009-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR +#define BOOST_GEOMETRY_NO_BOOST_TEST + +#include + +#include +#include +#include +#include +#include +#include + + +template +inline void make_polygon(Polygon& polygon, Generator& generator, bool triangular) +{ + typedef typename bg::point_type::type point_type; + typedef typename bg::coordinate_type::type coordinate_type; + + coordinate_type x, y; + x = generator(); + y = generator(); + + typename bg::ring_type::type& ring = bg::exterior_ring(polygon); + + point_type p; + bg::set<0>(p, x); bg::set<1>(p, y); ring.push_back(p); + bg::set<0>(p, x); bg::set<1>(p, y + 1); ring.push_back(p); + bg::set<0>(p, x + 1); bg::set<1>(p, y + 1); ring.push_back(p); + bg::set<0>(p, x + 1); bg::set<1>(p, y); ring.push_back(p); + bg::set<0>(p, x); bg::set<1>(p, y); ring.push_back(p); + + if (triangular) + { + // Remove a point depending on generator + int c = generator() % 4; + if (c >= 1 && c <= 3) + { + ring.erase(ring.begin() + c); + } + } +} + + + +template +bool test_recursive_boxes(MultiPolygon& result, int& index, + Generator& generator, + int level, bool triangular, p_q_settings const& settings) +{ + MultiPolygon p, q; + + // Generate two boxes + if (level == 0) + { + p.resize(1); + q.resize(1); + make_polygon(p.front(), generator, triangular); + make_polygon(q.front(), generator, triangular); + bg::correct(p); + bg::correct(q); + } + else + { + bg::correct(p); + bg::correct(q); + if (! test_recursive_boxes(p, index, generator, level - 1, triangular, settings) + || ! test_recursive_boxes(q, index, generator, level - 1, triangular, settings)) + { + return false; + } + } + + typedef typename boost::range_value::type polygon; + + std::ostringstream out; + out << "recursive_box_" << index++ << "_" << level; + + if (! test_overlay_p_q + < + polygon, + typename bg::coordinate_type::type + >(out.str(), p, q, settings)) + { + return false; + } + + MultiPolygon mp; + bg::detail::union_::union_insert + < + polygon + >(p, q, std::back_inserter(mp)); + + bg::unique(mp); + bg::simplify(mp, result, 0.01); + bg::correct(mp); + return true; +} + + +template +void test_all(int seed, int count, int field_size, int level, bool triangular, p_q_settings const& settings) +{ + boost::timer t; + + typedef boost::minstd_rand base_generator_type; + + base_generator_type generator(seed); + + boost::uniform_int<> random_coordinate(0, field_size - 1); + boost::variate_generator > + coordinate_generator(generator, random_coordinate); + + typedef bg::model::polygon + < + bg::model::d2::point_xy, Clockwise, Closed + > polygon; + typedef bg::model::multi_polygon mp; + + + int index = 0; + for(int i = 0; i < count; i++) + { + mp p; + test_recursive_boxes(p, index, coordinate_generator, level, triangular, settings); + } + std::cout + << "polygons: " << index + << " type: " << string_from_type::name() + << " time: " << t.elapsed() << std::endl; +} + +int main(int argc, char** argv) +{ + try + { + namespace po = boost::program_options; + po::options_description description("=== recursive_polygons ===\nAllowed options"); + + int count = 1; + int seed = static_cast(std::time(0)); + int level = 3; + int field_size = 10; + bool ccw = false; + bool open = false; + p_q_settings settings; + std::string form = "box"; + + description.add_options() + ("help", "Help message") + ("seed", po::value(&seed), "Initialization seed for random generator") + ("count", po::value(&count)->default_value(1), "Number of tests") + ("diff", po::value(&settings.also_difference)->default_value(false), "Include testing on difference") + ("validity", po::value(&settings.validity)->default_value(true), "Include testing on validity") + ("level", po::value(&level)->default_value(3), "Level to reach (higher->slower)") + ("size", po::value(&field_size)->default_value(10), "Size of the field") + ("form", po::value(&form)->default_value("box"), "Form of the polygons (box, triangle)") + ("ccw", po::value(&ccw)->default_value(false), "Counter clockwise polygons") + ("open", po::value(&open)->default_value(false), "Open polygons") + ("wkt", po::value(&settings.wkt)->default_value(false), "Create a WKT of the inputs, for all tests") + ("svg", po::value(&settings.svg)->default_value(false), "Create a SVG for all tests") + ; + + po::variables_map varmap; + po::store(po::parse_command_line(argc, argv, description), varmap); + po::notify(varmap); + + if (varmap.count("help") + || (form != "box" && form != "triangle")) + { + std::cout << description << std::endl; + return 1; + } + + bool triangular = form != "box"; + + + if (ccw && open) + { + test_all(seed, count, field_size, level, triangular, settings); + } + else if (ccw) + { + test_all(seed, count, field_size, level, triangular, settings); + } + else if (open) + { + test_all(seed, count, field_size, level, triangular, settings); + } + else + { + test_all(seed, count, field_size, level, triangular, settings); + } + +#if defined(HAVE_TTMATH) + // test_all(seed, count, max, svg, level); +#endif + } + catch(std::exception const& e) + { + std::cout << "Exception " << e.what() << std::endl; + } + catch(...) + { + std::cout << "Other exception" << std::endl; + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/robustness/overlay/areal_areal/star_comb.cpp b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/star_comb.cpp new file mode 100644 index 000000000..40bec4052 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/star_comb.cpp @@ -0,0 +1,144 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2009-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + + +// #define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR +#define BOOST_GEOMETRY_NO_BOOST_TEST +// #define BOOST_GEOMETRY_TIME_OVERLAY + + +#include + +#include +#include +#include +#include +#include +#include + +#include + + +template +void add(Polygon& polygon, double x, double y, int) +{ + typedef typename boost::geometry::point_type::type p; + boost::geometry::exterior_ring(polygon).push_back(boost::geometry::make

(x, y)); +} + + +template +void test_star_comb(int star_point_count, int comb_comb_count, double factor1, double factor2, bool do_union, p_q_settings const& settings) +{ + Polygon star, comb; + make_star(star, add, star_point_count, factor1, factor2); + make_comb(comb, add, comb_comb_count); + + std::ostringstream out; + out << "star_comb"; + test_overlay_p_q + < + Polygon, + typename bg::coordinate_type::type + >(out.str(), star, comb, settings); +} + + +template +void test_all(int count, int star_point_count, int comb_comb_count, double factor1, double factor2, bool do_union, p_q_settings const& settings) +{ + boost::timer t; + + typedef bg::model::polygon + < + bg::model::d2::point_xy, Clockwise, Closed + > polygon; + + for(int i = 0; i < count; i++) + { + test_star_comb(star_point_count, comb_comb_count, factor1, factor2, do_union, settings); + } + std::cout + << " type: " << string_from_type::name() + << " time: " << t.elapsed() << std::endl; +} + +int main(int argc, char** argv) +{ + try + { + namespace po = boost::program_options; + po::options_description description("=== star_comb ===\nAllowed options"); + + int count = 1; + bool do_union = false; + bool ccw = false; + bool open = false; + double factor1 = 1.1; + double factor2 = 0.2; + int point_count = 50; + p_q_settings settings; + + description.add_options() + ("help", "Help message") + ("count", po::value(&count)->default_value(1), "Number of tests") + ("point_count", po::value(&point_count)->default_value(1), "Number of points in the star") + ("diff", po::value(&settings.also_difference)->default_value(false), "Include testing on difference") + ("ccw", po::value(&ccw)->default_value(false), "Counter clockwise polygons") + ("open", po::value(&open)->default_value(false), "Open polygons") + ("wkt", po::value(&settings.wkt)->default_value(false), "Create a WKT of the inputs, for all tests") + ("svg", po::value(&settings.svg)->default_value(false), "Create a SVG for all tests") + ; + + po::variables_map varmap; + po::store(po::parse_command_line(argc, argv, description), varmap); + po::notify(varmap); + + if (varmap.count("help")) + { + std::cout << description << std::endl; + return 1; + } + + int star_point_count = point_count * 2 + 1; + int comb_comb_count = point_count; + + + if (ccw && open) + { + test_all(count, star_point_count, comb_comb_count, factor1, factor2, do_union, settings); + } + else if (ccw) + { + test_all(count, star_point_count, comb_comb_count, factor1, factor2, do_union, settings); + } + else if (open) + { + test_all(count, star_point_count, comb_comb_count, factor1, factor2, do_union, settings); + } + else + { + test_all(count, star_point_count, comb_comb_count, factor1, factor2, do_union, settings); + } + +#if defined(HAVE_TTMATH) + // test_all(seed, count, max, svg, level); +#endif + } + catch(std::exception const& e) + { + std::cout << "Exception " << e.what() << std::endl; + } + catch(...) + { + std::cout << "Other exception" << std::endl; + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/robustness/overlay/areal_areal/star_comb.hpp b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/star_comb.hpp new file mode 100644 index 000000000..7019a26d5 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/star_comb.hpp @@ -0,0 +1,130 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2009-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#ifndef BOOST_GEOMETRY_STAR_COMB_HPP +#define BOOST_GEOMETRY_STAR_COMB_HPP + +#include +#include +#include + +#include +#include +#include + +#include + + +template +inline void make_star(Polygon& polygon, AddFunctor functor, + int count, double factor1, double factor2, + double offset = 0.0, + bool close = true, + double orientation = 1.0) +{ + // Create star + double cx = 25.0; + double cy = 25.0; + + double dx = 50.0; + double dy = 50.0; + + double a1 = factor1 * 0.5 * dx; + double b1 = factor1 * 0.5 * dy; + double a2 = factor2 * 0.5 * dx; + double b2 = factor2 * 0.5 * dy; + + double delta = orientation * boost::math::constants::pi() * 2.0 / (count - 1); + double angle = offset * delta; + double x0, y0; + bool first = true; + for (int i = 0; i < count - 1; i++, angle += delta) + { + bool even = i % 2 == 0; + double x = cx + (even ? a1 : a2) * sin(angle); + double y = cy + (even ? b1 : b2) * cos(angle); + functor(polygon, x, y, i); + if (first) + { + x0 = x; + y0 = y; + first = false; + } + + } + if (close) + { + functor(polygon, x0, y0, count); + } +} + +template +void ccw_pushback(Vector& vector, double x, double y, int) +{ + vector.push_back(boost::make_tuple(x, y)); +} + +template +inline void make_comb(Polygon& polygon, AddFunctor functor, + int count, + bool close = true, + bool clockwise = true) +{ + int n = 0; + + if (! clockwise) + { + typedef boost::tuple tup; + typedef std::vector vector_type; + vector_type vec; + + // Create in clockwise order + make_comb(vec, ccw_pushback, count, close, true); + + // Add in reverse + // (For GCC 3.4 have it const) + vector_type const& v = vec; + for (vector_type::const_reverse_iterator + it = v.rbegin(); it != v.rend(); ++it) + { + functor(polygon, it->get<0>(), it->get<1>(), n++); + } + return; + } + + // Create comb + functor(polygon, 25.0, 0.0, n++); + functor(polygon, 0.0, 25.0, n++); + functor(polygon, 25.0, 50.0, n++); + + // Function parameters + double diff = (25.0 / (count - 0.5)) / 2.0; + + double b1 = -25.0; + double b2 = 25.0 - diff * 2.0; + + double x1 = 50.0, x2 = 25.0; + + for (int i = 0; i < count - 1; i++) + { + functor(polygon, x1, (x1 + b1), n++); x1 -= diff; + functor(polygon, x1, (x1 + b1), n++); x1 -= diff; + functor(polygon, x2, (x2 + b2), n++); x2 -= diff; + functor(polygon, x2, (x2 + b2), n++); x2 -= diff; + } + functor(polygon, x1, (x1 + b1), n++); + + if (close) + { + functor(polygon, 25.0, 0.0, 4); + } +} + + +#endif // BOOST_GEOMETRY_STAR_COMB_HPP + diff --git a/src/boost/libs/geometry/test/robustness/overlay/areal_areal/test_overlay_p_q.hpp b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/test_overlay_p_q.hpp new file mode 100644 index 000000000..ac9ffa3e3 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/test_overlay_p_q.hpp @@ -0,0 +1,293 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test +// +// Copyright (c) 2009-2015 Barend Gehrels, Amsterdam, the Netherlands. +// 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) + +#ifndef BOOST_GEOMETRY_TEST_OVERLAY_P_Q_HPP +#define BOOST_GEOMETRY_TEST_OVERLAY_P_Q_HPP + +#include +#include +#include +#include + +#include + +//#define BOOST_GEOMETRY_ROBUSTNESS_USE_DIFFERENCE + +#include + +// For mixing int/float +#if defined(_MSC_VER) +#pragma warning( disable : 4244 ) +#pragma warning( disable : 4267 ) +#endif + + +#include +#include +#include +#include + +#include +#include +#include +#include + +struct p_q_settings +{ + bool svg; + bool also_difference; + bool validity; + bool wkt; + bool verify_area; + double tolerance; + + p_q_settings() + : svg(false) + , also_difference(false) + , validity(false) + , wkt(false) + , verify_area(false) + , tolerance(1.0e-3) // since rescaling to integer the tolerance should be less. Was originally 1.0e-6 + {} +}; + +template +inline typename bg::default_area_result::type p_q_area(Geometry const& g) +{ + try + { + return bg::area(g); + } + catch(bg::empty_input_exception const&) + { + return 0; + } +} + +struct verify_area +{ + template + static inline bool check_ring(Iterator begin, Iterator end) + { + for (Iterator it = begin; it != end; ++it) + { + double const area = bg::area(*it); + if (fabs(area) < 0.01) + { + return false; + } + } + return true; + } + + template + static inline bool check_rings(Interiors const& rings) + { + return check_ring(boost::begin(rings), boost::end(rings)); + } + + template + static inline bool check_polys(Iterator begin, Iterator end) + { + for (Iterator it = begin; it != end; ++it) + { + // If necessary, exterior_ring can be checked too + if (! check_rings(bg::interior_rings(*it))) + { + return false; + } + } + return true; + } + + template + static inline bool apply(Geometry const& g) + { + return check_polys(boost::begin(g), boost::end(g)); + } +}; + +template +static bool test_overlay_p_q(std::string const& caseid, + G1 const& p, G2 const& q, + p_q_settings const& settings) +{ + bool result = true; + + typedef typename bg::coordinate_type::type coordinate_type; + typedef typename bg::point_type::type point_type; + + bg::model::multi_polygon out_i, out_u, out_d1, out_d2; + + CalculationType area_p = p_q_area(p); + CalculationType area_q = p_q_area(q); + CalculationType area_d1 = 0, area_d2 = 0; + + bg::intersection(p, q, out_i); + CalculationType area_i = p_q_area(out_i); + + bg::union_(p, q, out_u); + CalculationType area_u = p_q_area(out_u); + + double sum = (area_p + area_q) - area_u - area_i; + + bool wrong = std::abs(sum) > settings.tolerance; + + if (settings.also_difference) + { + bg::difference(p, q, out_d1); + bg::difference(q, p, out_d2); + area_d1 = p_q_area(out_d1); + area_d2 = p_q_area(out_d2); + double sum_d1 = (area_u - area_q) - area_d1; + double sum_d2 = (area_u - area_p) - area_d2; + bool wrong_d1 = std::abs(sum_d1) > settings.tolerance; + bool wrong_d2 = std::abs(sum_d2) > settings.tolerance; + + if (wrong_d1 || wrong_d2) + { + wrong = true; + } + } + + if (settings.validity) + { + std::string message; + if (! bg::is_valid(out_u, message)) + { + std::cout << "Union is not valid: " << message << std::endl; + wrong = true; + } + if (! bg::is_valid(out_i, message)) + { + std::cout << "Intersection is not valid: " << message << std::endl; + wrong = true; + } + if (settings.also_difference) + { + if (! bg::is_valid(out_d1, message)) + { + std::cout << "Difference (p-q) is not valid: " << message << std::endl; + wrong = true; + } + if (! bg::is_valid(out_d2, message)) + { + std::cout << "Difference (q-p) is not valid: " << message << std::endl; + wrong = true; + } + } + + if (settings.verify_area && ! verify_area::apply(out_u)) + { + std::cout << "Union/interior area incorrect" << std::endl; + wrong = true; + } + if (settings.verify_area && ! verify_area::apply(out_i)) + { + std::cout << "Intersection/interior area incorrect" << std::endl; + wrong = true; + } + } + + if (true) + { + if ((area_i > 0 && bg::touches(p, q)) + || (area_i <= 0 && bg::intersects(p, q) && ! bg::touches(p, q))) + { + std::cout << "Wrong 'touch'! " + << " Intersection area: " << area_i + << " Touch gives: " << std::boolalpha << bg::touches(p, q) + << std::endl; + wrong = true; + } + } + + bool svg = settings.svg; + + if (wrong || settings.wkt) + { + if (wrong) + { + result = false; + svg = true; + } + bg::unique(out_i); + bg::unique(out_u); + + std::cout + << "type: " << string_from_type::name() + << " id: " << caseid + << " area i: " << area_i + << " area u: " << area_u + << " area p: " << area_p + << " area q: " << area_q + << " sum: " << sum; + + if (settings.also_difference) + { + std::cout + << " area d1: " << area_d1 + << " area d2: " << area_d2; + } + std::cout + << std::endl + << std::setprecision(9) + << " p: " << bg::wkt(p) << std::endl + << " q: " << bg::wkt(q) << std::endl + << " i: " << bg::wkt(out_i) << std::endl + << " u: " << bg::wkt(out_u) << std::endl + ; + + } + + if(svg) + { + std::ostringstream filename; + filename << "overlay_" << caseid << "_" + << string_from_type::name() + << string_from_type::name() + << ".svg"; + + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 500, 500); + + mapper.add(p); + mapper.add(q); + + // Input shapes in green/blue + mapper.map(p, "fill-opacity:0.5;fill:rgb(153,204,0);" + "stroke:rgb(153,204,0);stroke-width:3"); + mapper.map(q, "fill-opacity:0.3;fill:rgb(51,51,153);" + "stroke:rgb(51,51,153);stroke-width:3"); + + if (settings.also_difference) + { + for (BOOST_AUTO(it, out_d1.begin()); it != out_d1.end(); ++it) + { + mapper.map(*it, + "opacity:0.8;fill:none;stroke:rgb(255,128,0);stroke-width:4;stroke-dasharray:1,7;stroke-linecap:round"); + } + for (BOOST_AUTO(it, out_d2.begin()); it != out_d2.end(); ++it) + { + mapper.map(*it, + "opacity:0.8;fill:none;stroke:rgb(255,0,255);stroke-width:4;stroke-dasharray:1,7;stroke-linecap:round"); + } + } + else + { + mapper.map(out_i, "fill-opacity:0.1;stroke-opacity:0.4;fill:rgb(255,0,128);" + "stroke:rgb(255,0,0);stroke-width:4"); + mapper.map(out_u, "fill-opacity:0.1;stroke-opacity:0.4;fill:rgb(255,0,0);" + "stroke:rgb(255,0,255);stroke-width:4"); + } + } + return result; +} + +#endif // BOOST_GEOMETRY_TEST_OVERLAY_P_Q_HPP diff --git a/src/boost/libs/geometry/test/robustness/overlay/areal_areal/ticket_9081.cpp b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/ticket_9081.cpp new file mode 100644 index 000000000..91f336c6f --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/areal_areal/ticket_9081.cpp @@ -0,0 +1,239 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) // Robustness Test + +// Copyright (c) 2013-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +// Adapted from: the attachment of ticket 9081 + +#define CHECK_SELF_INTERSECTIONS +#define LIST_WKT + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + +#include +#include +#include +#include +#include + + +typedef boost::geometry::model::d2::point_xy pt; +typedef boost::geometry::model::polygon polygon; +typedef boost::geometry::model::segment segment; +typedef boost::geometry::model::multi_polygon multi_polygon; + +template +inline void debug_with_svg(int index, char method, Geometry const& a, Geometry const& b, std::string const& headera, std::string const& headerb) +{ + multi_polygon output; + try + { + switch(method) + { + case 'i': boost::geometry::intersection(a, b, output); break; + case 'u': boost::geometry::union_(a, b, output); break; + case 'd': boost::geometry::difference(a, b, output); break; + case 'v': boost::geometry::difference(b, a, output); break; + default : return; + } + } + catch(...) + {} + + std::ostringstream filename; + filename << "ticket_9081_" << method << "_" << (1000000 + index) << ".svg"; + std::ofstream svg(filename.str().c_str()); + + boost::geometry::svg_mapper mapper(svg, 400, 400); + mapper.add(a); + mapper.add(b); + + mapper.map(a, "fill-opacity:0.5;fill:rgb(153,204,0);stroke:rgb(153,204,0);stroke-width:2"); + mapper.map(b, "fill-opacity:0.3;fill:rgb(51,51,153);stroke:rgb(51,51,153);stroke-width:2"); + BOOST_FOREACH(polygon const& g, output) + { + mapper.map(g, "opacity:0.8;fill:none;stroke:rgb(255,128,0);stroke-width:4;stroke-dasharray:1,7;stroke-linecap:round"); + } + + std::ostringstream out; + out << headera << std::endl << headerb; + mapper.map(boost::geometry::return_centroid(a), "fill:rgb(152,204,0);stroke:rgb(153,204,0);stroke-width:0.1", 3); + mapper.map(boost::geometry::return_centroid(b), "fill:rgb(51,51,153);stroke:rgb(153,204,0);stroke-width:0.1", 3); + mapper.text(boost::geometry::return_centroid(a), headera, "fill:rgb(0,0,0);font-family:Arial;font-size:10px"); + mapper.text(boost::geometry::return_centroid(b), headerb, "fill:rgb(0,0,0);font-family:Arial;font-size:10px"); +} + +int main() +{ + int num_orig = 50; + int num_rounds = 30000; + srand(1234); + std::cout << std::setprecision(16); + std::map genesis; + int pj; + + + std::string wkt1, wkt2, operation; + + try + { + + + boost::timer t; + std::vector poly_list; + + for(int i=0;i 0) + { + std::ostringstream out; + out << j << " intersection(" << genesis[a] << " , " << genesis[b] << ")"; + genesis[poly_list.size()] = out.str(); + poly_list.push_back(mp_i); + } + if(boost::geometry::area(mp_d) > 0) + { + std::ostringstream out; + out << j << " difference(" << genesis[a] << " - " << genesis[b] << ")"; + genesis[poly_list.size()] = out.str(); + poly_list.push_back(mp_d); + } + if(boost::geometry::area(mp_e) > 0) + { + std::ostringstream out; + out << j << " difference(" << genesis[b] << " - " << genesis[a] << ")"; + genesis[poly_list.size()] = out.str(); + poly_list.push_back(mp_e); + } + } + + std::cout << "FINISHED " << t.elapsed() << std::endl; + + } + catch(std::exception const& e) + { + std::cout << e.what() + << " in " << operation << " at " << pj << std::endl + << wkt1 << std::endl + << wkt2 << std::endl + << std::endl; + } + catch(...) + { + std::cout << "Other exception" << std::endl; + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/robustness/overlay/buffer/Jamfile b/src/boost/libs/geometry/test/robustness/overlay/buffer/Jamfile new file mode 100644 index 000000000..f724fcf8c --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/buffer/Jamfile @@ -0,0 +1,19 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# Robustness Test - overlay - buffer +# +# Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands. + +# 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) + + +project recursive_polygons_buffer + : requirements + . + ../.. + ../../../../../program_options/build//boost_program_options + static + ; + +exe recursive_polygons_buffer : recursive_polygons_buffer.cpp ; diff --git a/src/boost/libs/geometry/test/robustness/overlay/buffer/many_ring_buffer.cpp b/src/boost/libs/geometry/test/robustness/overlay/buffer/many_ring_buffer.cpp new file mode 100644 index 000000000..1fd54c23f --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/buffer/many_ring_buffer.cpp @@ -0,0 +1,301 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#define BOOST_GEOMETRY_BUFFER_TEST_SVG_USE_ALTERNATE_BOX_FOR_INPUT +#define BOOST_GEOMETRY_BUFFER_TEST_SVG_ALTERNATE_BOX "BOX(179 4, 180 5)" + + +#include + +#include +#include + +#include +#include +#include +#include + + + +const int point_count = 90; // points for a full circle + +// Function to let buffer-distance depend on alpha, e.g.: +inline double corrected_distance(double distance, double alpha) +{ + return distance * 1.0 + 0.2 * sin(alpha * 6.0); +} + +class buffer_point_strategy_sample +{ +public : + + template + < + typename Point, + typename OutputRange, + typename DistanceStrategy + > + void apply(Point const& point, + DistanceStrategy const& distance_strategy, + OutputRange& output_range) const + { + double const distance = distance_strategy.apply(point, point, + bg::strategy::buffer::buffer_side_left); + + double const angle_increment = 2.0 * M_PI / double(point_count); + + double alpha = 0; + for (std::size_t i = 0; i <= point_count; i++, alpha -= angle_increment) + { + double const cd = corrected_distance(distance, alpha); + + typename boost::range_value::type output_point; + bg::set<0>(output_point, bg::get<0>(point) + cd * cos(alpha)); + bg::set<1>(output_point, bg::get<1>(point) + cd * sin(alpha)); + output_range.push_back(output_point); + } + } +}; + +class buffer_join_strategy_sample +{ +private : + template + < + typename Point, + typename DistanceType, + typename RangeOut + > + inline void generate_points(Point const& vertex, + Point const& perp1, Point const& perp2, + DistanceType const& buffer_distance, + RangeOut& range_out) const + { + double dx1 = bg::get<0>(perp1) - bg::get<0>(vertex); + double dy1 = bg::get<1>(perp1) - bg::get<1>(vertex); + double dx2 = bg::get<0>(perp2) - bg::get<0>(vertex); + double dy2 = bg::get<1>(perp2) - bg::get<1>(vertex); + + // Assuming the corner is convex, angle2 < angle1 + double const angle1 = atan2(dy1, dx1); + double angle2 = atan2(dy2, dx2); + + while (angle2 > angle1) + { + angle2 -= 2 * M_PI; + } + + double const angle_increment = 2.0 * M_PI / double(point_count); + double alpha = angle1 - angle_increment; + + for (int i = 0; alpha >= angle2 && i < point_count; i++, alpha -= angle_increment) + { + double cd = corrected_distance(buffer_distance, alpha); + + Point p; + bg::set<0>(p, bg::get<0>(vertex) + cd * cos(alpha)); + bg::set<1>(p, bg::get<1>(vertex) + cd * sin(alpha)); + range_out.push_back(p); + } + } + +public : + + template + inline bool apply(Point const& ip, Point const& vertex, + Point const& perp1, Point const& perp2, + DistanceType const& buffer_distance, + RangeOut& range_out) const + { + generate_points(vertex, perp1, perp2, buffer_distance, range_out); + return true; + } + + template + static inline NumericType max_distance(NumericType const& distance) + { + return distance; + } + +}; + +class buffer_side_sample +{ +public : + template + < + typename Point, + typename OutputRange, + typename DistanceStrategy + > + static inline void apply( + Point const& input_p1, Point const& input_p2, + bg::strategy::buffer::buffer_side_selector side, + DistanceStrategy const& distance, + OutputRange& output_range) + { + // Generate a block along (left or right of) the segment + + double const dx = bg::get<0>(input_p2) - bg::get<0>(input_p1); + double const dy = bg::get<1>(input_p2) - bg::get<1>(input_p1); + + // For normalization [0,1] (=dot product d.d, sqrt) + double const length = bg::math::sqrt(dx * dx + dy * dy); + + if (bg::math::equals(length, 0)) + { + return; + } + + // Generate the normalized perpendicular p, to the left (ccw) + double const px = -dy / length; + double const py = dx / length; + + // Both vectors perpendicular to input p1 and input p2 have same angle + double const alpha = atan2(py, px); + + double const d = distance.apply(input_p1, input_p2, side); + + double const cd = corrected_distance(d, alpha); + + output_range.resize(2); + + bg::set<0>(output_range.front(), bg::get<0>(input_p1) + px * cd); + bg::set<1>(output_range.front(), bg::get<1>(input_p1) + py * cd); + bg::set<0>(output_range.back(), bg::get<0>(input_p2) + px * cd); + bg::set<1>(output_range.back(), bg::get<1>(input_p2) + py * cd); + } +}; + +#ifdef TEST_WITH_SVG +template +void create_svg(std::string const& filename, Geometry1 const& original, Geometry2 const& buffer, std::string const& color) +{ + typedef typename bg::point_type::type point_type; + std::ofstream svg(filename.c_str()); + + bg::svg_mapper mapper(svg, 800, 800); + mapper.add(buffer); + + mapper.map(original, "fill-opacity:0.3;fill:rgb(255,0,0);stroke:rgb(0,0,0);stroke-width:1"); + + std::string style = "fill-opacity:0.3;fill:"; + style += color; + style += ";stroke:rgb(0,0,0);stroke-width:1"; + mapper.map(buffer, style); +} +#endif + + +void test_many_rings(int imn, int jmx, int count, + double expected_area_exterior, + double expected_area_interior) +{ + typedef bg::model::point point; + typedef bg::model::polygon polygon_type; + typedef bg::model::multi_polygon multi_polygon_type; + + // Predefined strategies + bg::strategy::buffer::distance_symmetric distance_strategy(1.3); + bg::strategy::buffer::end_flat end_strategy; // not effectively used + + // Own strategies + buffer_join_strategy_sample join_strategy; + buffer_point_strategy_sample point_strategy; + buffer_side_sample side_strategy; + + // Declare output + + bg::model::multi_point mp; + + // Use a bit of random disturbance in the otherwise too regular grid + typedef boost::minstd_rand base_generator_type; + base_generator_type generator(12345); + boost::uniform_real<> random_range(0.0, 0.5); + boost::variate_generator + < + base_generator_type&, + boost::uniform_real<> + > random(generator, random_range); + + for (int i = 0; i < count; i++) + { + for (int j = 0; j < count; j++) + { + double x = i * 3.0 + random(); + double y = j * 3.0 + random(); + //if (i > 30 && j < 30) + if (i > imn && j < jmx) + { + point p(x, y); + mp.push_back(p); + } + } + } + + multi_polygon_type many_rings; + // Create the buffer of a multi-point + bg::buffer(mp, many_rings, + distance_strategy, side_strategy, + join_strategy, end_strategy, point_strategy); + + bg::model::box envelope; + bg::envelope(many_rings, envelope); + bg::buffer(envelope, envelope, 1.0); + + multi_polygon_type many_interiors; + bg::difference(envelope, many_rings, many_interiors); + +#ifdef TEST_WITH_SVG + create_svg("/tmp/many_interiors.svg", mp, many_interiors, "rgb(51,51,153)"); + create_svg("/tmp/buffer.svg", mp, many_rings, "rgb(51,51,153)"); +#endif + + bg::strategy::buffer::join_round join_round(100); + bg::strategy::buffer::end_flat end_flat; + + { + std::ostringstream out; + out << "many_rings_" << count; + out << "_" << imn << "_" << jmx; + std::ostringstream wkt; + wkt << std::setprecision(12) << bg::wkt(many_rings); + + boost::timer t; + test_one(out.str(), wkt.str(), join_round, end_flat, expected_area_exterior, 0.3); + std::cout << "Exterior " << count << " " << t.elapsed() << std::endl; + } + + return; + { + std::ostringstream out; + out << "many_interiors_" << count; + std::ostringstream wkt; + wkt << std::setprecision(12) << bg::wkt(many_interiors); + + boost::timer t; + test_one(out.str(), wkt.str(), join_round, end_flat, expected_area_interior, 0.3); + std::cout << "Interior " << count << " " << t.elapsed() << std::endl; + } +} + +int test_main(int, char* []) +{ +// test_many_rings(10, 795.70334, 806.7609); +// test_many_rings(30, 7136.7098, 6174.4496); + test_many_rings(30, 30, 70, 38764.2721, 31910.3280); +// for (int i = 30; i < 60; i++) +// { +// for (int j = 5; j <= 30; j++) +// { +// test_many_rings(i, j, 70, 38764.2721, 31910.3280); +// } +// } + return 0; +} diff --git a/src/boost/libs/geometry/test/robustness/overlay/buffer/multi_point_growth.cpp b/src/boost/libs/geometry/test/robustness/overlay/buffer/multi_point_growth.cpp new file mode 100644 index 000000000..4aed939cf --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/buffer/multi_point_growth.cpp @@ -0,0 +1,139 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Performance Test + +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#include +#include + +#include +#include +#include + + +namespace bg = boost::geometry; + +template +< + typename GeometryOut, + typename Geometry +> +double test_growth(Geometry const& geometry, int n, int d, double distance) +{ + + typedef typename bg::coordinate_type::type coordinate_type; + typedef typename bg::point_type::type point_type; + + // extern int point_buffer_count; + std::ostringstream complete; + complete + << "point_growth" + << "_" << "r" + << "_" << n + << "_" << d + // << "_" << point_buffer_count + ; + + //std::cout << complete.str() << std::endl; + + std::ostringstream filename; + filename << "buffer_" << complete.str() << ".svg"; + + std::ofstream svg(filename.str().c_str()); + +#ifdef BOOST_GEOMETRY_DEBUG_WITH_MAPPER + bg::svg_mapper mapper(svg, 500, 500); + + { + bg::model::box box; + bg::envelope(geometry, box); + + bg::buffer(box, box, distance * 1.01); + mapper.add(box); + } +#endif + + bg::strategy::buffer::join_round join_strategy(100); + bg::strategy::buffer::end_flat end_strategy; + bg::strategy::buffer::point_circle point_strategy; + bg::strategy::buffer::side_straight side_strategy; + + typedef bg::strategy::buffer::distance_symmetric distance_strategy_type; + distance_strategy_type distance_strategy(distance); + + std::vector buffered; + + bg::buffer(geometry, buffered, + distance_strategy, side_strategy, + join_strategy, end_strategy, point_strategy); + + + typename bg::default_area_result::type area = 0; + BOOST_FOREACH(GeometryOut const& polygon, buffered) + { + area += bg::area(polygon); + } + +#ifdef BOOST_GEOMETRY_DEBUG_WITH_MAPPER + // Map input geometry in green + mapper.map(geometry, "opacity:0.5;fill:rgb(0,128,0);stroke:rgb(0,128,0);stroke-width:10"); + + BOOST_FOREACH(GeometryOut const& polygon, buffered) + { + mapper.map(polygon, "opacity:0.4;fill:rgb(255,255,128);stroke:rgb(0,0,0);stroke-width:3"); + } +#endif + + return area; +} + +template +void test_growth(int n, int distance_count) +{ + srand(int(time(NULL))); + //std::cout << typeid(bg::coordinate_type

::type).name() << std::endl; + boost::timer t; + + namespace buf = bg::strategy::buffer; + typedef bg::model::polygon

polygon; + typedef bg::model::multi_point

multi_point_type; + + multi_point_type multi_point; + for (int i = 0; i < n; i++) + { + P point(rand() % 100, rand() % 100); + multi_point.push_back(point); + } + + //std::cout << bg::wkt(multi_point) << std::endl; + + double previous_area = 0; + double epsilon = 0.1; + double distance = 15.0; + for (int d = 0; d < distance_count; d++, distance += epsilon) + { + double area = test_growth(multi_point, n, d, distance); + if (area < previous_area) + { + std::cout << "Error: " << area << " < " << previous_area << std::endl + << " n=" << n << " distance=" << distance + << bg::wkt(multi_point) << std::endl; + } + previous_area = area; + } + std::cout << "n=" << n << " time=" << t.elapsed() << std::endl; +} + +int main(int, char* []) +{ + for (int i = 5; i <= 50; i++) + { + test_growth >(i, 20); + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp b/src/boost/libs/geometry/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp new file mode 100644 index 000000000..cd7f57ac2 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp @@ -0,0 +1,362 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Robustness Test + +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2015. +// Modifications copyright (c) 2015 Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, 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) + +#if defined(_MSC_VER) +# pragma warning( disable : 4244 ) +# pragma warning( disable : 4267 ) +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#include +#include + + +struct buffer_settings : public common_settings +{ + int join_code; + double distance; +}; + +namespace bg = boost::geometry; + +template +void create_svg(std::string const& filename + , Geometry1 const& mp + , Geometry2 const& buffer + ) +{ + typedef typename boost::geometry::point_type::type point_type; + + + std::ofstream svg(filename.c_str()); + boost::geometry::svg_mapper mapper(svg, 800, 800); + + boost::geometry::model::box box; + bg::envelope(mp, box); + bg::buffer(box, box, 1.0); + mapper.add(box); + + if (! bg::is_empty(buffer)) + { + bg::envelope(buffer, box); + bg::buffer(box, box, 1.0); + mapper.add(box); + } + + mapper.map(mp, "fill-opacity:0.5;fill:rgb(153,204,0);stroke:rgb(153,204,0);stroke-width:3"); + mapper.map(buffer, "stroke-opacity:0.9;stroke:rgb(0,0,0);fill:none;stroke-width:1"); + + //mapper.map(intersection,"opacity:0.6;stroke:rgb(0,128,0);stroke-width:5"); +} + + + + +template +bool verify(std::string const& caseid, MultiPolygon const& mp, MultiPolygon const& buffer, Settings const& settings) +{ + bool result = true; + + // Area of buffer must be larger than of original polygon + double area_mp = bg::area(mp); + double area_buf = bg::area(buffer); + + if (area_buf < area_mp) + { + result = false; + } + + if (result) + { + typedef typename boost::range_value::type polygon_type; + BOOST_FOREACH(polygon_type const& polygon, mp) + { + typename bg::point_type::type point; + bg::point_on_border(point, polygon); + if (! bg::within(point, buffer)) + { + result = false; + } + } + } + + if (result) + { + std::string message; + if (! bg::is_valid(buffer, message)) + { + std::cout << "Buffer is not valid: " << message << std::endl; + result = false; + } + } + + bool svg = settings.svg; + bool wkt = settings.wkt; + if (! result) + { + std::cout << "ERROR " << caseid << std::endl; + //std::cout << bg::wkt(mp) << std::endl; + //std::cout << bg::wkt(buffer) << std::endl; + svg = true; + wkt = true; + } + + if (svg || wkt) + { + //std::cout << caseid << std::endl; + } + + if (svg) + { + std::ostringstream filename; + filename << caseid << "_" + << typeid(typename bg::coordinate_type::type).name() + << ".svg"; + create_svg(filename.str(), mp, buffer); + } + + if (wkt) + { + std::ostringstream filename; + filename << caseid << "_" + << typeid(typename bg::coordinate_type::type).name() + << ".wkt"; + std::ofstream stream(filename.str().c_str()); + stream << bg::wkt(mp) << std::endl; + stream << bg::wkt(buffer) << std::endl; + } + + return result; +} + +template +bool test_buffer(MultiPolygon& result, int& index, + Generator& generator, + int level, Settings const& settings) +{ + MultiPolygon p, q; + + // Generate two boxes + if (level == 0) + { + p.resize(1); + q.resize(1); + make_square_polygon(p.front(), generator, settings); + make_square_polygon(q.front(), generator, settings); + bg::correct(p); + bg::correct(q); + } + else + { + bg::correct(p); + bg::correct(q); + if (! test_buffer(p, index, generator, level - 1, settings) + || ! test_buffer(q, index, generator, level - 1, settings)) + { + return false; + } + } + + typedef typename boost::range_value::type polygon; + + MultiPolygon mp; + bg::detail::union_::union_insert + < + polygon + >(p, q, std::back_inserter(mp)); + + bg::unique(mp); + bg::unique(mp); + bg::correct(mp); + result = mp; + + + typedef typename bg::coordinate_type::type coordinate_type; + typedef bg::strategy::buffer::distance_asymmetric distance_strategy_type; + distance_strategy_type distance_strategy(settings.distance, settings.distance); + + MultiPolygon buffered; + + std::ostringstream out; + out << "recursive_polygons_buffer_" << index++ << "_" << level; + + bg::strategy::buffer::end_round end_strategy; + bg::strategy::buffer::point_circle point_strategy; + bg::strategy::buffer::side_straight side_strategy; + bg::strategy::buffer::join_round join_round_strategy(32); // Compatible with MySQL + bg::strategy::buffer::join_miter join_miter_strategy; + + try + { + switch(settings.join_code) + { + case 1 : + bg::buffer(mp, buffered, + distance_strategy, side_strategy, + join_round_strategy, + end_strategy, point_strategy); + break; + case 2 : + bg::buffer(mp, buffered, + distance_strategy, side_strategy, + join_miter_strategy, + end_strategy, point_strategy); + break; + default : + return false; + } + } + catch(std::exception const& e) + { + MultiPolygon empty; + std::cout << out.str() << std::endl; + std::cout << "Exception " << e.what() << std::endl; + verify(out.str(), mp, empty, settings); + return false; + } + + + return verify(out.str(), mp, buffered, settings); +} + + +template +void test_all(int seed, int count, int level, Settings const& settings) +{ + boost::timer t; + + typedef boost::minstd_rand base_generator_type; + + base_generator_type generator(seed); + + boost::uniform_int<> random_coordinate(0, settings.field_size - 1); + boost::variate_generator > + coordinate_generator(generator, random_coordinate); + + typedef bg::model::polygon + < + bg::model::d2::point_xy, Clockwise, Closed + > polygon; + typedef bg::model::multi_polygon mp; + + + int index = 0; + for(int i = 0; i < count; i++) + { + mp p; + test_buffer(p, index, coordinate_generator, level, settings); + } + std::cout + << "geometries: " << index + << " type: " << typeid(T).name() + << " time: " << t.elapsed() << std::endl; +} + +int main(int argc, char** argv) +{ + try + { + namespace po = boost::program_options; + po::options_description description("=== recursive_polygons_linear_areal ===\nAllowed options"); + + int count = 1; + int seed = static_cast(std::time(0)); + int level = 3; + bool ccw = false; + bool open = false; + buffer_settings settings; + std::string form = "box"; + std::string join = "round"; + + description.add_options() + ("help", "Help message") + ("seed", po::value(&seed), "Initialization seed for random generator") + ("count", po::value(&count)->default_value(1), "Number of tests") + ("level", po::value(&level)->default_value(3), "Level to reach (higher->slower)") + ("distance", po::value(&settings.distance)->default_value(1.0), "Distance (1.0)") + ("form", po::value(&form)->default_value("box"), "Form of the polygons (box, triangle)") + ("join", po::value(&join)->default_value("round"), "Form of the joins (round, miter)") + ("ccw", po::value(&ccw)->default_value(false), "Counter clockwise polygons") + ("open", po::value(&open)->default_value(false), "Open polygons") + ("size", po::value(&settings.field_size)->default_value(10), "Size of the field") + ("wkt", po::value(&settings.wkt)->default_value(false), "Create a WKT of the inputs, for all tests") + ("svg", po::value(&settings.svg)->default_value(false), "Create a SVG for all tests") + ; + + po::variables_map varmap; + po::store(po::parse_command_line(argc, argv, description), varmap); + po::notify(varmap); + + if (varmap.count("help") + || (form != "box" && form != "triangle") + || (join != "round" && join != "miter") + ) + { + std::cout << description << std::endl; + return 1; + } + + settings.triangular = form != "box"; + settings.join_code = join == "round" ? 1 : 2; + + if (ccw && open) + { + test_all(seed, count, level, settings); + } + else if (ccw) + { + test_all(seed, count, level, settings); + } + else if (open) + { + test_all(seed, count, level, settings); + } + else + { + test_all(seed, count, level, settings); + } + +#if defined(HAVE_TTMATH) + // test_all(seed, count, max, svg, level); +#endif + } + catch(std::exception const& e) + { + std::cout << "Exception " << e.what() << std::endl; + } + catch(...) + { + std::cout << "Other exception" << std::endl; + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/robustness/overlay/linear_areal/Jamfile b/src/boost/libs/geometry/test/robustness/overlay/linear_areal/Jamfile new file mode 100644 index 000000000..a31dadf15 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/linear_areal/Jamfile @@ -0,0 +1,19 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# Robustness Test - overlay - linear/areal +# +# Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands. + +# 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) + + +project recursive_polygons_linear_areal + : requirements + . + ../.. + ../../../../../program_options/build//boost_program_options + static + ; + +exe recursive_polygons_linear_areal : recursive_polygons_linear_areal.cpp ; diff --git a/src/boost/libs/geometry/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp b/src/boost/libs/geometry/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp new file mode 100644 index 000000000..c29a0df12 --- /dev/null +++ b/src/boost/libs/geometry/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp @@ -0,0 +1,500 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Robustness Test + +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// 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) + +#if defined(_MSC_VER) +# pragma warning( disable : 4244 ) +# pragma warning( disable : 4267 ) +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + + +namespace bg = boost::geometry; + +template +void create_svg(std::string const& filename + , Geometry1 const& mp + , Geometry2 const& ls + , Geometry3 const& difference + , Geometry3 const& intersection + ) +{ + typedef typename boost::geometry::point_type::type point_type; + + + std::ofstream svg(filename.c_str()); + boost::geometry::svg_mapper mapper(svg, 800, 800); + + boost::geometry::model::box box; + bg::envelope(mp, box); + bg::buffer(box, box, 1.0); + mapper.add(box); + bg::envelope(ls, box); + bg::buffer(box, box, 1.0); + mapper.add(box); + + mapper.map(mp, "fill-opacity:0.5;fill:rgb(153,204,0);stroke:rgb(153,204,0);stroke-width:3"); + mapper.map(ls, "stroke-opacity:0.9;stroke:rgb(0,0,0);stroke-width:1"); + + mapper.map(intersection,"opacity:0.6;stroke:rgb(0,128,0);stroke-width:5"); + mapper.map(difference, "opacity:0.6;stroke:rgb(255,0,255);stroke-width:5"); //;stroke-dasharray:1,7;stroke-linecap:round +} + + +template +inline void make_random_linestring(Linestring& line, Generator& generator, Settings const& settings) +{ + using namespace boost::geometry; + + typedef typename point_type::type point_type; + typedef typename coordinate_type::type coordinate_type; + + coordinate_type x, y; + x = generator(); + y = generator(); + + int count = 3 + generator() % 6; + int d = 0; // direction + + for (int i = 0; i <= count && x <= settings.field_size; i++, x++, d = 1 - d) + { + append(line, make(x, y + d)); + append(line, make(x, y + 1 - d)); + } + + if (d == 0 && generator() % 4 < 3 && y >= 2) + { + d = 1 - d; + x--; + y -= 2; + count = 3 + generator() % 6; + for (int i = 0; i <= count && x >= 0; i++, x--, d = 1 - d) + { + append(line, make(x, y + d)); + append(line, make(x, y + 1 - d)); + } + } + + //if (settings.triangular) + //{ + // // Remove a point, generator says which + // int c = generator() % 4; + // if (c >= 1 && c <= 3) + // { + // ring.erase(ring.begin() + c); + // } + //} +} + +template +class inside_check +{ + Geometry const& m_geo; + bool& m_result; +public : + + inside_check(Geometry const& geo, bool& result) + : m_geo(geo) + , m_result(result) + {} + + inline inside_check operator=(inside_check const& input) + { + return inside_check(input.m_geo, input.m_result); + } + + template + inline void operator()(Point const& p) + { + if (! bg::covered_by(p, m_geo)) + { + if (m_result) + { + std::cout << "Does not fulfill inside check" << std::endl; + } + m_result = false; + } + } +}; + + +template +class outside_check +{ + Geometry const& m_geo; + bool& m_result; +public : + outside_check(Geometry const& geo, bool& result) + : m_geo(geo) + , m_result(result) + {} + + inline outside_check operator=(outside_check const& input) + { + return outside_check(input.m_geo, input.m_result); + } + + template + inline void operator()(Point const& p) + { + if (bg::within(p, m_geo)) + { + if (m_result) + { + std::cout << "Does not fulfill outside check" << std::endl; + } + m_result = false; + } + } +}; + +template +class border2_check +{ + Segment const& m_segment; + bool& m_result; + +public : + border2_check(Segment const& seg, bool& result) + : m_segment(seg) + , m_result(result) + {} + + inline border2_check operator=(border2_check const& input) + { + return border2_check(input.m_segment, input.m_result); + } + + template + inline void operator()(Segment2 const& segment) + { + // Create copies (TODO: find out why referring_segment does not compile) + typedef typename bg::point_type::type pt; + typedef bg::model::segment segment_type; + + typedef bg::strategy::intersection::relate_cartesian_segments + < + bg::policies::relate::segments_intersection_points + < + segment_type, + segment_type, + bg::segment_intersection_points + > + > policy; + + segment_type seg1, seg2; + bg::convert(m_segment, seg1); + bg::convert(segment, seg2); + bg::segment_intersection_points is = policy::apply(seg1, seg2); + + if (is.count == 2) + { + if (m_result) + { + std::cout << "Does not fulfill border2 check" << std::endl; + } + m_result = true; + } + } +}; + +template +class border_check +{ + Geometry const& m_geo; + bool& m_result; +public : + border_check(Geometry const& geo, bool& result) + : m_geo(geo) + , m_result(result) + {} + + inline border_check operator=(border_check const& input) + { + return border_check(input.m_geo, input.m_result); + } + + template + inline void operator()(Segment const& s) + { + bool on_border = false; + border2_check checker(s, on_border); + bg::for_each_segment(m_geo, checker); + + if (on_border) + { + if (m_result) + { + std::cout << "Does not fulfill border check" << std::endl; + } + m_result = false; + } + } +}; + + +template +bool verify(std::string const& caseid, MultiPolygon const& mp, Linestring const& ls, Settings const& settings) +{ + bg::model::multi_linestring difference, intersection; + bg::difference(ls, mp, difference); + bg::intersection(ls, mp, intersection); + + //typedef typename bg::length_result_type::type length_type; + + bool result = true; + + // 1) Check by length + typedef double length_type; + length_type len_input = bg::length(ls); + length_type len_difference = bg::length(difference); + length_type len_intersection = bg::length(intersection); + if (! bg::math::equals(len_input, len_difference + len_intersection)) + { + std::cout << "Input: " << len_input + << " difference: " << len_difference + << " intersection: " << len_intersection + << std::endl; + + std::cout << "Does not fulfill length check" << std::endl; + + result = false; + } + + // 2) Check by within and covered by + inside_check ic(mp, result); + bg::for_each_point(intersection, ic); + + outside_check oc(mp, result); + bg::for_each_point(difference, oc); + + border_check bc(mp, result); + bg::for_each_segment(difference, bc); + + // 3) check also the mid-points from the difference to remove false positives + BOOST_FOREACH(Linestring const& d, difference) + { + Linestring difference_midpoints; + bg::midpoints(d, false, std::back_inserter(difference_midpoints)); + outside_check ocm(mp, result); + bg::for_each_point(difference_midpoints, ocm); + } + + + bool svg = settings.svg; + bool wkt = settings.wkt; + if (! result) + { + std::cout << "ERROR " << caseid << std::endl; + std::cout << bg::wkt(mp) << std::endl; + std::cout << bg::wkt(ls) << std::endl; + svg = true; + wkt = true; + } + + if (svg) + { + std::ostringstream filename; + filename << caseid << "_" + << typeid(typename bg::coordinate_type::type).name() + << ".svg"; + create_svg(filename.str(), mp, ls, difference, intersection); + } + + if (wkt) + { + std::ostringstream filename; + filename << caseid << "_" + << typeid(typename bg::coordinate_type::type).name() + << ".wkt"; + std::ofstream stream(filename.str().c_str()); + stream << bg::wkt(mp) << std::endl; + stream << bg::wkt(ls) << std::endl; + } + + return result; +} + +template +bool test_linear_areal(MultiPolygon& result, int& index, + Generator& generator, + int level, common_settings const& settings) +{ + MultiPolygon p, q; + + // Generate two boxes + if (level == 0) + { + p.resize(1); + q.resize(1); + make_square_polygon(p.front(), generator, settings); + make_square_polygon(q.front(), generator, settings); + bg::correct(p); + bg::correct(q); + } + else + { + bg::correct(p); + bg::correct(q); + if (! test_linear_areal(p, index, generator, level - 1, settings) + || ! test_linear_areal(q, index, generator, level - 1, settings)) + { + return false; + } + } + + typedef typename boost::range_value::type polygon; + + MultiPolygon mp; + bg::detail::union_::union_insert + < + polygon + >(p, q, std::back_inserter(mp)); + + bg::unique(mp); + bg::simplify(mp, result, 0.01); + bg::correct(mp); + + // Generate a linestring + typedef typename bg::point_type::type point_type; + typedef bg::model::linestring linestring_type; + linestring_type ls; + make_random_linestring(ls, generator, settings); + + std::ostringstream out; + out << "recursive_la_" << index++ << "_" << level; + return verify(out.str(), mp, ls, settings); +} + + +template +void test_all(int seed, int count, int level, common_settings const& settings) +{ + boost::timer t; + + typedef boost::minstd_rand base_generator_type; + + base_generator_type generator(seed); + + boost::uniform_int<> random_coordinate(0, settings.field_size - 1); + boost::variate_generator > + coordinate_generator(generator, random_coordinate); + + typedef bg::model::polygon + < + bg::model::d2::point_xy, Clockwise, Closed + > polygon; + typedef bg::model::multi_polygon mp; + + + int index = 0; + for(int i = 0; i < count; i++) + { + mp p; + test_linear_areal(p, index, coordinate_generator, level, settings); + } + std::cout + << "geometries: " << index + << " type: " << typeid(T).name() + << " time: " << t.elapsed() << std::endl; +} + +int main(int argc, char** argv) +{ + try + { + namespace po = boost::program_options; + po::options_description description("=== recursive_polygons_linear_areal ===\nAllowed options"); + + int count = 1; + int seed = static_cast(std::time(0)); + int level = 3; + bool ccw = false; + bool open = false; + common_settings settings; + std::string form = "box"; + + description.add_options() + ("help", "Help message") + ("seed", po::value(&seed), "Initialization seed for random generator") + ("count", po::value(&count)->default_value(1), "Number of tests") + ("diff", po::value(&settings.also_difference)->default_value(false), "Include testing on difference") + ("level", po::value(&level)->default_value(3), "Level to reach (higher->slower)") + ("form", po::value(&form)->default_value("box"), "Form of the polygons (box, triangle)") + ("ccw", po::value(&ccw)->default_value(false), "Counter clockwise polygons") + ("open", po::value(&open)->default_value(false), "Open polygons") + ("size", po::value(&settings.field_size)->default_value(10), "Size of the field") + ("wkt", po::value(&settings.wkt)->default_value(false), "Create a WKT of the inputs, for all tests") + ("svg", po::value(&settings.svg)->default_value(false), "Create a SVG for all tests") + ; + + po::variables_map varmap; + po::store(po::parse_command_line(argc, argv, description), varmap); + po::notify(varmap); + + if (varmap.count("help") + || (form != "box" && form != "triangle")) + { + std::cout << description << std::endl; + return 1; + } + + settings.triangular = form != "box"; + + if (ccw && open) + { + test_all(seed, count, level, settings); + } + else if (ccw) + { + test_all(seed, count, level, settings); + } + else if (open) + { + test_all(seed, count, level, settings); + } + else + { + test_all(seed, count, level, settings); + } + +#if defined(HAVE_TTMATH) + // test_all(seed, count, max, svg, level); +#endif + } + catch(std::exception const& e) + { + std::cout << "Exception " << e.what() << std::endl; + } + catch(...) + { + std::cout << "Other exception" << std::endl; + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/Jamfile b/src/boost/libs/geometry/test/srs/Jamfile new file mode 100644 index 000000000..f513108d8 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/Jamfile @@ -0,0 +1,31 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +# +# This file was modified by Oracle on 2017, 2018, 2020. +# Modifications copyright (c) 2017-2020, 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) + +# TODO: move project transformer test to strategies +test-suite boost-geometry-srs + : + [ run projection.cpp : : : : srs_projection ] + [ run projection_epsg.cpp : : : : srs_projection_epsg ] + [ run projection_interface_d.cpp : : : : srs_projection_interface_d ] + [ run projection_interface_p4.cpp : : : : srs_projection_interface_p4 ] + [ run projection_interface_s.cpp : : : : srs_projection_interface_s ] + [ run projection_selftest.cpp : : : : srs_projection_selftest ] + [ run projections.cpp : : : : srs_projections ] + [ run projections_combined.cpp : : : : srs_projections_combined ] + [ run projections_static.cpp : : : : srs_projections_static ] + [ compile spar.cpp : : srs_spar ] + [ run srs_transformer.cpp : : : : srs_srs_transformer ] + [ run transformation_epsg.cpp : : : : srs_transformation_epsg ] + [ run transformation_interface.cpp : : : : srs_transformation_interface ] + ; diff --git a/src/boost/libs/geometry/test/srs/check_geometry.hpp b/src/boost/libs/geometry/test/srs/check_geometry.hpp new file mode 100644 index 000000000..e188ff686 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/check_geometry.hpp @@ -0,0 +1,162 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017, 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) + + +#ifndef BOOST_GEOMETRY_TEST_SRS_CHECK_GEOMETRY_HPP +#define BOOST_GEOMETRY_TEST_SRS_CHECK_GEOMETRY_HPP + + +#include + +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include + + +namespace test +{ + +struct check_point +{ + template + static void apply(Point const& point1, Point const& point2, T tol) + { + typename bg::coordinate_type::type + x1 = bg::get<0>(point1), + y1 = bg::get<1>(point1), + x2 = bg::get<0>(point2), + y2 = bg::get<1>(point2); + + BOOST_CHECK_CLOSE(x1, x2, tol); + BOOST_CHECK_CLOSE(y1, y2, tol); + } +}; + +template +struct check_range +{ + template + static void apply(Range const& range1, Range const& range2, T tol) + { + size_t range1_count = boost::size(range1); + size_t range2_count = boost::size(range2); + BOOST_CHECK_EQUAL(range1_count, range2_count); + if (range1_count == range2_count) + { + apply(boost::begin(range1), boost::end(range1), + boost::begin(range2), tol); + } + } + template + static void apply(It first1, It last1, It first2, T tol) + { + for ( ; first1 != last1 ; ++first1, ++first2) + Policy::apply(*first1, *first2, tol); + } +}; + + +template ::type> +struct check_geometry_impl +{}; + +template +struct check_geometry_impl + : check_point +{}; + +template +struct check_geometry_impl +{ + template + static void apply(Segment const& g1, Segment const& g2, T tol) + { + bg::detail::indexed_point_view p1(g1); + bg::detail::indexed_point_view p2(g1); + bg::detail::indexed_point_view q1(g2); + bg::detail::indexed_point_view q2(g2); + + check_point::apply(p1, q1, tol); + check_point::apply(p2, q2, tol); + } +}; + +template +struct check_geometry_impl + : check_range<> +{}; + +template +struct check_geometry_impl + : check_range<> +{}; + +template +struct check_geometry_impl + : check_range< check_range<> > +{}; + +template +struct check_geometry_impl + : check_range<> +{}; + +template +struct check_geometry_impl +{ + template + static void apply(Polygon const& g1, Polygon const& g2, T tol) + { + check_range<>::apply(bg::exterior_ring(g1), bg::exterior_ring(g2), tol); + check_range< check_range<> >::apply(bg::interior_rings(g1), bg::interior_rings(g2), tol); + } +}; + +template +struct check_geometry_impl + : check_range + < + check_geometry_impl + < + typename boost::range_value::type, + bg::polygon_tag + > + > +{}; + + +template +inline void check_geometry(Geometry const& g1, Geometry const& g2, T tol) +{ + check_geometry_impl::apply(g1, g2, tol); +} + +template +inline void check_geometry(Geometry const& g1, std::string const& wkt2, T tol) +{ + Geometry g2; + bg::read_wkt(wkt2, g2); + check_geometry_impl::apply(g1, g2, tol); +} + +} // namespace test + + +#endif // BOOST_GEOMETRY_TEST_SRS_CHECK_GEOMETRY_HPP diff --git a/src/boost/libs/geometry/test/srs/proj4.hpp b/src/boost/libs/geometry/test/srs/proj4.hpp new file mode 100644 index 000000000..10a7f4dd5 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/proj4.hpp @@ -0,0 +1,330 @@ +// Boost.Geometry + +// Copyright (c) 2017-2019, 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) + +#ifndef BOOST_GEOMETRY_TEST_SRS_PROJ4_HPP +#define BOOST_GEOMETRY_TEST_SRS_PROJ4_HPP + +#include + +#include +#include + +#if defined(TEST_WITH_PROJ6) +#define TEST_WITH_PROJ5 +#endif + +#if defined(TEST_WITH_PROJ5) +#define TEST_WITH_PROJ4 + +#include + +#endif + +#if defined(TEST_WITH_PROJ4) +#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H + +#include + +struct pj_ptr +{ + explicit pj_ptr(projPJ ptr = NULL) + : m_ptr(ptr) + {} + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + pj_ptr(pj_ptr && other) + : m_ptr(other.m_ptr) + { + other.m_ptr = NULL; + } + + pj_ptr & operator=(pj_ptr && other) + { + if (m_ptr) + pj_free(m_ptr); + m_ptr = other.m_ptr; + other.m_ptr = NULL; + return *this; + } +#endif + + projPJ get() const + { + return m_ptr; + } + + ~pj_ptr() + { + if (m_ptr) + pj_free(m_ptr); + } + +private: + pj_ptr(pj_ptr const&); + pj_ptr & operator=(pj_ptr const&); + + projPJ m_ptr; +}; +/* +struct pj_projection +{ + pj_projection(std::string const& prj) + : m_ptr(pj_init_plus(prj.c_str())) + {} + + template + void forward(In const& in, Out & out) const + { + double x = boost::geometry::get_as_radian<0>(in); + double y = boost::geometry::get_as_radian<1>(in); + + projUV p1; + projUV p2; + + p1.u = x; + p1.v = y; + + p2 = pj_fwd(p1, m_ptr.get()); + + boost::geometry::set_from_radian<0>(out, p2.u); + boost::geometry::set_from_radian<1>(out, p2.v); + } + + template + void inverse(In const& in, Out & out) const + { + double lon = boost::geometry::get_as_radian<0>(in); + double lat = boost::geometry::get_as_radian<1>(in); + + projUV p1; + projUV p2; + + p1.u = lon; + p1.v = lat; + + p2 = pj_inv(p1, m_ptr.get()); + + boost::geometry::set_from_radian<0>(out, p2.u); + boost::geometry::set_from_radian<1>(out, p2.v); + } + +private: + pj_ptr m_ptr; +};*/ + +struct pj_transformation +{ + pj_transformation(std::string const& from, std::string const& to) + : m_from(pj_init_plus(from.c_str())) + , m_to(pj_init_plus(to.c_str())) + {} + + void forward(std::vector in_x, + std::vector in_y, + std::vector & out_x, + std::vector & out_y) const + { + assert(in_x.size() == in_y.size()); + pj_transform(m_from.get(), m_to.get(), (long)in_x.size(), 1, &in_x[0], &in_y[0], NULL); + out_x = std::move(in_x); + out_y = std::move(in_y); + } + + void forward(std::vector in_xy, + std::vector & out_xy) const + { + assert(in_xy.size() % 2 == 0); + pj_transform(m_from.get(), m_to.get(), (long)in_xy.size() / 2, 2, &in_xy[0], &in_xy[1], NULL); + out_xy = std::move(in_xy); + } + + void forward(std::vector > const& in_xy, + std::vector > & out_xy) const + { + out_xy.resize(in_xy.size()); + for (size_t i = 0 ; i < in_xy.size(); ++i) + forward(in_xy[i], out_xy[i]); + } + + template + void forward(In const& in, Out & out, + typename boost::enable_if_c + < + boost::is_same + < + typename boost::geometry::tag::type, + boost::geometry::point_tag + >::value + >::type* dummy = 0) const + { + transform_point(in, out, m_from, m_to); + } + + template + void inverse(In const& in, Out & out, + typename boost::enable_if_c + < + boost::is_same + < + typename boost::geometry::tag::type, + boost::geometry::point_tag + >::value + >::type* dummy = 0) const + { + transform_point(in, out, m_to, m_from); + } + +private: + template + static void transform_point(In const& in, Out & out, + pj_ptr const& from, pj_ptr const& to) + { + double x = boost::geometry::get_as_radian<0>(in); + double y = boost::geometry::get_as_radian<1>(in); + + pj_transform(from.get(), to.get(), 1, 0, &x, &y, NULL); + + boost::geometry::set_from_radian<0>(out, x); + boost::geometry::set_from_radian<1>(out, y); + } + + pj_ptr m_from; + pj_ptr m_to; +}; + +#endif // TEST_WITH_PROJ4 + +#if defined(TEST_WITH_PROJ5) + +struct proj5_ptr +{ + explicit proj5_ptr(PJ *ptr = NULL) + : m_ptr(ptr) + {} + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + proj5_ptr(proj5_ptr && other) + : m_ptr(other.m_ptr) + { + other.m_ptr = NULL; + } + + proj5_ptr & operator=(proj5_ptr && other) + { + if (m_ptr) + proj_destroy(m_ptr); + m_ptr = other.m_ptr; + other.m_ptr = NULL; + return *this; + } +#endif + + PJ *get() const + { + return m_ptr; + } + + ~proj5_ptr() + { + if (m_ptr) + proj_destroy(m_ptr); + } + +private: + proj5_ptr(proj5_ptr const&); + proj5_ptr & operator=(proj5_ptr const&); + + PJ *m_ptr; +}; + +struct proj5_transformation +{ + proj5_transformation(std::string const& to) + : m_proj(proj_create(PJ_DEFAULT_CTX, to.c_str())) + {} + + void forward(std::vector in, + std::vector & out) const + { + proj_trans_array(m_proj.get(), PJ_FWD, in.size(), &in[0]); + out = std::move(in); + } + + template + void forward(In const& in, Out & out, + typename boost::enable_if_c + < + boost::is_same + < + typename boost::geometry::tag::type, + boost::geometry::point_tag + >::value + >::type* dummy = 0) const + { + PJ_COORD c; + c.lp.lam = boost::geometry::get_as_radian<0>(in); + c.lp.phi = boost::geometry::get_as_radian<1>(in); + + c = proj_trans(m_proj.get(), PJ_FWD, c); + + boost::geometry::set_from_radian<0>(out, c.xy.x); + boost::geometry::set_from_radian<1>(out, c.xy.y); + } + +private: + proj5_ptr m_proj; +}; + +#endif // TEST_WITH_PROJ5 + +#if defined(TEST_WITH_PROJ6) + +struct proj6_transformation +{ + proj6_transformation(std::string const& from, std::string const& to) + : m_proj(proj_create_crs_to_crs(PJ_DEFAULT_CTX, from.c_str(), to.c_str(), NULL)) + { + //proj_normalize_for_visualization(0, m_proj.get()); + } + + void forward(std::vector in, + std::vector & out) const + { + proj_trans_array(m_proj.get(), PJ_FWD, in.size(), &in[0]); + out = std::move(in); + } + + template + void forward(In const& in, Out & out, + typename boost::enable_if_c + < + boost::is_same + < + typename boost::geometry::tag::type, + boost::geometry::point_tag + >::value + >::type* dummy = 0) const + { + PJ_COORD c; + c.lp.lam = boost::geometry::get_as_radian<0>(in); + c.lp.phi = boost::geometry::get_as_radian<1>(in); + + c = proj_trans(m_proj.get(), PJ_FWD, c); + + boost::geometry::set_from_radian<0>(out, c.xy.x); + boost::geometry::set_from_radian<1>(out, c.xy.y); + } + +private: + proj5_ptr m_proj; +}; + +#endif // TEST_WITH_PROJ6 + +#endif // BOOST_GEOMETRY_TEST_SRS_PROJ4_HPP diff --git a/src/boost/libs/geometry/test/srs/projection.cpp b/src/boost/libs/geometry/test/srs/projection.cpp new file mode 100644 index 000000000..ed65c142a --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection.cpp @@ -0,0 +1,95 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2017, 2018. +// Modifications copyright (c) 2017-2018, 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. + +// 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) + + +#if defined(_MSC_VER) +#pragma warning( disable : 4305 ) // truncation double -> float +#endif // defined(_MSC_VER) + + +#define BOOST_GEOMETRY_SRS_ENABLE_STATIC_PROJECTION_HYBRID_INTERFACE + +#include + +#include + +#include +#include + +#include +#include +#include +#include + + +namespace srs = bg::srs; + +template +void test_one(double lon, double lat, + typename bg::coordinate_type::type x, + typename bg::coordinate_type::type y, + Params const& params) +{ + // hybrid interface disabled by default + // static_proj4 default ctor, dynamic parameters passed + srs::projection prj(params); + + P1 ll; + bg::set<0>(ll, lon); + bg::set<1>(ll, lat); + + P2 xy; + prj.forward(ll, xy); + + BOOST_CHECK_CLOSE(bg::get<0>(xy), x, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(xy), y, 0.001); +} + +template +void test_all() +{ + typedef typename bg::coordinate_type

::type coord_type; + typedef bg::model::point > point_type; + + using namespace srs::spar; + + // aea + test_one + (4.897000, 52.371000, 334609.583974, 5218502.503686, + parameters, lat_2<> >( + proj_aea(), ellps_wgs84(), units_m(), lat_1<>(55), lat_2<>(65))); +} + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(bg::cs::cartesian) + +int test_main(int, char* []) +{ + //test_all(); + test_all(); + test_all(); + + // 2D -> 3D + //test_all(); + + //test_all >(); + test_all >(); + test_all >(); + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projection_epsg.cpp b/src/boost/libs/geometry/test/srs/projection_epsg.cpp new file mode 100644 index 000000000..79fcd2e83 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection_epsg.cpp @@ -0,0 +1,93 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2017, 2018. +// Modifications copyright (c) 2017-2018, 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. + +// 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) + +#if defined(_MSC_VER) +#pragma warning( disable : 4305 ) // truncation double -> float +#endif // defined(_MSC_VER) + + +#include + +#include + +#include +#include + +#include + +#include +#include +#include +#include + +namespace srs = bg::srs; + +template +void test_one(double lon, double lat, + typename bg::coordinate_type::type x, + typename bg::coordinate_type::type y) +{ + srs::projection > prj; + + P1 ll; + bg::set<0>(ll, lon); + bg::set<1>(ll, lat); + + P2 xy; + bg::set<0>(xy, 0.0); + bg::set<1>(xy, 0.0); + prj.forward(ll, xy); + + BOOST_CHECK_CLOSE(bg::get<0>(xy), x, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(xy), y, 0.001); +} + +template +void test_deg_rad(double factor) +{ + typedef typename bg::coordinate_type

::type coord_type; + typedef bg::model::point > point_type; + + // sterea + test_one<28992, point_type, P>(4.897000 * factor, 52.371000 * factor, 121590.388077, 487013.903377); + // utm + test_one<29118, point_type, P>(4.897000 * factor, 52.371000 * factor, 4938115.7568751378, 9139797.6057944782); +} + +template +void test_all() +{ + test_deg_rad(1.0); + test_deg_rad(bg::math::d2r()); +} + +int test_main(int, char* []) +{ + // Commented out most the types because otherwise it cannot be linked + //test_all(); + //test_all(); + //test_all(); + //test_all(); + //test_all >(); + ////test_all >(); + ////test_all >(); + + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projection_interface_d.cpp b/src/boost/libs/geometry/test/srs/projection_interface_d.cpp new file mode 100644 index 000000000..2671651ca --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection_interface_d.cpp @@ -0,0 +1,67 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017-2018, 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) + + +#include + +#include +#include +#include +#include +#include +#include + +#include "check_geometry.hpp" + +int test_main(int, char*[]) +{ + using namespace boost::geometry; + using namespace boost::geometry::model; + using namespace boost::geometry::srs; + + typedef point > point_ll; + typedef point point_xy; + + { + point_ll pt_ll(1, 1); + point_ll pt_ll2(0, 0); + point_xy pt_xy(0, 0); + + projection<> prj = epsg(2000); + + prj.forward(pt_ll, pt_xy); + test::check_geometry(pt_xy, "POINT(9413505.3284665551 237337.74515944949)", 0.001); + + prj.inverse(pt_xy, pt_ll2); + // TODO: investigate this wierd result + test::check_geometry(pt_ll2, "POINT(-2.4463131191981073 1.5066638962045082)", 0.001); + + projection<> prj2 = esri(37001); + projection<> prj3 = iau2000(19900); + } + + { + using namespace boost::geometry::srs::dpar; + + point_ll pt_ll(1, 1); + point_ll pt_ll2(0, 0); + point_xy pt_xy(0, 0); + + projection<> prj = parameters<>(proj_tmerc)(ellps_wgs84)(units_m); + + prj.forward(pt_ll, pt_xy); + test::check_geometry(pt_xy, "POINT(111308.33561309829 110591.34223734379)", 0.001); + + prj.inverse(pt_xy, pt_ll2); + test::check_geometry(pt_ll2, "POINT(1 1)", 0.001); + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projection_interface_p4.cpp b/src/boost/libs/geometry/test/srs/projection_interface_p4.cpp new file mode 100644 index 000000000..731ad4124 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection_interface_p4.cpp @@ -0,0 +1,124 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017-2018, 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) + + +#include + +#include +#include +#include + +#include "check_geometry.hpp" + +int test_main(int, char*[]) +{ + using namespace boost::geometry; + using namespace boost::geometry::model; + using namespace boost::geometry::srs; + + typedef point > point_ll; + typedef point point_xy; + + { + point_ll pt_ll(1, 1); + point_ll pt_ll2(0, 0); + point_xy pt_xy(0, 0); + + projection<> prj = proj4("+proj=tmerc +ellps=WGS84 +units=m"); + + prj.forward(pt_ll, pt_xy); + test::check_geometry(pt_xy, "POINT(111308.33561309829 110591.34223734379)", 0.001); + + prj.inverse(pt_xy, pt_ll2); + test::check_geometry(pt_ll2, "POINT(1 1)", 0.001); + } + + // run-time errors + { + point_ll pt_ll(1, 1); + point_xy pt_xy(0, 0); + + BOOST_CHECK_THROW(projection<> prj1((proj4(""))), bg::projection_exception); + + BOOST_CHECK_THROW(projection<> prj1((proj4("+proj=abcd"))), bg::projection_exception); + + projection<> prj3 = proj4("+proj=bacon +a=6400000"); + BOOST_CHECK_THROW(prj3.inverse(pt_xy, pt_ll), bg::projection_exception); + } + + { + segment seg_ll; + segment seg_xy; + linestring ls_ll; + linestring ls_xy; + ring ring_ll; + ring ring_xy; + polygon poly_ll; + polygon poly_xy; + multi_point mpt_ll; + multi_point mpt_xy; + multi_linestring > mls_ll; + multi_linestring > mls_xy; + multi_polygon > mpoly_ll; + multi_polygon > mpoly_xy; + + bg::read_wkt("LINESTRING(0 0, 1 1)", seg_ll); + bg::read_wkt("LINESTRING(0 0, 1 1, 2 2)", ls_ll); + bg::read_wkt("POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))", ring_ll); + bg::read_wkt("POLYGON((0 0, 0 3, 3 3, 3 0, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1))", poly_ll); + bg::read_wkt("MULTIPOINT(0 0, 1 1, 2 2)", mpt_ll); + bg::read_wkt("MULTILINESTRING((0 0, 1 1),(2 2, 3 3))", mls_ll); + bg::read_wkt("MULTIPOLYGON(((0 0, 0 3, 3 3, 3 0, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)),((3 3,3 4,4 4,4 3,3 3)))", mpoly_ll); + + projection<> prj = proj4("+proj=tmerc +ellps=WGS84 +units=m"); + + prj.forward(seg_ll, seg_xy); + prj.forward(ls_ll, ls_xy); + prj.forward(ring_ll, ring_xy); + prj.forward(poly_ll, poly_xy); + prj.forward(mpt_ll, mpt_xy); + prj.forward(mls_ll, mls_xy); + prj.forward(mpoly_ll, mpoly_xy); + + test::check_geometry(seg_xy, "LINESTRING(0 0,111308 110591)", 0.001); + test::check_geometry(ls_xy, "LINESTRING(0 0,111308 110591,222550 221285)", 0.001); + test::check_geometry(ring_xy, "POLYGON((0 0,0 110574,111308 110591,111325 0,0 0))", 0.001); + test::check_geometry(poly_xy, "POLYGON((0 0,0 331726,333657 332183,334112 0,0 0),(111308 110591,222651 110642,222550 221285,111258 221183,111308 110591))", 0.001); + test::check_geometry(mpt_xy, "MULTIPOINT((0 0),(111308 110591),(222550 221285))", 0.001); + test::check_geometry(mls_xy, "MULTILINESTRING((0 0,111308 110591),(222550 221285,333657 332183))", 0.001); + test::check_geometry(mpoly_xy, "MULTIPOLYGON(((0 0,0 331726,333657 332183,334112 0,0 0),(111308 110591,222651 110642,222550 221285,111258 221183,111308 110591)),((333657 332183,333302 442913,444561 443388,445034 332540,333657 332183)))", 0.001); + + bg::clear(seg_ll); + bg::clear(ls_ll); + bg::clear(ring_ll); + bg::clear(poly_ll); + bg::clear(mpt_ll); + bg::clear(mls_ll); + bg::clear(mpoly_ll); + + prj.inverse(seg_xy, seg_ll); + prj.inverse(ls_xy, ls_ll); + prj.inverse(ring_xy, ring_ll); + prj.inverse(poly_xy, poly_ll); + prj.inverse(mpt_xy, mpt_ll); + prj.inverse(mls_xy, mls_ll); + prj.inverse(mpoly_xy, mpoly_ll); + + test::check_geometry(seg_ll, "LINESTRING(0 0, 1 1)", 0.001); + test::check_geometry(ls_ll, "LINESTRING(0 0, 1 1, 2 2)", 0.001); + test::check_geometry(ring_ll, "POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))", 0.001); + test::check_geometry(poly_ll, "POLYGON((0 0, 0 3, 3 3, 3 0, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1))", 0.001); + test::check_geometry(mpt_ll, "MULTIPOINT(0 0, 1 1, 2 2)", 0.001); + test::check_geometry(mls_ll, "MULTILINESTRING((0 0, 1 1),(2 2, 3 3))", 0.001); + test::check_geometry(mpoly_ll, "MULTIPOLYGON(((0 0, 0 3, 3 3, 3 0, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)),((3 3,3 4,4 4,4 3,3 3)))", 0.001); + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projection_interface_s.cpp b/src/boost/libs/geometry/test/srs/projection_interface_s.cpp new file mode 100644 index 000000000..571eb3ac9 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection_interface_s.cpp @@ -0,0 +1,96 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017-2018, 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) + + +#include + +#include +#include +#include +#include +#include +#include + +#include "check_geometry.hpp" + +int test_main(int, char*[]) +{ + using namespace boost::geometry; + using namespace boost::geometry::model; + using namespace boost::geometry::srs; + + typedef point > point_ll; + typedef point point_xy; + + { + using namespace boost::geometry::srs::spar; + + point_ll pt_ll(1, 1); + point_ll pt_ll2(0, 0); + point_xy pt_xy(0, 0); + + projection > prj; + + prj.forward(pt_ll, pt_xy); + test::check_geometry(pt_xy, "POINT(111308.33561309829 110591.34223734379)", 0.001); + + prj.inverse(pt_xy, pt_ll2); + test::check_geometry(pt_ll2, "POINT(1 1)", 0.001); + } + + { + using namespace boost::geometry::srs::spar; + + projection > prj1; + projection > prj2; + projection > prj3; + projection, y_0<> > > prj4 + = parameters, y_0<> >( + proj_tmerc(), ellps_wgs84(), x_0<>(0), y_0<>(0)); + + typedef spheroid sph; + typedef ellps ell; + typedef proj_tmerc prj; + projection > prj5 + = parameters(ell(sph(1000, 999))); + } + + { + point_ll pt_ll(1, 1); + point_ll pt_ll2(0, 0); + point_xy pt_xy(0, 0); + + projection > prj; + + prj.forward(pt_ll, pt_xy); + test::check_geometry(pt_xy, "POINT(9413505.3284665551 237337.74515944949)", 0.001); + + prj.inverse(pt_xy, pt_ll2); + // TODO: investigate this wierd result + test::check_geometry(pt_ll2, "POINT(-2.4463131191981073 1.5066638962045082)", 0.001); + + projection > prj2; + projection > prj3; + } + + // compile-time errors + { + point_ll pt_ll(1, 1); + point_xy pt_xy(0, 0); + + //projection > prj1; + //projection prj2; + + projection > prj3; + //prj3.inverse(pt_xy, pt_ll); + } + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projection_selftest.cpp b/src/boost/libs/geometry/test/srs/projection_selftest.cpp new file mode 100644 index 000000000..cf98f3c3e --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection_selftest.cpp @@ -0,0 +1,115 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017-2018, 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) + + +#include + +#include + +#include + +#include "projection_selftest_cases.hpp" +#include "proj4.hpp" + + +void test_projection(std::string const& id, std::string const& parameters, + const LL * fwd_in, const XY * fwd_expected, + const XY * inv_in, const LL * inv_expected) +{ + bg::srs::projection<> prj = bg::srs::proj4(parameters); + +#ifdef TEST_WITH_PROJ4 + pj_projection pj_par(parameters); +#endif + + for (std::size_t i = 0 ; i < 4 ; ++i) + { + if (bg::get<0>(fwd_expected[i]) == HUGE_VAL) + break; + + { + XY fwd_out; + prj.forward(fwd_in[i], fwd_out); + + bool fwd_eq = bg::math::abs(bg::get<0>(fwd_out) - bg::get<0>(fwd_expected[i])) < 1e-7 + && bg::math::abs(bg::get<1>(fwd_out) - bg::get<1>(fwd_expected[i])) < 1e-7; + + BOOST_CHECK_MESSAGE((fwd_eq), + std::setprecision(16) << "Result of " << id << " forward projection {" + << bg::wkt(fwd_out) << "} different than expected {" + << bg::wkt(fwd_expected[i]) << "}"); + +#ifdef TEST_WITH_PROJ4 + { + XY pj_xy; + pj_par.forward(fwd_in[i], pj_xy); + double d1 = bg::math::abs(bg::get<0>(fwd_out) - bg::get<0>(pj_xy)); + double d2 = bg::math::abs(bg::get<1>(fwd_out) - bg::get<1>(pj_xy)); + double d = (std::max)(d1, d2); + bool same_as_pj = d < 1e-15; + BOOST_CHECK_MESSAGE((same_as_pj), + std::setprecision(16) << "Result of " << id << " forward projection {" + << bg::wkt(fwd_out) << "} different than Proj4 {" + << bg::wkt(pj_xy) << "} by " << d); + } +#endif + } + + if (bg::get<0>(inv_expected[i]) == HUGE_VAL) + break; + + { + LL inv_out; + prj.inverse(inv_in[i], inv_out); + + bool inv_eq = bg::math::abs(bg::get<0>(inv_out) - bg::get<0>(inv_expected[i])) < 1e-7 + && bg::math::abs(bg::get<1>(inv_out) - bg::get<1>(inv_expected[i])) < 1e-7; + + BOOST_CHECK_MESSAGE((inv_eq), + std::setprecision(16) << "Result of " << id << " inverse projection {" + << bg::wkt(inv_out) << "} different than expected {" + << bg::wkt(inv_expected[i]) << "}"); + +#ifdef TEST_WITH_PROJ4 + { + LL pj_ll; + pj_par.inverse(inv_in[i], pj_ll); + double d1 = bg::math::abs(bg::get<0>(inv_out) - bg::get<0>(pj_ll)); + double d2 = bg::math::abs(bg::get<1>(inv_out) - bg::get<1>(pj_ll)); + double d = (std::max)(d1, d2); + bool same_as_pj = d < 1e-15; + BOOST_CHECK_MESSAGE((same_as_pj), + std::setprecision(16) << "Result of " << id << " inverse projection {" + << bg::wkt(inv_out) << "} different than Proj4 {" + << bg::wkt(pj_ll) << "} by " << d); + } +#endif + } + } +} + +void test_projections(const projection_case * cases, std::size_t n) +{ + for (std::size_t i = 0 ; i < n ; ++i) + { + projection_case const& pcas = cases[i]; + + test_projection(pcas.id, pcas.args, + pcas.fwd_in, pcas.fwd_expect, + pcas.inv_in, pcas.inv_expect); + } +} + +int test_main(int, char*[]) +{ + test_projections(projection_cases, sizeof(projection_cases)/sizeof(projection_case)); + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projection_selftest_cases.hpp b/src/boost/libs/geometry/test/srs/projection_selftest_cases.hpp new file mode 100644 index 000000000..1bf4dc15c --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projection_selftest_cases.hpp @@ -0,0 +1,3935 @@ +// Boost.Geometry +// Unit Test + +// Copyright (c) 2017-2018, 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) + +// This file contains test cases converted from PROJ4, http://trac.osgeo.org/proj +// PROJ4 is originally written by Gerald Evenden (then of the USGS) +// PROJ4 is maintained by Frank Warmerdam +// Test cases was converted to Boost.Geometry by Adam Wulkiewicz + +// Original copyright notice: + +// Copyright (c) 1995, Gerald Evenden + +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef BOOST_GEOMETRY_TEST_SRS_PROJECTION_SELFTEST_CASES_HPP +#define BOOST_GEOMETRY_TEST_SRS_PROJECTION_SELFTEST_CASES_HPP + + +#include + +#include +#include + + +struct XY { double x, y; }; +struct LL { double lon, lat; }; + +BOOST_GEOMETRY_REGISTER_POINT_2D(XY, double, bg::cs::cartesian, x, y) +BOOST_GEOMETRY_REGISTER_POINT_2D(LL, double, bg::cs::geographic, lon, lat) + +struct projection_case +{ + std::string id; + std::string args; + LL fwd_in[4]; + XY fwd_expect[4]; + XY inv_in[4]; + LL inv_expect[4]; +}; + +static const projection_case projection_cases[] = { + { + "aea_e", + "+proj=aea +ellps=GRS80 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222571.60875710563, 110653.32674302977}, + {222706.30650839131, -110484.26714439997}, + {-222571.60875710563, 110653.32674302977}, + {-222706.30650839131, -110484.26714439997} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017966310597749514, 0.00090436885862202158}, + {0.0017966300767030448, -0.00090437009538581453}, + {-0.0017966310597749514, 0.00090436885862202158}, + {-0.0017966300767030448, -0.00090437009538581453} + } + },{ + "aea_s", + "+proj=aea +R=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223334.08517088494, 111780.43188447191}, + {223470.15499168713, -111610.33943099028}, + {-223334.08517088494, 111780.43188447191}, + {-223470.15499168713, -111610.33943099028} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904935979658752, 0.00089524594491375306}, + {0.0017904926216016812, -0.00089524716502493225}, + {-0.0017904935979658752, 0.00089524594491375306}, + {-0.0017904926216016812, -0.00089524716502493225} + } + },{ + "leac_e", + "+proj=leac +ellps=GRS80 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {220685.14054297868, 112983.50088939646}, + {224553.31227982609, -108128.63674487274}, + {-220685.14054297868, 112983.50088939646}, + {-224553.31227982609, -108128.63674487274} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017966446840328458, 0.00090435171340223211}, + {0.0017966164523713021, -0.00090438724081843625}, + {-0.0017966446840328458, 0.00090435171340223211}, + {-0.0017966164523713021, -0.00090438724081843625} + } + },{ + "leac_s", + "+proj=leac +R=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {221432.86859285168, 114119.45452653214}, + {225331.72412711097, -109245.82943505641}, + {-221432.86859285168, 114119.45452653214}, + {-225331.72412711097, -109245.82943505641} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017905070979748127, 0.00089522906964877795}, + {0.001790479121519977, -0.00089526404022281043}, + {-0.0017905070979748127, 0.00089522906964877795}, + {-0.001790479121519977, -0.00089526404022281043} + } + },{ + "aeqd_e", + "+proj=aeqd +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222616.522190051648, 110596.996549550197}, + { 222616.522190051648, -110596.996549550211}, + {-222616.522190051648, 110596.996549550197}, + {-222616.522190051648, -110596.996549550211} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179663056838724787, 0.000904369476930248902}, + { 0.00179663056838724787, -0.000904369476930248469}, + {-0.00179663056838724787, 0.000904369476930248902}, + {-0.00179663056838724787, -0.000904369476930248469} + } + },{ + "aeqd_s", + "+proj=aeqd +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223379.456047271, 111723.757570854126}, + { 223379.456047271, -111723.757570854126}, + {-223379.456047271, 111723.757570854126}, + {-223379.456047271, -111723.757570854126} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310992953335, 0.000895246554746200623}, + { 0.00179049310992953335, -0.000895246554746200623}, + {-0.00179049310992953335, 0.000895246554746200623}, + {-0.00179049310992953335, -0.000895246554746200623} + } + },{ + "airy", + "+proj=airy +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 189109.88690862127, 94583.752387504152}, + { 189109.88690862127, -94583.752387504152}, + {-189109.88690862127, 94583.752387504152}, + {-189109.88690862127, -94583.752387504152} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "aitoff", + "+proj=aitoff +R=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223379.45881169615, 111706.74288385305}, + {223379.45881169615, -111706.74288385305}, + {-223379.45881169615, 111706.74288385305}, + {-223379.45881169615, -111706.74288385305} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904931100388164, 0.00089524655491012516}, + {0.0017904931100388164, -0.00089524655491012516}, + {-0.0017904931100388164, 0.00089524655491012516}, + {-0.0017904931100388164, -0.00089524655491012516} + } + },{ + "wintri", + "+proj=wintri +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223390.80153348515, 111703.90750574505}, + {223390.80153348515, -111703.90750574505}, + {-223390.80153348515, 111703.90750574505}, + {-223390.80153348515, -111703.90750574505} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904931099113196, 0.00089524655490101819}, + {0.0017904931099113196, -0.00089524655490101819}, + {-0.0017904931099113196, 0.00089524655490101819}, + {-0.0017904931099113196, -0.00089524655490101819} + } + },{ + "august", + "+proj=august +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223404.97818097242, 111722.34028976287}, + {223404.97818097242, -111722.34028976287}, + {-223404.97818097242, 111722.34028976287}, + {-223404.97818097242, -111722.34028976287} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "bacon", + "+proj=bacon +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223334.13255596498, 175450.72592266591}, + {223334.13255596498, -175450.72592266591}, + {-223334.13255596498, 175450.72592266591}, + {-223334.13255596498, -175450.72592266591} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "apian", + "+proj=apian +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223374.57735525275, 111701.07212763709}, + { 223374.57735525275, -111701.07212763709}, + {-223374.57735525275, 111701.07212763709}, + {-223374.57735525275, -111701.07212763709} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "ortel", + "+proj=ortel +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223374.57735525275, 111701.07212763709}, + { 223374.57735525275, -111701.07212763709}, + {-223374.57735525275, 111701.07212763709}, + {-223374.57735525275, -111701.07212763709} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "bipc_e", + "+proj=bipc +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {2452160.2177257561, -14548450.759654747}, + {2447915.213725341, -14763427.21279873}, + {2021695.5229349085, -14540413.695283702}, + {2018090.5030046992, -14755620.651414108} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-73.038700284978702, 17.248118466239116}, + {-73.03730373933017, 17.249414978178777}, + {-73.03589317304332, 17.245536403008771}, + {-73.034496627213585, 17.246832895573739} + } + },{ + "bipc_s", + "+proj=bipc +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {2460565.7409749646, -14598319.9893308}, + {2456306.1859352002, -14814033.339502094}, + {2028625.4978190989, -14590255.375482792}, + {2025008.1205891429, -14806200.018759441} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-73.038693104942126, 17.248116270440242}, + {-73.037301330021322, 17.24940835333777}, + {-73.035895582251086, 17.245543027866539}, + {-73.034503807150301, 17.246835091521532} + } + },{ + "boggs", + "+proj=boggs +a=6400000 +lat_1=0 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 211949.70080818201, 117720.99830541089}, + { 211949.70080818201, -117720.99830541089}, + {-211949.70080818201, 117720.99830541089}, + {-211949.70080818201, -117720.99830541089}, + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "bonne_e", + "+proj=bonne +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222605.29609715697, 55321.139565494814}, + { 222605.29609923941, -165827.64779905154}, + {-222605.29609715697, 55321.139565494814}, + {-222605.29609923941, -165827.64779905154} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966987691132891, 0.50090436853737497}, + { 0.0017966982774478867, 0.4990956309655612}, + {-0.0017966987691132891, 0.50090436853737497}, + {-0.0017966982774478867, 0.4990956309655612} + } + },{ + "bonne_s", + "+proj=bonne +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223368.11557252839, 55884.555246393575}, + { 223368.11557463196, -167517.59936969393}, + {-223368.11557252839, 55884.555246393575}, + {-223368.11557463196, -167517.59936969393} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017905615332457991, 0.50089524631087834}, + { 0.0017905610449335603, 0.49910475320072978}, + {-0.0017905615332457991, 0.50089524631087834}, + {-0.0017905610449335603, 0.49910475320072978} + } + }, + // NOT IMPLEMENTED IN Boost.Geometry + /* + { + "calcofi_e", + "+proj=calcofi +ellps=GRS80 +lat_1=0.5 +lat_2=2 +no_defs", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {508.44487214981905, -1171.7648604175156}, + {514.99916815188112, -1145.8219814677668}, + {500.68538412539851, -1131.4453779204598}, + {507.36971913666355, -1106.1782014834275} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-110.36330792469906, 12.032056975840137}, + {-98.455008863288782, 18.698723642506803}, + {-207.4470245036909, 81.314089278595247}, + {-62.486322854481287, 87.980755945261919} + } + },{ + "calcofi_s", + "+proj=calcofi +R=6400000 +lat_1=0.5 +lat_2=2 +no_defs", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {507.09050748781806, -1164.7273751978314}, + {513.68613637462886, -1138.9992682173072}, + {499.33626147591531, -1124.4351309968195}, + {506.0605703929898, -1099.3756650673038} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-110.30519040955151, 12.032056975840137}, + {-98.322360950234085, 18.698723642506803}, + {-207.54490681381429, 81.314089278595247}, + {-62.576950371885275, 87.980755945261919} + } + },*/ + // NOTE: cart projection test cases are implemented differently in Proj4 + { + "cass_e", + "+proj=cass +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222605.28577699114, 110642.22925399939}, + { 222605.28577699114, -110642.22925399939}, + {-222605.28577699114, 110642.22925399939}, + {-222605.28577699114, -110642.22925399939} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966305684613522, 0.00090436947663183841}, + { 0.0017966305684613522, -0.00090436947663183841}, + {-0.0017966305684613522, 0.00090436947663183841}, + {-0.0017966305684613522, -0.00090436947663183841} + } + },{ + "cass_s", + "+proj=cass +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223368.10520348375, 111769.14504058579}, + { 223368.10520348375, -111769.14504058579}, + {-223368.10520348375, 111769.14504058579}, + {-223368.10520348375, -111769.14504058579} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931100023887, 0.00089524655445477922}, + { 0.0017904931100023887, -0.00089524655445477922}, + {-0.0017904931100023887, 0.00089524655445477922}, + {-0.0017904931100023887, -0.00089524655445477922} + } + },{ + "cc", + "+proj=cc +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223402.14425527418, 111712.41554059254}, + {223402.14425527418, -111712.41554059254}, + {-223402.14425527418, 111712.41554059254}, + {-223402.14425527418, -111712.41554059254} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904931097838226, 0.00089524655481905597}, + {0.0017904931097838226, -0.00089524655481905597}, + {-0.0017904931097838226, 0.00089524655481905597}, + {-0.0017904931097838226, -0.00089524655481905597} + } + },{ + "cea_e", + "+proj=cea +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222638.981586547132, 110568.812396267356}, + { 222638.981586547132, -110568.812396265886}, + {-222638.981586547132, 110568.812396267356}, + {-222638.981586547132, -110568.812396265886} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179663056823904264, 0.000904369476105564289}, + { 0.00179663056823904264, -0.000904369476105564289}, + {-0.00179663056823904264, 0.000904369476105564289}, + {-0.00179663056823904264, -0.000904369476105564289} + } + },{ + "cea_s", + "+proj=cea +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.144255274179, 111695.401198614476}, + { 223402.144255274179, -111695.401198614476}, + {-223402.144255274179, 111695.401198614476}, + {-223402.144255274179, -111695.401198614476} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310978382265, 0.000895246554928338998}, + { 0.00179049310978382265, -0.000895246554928338998}, + {-0.00179049310978382265, 0.000895246554928338998}, + {-0.00179049310978382265, -0.000895246554928338998} + } + },{ + "chamb", + "+proj=chamb +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-27864.7795868005815, -223364.324593274243}, + {-251312.283053493476, -223402.145526208304}, + {-27864.7856491046077, 223364.327328827145}, + {-251312.289116443484, 223402.142197287147} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "collg", + "+proj=collg +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {249872.921577929839, 99423.1747884602082}, + {254272.532301245432, -98559.3077607425657}, + {-249872.921577929839, 99423.1747884602082}, + {-254272.532301245432, -98559.3077607425657} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.00158679719207879865, 0.00101017310941749921}, + {0.001586769215623956, -0.00101018201458258111}, + {-0.00158679719207879865, 0.00101017310941749921}, + {-0.001586769215623956, -0.00101018201458258111} + } + }, + // NOT IMPLEMENTED IN Boost.Geometry + /*{ + "comill", + "+proj=comill +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223402.144255274179, 110611.859089458536}, + {223402.144255274179, -110611.859089458536}, + {-223402.144255274179, 110611.859089458536}, + {-223402.144255274179, -110611.859089458536} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.00179049310978382265, 0.000904106801510605831}, + {0.00179049310978382265, -0.000904106801510605831}, + {-0.00179049310978382265, 0.000904106801510605831}, + {-0.00179049310978382265, -0.000904106801510605831} + } + },*/{ + "crast", + "+proj=crast +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {218280.142056780722, 114306.045604279774}, + {218280.142056780722, -114306.045604279774}, + {-218280.142056780722, 114306.045604279774}, + {-218280.142056780722, -114306.045604279774} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.00183225941982580187, 0.00087483943098902331}, + {0.00183225941982580187, -0.00087483943098902331}, + {-0.00183225941982580187, 0.00087483943098902331}, + {-0.00183225941982580187, -0.00087483943098902331} + } + },{ + "denoy", + "+proj=denoy +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223377.422876954137, 111701.07212763709}, + { 223377.422876954137, -111701.07212763709}, + {-223377.422876954137, 111701.07212763709}, + {-223377.422876954137, -111701.07212763709} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "eck1", + "+proj=eck1 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 204680.88820295094, 102912.17842606473}, + { 204680.88820295094, -102912.17842606473}, + {-204680.88820295094, 102912.17842606473}, + {-204680.88820295094, -102912.17842606473} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0019434150820034624, 0.00097170229538813102}, + { 0.0019434150820034624, -0.00097170229538813102}, + {-0.0019434150820034624, 0.00097170229538813102}, + {-0.0019434150820034624, -0.00097170229538813102} + } + },{ + "eck2", + "+proj=eck2 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 204472.87090796008, 121633.73497524235}, + { 204472.87090796008, -121633.73497524235}, + {-204472.87090796008, 121633.73497524235}, + {-204472.87090796008, -121633.73497524235} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0019434150820034624, 0.00082480429919795412}, + { 0.0019434150820034624, -0.00082480429919795412}, + {-0.0019434150820034624, 0.00082480429919795412}, + {-0.0019434150820034624, -0.00082480429919795412} + } + },{ + "eck3", + "+proj=eck3 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 188652.01572153764, 94328.919337031271}, + { 188652.01572153764, -94328.919337031271}, + {-188652.01572153764, 94328.919337031271}, + {-188652.01572153764, -94328.919337031271} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0021202405520236059, 0.0010601202759750307}, + { 0.0021202405520236059, -0.0010601202759750307}, + {-0.0021202405520236059, 0.0010601202759750307}, + {-0.0021202405520236059, -0.0010601202759750307} + } + },{ + "eck4", + "+proj=eck4 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 188646.38935641639, 132268.54017406539}, + { 188646.38935641639, -132268.54017406539}, + {-188646.38935641639, 132268.54017406539}, + {-188646.38935641639, -132268.54017406539} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0021202405520236059, 0.00075601458836610643}, + { 0.0021202405520236059, -0.00075601458836610643}, + {-0.0021202405520236059, 0.00075601458836610643}, + {-0.0021202405520236059, -0.00075601458836610643} + } + },{ + "eck5", + "+proj=eck5 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 197031.39213406085, 98523.198847226551}, + { 197031.39213406085, -98523.198847226551}, + {-197031.39213406085, 98523.198847226551}, + {-197031.39213406085, -98523.198847226551} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.002029978749734037, 0.001014989374787388}, + {0.002029978749734037, -0.001014989374787388}, + {-0.002029978749734037, 0.001014989374787388}, + {-0.002029978749734037, -0.001014989374787388} + } + },{ + "eqc", + "+proj=eqc +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.144255274179, 111701.07212763709}, + { 223402.144255274179, -111701.07212763709}, + {-223402.144255274179, 111701.07212763709}, + {-223402.144255274179, -111701.07212763709} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310978382265, 0.000895246554891911323}, + { 0.00179049310978382265, -0.000895246554891911323}, + {-0.00179049310978382265, 0.000895246554891911323}, + {-0.00179049310978382265, -0.000895246554891911323} + } + },{ + "eqdc_e", + "+proj=eqdc +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222588.440269285755, 110659.134907347048}, + { 222756.836702042434, -110489.578087220681}, + {-222588.440269285755, 110659.134907347048}, + {-222756.836702042434, -110489.578087220681} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179635944879094839, 0.000904368858588402644}, + { 0.00179635822020772734, -0.000904370095529954975}, + {-0.00179635944879094839, 0.000904368858588402644}, + {-0.00179635822020772734, -0.000904370095529954975} + } + },{ + "eqdc_s", + "+proj=eqdc +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223351.088175113517, 111786.108747173785}, + { 223521.200266735133, -111615.970741240744}, + {-223351.088175113517, 111786.108747173785}, + {-223521.200266735133, -111615.970741240744} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017902210900486641, 0.000895245944814909169}, + { 0.00179021986984890255, -0.000895247165333684842}, + {-0.0017902210900486641, 0.000895245944814909169}, + {-0.00179021986984890255, -0.000895247165333684842} + } + },{ + "fahey", + "+proj=fahey +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 182993.34464912376, 101603.19356988439}, + { 182993.34464912376, -101603.19356988439}, + {-182993.34464912376, 101603.19356988439}, + {-182993.34464912376, -101603.19356988439} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0021857886080359551, 0.00098424601668238403}, + {0.0021857886080359551, -0.00098424601668238403}, + {-0.0021857886080359551, 0.00098424601668238403}, + {-0.0021857886080359551, -0.00098424601668238403} + } + },{ + "fouc_s", + "+proj=fouc_s +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.14425527424, 111695.40119861449}, + { 223402.14425527424, -111695.40119861449}, + {-223402.14425527424, 111695.40119861449}, + {-223402.14425527424, -111695.40119861449} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931097838226, 0.000895246554928339}, + { 0.0017904931097838226, -0.000895246554928339}, + {-0.0017904931097838226, 0.000895246554928339}, + {-0.0017904931097838226, -0.000895246554928339} + } + },{ + "gall", + "+proj=gall +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 157969.17113451968, 95345.249178385886}, + { 157969.17113451968, -95345.249178385886}, + {-157969.17113451968, 95345.249178385886}, + {-157969.17113451968, -95345.249178385886} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0025321396391918614, 0.001048846580346495}, + { 0.0025321396391918614, -0.001048846580346495}, + {-0.0025321396391918614, 0.001048846580346495}, + {-0.0025321396391918614, -0.001048846580346495} + } + },{ + "geos_e", + "+proj=geos +ellps=GRS80 +lat_1=0.5 +lat_2=2 +h=35785831", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222527.07036580026, 110551.30341332949}, + { 222527.07036580026, -110551.30341332949}, + {-222527.07036580026, 110551.30341332949}, + {-222527.07036580026, -110551.30341332949} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966305689715385, 0.00090436947723267452}, + { 0.0017966305689715385, -0.00090436947723267452}, + {-0.0017966305689715385, 0.00090436947723267452}, + {-0.0017966305689715385, -0.00090436947723267452} + } + },{ + "geos_s", + "+proj=geos +R=6400000 +lat_1=0.5 +lat_2=2 +h=35785831", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223289.45763579503, 111677.65745653701}, + { 223289.45763579503, -111677.65745653701}, + {-223289.45763579503, 111677.65745653701}, + {-223289.45763579503, -111677.65745653701} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931105078943, 0.00089524655504237148}, + { 0.0017904931105078943, -0.00089524655504237148}, + {-0.0017904931105078943, 0.00089524655504237148}, + {-0.0017904931105078943, -0.00089524655504237148} + } + },{ + "gins8", + "+proj=gins8 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 194350.25093959007, 111703.90763533533}, + { 194350.25093959007, -111703.90763533533}, + {-194350.25093959007, 111703.90763533533}, + {-194350.25093959007, -111703.90763533533} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "sinu_e", + "+proj=sinu +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222605.29953946592, 110574.38855415257}, + { 222605.29953946592, -110574.38855415257}, + {-222605.29953946592, 110574.38855415257}, + {-222605.29953946592, -110574.38855415257} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966305684613522, 0.00090436947707945409}, + { 0.0017966305684613522, -0.00090436947707945409}, + {-0.0017966305684613522, 0.00090436947707945409}, + {-0.0017966305684613522, -0.00090436947707945409} + } + },{ + "sinu_s", + "+proj=sinu +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223368.11902663155, 111701.07212763709}, + { 223368.11902663155, -111701.07212763709}, + {-223368.11902663155, 111701.07212763709}, + {-223368.11902663155, -111701.07212763709} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931100023887, 0.00089524655489191132}, + { 0.0017904931100023887, -0.00089524655489191132}, + {-0.0017904931100023887, 0.00089524655489191132}, + {-0.0017904931100023887, -0.00089524655489191132} + } + },{ + "eck6", + "+proj=eck6 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 197021.60562899226, 126640.42073317352}, + { 197021.60562899226, -126640.42073317352}, + {-197021.60562899226, 126640.42073317352}, + {-197021.60562899226, -126640.42073317352} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.002029978749734037, 0.00078963032910382171}, + { 0.002029978749734037, -0.00078963032910382171}, + {-0.002029978749734037, 0.00078963032910382171}, + {-0.002029978749734037, -0.00078963032910382171} + } + },{ + "mbtfps", + "+proj=mbtfps +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 204740.11747857218, 121864.72971934026}, + { 204740.11747857218, -121864.72971934026}, + {-204740.11747857218, 121864.72971934026}, + {-204740.11747857218, -121864.72971934026} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0019534152166442065, 0.00082057965689633387}, + { 0.0019534152166442065, -0.00082057965689633387}, + {-0.0019534152166442065, 0.00082057965689633387}, + {-0.0019534152166442065, -0.00082057965689633387} + } + },{ + "gn_sinu", + "+proj=gn_sinu +a=6400000 +lat_1=0.5 +lat_2=2 +m=1 +n=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223385.13250469571, 111698.23644718733}, + { 223385.13250469571, -111698.23644718733}, + {-223385.13250469571, 111698.23644718733}, + {-223385.13250469571, -111698.23644718733} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931098931057, 0.00089524655491012516}, + { 0.0017904931098931057, -0.00089524655491012516}, + {-0.0017904931098931057, 0.00089524655491012516}, + {-0.0017904931098931057, -0.00089524655491012516} + } + },{ + "gnom", + "+proj=gnom +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223492.92474718543, 111780.50920659291}, + { 223492.92474718543, -111780.50920659291}, + {-223492.92474718543, 111780.50920659291}, + {-223492.92474718543, -111780.50920659291} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931092009798, 0.00089524655438192376}, + { 0.0017904931092009798, -0.00089524655438192376}, + {-0.0017904931092009798, 0.00089524655438192376}, + {-0.0017904931092009798, -0.00089524655438192376} + } + },{ + "goode", + "+proj=goode +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223368.11902663155, 111701.07212763709}, + { 223368.11902663155, -111701.07212763709}, + {-223368.11902663155, 111701.07212763709}, + {-223368.11902663155, -111701.07212763709} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931100023887, 0.00089524655489191132}, + { 0.0017904931100023887, -0.00089524655489191132}, + {-0.0017904931100023887, 0.00089524655489191132}, + {-0.0017904931100023887, -0.00089524655489191132} + } + },{ + "gstmerc", + "+proj=gstmerc +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223413.46640632182, 111769.14504058557}, + { 223413.46640632182, -111769.14504058668}, + {-223413.46640632302, 111769.14504058557}, + {-223413.46640632302, -111769.14504058668} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931097109673, 0.0008952465544509083}, + { 0.0017904931097109673, -0.0008952465544509083}, + {-0.0017904931097109673, 0.0008952465544509083}, + {-0.0017904931097109673, -0.0008952465544509083} + } + },{ + "hammer", + "+proj=hammer +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223373.78870324057, 111703.90739776699}, + { 223373.78870324057, -111703.90739776699}, + {-223373.78870324057, 111703.90739776699}, + {-223373.78870324057, -111703.90739776699} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.001790493109965961, 0.00089524655487369749}, + { 0.001790493109965961, -0.00089524655487369749}, + {-0.001790493109965961, 0.00089524655487369749}, + {-0.001790493109965961, -0.00089524655487369749} + } + },{ + "hatano", + "+proj=hatano +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 189878.87894652804, 131409.8024406255 }, + { 189881.08195244463, -131409.14227607418 }, + {-189878.87894652804, 131409.8024406255 }, + {-189881.08195244463, -131409.14227607418 } + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0021064624821817597, 0.00076095689425791926 }, + { 0.0021064624821676096, -0.00076095777439265377 }, + {-0.0021064624821817597, 0.00076095689425791926 }, + {-0.0021064624821676096, -0.00076095777439265377 } + } + },{ + "healpix_e", + "+proj=healpix +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222390.10394923863, 130406.58866448226}, + { 222390.10394923863, -130406.58866448054}, + {-222390.10394923863, 130406.58866448226}, + {-222390.10394923863, -130406.58866448054} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017986411845524453, 0.00076679453057823619}, + { 0.0017986411845524453, -0.00076679453057823619}, + {-0.0017986411845524453, 0.00076679453057823619}, + {-0.0017986411845524453, -0.00076679453057823619} + } + },{ + "healpix_s", + "+proj=healpix +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.14425527418, 131588.04444199943}, + { 223402.14425527418, -131588.04444199943}, + {-223402.14425527418, 131588.04444199943}, + {-223402.14425527418, -131588.04444199943} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931097838226, 0.00075990887733981202}, + { 0.0017904931097838226, -0.00075990887733981202}, + {-0.0017904931097838226, 0.00075990887733981202}, + {-0.0017904931097838226, -0.00075990887733981202} + } + },{ + "rhealpix_e", + "+proj=rhealpix +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222390.10394923863, 130406.58866448226}, + { 222390.10394923863, -130406.58866448054}, + {-222390.10394923863, 130406.58866448226}, + {-222390.10394923863, -130406.58866448054} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017986411845524453, 0.00076679453057823619}, + { 0.0017986411845524453, -0.00076679453057823619}, + {-0.0017986411845524453, 0.00076679453057823619}, + {-0.0017986411845524453, -0.00076679453057823619} + } + },{ + "rhealpix_s", + "+proj=rhealpix +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.14425527418, 131588.04444199943}, + { 223402.14425527418, -131588.04444199943}, + {-223402.14425527418, 131588.04444199943}, + {-223402.14425527418, -131588.04444199943} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931097838226, 0.00075990887733981202}, + { 0.0017904931097838226, -0.00075990887733981202}, + {-0.0017904931097838226, 0.00075990887733981202}, + {-0.0017904931097838226, -0.00075990887733981202} + } + }, + // helmert projection is not implemented in Boost.Geometry + // hgridshift projection is not implemented in Boost.Geometry + // horner projection is not implemented in Boost.Geometry + { + "igh", + "+proj=igh +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ { 223878.49745627123, 111701.07212763709}, + { 223708.37131305804, -111701.07212763709}, + {-222857.74059699223, 111701.07212763709}, + {-223027.86674020503, -111701.07212763709} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ { 0.001790489447892545, 0.00089524655489191132}, + { 0.0017904906685957927, -0.00089524655489191132}, + {-0.001790496772112032, 0.00089524655489191132}, + {-0.0017904955514087843, -0.00089524655489191132} + } + },{ + "imw_p", + "+proj=imw_p +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222588.4411393762, 55321.128653809537}, + { 222756.90637768712, -165827.58428832365}, + {-222588.4411393762, 55321.128653809537}, + {-222756.90637768712, -165827.58428832365} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966991379592214, 0.50090492361427374}, + { 0.0017966979081574697, 0.49909507588689922}, + {-0.0017966991379592214, 0.50090492361427374}, + {-0.0017966979081574697, 0.49909507588689922} + } + },{ + "isea", + "+proj=isea +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-1097074.9480224741, 3442909.3090371834}, + {-1097074.9482647954, 3233611.7285857084}, + {-1575486.3536415542, 3442168.3420281881}, + {-1575486.353880283, 3234352.6955947056} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "krovak", + "+proj=krovak +ellps=GRS80 +no_defs", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-3196535.2325636409, -6617878.8675514441}, + {-3260035.4405521089, -6898873.6148780314}, + {-3756305.3288691747, -6478142.5615715114}, + {-3831703.6585019818, -6759107.1701553948} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {24.836218918719162, 59.758403933233858}, + {24.836315484509566, 59.756888425730189}, + {24.830447747947495, 59.758403933233858}, + {24.830351182157091, 59.756888425730189} + } + },{ + "labrd", + "+proj=labrd +ellps=GRS80 +lon_0=0.5 +lat_0=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 166973.166090228391, -110536.912730266107}, + { 166973.168287157256, -331761.993650884193}, + {-278345.500519976194, -110469.032642031714}, + {-278345.504185269645, -331829.870790275279} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.501797719349373672, 2.00090435742047923}, + {0.501797717380853658, 1.99909564058898681}, + {0.498202280650626328, 2.00090435742047923}, + {0.498202282619146342, 1.99909564058898681} + } + },{ + "laea_e", + "+proj=laea +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222602.471450095181, 110589.82722441027}, + { 222602.471450095181, -110589.827224408786}, + {-222602.471450095181, 110589.82722441027}, + {-222602.471450095181, -110589.827224408786} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179663056847900867, 0.000904369475966495845}, + { 0.00179663056847900867, -0.000904369475966495845}, + {-0.00179663056847900867, 0.000904369475966495845}, + {-0.00179663056847900867, -0.000904369475966495845} + } + },{ + "laea_s", + "+proj=laea +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223365.281370124663, 111716.668072915665}, + { 223365.281370124663, -111716.668072915665}, + {-223365.281370124663, 111716.668072915665}, + {-223365.281370124663, -111716.668072915665} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049311002060264, 0.000895246554791735271}, + { 0.00179049311002060264, -0.000895246554791735271}, + {-0.00179049311002060264, 0.000895246554791735271}, + {-0.00179049311002060264, -0.000895246554791735271} + } + },{ + "lagrng", + "+proj=lagrng +a=6400000 +W=2 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 111703.37591722561, 27929.8319080333386}, + { 111699.122088816002, -83784.1780133577704}, + {-111703.37591722561, 27929.8319080333386}, + {-111699.122088816002, -83784.1780133577704} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "larr", + "+proj=larr +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223393.637624200899, 111707.215961255497}, + {223393.637624200899, -111707.215961255497}, + {-223393.637624200899, 111707.215961255497}, + {-223393.637624200899, -111707.215961255497} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "lask", + "+proj=lask +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 217928.275907355128, 112144.32922014239}, + { 217928.275907355128, -112144.32922014239}, + {-217928.275907355128, 112144.32922014239}, + {-217928.275907355128, -112144.32922014239} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "lcc", + "+proj=lcc +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222588.439735968423, 110660.533870799671}, + { 222756.879700278747, -110532.797660827026}, + {-222588.439735968423, 110660.533870799671}, + {-222756.879700278747, -110532.797660827026} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179635940600536667, 0.000904232207322381741}, + { 0.00179635817735249777, -0.000904233135128348995}, + {-0.00179635940600536667, 0.000904232207322381741}, + {-0.00179635817735249777, -0.000904233135128348995} + } + },{ + "lcca", + "+proj=lcca +ellps=GRS80 +lat_0=1 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222605.285770237417, 67.8060072715846616}, + { 222740.037637936533, -221125.539829601563}, + {-222605.285770237417, 67.8060072715846616}, + {-222740.037637936533, -221125.539829601563} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179690290525662526, 1.00090436621350798}, + { 0.00179690192174008037, 0.999095632791497268}, + {-0.00179690290525662526, 1.00090436621350798}, + {-0.00179690192174008037, 0.999095632791497268} + } + },{ + "loxim", + "+proj=loxim +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223382.295791338867, 55850.5360638185448}, + { 223393.637462243292, -167551.608191455656}, + {-223382.295791338867, 55850.5360638185448}, + {-223393.637462243292, -167551.608191455656} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179056141104335601, 0.500895246554891926}, + { 0.00179056116683692576, 0.499104753445108074}, + {-0.00179056141104335601, 0.500895246554891926}, + {-0.00179056116683692576, 0.499104753445108074} + } + },{ + "lsat", + "+proj=lsat +ellps=GRS80 +lat_1=0.5 +lat_2=2 +lsat=1 +path=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {18241950.01455855, 9998256.83982293494}, + {18746856.2533194572, 10215761.669925211}, + {18565503.6836331636, 9085039.14672705345}, + {19019696.9020289108, 9247763.0394328218} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {126.000423834530011, 0.00172378224025701425}, + {126.002213738256714, 0.00188015467480917966}, + {126.000734468914601, -0.00188015467480917966}, + {126.002524372641304, -0.00172378224025701425} + } + }, { + "mbt_fps", + "+proj=mbt_fps +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 198798.176129849948, 125512.017254530627}, + { 198798.176129849948, -125512.017254530627}, + {-198798.176129849948, 125512.017254530627}, + {-198798.176129849948, -125512.017254530627} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00201197086238270742, 0.000796711850174446003}, + { 0.00201197086238270742, -0.000796711850174446003}, + {-0.00201197086238270742, 0.000796711850174446003}, + {-0.00201197086238270742, -0.000796711850174446003} + } + },{ + "mbtfpp", + "+proj=mbtfpp +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {206804.786929820373, 120649.762565792524}, + {206804.786929820373, -120649.762565792524}, + {-206804.786929820373, 120649.762565792524}, + {-206804.786929820373, -120649.762565792524} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.00193395359462902698, 0.00082883725477665357}, + {0.00193395359462902698, -0.00082883725477665357}, + {-0.00193395359462902698, 0.00082883725477665357}, + {-0.00193395359462902698, -0.00082883725477665357} + } + },{ + "mbtfpq", + "+proj=mbtfpq +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 209391.854738393013, 119161.040199054827}, + { 209391.854738393013, -119161.040199054827}, + {-209391.854738393013, 119161.040199054827}, + {-209391.854738393013, -119161.040199054827} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00191010555824111571, 0.000839185447792341723}, + { 0.00191010555824111571, -0.000839185447792341723}, + {-0.00191010555824111571, 0.000839185447792341723}, + {-0.00191010555824111571, -0.000839185447792341723} + } + },{ + "merc_e", + "+proj=merc +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222638.981586547132, 110579.965218249708}, + { 222638.981586547132, -110579.965218249112}, + {-222638.981586547132, 110579.965218249708}, + {-222638.981586547132, -110579.965218249112} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179663056823904264, 0.00090436947522799056}, + { 0.00179663056823904264, -0.00090436947522799056}, + {-0.00179663056823904264, 0.00090436947522799056}, + {-0.00179663056823904264, -0.00090436947522799056} + } + },{ + "merc_s", + "+proj=merc +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.144255274179, 111706.743574944077}, + { 223402.144255274179, -111706.743574944485}, + {-223402.144255274179, 111706.743574944077}, + {-223402.144255274179, -111706.743574944485} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310978382265, 0.000895246554845297135}, + { 0.00179049310978382265, -0.000895246554858019272}, + {-0.00179049310978382265, 0.000895246554845297135}, + {-0.00179049310978382265, -0.000895246554858019272} + } + },{ + "mill", + "+proj=mill +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223402.144255274179, 111704.701754393827}, + { 223402.144255274179, -111704.701754396243}, + {-223402.144255274179, 111704.701754393827}, + {-223402.144255274179, -111704.701754396243} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310978382265, 0.000895246554873922024}, + { 0.00179049310978382265, -0.000895246554873922024}, + {-0.00179049310978382265, 0.000895246554873922024}, + {-0.00179049310978382265, -0.000895246554873922024} + } + }, + // the following projections are not implemented in Boost.Geometry + /*{ + "misrsom_e", + "+proj=misrsom +ellps=GRS80 +lat_1=0.5 +lat_2=2 +path=1", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {18556630.3683698252, 9533394.6753112711}, + {19041866.0067297369, 9707182.17532352544}, + {18816810.1301847994, 8647669.64980295487}, + {19252610.7845367305, 8778164.08580140397} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {127.759503987730625, 0.00173515039622462014}, + {127.761295471077958, 0.00187196632421706517}, + {127.759775773557251, -0.00187196632421891525}, + {127.76156725690457, -0.00173515039622462014} + } + },{ + "misrsom_s", + "+proj=misrsom +R=6400000 +lat_1=0.5 +lat_2=2 +path=1", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {18641249.2791703865, 9563342.53233416565}, + {19130982.4615812786, 9739539.59350463562}, + {18903483.5150115378, 8675064.50061797537}, + {19343388.3998006098, 8807471.90406848863} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {127.75950514818588, 0.00171623111593511971}, + {127.761290323778738, 0.00185412132880796244}, + {127.759780920856471, -0.00185412132880796244}, + {127.761566096449329, -0.00171623111593511971} + } + },{ + "mil_os", + "+proj=mil_os +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-1908527.94959420455, -1726237.4730614475}, + {-1916673.02291848511, -1943133.88812552323}, + {-2344429.41208962305, -1706258.05121891224}, + {-2354637.83553299867, -1926468.60513541684} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {20.0020363939492398, 18.0009683469140498}, + {20.0020363715837419, 17.999031631815086}, + {19.9979636060507602, 18.0009683469140498}, + {19.9979636284162581, 17.999031631815086} + } + },{ + "lee_os", + "+proj=lee_os +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-25564478.9526050538, 154490848.8286255}, + { 30115393.9385746419, 125193997.439701974}, + {-31039340.5921660066, 57678685.0448915437}, + {-3088419.93942357088, 58150091.0991110131} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-164.997479457813824, -9.99875886103541411}, + {-164.997479438558884, -10.0012411200022751}, + {-165.002520542186289, -9.99875886103545142}, + {-165.002520561440946, -10.0012411200022999} + } + },{ + "gs48", + "+proj=gs48 +R=6370997", + // All latitudes and longitudes within the continental US + { + { -119.0, 40.0}, + { -70.0, 64.0}, + { -80.0, 25.0}, + { -95.0, 35.0} + },{ + { -1923908.446529345820, 355874.658944479190}, + { 1354020.375109298155, 3040846.007866524626}, + { 1625139.160484319553, -1413614.894029108109}, + { 90241.658071457961, -439595.048485902138} + },{ + { -1923000.0, 355000.0}, + { 1354000.0, 3040000.0}, + { 1625000.0, -1413000.0}, + { 90000.0, -439000.0} + },{ + {-118.987112613284, 39.994449789388}, + { -70.005208999424, 63.993387835525}, + { -80.000346610440, 25.005602546594}, + { -95.002606473071, 35.005424705030} + } + },{ + "alsk_e", + "+proj=alsk +ellps=clrk66", + { + {-160.0, 55.0}, + {-160.0, 70.0}, + {-145.0, 70.0}, + {-145.0, 60.0} + },{ + {-513253.146950842060, -968928.031867943470}, + {-305001.133897637190, 687494.464958650530}, + {266454.305088600490, 683423.477493030950}, + {389141.322439243960, -423913.251230396680} + },{ + {-500000.0, -950000.0}, + {-305000.0, 700000.0}, + { 250000.0, 700000.0}, + { 400000.0, -400000.0} + },{ + {-159.830804302926, 55.183195262220}, + {-160.042203155537, 70.111086864056}, + {-145.381043551466, 70.163900908411}, + {-144.758985461448, 60.202929200739} + } + },{ + "alsk_s", + "+proj=alsk +R=6370997", + { + {-160.0, 55.0}, + {-160.0, 70.0}, + {-145.0, 70.0}, + {-145.0, 60.0} + },{ + {-511510.319410844070, -967150.991676078060}, + {-303744.771290368980, 685439.745941123230}, + {265354.974019662940, 681386.892874573010}, + {387711.995394026630, -422980.685505462640} + },{ + {-500000.0, -950000.0}, + {-305000.0, 700000.0}, + { 250000.0, 700000.0}, + { 400000.0, -400000.0} + },{ + {-159.854014457557, 55.165653849074}, + {-160.082332371601, 70.128307617632}, + {-145.347827407243, 70.181566919011}, + {-144.734239827146, 60.193564732505} + } + },{ + "gs50_e", + "+proj=gs50 +ellps=clrk66", + { + {-160.0, 65.0}, + {-130.0, 45.0}, + { -65.0, 45.0}, + { -80.0, 36.0} + },{ + {-1874628.5377402329, 2660907.942291015300}, + { -771831.51885333552, 48465.166491304852}, + { 4030931.8339815089, 1323687.864777399200}, + { 3450764.2615361013, -175619.041820732440} + },{ + {-1800000.0, 2600000.0}, + { -800000.0, 500000.0}, + { 4000000.0, 1300000.0}, + { 3900000.0, -170000.0} + },{ + {-157.989284999679, 64.851559609698}, + {-131.171390466814, 49.084969745967}, + { -65.491568685301, 44.992837923774}, + { -75.550660091101, 34.191114075743} + } + },{ + "gs50_s", + "+proj=gs50 +R=6370997", + { + {-160.0, 65.0}, + {-130.0, 45.0}, + { -65.0, 45.0}, + { -80.0, 36.0} + },{ + {-1867268.2534600089, 2656506.230401823300}, + { -769572.18967299373, 48324.312440863941}, + { 4019393.068680791200, 1320191.309350289200}, + { 3442685.615172345700, -178760.423489428680} + },{ + {-1800000.0, 2600000.0}, + { -800000.0, 500000.0}, + { 4000000.0, 1300000.0}, + { 3900000.0, -170000.0} + },{ + {-158.163295044933, 64.854288364994}, + {-131.206816959506, 49.082915350974}, + { -65.348945220767, 44.957292681774}, + { -75.446820242089, 34.185406225616} + } + },*/ + { + "moll", + "+proj=moll +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {201113.698641813244, 124066.283433859542}, + {201113.698641813244, -124066.283433859542}, + {-201113.698641813244, 124066.283433859542}, + {-201113.698641813244, -124066.283433859542} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.00198873782220854774, 0.000806005080362811612}, + {0.00198873782220854774, -0.000806005080362811612}, + {-0.00198873782220854774, 0.000806005080362811612}, + {-0.00198873782220854774, -0.000806005080362811612} + } + },{ + "wag4", + "+proj=wag4 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 192801.218662384286, 129416.216394802992}, + { 192801.218662384286, -129416.216394802992}, + {-192801.218662384286, 129416.216394802992}, + {-192801.218662384286, -129416.216394802992} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00207450259783523421, 0.000772682950537716476}, + { 0.00207450259783523421, -0.000772682950537716476}, + {-0.00207450259783523421, 0.000772682950537716476}, + {-0.00207450259783523421, -0.000772682950537716476} + } + },{ + "wag5", + "+proj=wag5 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 203227.05192532466, 138651.631442713202}, + { 203227.05192532466, -138651.631442713202}, + {-203227.05192532466, 138651.631442713202}, + {-203227.05192532466, -138651.631442713202} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00196807227086416396, 0.00072121615041701424}, + { 0.00196807227086416396, -0.00072121615041701424}, + {-0.00196807227086416396, 0.00072121615041701424}, + {-0.00196807227086416396, -0.00072121615041701424} + } + },{ + "natearth", + "+proj=natearth +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 194507.265257889288, 112508.737358294515}, + { 194507.265257889288, -112508.737358294515}, + {-194507.265257889288, 112508.737358294515}, + {-194507.265257889288, -112508.737358294515} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00205638349586440223, 0.000888823913291242177}, + { 0.00205638349586440223, -0.000888823913291242177}, + {-0.00205638349586440223, 0.000888823913291242177}, + {-0.00205638349586440223, -0.000888823913291242177} + } + }, + // the following projection is not implemented in Boost.Geometry + /*{ + "natearth2", + "+proj=natearth2 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 189255.172934730799, 113022.495810907014}, + { 189255.172934730799, -113022.495810907014}, + {-189255.172934730799, 113022.495810907014}, + {-189255.172934730799, -113022.495810907014} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00211344929691056112, 0.000884779612080993237}, + { 0.00211344929691056112, -0.000884779612080993237}, + {-0.00211344929691056112, 0.000884779612080993237}, + {-0.00211344929691056112, -0.000884779612080993237} + } + },*/ + { + "nell", + "+proj=nell +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223385.132504695706, 111698.23644718733}, + { 223385.132504695706, -111698.23644718733}, + {-223385.132504695706, 111698.23644718733}, + {-223385.132504695706, -111698.23644718733} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310989310567, 0.000895246554910125161}, + { 0.00179049310989310567, -0.000895246554910125161}, + {-0.00179049310989310567, 0.000895246554910125161}, + {-0.00179049310989310567, -0.000895246554910125161} + } + },{ + "nell_h", + "+proj=nell_h +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223385.131640952837, 111698.236533561678}, + { 223385.131640952837, -111698.236533561678}, + {-223385.131640952837, 111698.236533561678}, + {-223385.131640952837, -111698.236533561678} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310989310567, 0.000895246554910125378}, + { 0.00179049310989310567, -0.000895246554910125378}, + {-0.00179049310989310567, 0.000895246554910125378}, + {-0.00179049310989310567, -0.000895246554910125378} + } + },{ + "nicol", + "+proj=nicol +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223374.561814139714, 111732.553988545071}, + { 223374.561814139714, -111732.553988545071}, + {-223374.561814139714, 111732.553988545071}, + {-223374.561814139714, -111732.553988545071} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "nsper", + "+proj=nsper +a=6400000 +h=1000000", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222239.816114099842, 111153.763991924759}, + { 222239.816114099842, -111153.763991924759}, + {-222239.816114099842, 111153.763991924759}, + {-222239.816114099842, -111153.763991924759} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049311728792437, 0.000895246558425396135}, + { 0.00179049311728792437, -0.000895246558425396135}, + {-0.00179049311728792437, 0.000895246558425396135}, + {-0.00179049311728792437, -0.000895246558425396135} + } + },{ + "tpers", + "+proj=tpers +a=6400000 +h=1000000 +azi=20", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 170820.288955531199, 180460.865555804776}, + { 246853.941538942483, -28439.8780357754222}, + {-246853.941538942483, 28439.8780357754222}, + {-170820.288955531199, -180460.865555804776} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00198870552603137678, 0.000228871872278689991}, + { 0.00137632081376749859, -0.00145364129728205432}, + {-0.00137632081376749859, 0.00145364129728205432}, + {-0.00198870552603137678, -0.000228871872278689991} + } + },{ + "nzmg", + "+proj=nzmg +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {3352675144.74742508, -7043205391.10024357}, + {3691989502.77930641, -6729069415.33210468}, + {4099000768.45323849, -7863208779.66724873}, + {4466166927.36997604, -7502531736.62860489} + },{ + { 200000, 100000}, + { 200000,-100000}, + {-200000, 100000}, + {-200000,-100000} + },{ + {175.48208682711271, -69.4226921826331846}, + {175.756819472543611, -69.5335710883796168}, + {134.605119233460016, -61.4599957106629091}, + {134.333684315954827, -61.6215536756024349} + } + },{ + "ob_tran", + "+proj=ob_tran +a=6400000 +o_proj=latlon +o_lon_p=20 +o_lat_p=20 +lon_0=180", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-2.6856872138416592, 1.2374302350496296}, + {-2.6954069748943286, 1.2026833954513816}, + {-2.8993663925401947, 1.2374302350496296}, + {-2.8896466314875244, 1.2026833954513816} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 121.5518748407577, -2.5361001573966084}, + { 63.261184340201858, 17.585319578673531}, + {-141.10073322351622, 26.091712304855108}, + {-65.862385598848391, 51.830295078417215} + } + },{ + "ocea", + "+proj=ocea +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {19994423.837934087962, 223322.760576727800}, + {20217962.128015257418, 223322.760576729401}, + {19994423.837934091687, -223322.760576726549}, + {20217962.128015264869, -223322.760576724948}, + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 179.999104753445, 0.001790493110}, + {-179.999104753445, 0.001790493110}, + { 179.999104753445, -0.001790493110}, + {-179.999104753445, -0.001790493110} + } + },{ + "oea", + "+proj=oea +a=6400000 +lat_1=0.5 +lat_2=2 +n=1 +m=2 +theta=3", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 228926.872097864107, 99870.4884300760023}, + { 217242.584036940476, -123247.885607474513}, + {-217242.584036940476, 123247.885607474556}, + {-228926.872097864078, -99870.4884300760168} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017411857167771369, 0.000987726819566195693}, + { 0.00183489288577854998, -0.000800312481495174641}, + {-0.00183489288577854954, 0.000800312481495174966}, + {-0.00174118571677713712, -0.000987726819566195043} + } + },{ + "omerc", + "+proj=omerc +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222650.796885261341, 110642.229314983808}, + { 222650.796885261341, -110642.229314983808}, + {-222650.796885261545, 110642.229314983808}, + {-222650.796885261545, -110642.229314983808} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179663056816996357, 0.000904369474808157338}, + { 0.00179663056816996357, -0.000904369474820879583}, + {-0.0017966305681604536, 0.000904369474808157338}, + {-0.0017966305681604536, -0.000904369474820879583} + } + },{ + "ortho", + "+proj=ortho +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223322.76057672748, 111695.401198614476}, + { 223322.76057672748, -111695.401198614476}, + {-223322.76057672748, 111695.401198614476}, + {-223322.76057672748, -111695.401198614476} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931102938101, 0.000895246554928338998}, + { 0.0017904931102938101, -0.000895246554928338998}, + {-0.0017904931102938101, 0.000895246554928338998}, + {-0.0017904931102938101, -0.000895246554928338998} + } + }, + // patterson projection is not implemented in Boost.Geometry + /*{ + "patterson", + "+proj=patterson +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223402.144255274179, 113354.250397779804}, + {223402.144255274179, -113354.250397779804}, + {-223402.144255274179, 113354.250397779804}, + {-223402.144255274179, -113354.250397779804} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.00179049310978382265, 0.000882190140807953657}, + {0.00179049310978382265, -0.000882190140807953657}, + {-0.00179049310978382265, 0.000882190140807953657}, + {-0.00179049310978382265, -0.000882190140807953657} + } + },*/ + // pipeline projection is not implemented in Boost.Geometry + // and tests are implemented differently + { + "poly_e", + "+proj=poly +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222605.285770237475, 110642.194561440483}, + { 222605.285770237475, -110642.194561440483}, + {-222605.285770237475, 110642.194561440483}, + {-222605.285770237475, -110642.194561440483} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179663056846135222, 0.000904369476631838518}, + { 0.00179663056846135222, -0.000904369476631838518}, + {-0.00179663056846135222, 0.000904369476631838518}, + {-0.00179663056846135222, -0.000904369476631838518} + } + },{ + "poly_s", + "+proj=poly +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223368.105210218986, 111769.110491224754}, + { 223368.105210218986, -111769.110491224754}, + {-223368.105210218986, 111769.110491224754}, + {-223368.105210218986, -111769.110491224754} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931100023887, 0.000895246554454779222}, + { 0.0017904931100023887, -0.000895246554454779222}, + {-0.0017904931100023887, 0.000895246554454779222}, + {-0.0017904931100023887, -0.000895246554454779222} + } + },{ + "putp2", + "+proj=putp2 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 211638.039634339279, 117895.033043379764}, + { 211638.039634339279, -117895.033043379764}, + {-211638.039634339279, 117895.033043379764}, + {-211638.039634339279, -117895.033043379764} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00188980221640386672, 0.000848201580276863377}, + { 0.00188980221640386672, -0.000848201580276863377}, + {-0.00188980221640386672, 0.000848201580276863377}, + {-0.00188980221640386672, -0.000848201580276863377} + } + },{ + "putp3", + "+proj=putp3 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 178227.115507793525, 89124.5607860879827}, + { 178227.115507793525, -89124.5607860879827}, + {-178227.115507793525, 89124.5607860879827}, + {-178227.115507793525, -89124.5607860879827} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00224405032986489889, 0.00112202516475805899}, + { 0.00224405032986489889, -0.00112202516475805899}, + {-0.00224405032986489889, 0.00112202516475805899}, + {-0.00224405032986489889, -0.00112202516475805899} + } + },{ + "putp3p", + "+proj=putp3p +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 178238.118539984745, 89124.5607860879827}, + { 178238.118539984745, -89124.5607860879827}, + {-178238.118539984745, 89124.5607860879827}, + {-178238.118539984745, -89124.5607860879827} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00224405032969050844, 0.00112202516475805899}, + { 0.00224405032969050844, -0.00112202516475805899}, + {-0.00224405032969050844, 0.00112202516475805899}, + {-0.00224405032969050844, -0.00112202516475805899} + } + },{ + "putp4p", + "+proj=putp4p +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 195241.47734938623, 127796.782307926231}, + { 195241.47734938623, -127796.782307926231}, + {-195241.47734938623, 127796.782307926231}, + {-195241.47734938623, -127796.782307926231} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00204852830860296001, 0.000782480174932193733}, + { 0.00204852830860296001, -0.000782480174932193733}, + {-0.00204852830860296001, 0.000782480174932193733}, + {-0.00204852830860296001, -0.000782480174932193733} + } + },{ + "weren", + "+proj=weren +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223378.515757633519, 146214.093042288267}, + { 223378.515757633519, -146214.093042288267}, + {-223378.515757633519, 146214.093042288267}, + {-223378.515757633519, -146214.093042288267} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00179049310987240413, 0.000683917989676492265}, + { 0.00179049310987240413, -0.000683917989676492265}, + {-0.00179049310987240413, 0.000683917989676492265}, + {-0.00179049310987240413, -0.000683917989676492265} + } + },{ + "putp5", + "+proj=putp5 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 226367.21338056153, 113204.56855847509}, + { 226367.21338056153, -113204.56855847509}, + {-226367.21338056153, 113204.56855847509}, + {-226367.21338056153, -113204.56855847509} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00176671315102969553, 0.000883356575387199546}, + { 0.00176671315102969553, -0.000883356575387199546}, + {-0.00176671315102969553, 0.000883356575387199546}, + {-0.00176671315102969553, -0.000883356575387199546} + } + },{ + "putp5p", + "+proj=putp5p +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 226388.175248755841, 113204.56855847509}, + { 226388.175248755841, -113204.56855847509}, + {-226388.175248755841, 113204.56855847509}, + {-226388.175248755841, -113204.56855847509} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00176671315090204742, 0.000883356575387199546}, + { 0.00176671315090204742, -0.000883356575387199546}, + {-0.00176671315090204742, 0.000883356575387199546}, + {-0.00176671315090204742, -0.000883356575387199546} + } + },{ + "putp6", + "+proj=putp6 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 226369.395133402577, 110218.523796520662}, + { 226369.395133402577, -110218.523796520749}, + {-226369.395133402577, 110218.523796520662}, + {-226369.395133402577, -110218.523796520749} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00176671315102969921, 0.000907295534210503544}, + { 0.00176671315102969921, -0.000907295534205924308}, + {-0.00176671315102969921, 0.000907295534210503544}, + {-0.00176671315102969921, -0.000907295534205924308} + } + },{ + "putp6p", + "+proj=putp6p +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 198034.195132195076, 125989.475461323193}, + { 198034.195132195076, -125989.475461323193}, + {-198034.195132195076, 125989.475461323193}, + {-198034.195132195076, -125989.475461323193} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00201955053120177067, 0.000793716441164738612}, + { 0.00201955053120177067, -0.000793716441164738612}, + {-0.00201955053120177067, 0.000793716441164738612}, + {-0.00201955053120177067, -0.000793716441164738612} + } + },{ + "qsc_e", + "+proj=qsc +ellps=GRS80 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 304638.450843852363, 164123.870923793991}, + { 304638.450843852363, -164123.870923793991}, + {-304638.450843852363, 164123.870923793962}, + {-304638.450843852421, -164123.870923793904} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00132134098471627126, 0.000610652900922527926}, + { 0.00132134098471627126, -0.000610652900922527926}, + {-0.00132134098471627126, 0.000610652900922527926}, + {-0.00132134098471627126, -0.000610652900922527926} + } + },{ + "qsc_s", + "+proj=qsc +R=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 305863.792402890511, 165827.722754715243}, + { 305863.792402890511, -165827.722754715243}, + {-305863.792402890511, 165827.722754715243}, + {-305863.792402890569, -165827.722754715156} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.00131682718763827234, 0.000604493198178676161}, + { 0.00131682718763827234, -0.000604493198178676161}, + {-0.00131682718763827234, 0.000604493198178676161}, + {-0.00131682718763827234, -0.000604493198178676161} + } + },{ + "robin", + "+proj=robin +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ // original expected different because float coefficients are defined + /*{ 189588.423282507836, 107318.530350702888}, + { 189588.423282507836, -107318.530350702888}, + {-189588.423282507836, 107318.530350702888}, + {-189588.423282507836, -107318.530350702888}*/ + { 189588.4232821252, 107318.5272684303}, + { 189588.4232821252, -107318.5272684303}, + {-189588.4232821252, 107318.5272684303}, + {-189588.4232821252, -107318.5272684303} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.002109689065506131, 0.000931805533547745983}, + { 0.002109689065506131, -0.000931805533547745983}, + {-0.002109689065506131, 0.000931805533547745983}, + {-0.002109689065506131, -0.000931805533547745983} + } + },{ + "rpoly", + "+proj=rpoly +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223368.09830201423, 111769.110486991223}, + { 223368.09830201423, -111769.110486991223}, + {-223368.09830201423, 111769.110486991223}, + {-223368.09830201423, -111769.110486991223} + }, + {},{{HUGE_VAL, HUGE_VAL}} + }, + // sch projection not implemented in Boost.Geometry + // and the tests are not implemented in Proj4 anyway + { + "euler_e", + "+proj=euler +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222597.63465910763, 111404.24054991946}, + {222767.16563187627, -111234.6764910177}, + {-222597.63465910763, 111404.24054991946}, + {-222767.16563187627, -111234.6764910177} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017962807023075235, 0.0008983146697688839}, + {0.0017962794738334226, -0.00089831589842987965}, + {-0.0017962807023075235, 0.0008983146697688839}, + {-0.0017962794738334226, -0.00089831589842987965} + } + },{ + "euler_s", + "+proj=euler +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223360.65559869423, 111786.11238979101}, + {223530.76769031584, -111615.96709862351}, + {-223360.65559869423, 111786.11238979101}, + {-223530.76769031584, -111615.96709862351} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017901444369360026, 0.00089524594522202015}, + {0.001790143216840731, -0.00089524716533368484}, + {-0.0017901444369360026, 0.00089524594522202015}, + {-0.001790143216840731, -0.00089524716533368484} + } + },{ + "murd1_e", + "+proj=murd1 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222600.81347355421, 111404.24418054636}, + {222770.3492878644, -111234.6728566746}, + {-222600.81347355421, 111404.24418054636}, + {-222770.3492878644, -111234.6728566746} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017962550410516366, 0.0008983146697688839}, + {0.0017962538125775522, -0.00089831589842987965}, + {-0.0017962550410516366, 0.0008983146697688839}, + {-0.0017962538125775522, -0.00089831589842987965} + } + },{ + "murd1_s", + "+proj=murd1 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223363.84530949194, 111786.11603286299}, + {223533.96225925098, -111615.96345182261}, + {-223363.84530949194, 111786.11603286299}, + {-223533.96225925098, -111615.96345182261} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017901188633413715, 0.00089524594522202015}, + {0.0017901176432461162, -0.00089524716492657387}, + {-0.0017901188633413715, 0.00089524594522202015}, + {-0.0017901176432461162, -0.00089524716492657387} + } + },{ + "murd2_e", + "+proj=murd2 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222588.09975123021, 111426.14002741246}, + {222757.72626701824, -111341.43131750476}, + {-222588.09975123021, 111426.14002741246}, + {-222757.72626701824, -111341.43131750476} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017963574947305447, 0.00089788747830845382}, + {0.0017963562661689487, -0.00089788809264252983}, + {-0.0017963574947305447, 0.00089788747830845382}, + {-0.0017963562661689487, -0.00089788809264252983} + } + },{ + "murd2_s", + "+proj=murd2 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223351.08800702673, 111808.08693438848}, + {223521.2959691704, -111723.08785967289}, + {-223351.08800702673, 111808.08693438848}, + {-223521.2959691704, -111723.08785967289} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017902209670287586, 0.00089482021163422854}, + {0.0017902197468465887, -0.00089482082161134206}, + {-0.0017902209670287586, 0.00089482021163422854}, + {-0.0017902197468465887, -0.00089482082161134206} + } + },{ + "murd3_e", + "+proj=murd3 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222600.81407757697, 111404.24660137216}, + {222770.35473389886, -111234.67043217793}, + {-222600.81407757697, 111404.24660137216}, + {-222770.35473389886, -111234.67043217793} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017962550166583809, 0.0008983146697688839}, + {0.0017962537881492445, -0.00089831589842987965}, + {-0.0017962550166583809, 0.0008983146697688839}, + {-0.0017962537881492445, -0.00089831589842987965} + } + },{ + "murd3_s", + "+proj=murd3 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223363.84591558515, 111786.11846198692}, + {223533.96772395336, -111615.96101901523}, + {-223363.84591558515, 111786.11846198692}, + {-223533.96772395336, -111615.96101901523} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017901188390313859, 0.00089524594522202015}, + {0.0017901176189013177, -0.00089524716533368484}, + {-0.0017901188390313859, 0.00089524594522202015}, + {-0.0017901176189013177, -0.00089524716533368484} + } + },{ + "pconic_e", + "+proj=pconic +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222588.09884161691, 111416.60477006658}, + {222757.71809109033, -111331.88153107995}, + {-222588.09884161691, 111416.60477006658}, + {-222757.71809109033, -111331.88153107995} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017963575313784969, 0.0008979644089172499}, + {0.0017963563027642206, -0.00089796502355327969}, + {-0.0017963575313784969, 0.0008979644089172499}, + {-0.0017963563027642206, -0.00089796502355327969} + } + },{ + "pconic_s", + "+proj=pconic +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223351.08709429545, 111798.5189920546}, + {223521.28776521701, -111713.50533845725}, + {-223351.08709429545, 111798.5189920546}, + {-223521.28776521701, -111713.50533845725} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017902210035514285, 0.0008948968793741558}, + {0.0017902197833169374, -0.00089489748965381963}, + {-0.0017902210035514285, 0.0008948968793741558}, + {-0.0017902197833169374, -0.00089489748965381963} + } + },{ + "tissot_e", + "+proj=tissot +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222641.07869963095, 54347.828487281469}, + {222810.61451394114, -168291.08854993948}, + {-222641.07869963095, 54347.828487281469}, + {-222810.61451394114, -168291.08854993948} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017962807107425871, 0.51344495513064536}, + {0.0017962794822333915, 0.51164832456244658}, + {-0.0017962807107425871, 0.51344495513064536}, + {-0.0017962794822333915, 0.51164832456244658} + } + },{ + "tissot_s", + "+proj=tissot +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223404.24855684943, 54534.122161157939}, + {223574.36550660848, -168867.95732352766}, + {-223404.24855684943, 54534.122161157939}, + {-223574.36550660848, -168867.95732352766} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017901444453421915, 0.51344188640609856}, + {0.001790143225212064, 0.51165139329554277}, + {-0.0017901444453421915, 0.51344188640609856}, + {-0.001790143225212064, 0.51165139329554277} + } + },{ + "vitk1_e", + "+proj=vitk1 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222607.17121145778, 111404.25144243463}, + {222776.71670959776, -111234.66558744459}, + {-222607.17121145778, 111404.25144243463}, + {-222776.71670959776, -111234.66558744459} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017962037198570686, 0.0008983146697688839}, + {0.0017962024913830157, -0.00089831589842987965}, + {-0.0017962037198570686, 0.0008983146697688839}, + {-0.0017962024913830157, -0.00089831589842987965} + } + },{ + "vitk1_s", + "+proj=vitk1 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223370.22484047143, 111786.12331964359}, + {223540.3515072545, -111615.9561576751}, + {-223370.22484047143, 111786.12331964359}, + {-223540.3515072545, -111615.9561576751} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017900677174648159, 0.00089524594522202015}, + {0.0017900664973695916, -0.00089524716533368484}, + {-0.0017900677174648159, 0.00089524594522202015}, + {-0.0017900664973695916, -0.00089524716533368484} + } + },{ + "somerc_e", + "+proj=somerc +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222638.98158654713, 110579.96521824898}, + {222638.98158654713, -110579.96521825089}, + {-222638.98158654713, 110579.96521824898}, + {-222638.98158654713, -110579.96521825089} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017966305682390426, 0.00090436947704129484}, + {0.0017966305682390426, -0.00090436947704377105}, + {-0.0017966305682390426, 0.00090436947704129484}, + {-0.0017966305682390426, -0.00090436947704377105} + } + },{ + "somerc_s", + "+proj=somerc +R=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223402.14425527418, 111706.74357494408}, + {223402.14425527418, -111706.74357494518}, + {-223402.14425527418, 111706.74357494408}, + {-223402.14425527418, -111706.74357494518} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904931097838226, 0.00089524655485801927}, + {0.0017904931097838226, -0.00089524655484529714}, + {-0.0017904931097838226, 0.00089524655485801927}, + {-0.0017904931097838226, -0.00089524655484529714} + } + },{ + "stere_e", + "+proj=stere +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222644.8545501172, 110610.8834741739}, + { 222644.8545501172, -110610.8834741739}, + {-222644.8545501172, 110610.8834741739}, + {-222644.8545501172, -110610.8834741739} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966305682022392, 0.00090436947502443507}, + { 0.0017966305682022392, -0.00090436947502443507}, + {-0.0017966305682022392, 0.00090436947502443507}, + {-0.0017966305682022392, -0.00090436947502443507} + } + },{ + "stere_s", + "+proj=stere +R=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223407.81025950745, 111737.938996443}, + { 223407.81025950745, -111737.938996443}, + {-223407.81025950745, 111737.938996443}, + {-223407.81025950745, -111737.938996443} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.001790493109747395, 0.00089524655465513144}, + { 0.001790493109747395, -0.00089524655465513144}, + {-0.001790493109747395, 0.00089524655465513144}, + {-0.001790493109747395, -0.00089524655465513144} + } + },{ + "ups", + "+proj=ups +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {2433455.5634384668, -10412543.301512826}, + {2448749.1185681992, -10850493.419804076}, + {1566544.4365615332, -10412543.301512826}, + {1551250.8814318008, -10850493.419804076} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-44.998567498074834, 64.9182362867341}, + {-44.995702709112308, 64.917020250675748}, + {-45.004297076028529, 64.915804280954518}, + {-45.001432287066002, 64.914588377560719} + } + },{ + "sterea_e", + "+proj=sterea +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222644.89410919772, 110611.09187173686}, + { 222644.89410919772, -110611.09187173827}, + {-222644.89410919772, 110611.09187173686}, + {-222644.89410919772, -110611.09187173827} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966305682019911, 0.00090436947683099009}, + { 0.0017966305682019911, -0.00090436947684371233}, + {-0.0017966305682019911, 0.00090436947683099009}, + {-0.0017966305682019911, -0.00090436947684371233} + } + },{ + "sterea_s", + "+proj=sterea +R=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223407.81025950745, 111737.93899644315}, + { 223407.81025950745, -111737.93899644315}, + {-223407.81025950745, 111737.93899644315}, + {-223407.81025950745, -111737.93899644315} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.001790493109747395, 0.00089524655465446378}, + { 0.001790493109747395, -0.00089524655465446378}, + {-0.001790493109747395, 0.00089524655465446378}, + {-0.001790493109747395, -0.00089524655465446378} + } + },{ + "fouc_e", + "+proj=fouc +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222588.12067589167, 111322.31670069379}, + {222588.12067589167, -111322.31670069379}, + {-222588.12067589167, 111322.31670069379}, + {-222588.12067589167, -111322.31670069379} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017966305685702751, 0.00089831528410111959}, + {0.0017966305685702751, -0.00089831528410111959}, + {-0.0017966305685702751, 0.00089831528410111959}, + {-0.0017966305685702751, -0.00089831528410111959} + } + },{ + "fouc_s", + "+proj=fouc +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223351.10900341379, 111703.9077217125}, + {223351.10900341379, -111703.9077217125}, + {-223351.10900341379, 111703.9077217125}, + {-223351.10900341379, -111703.9077217125} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904931101116717, 0.00089524655487369749}, + {0.0017904931101116717, -0.00089524655487369749}, + {-0.0017904931101116717, 0.00089524655487369749}, + {-0.0017904931101116717, -0.00089524655487369749} + } + },{ + "kav5_e", + "+proj=kav5 +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {200360.90530882866, 123685.08247699818}, + {200360.90530882866, -123685.08247699818}, + {-200360.90530882866, 123685.08247699818}, + {-200360.90530882866, -123685.08247699818} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0019962591348533314, 0.00080848256185253912}, + {0.0019962591348533314, -0.00080848256185253912}, + {-0.0019962591348533314, 0.00080848256185253912}, + {-0.0019962591348533314, -0.00080848256185253912} + } + },{ + "kav5_s", + "+proj=kav5 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {201047.7031108776, 124109.05062917093}, + {201047.7031108776, -124109.05062917093}, + {-201047.7031108776, 124109.05062917093}, + {-201047.7031108776, -124109.05062917093} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0019894397264987643, 0.00080572070962591153}, + {0.0019894397264987643, -0.00080572070962591153}, + {-0.0019894397264987643, 0.00080572070962591153}, + {-0.0019894397264987643, -0.00080572070962591153} + } + },{ + "qua_aut_e", + "+proj=qua_aut +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222613.54903309655, 111318.07788798446}, + {222613.54903309655, -111318.07788798446}, + {-222613.54903309655, 111318.07788798446}, + {-222613.54903309655, -111318.07788798446} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017966305684046586, 0.00089831528412872229}, + {0.0017966305684046586, -0.00089831528412872229}, + {-0.0017966305684046586, 0.00089831528412872229}, + {-0.0017966305684046586, -0.00089831528412872229} + } + },{ + "qua_aut_s", + "+proj=qua_aut +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223376.62452402918, 111699.65437918637}, + {223376.62452402918, -111699.65437918637}, + {-223376.62452402918, 111699.65437918637}, + {-223376.62452402918, -111699.65437918637} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017904931099477471, 0.00089524655490101819}, + {0.0017904931099477471, -0.00089524655490101819}, + {-0.0017904931099477471, 0.00089524655490101819}, + {-0.0017904931099477471, -0.00089524655490101819} + } + },{ + "mbt_s_e", + "+proj=mbt_s +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {204131.51785027285, 121400.33022550763}, + {204131.51785027285, -121400.33022550763}, + {-204131.51785027285, 121400.33022550763}, + {-204131.51785027285, -121400.33022550763} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0019593827209883237, 0.00082369854658027549}, + {0.0019593827209883237, -0.00082369854658027549}, + {-0.0019593827209883237, 0.00082369854658027549}, + {-0.0019593827209883237, -0.00082369854658027549} + } + },{ + "mbt_s_s", + "+proj=mbt_s +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {204831.24057099217, 121816.46669603503}, + {204831.24057099217, -121816.46669603503}, + {-204831.24057099217, 121816.46669603503}, + {-204831.24057099217, -121816.46669603503} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0019526892859206603, 0.00082088471512331508}, + {0.0019526892859206603, -0.00082088471512331508}, + {-0.0019526892859206603, 0.00082088471512331508}, + {-0.0019526892859206603, -0.00082088471512331508} + } + },{ + "tcc", + "+proj=tcc +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223458.84419245756, 111769.14504058579}, + {223458.84419245756, -111769.14504058579}, + {-223458.84419245756, 111769.14504058579}, + {-223458.84419245756, -111769.14504058579} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "tcea", + "+proj=tcea +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223322.76057672748, 111769.14504058579}, + { 223322.76057672748, -111769.14504058579}, + {-223322.76057672748, 111769.14504058579}, + {-223322.76057672748, -111769.14504058579} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931102938101, 0.00089524655445477922}, + { 0.0017904931102938101, -0.00089524655445477922}, + {-0.0017904931102938101, 0.00089524655445477922}, + {-0.0017904931102938101, -0.00089524655445477922} + } + }, + // times projection not implemented + { + "tmerc_e", + "+proj=tmerc +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 222650.79679577847, 110642.22941192707}, + { 222650.79679577847, -110642.22941192707}, + {-222650.79679577847, 110642.22941192707}, + {-222650.79679577847, -110642.22941192707} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017966305681649396, 0.00090436947663183841}, + { 0.0017966305681649396, -0.00090436947663183841}, + {-0.0017966305681649396, 0.00090436947663183841}, + {-0.0017966305681649396, -0.00090436947663183841} + } + },{ + "tmerc_s", + "+proj=tmerc +R=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223413.46640632232, 111769.14504059685}, + { 223413.46640632232, -111769.14504059685}, + {-223413.46640632208, 111769.14504059685}, + {-223413.46640632208, -111769.14504059685} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931097048034, 0.00089524670602767842}, + { 0.0017904931097048034, -0.00089524670602767842}, + {-0.001790493109714345, 0.00089524670602767842}, + {-0.001790493109714345, -0.00089524670602767842} + } + },{ + "tpeqd_e", + "+proj=tpeqd +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-27750.758831679042, -222599.40369177726}, + {-250434.93702403645, -222655.93819326628}, + {-27750.758831679042, 222599.40369177726}, + {-250434.93702403645, 222655.93819326628} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-0.00089855554821257374, 1.2517966304145272}, + {0.0008985555481998515, 1.2517966304145272}, + {-0.00089855431859741167, 1.2482033692781642}, + {0.00089855431859741167, 1.2482033692781642} + } + },{ + "tpeqd_s", + "+proj=tpeqd +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {-27845.882978485075, -223362.43069526015}, + {-251293.37876465076, -223419.15898590829}, + {-27845.882978485075, 223362.43069526015}, + {-251293.37876465076, 223419.15898590829} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-0.00089548606640108474, 1.2517904929571837}, + {0.0008954860663883625, 1.2517904929571837}, + {-0.000895484845182587, 1.248209506737604}, + {0.00089548484516986475, 1.248209506737604} + } + },{ + "urm5", + "+proj=urm5 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223393.6384339639, 111696.81878511712}, + { 223393.6384339639, -111696.81878511712}, + {-223393.6384339639, 111696.81878511712}, + {-223393.6384339639, -111696.81878511712} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "urmfps", + "+proj=urmfps +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 196001.70813419219, 127306.84332999329}, + { 196001.70813419219, -127306.84332999329}, + {-196001.70813419219, 127306.84332999329}, + {-196001.70813419219, -127306.84332999329} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.002040720839642371, 0.00078547381740438178}, + { 0.002040720839642371, -0.00078547381740438178}, + {-0.002040720839642371, 0.00078547381740438178}, + {-0.002040720839642371, -0.00078547381740438178} + } + },{ + "wag1", + "+proj=wag1 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 195986.78156115755, 127310.07506065986}, + { 195986.78156115755, -127310.07506065986}, + {-195986.78156115755, 127310.07506065986}, + {-195986.78156115755, -127310.07506065986} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.002040720839738254, 0.00078547381739207999}, + { 0.002040720839738254, -0.00078547381739207999}, + {-0.002040720839738254, 0.00078547381739207999}, + {-0.002040720839738254, -0.00078547381739207999} + } + },{ + "vandg", + "+proj=vandg +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223395.24954340671, 111704.59663367498}, + { 223395.24954340671, -111704.59663367498}, + {-223395.24954340671, 111704.59663367498}, + {-223395.24954340671, -111704.59663367498} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.001790493715929761, 0.00089524655486993867}, + { 0.001790493715929761, -0.00089524655486993867}, + {-0.001790493715929761, 0.00089524655486993867}, + {-0.001790493715929761, -0.00089524655486993867} + } + },{ + "vandg2", + "+proj=vandg2 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223395.24785043663, 111718.49103722633}, + { 223395.24785043663, -111718.49103722633}, + {-223395.24785043663, 111718.49103722633}, + {-223395.24785043663, -111718.49103722633} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "vandg3", + "+proj=vandg3 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223395.24955283134, 111704.51990442065}, + { 223395.24955283134, -111704.51990442065}, + {-223395.24955283134, 111704.51990442065}, + {-223395.24955283134, -111704.51990442065} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "vandg4", + "+proj=vandg4 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223374.57729435508, 111701.19548415358 }, + { 223374.57729435508, -111701.19548415358 }, + {-223374.57729435508, 111701.19548415358 }, + {-223374.57729435508, -111701.19548415358 } + }, + {},{{HUGE_VAL, HUGE_VAL}} + }, + // vgridshift projection is not implemented in Boost.Geometry + // and the Proj4 test is in a different format + { + "wag2", + "+proj=wag2 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 206589.88809996162, 120778.04035754716}, + { 206589.88809996162, -120778.04035754716}, + {-206589.88809996162, 120778.04035754716}, + {-206589.88809996162, -120778.04035754716} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0019360240367390709, 0.00082795765763814082}, + { 0.0019360240367390709, -0.00082795765763814082}, + {-0.0019360240367390709, 0.00082795765763814082}, + {-0.0019360240367390709, -0.00082795765763814082} + } + },{ + "wag3", + "+proj=wag3 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {223387.02171816575, 111701.07212763709}, + {223387.02171816575, -111701.07212763709}, + {-223387.02171816575, 111701.07212763709}, + {-223387.02171816575, -111701.07212763709} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.001790493109880963, 0.00089524655489191132}, + {0.001790493109880963, -0.00089524655489191132}, + {-0.001790493109880963, 0.00089524655489191132}, + {-0.001790493109880963, -0.00089524655489191132} + } + },{ + "wag7", + "+proj=wag7 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 198601.87695731167, 125637.0457141714}, + { 198601.87695731167, -125637.0457141714}, + {-198601.87695731167, 125637.0457141714}, + {-198601.87695731167, -125637.0457141714} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "wink1", + "+proj=wink1 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223385.13164095284, 111701.07212763709}, + { 223385.13164095284, -111701.07212763709}, + {-223385.13164095284, 111701.07212763709}, + {-223385.13164095284, -111701.07212763709} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + { 0.0017904931098931057, 0.00089524655489191132}, + { 0.0017904931098931057, -0.00089524655489191132}, + {-0.0017904931098931057, 0.00089524655489191132}, + {-0.0017904931098931057, -0.00089524655489191132} + } + },{ + "wink2", + "+proj=wink2 +a=6400000 +lat_1=0.5 +lat_2=2", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + { 223387.39643378611, 124752.03279744535}, + { 223387.39643378611, -124752.03279744535}, + {-223387.39643378611, 124752.03279744535}, + {-223387.39643378611, -124752.03279744535} + }, + {},{{HUGE_VAL, HUGE_VAL}} + },{ + "etmerc", + "+proj=etmerc +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5 +zone=30", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {222650.79679758562, 110642.22941193319}, + {222650.79679758562, -110642.22941193319}, + {-222650.79679758562, 110642.22941193319}, + {-222650.79679758562, -110642.22941193319} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {0.0017966305681649398, 0.00090436947663183873}, + {0.0017966305681649398, -0.00090436947663183873}, + {-0.0017966305681649398, 0.00090436947663183873}, + {-0.0017966305681649398, -0.00090436947663183873} + } + },{ + "utm", + "+proj=utm +ellps=GRS80 +lat_1=0.5 +lat_2=2 +n=0.5 +zone=30", + { + { 2, 1}, + { 2,-1}, + {-2, 1}, + {-2,-1} + },{ + {1057002.4054912981, 110955.14117594929}, + {1057002.4054912981, -110955.14117594929}, + {611263.81227890507, 110547.10569680421}, + {611263.81227890507, -110547.10569680421} + },{ + { 200, 100}, + { 200,-100}, + {-200, 100}, + {-200,-100} + },{ + {-7.4869520833902357, 0.00090193980983462605}, + {-7.4869520833902357, -0.00090193980983462605}, + {-7.4905356820622613, 0.00090193535121489081}, + {-7.4905356820622613, -0.00090193535121489081} + } + } +}; + +#endif // BOOST_GEOMETRY_TEST_SRS_PROJECTION_SELFTEST_CASES_HPP diff --git a/src/boost/libs/geometry/test/srs/projections.cpp b/src/boost/libs/geometry/test/srs/projections.cpp new file mode 100644 index 000000000..c81daef9b --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projections.cpp @@ -0,0 +1,370 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, 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. + +// 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) + + // WARNING: this file takes several minutes to quarters to compile on GCC + + +#if defined(_MSC_VER) +#pragma warning( disable : 4305 ) // truncation double -> float +#endif // defined(_MSC_VER) + + +#include + +#include + +#include + +#include + +#include +#include + +#include + + +namespace srs = bg::srs; + +inline void check(double v, double ve, std::string const& name, std::string const& axis) +{ + //BOOST_CHECK_CLOSE(v, ve, 0.001); + + bool ok = ::boost::test_tools::check_is_close_t()(v, ve, ::boost::math::fpc::percent_tolerance(0.001)); + BOOST_CHECK_MESSAGE((ok), name << " " << axis << " -> " << v << " != " << ve); +} + +template +void test_forward(std::string const& name, + double lon, double lat, + typename bg::coordinate_type

::type x, + typename bg::coordinate_type

::type y, + std::string const& parameters) +{ + typedef typename bg::coordinate_type

::type coord_type; + typedef bg::model::point > lonlat_type; + + lonlat_type ll; + bg::set<0>(ll, lon); + bg::set<1>(ll, lat); + + srs::projection<> prj = srs::proj4(parameters); + + P xy; + prj.forward(ll, xy); + + //std::cout << std::setprecision(16) << bg::get<0>(xy) << " " << bg::get<1>(xy) << std::endl; + + check(bg::get<0>(xy), x, name, "x"); + check(bg::get<1>(xy), y, name, "y"); +} + +template +void test_inverse(std::string const& name, + typename bg::coordinate_type

::type x, + typename bg::coordinate_type

::type y, + double lon, double lat, + std::string const& parameters) +{ + typedef typename bg::coordinate_type

::type coord_type; + typedef bg::model::point > lonlat_type; + + P xy; + bg::set<0>(xy, x); + bg::set<1>(xy, y); + + srs::projection<> prj = srs::proj4(parameters); + + lonlat_type ll; + prj.inverse(xy, ll); + + //std::cout << std::setprecision(16) << bg::get<0>(ll) << " " << bg::get<1>(ll) << std::endl; + + check(bg::get<0>(ll), lon, name, "lon"); + check(bg::get<1>(ll), lat, name, "lat"); +} + + +template +void test_all() +{ + test_forward

("aea", 4.897000, 52.371000, 334609.583974, 5218502.503686, "+proj=aea +ellps=WGS84 +units=m +lat_1=55 +lat_2=65"); + test_forward

("aeqd", 4.897000, 52.371000, 384537.462363, 5809944.807548, "+proj=aeqd +ellps=WGS84 +units=m"); + test_forward

("airy", 4.897000, 52.371000, 328249.003313, 4987937.101447, "+proj=airy +ellps=WGS84 +units=m"); + test_forward

("aitoff", 4.897000, 52.371000, 384096.182830, 5831239.274680, "+proj=aitoff +ellps=WGS84 +units=m"); + test_forward

("alsk", -84.390000, 33.755000, 7002185.416415, -3700467.546545, "+proj=alsk +ellps=WGS84 +units=m +lon_0=-150W"); + test_forward

("apian", 4.897000, 52.371000, -489503.746852, 5829913.052335, "+proj=apian +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_forward

("august", 4.897000, 52.371000, 472494.816642, 6557137.075680, "+proj=august +ellps=WGS84 +units=m"); + test_forward

("bacon", 4.897000, 52.371000, -276322.940590, 7934660.138798, "+proj=bacon +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_forward

("bipc", 4.897000, 52.371000, 3693973.674143, -8459972.647559, "+proj=bipc +ellps=WGS84 +units=m"); + test_forward

("boggs", 4.897000, 52.371000, -469734.523784, 5966441.169806, "+proj=boggs +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_forward

("bonne", 4.897000, 52.371000, 333291.091896, 274683.016972, "+proj=bonne +ellps=WGS84 +units=m +lat_1=50"); + test_forward

("cass", 4.897000, 52.371000, 333274.431072, 5815921.803069, "+proj=cass +ellps=WGS84 +units=m"); + test_forward

("cc", 4.897000, 52.371000, 545131.546415, 8273513.720038, "+proj=cc +ellps=WGS84 +units=m"); + test_forward

("cea", 4.897000, 52.371000, -738753.247401, 5031644.669407, "+proj=cea +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_forward

("chamb", 4.897000, 52.371000, -3221300.532044, 872840.127676, "+proj=chamb +ellps=WGS84 +units=m +lat_1=52 +lon_1=5 +lat_2=30 +lon_2=80 +lat_3=20 +lon_3=-50"); + test_forward

("collg", 4.897000, 52.371000, 280548.640940, 6148862.475491, "+proj=collg +ellps=WGS84 +units=m"); + test_forward

("crast", 4.897000, 52.371000, 340944.220871, 5874029.522010, "+proj=crast +ellps=WGS84 +units=m"); + test_forward

("denoy", 4.897000, 52.371000, 382253.324398, 5829913.052335, "+proj=denoy +ellps=WGS84 +units=m"); + test_forward

("eck1", 4.897000, 52.371000, 356112.818167, 5371202.270688, "+proj=eck1 +ellps=WGS84 +units=m"); + test_forward

("eck2", 4.897000, 52.371000, 320023.223588, 6697754.654662, "+proj=eck2 +ellps=WGS84 +units=m"); + test_forward

("eck3", 4.897000, 52.371000, 417367.858470, 4923223.990430, "+proj=eck3 +ellps=WGS84 +units=m"); + test_forward

("eck4", 4.897000, 52.371000, 383678.300021, 6304427.033917, "+proj=eck4 +ellps=WGS84 +units=m"); + test_forward

("eck5", 4.897000, 52.371000, 387191.346304, 5142132.228246, "+proj=eck5 +ellps=WGS84 +units=m"); + test_forward

("eck6", 4.897000, 52.371000, 342737.885307, 6363364.830847, "+proj=eck6 +ellps=WGS84 +units=m"); + test_forward

("eqc", 4.897000, 52.371000, 545131.546415, 5829913.052335, "+proj=eqc +ellps=WGS84 +units=m"); + test_forward

("eqdc", 4.897000, 52.371000, 307874.536263, 5810915.646438, "+proj=eqdc +ellps=WGS84 +units=m +lat_1=60 +lat_2=0"); + test_forward

("etmerc", 4.897000, 52.371000, 333425.492123, 5815921.814393, "+proj=etmerc +ellps=WGS84 +units=m"); + test_forward

("euler", 4.897000, 52.371000, 338753.024859, 5836825.984893, "+proj=euler +ellps=WGS84 +units=m +lat_1=60 +lat_2=0"); + test_forward

("fahey", 4.897000, 52.371000, 388824.354103, 5705638.873094, "+proj=fahey +ellps=WGS84 +units=m"); + test_forward

("fouc", 4.897000, 52.371000, 268017.369817, 6272855.564674, "+proj=fouc +ellps=WGS84 +units=m"); + test_forward

("fouc_s", 4.897000, 52.371000, 545131.546415, 5051361.531375, "+proj=fouc_s +ellps=WGS84 +units=m"); + test_forward

("gall", 4.897000, 52.371000, 385466.213109, 5354217.135929, "+proj=gall +ellps=WGS84 +units=m"); + test_forward

("geocent", 4.897000, 52.371000, 545131.546415, 5829913.052335, "+proj=geocent +ellps=WGS84 +units=m"); + test_forward

("geos", 4.897000, 52.371000, 313594.638994, 4711397.361812, "+proj=geos +ellps=WGS84 +units=m +h=40000000"); + test_forward

("gins8", 4.897000, 52.371000, 409919.989781, 6235811.415629, "+proj=gins8 +ellps=WGS84 +units=m"); + test_forward

("gn_sinu", 4.897000, 52.371000, 326082.668183, 6264971.711917, "+proj=gn_sinu +ellps=WGS84 +units=m +m=0.5 +n=1.785"); + test_forward

("gnom", 4.897000, 52.371000, 546462.815658, 8303824.612633, "+proj=gnom +ellps=WGS84 +units=m"); + test_forward

("goode", 4.897000, 52.371000, 360567.451176, 5782693.787691, "+proj=goode +ellps=WGS84 +units=m"); + test_forward

("gs48", -84.390000, 33.755000, 4904886.323054, 12421187.782392, "+proj=gs48 +ellps=WGS84 +units=m +lon1=-48"); + test_forward

("gs50", -84.390000, 33.755000, 3190310.148850, -564230.076744, "+proj=gs50 +ellps=WGS84 +units=m +lon1=-50"); + test_forward

("gstmerc", 4.897000, 52.371000, 333173.875017, 5815062.181746, "+proj=gstmerc +ellps=WGS84 +units=m"); + test_forward

("hammer", 4.897000, 52.371000, 370843.923425, 5630047.232233, "+proj=hammer +ellps=WGS84 +units=m"); + test_forward

("hatano", 4.897000, 52.371000, 383644.128560, 6290117.704632, "+proj=hatano +ellps=WGS84 +units=m"); + test_forward

("healpix", 4.897000, 52.371000, 1469886.5704, 6042138.5098, "+proj=healpix +ellps=WGS84 +units=m"); + test_forward

("rhealpix", 4.897000, 52.371000, -11477441.24814, 13972970.8457, "+proj=rhealpix +ellps=WGS84 +units=m"); + test_forward

("imw_p", 4.897000, 52.371000, 318784.808056, 3594184.939568, "+proj=imw_p +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=5"); + test_forward

("isea", 4.897000, 52.371000, -413613.639976, 9218173.701546, "+proj=isea +ellps=WGS84 +units=m"); + test_forward

("kav5", 4.897000, 52.371000, 383646.088858, 5997047.888175, "+proj=kav5 +ellps=WGS84 +units=m"); + test_forward

("kav7", 4.897000, 52.371000, 407769.043907, 5829913.052335, "+proj=kav7 +ellps=WGS84 +units=m"); + test_forward

("krovak", 14.416667, 50.083333, -743286.779768, -1043498.912060, "+proj=krovak +ellps=WGS84 +units=m"); + test_forward

("laea", 4.897000, 52.371000, 371541.476735, 5608007.251007, "+proj=laea +ellps=WGS84 +units=m"); + test_forward

("lagrng", 4.897000, 52.371000, 413379.673720, 6281547.821085, "+proj=lagrng +ellps=WGS84 +units=m +W=1"); + test_forward

("larr", 4.897000, 52.371000, 485541.716273, 6497324.523196, "+proj=larr +ellps=WGS84 +units=m"); + test_forward

("lask", 4.897000, 52.371000, 456660.618715, 6141427.377857, "+proj=lask +ellps=WGS84 +units=m"); + test_forward

("latlon", 4.897000, 52.371000, 0.085469, 0.914046, "+proj=latlon +ellps=WGS84 +units=m"); + test_forward

("latlong", 4.897000, 52.371000, 0.085469, 0.914046, "+proj=latlong +ellps=WGS84 +units=m"); + test_forward

("lcc", 4.897000, 52.371000, 319700.820572, 5828852.504871, "+proj=lcc +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_forward

("lcca", 4.897000, 52.371000, 363514.402883, 2555324.493896, "+proj=lcca +ellps=WGS84 +units=m +lat_0=30n +lat_1=55n +lat_2=60n"); + test_forward

("leac", 4.897000, 52.371000, 249343.870798, 6909632.226405, "+proj=leac +ellps=WGS84 +units=m"); + test_forward

("lee_os", -84.390000, 33.755000, 7657412.020774, 4716426.185485, "+proj=lee_os +ellps=WGS84 +units=m"); + test_forward

("longlat", 4.897000, 52.371000, 0.085469, 0.914046, "+proj=longlat +ellps=WGS84 +units=m"); + test_forward

("lonlat", 4.897000, 52.371000, 0.085469, 0.914046, "+proj=lonlat +ellps=WGS84 +units=m"); + test_forward

("loxim", 4.897000, 52.371000, 462770.371742, 5829913.052335, "+proj=loxim +ellps=WGS84 +units=m"); + test_forward

("lsat", -84.390000, 33.755000, 16342543.294793, -2092348.169198, "+proj=lsat +ellps=WGS84 +units=m +lsat=1 +path=1"); + test_forward

("mbt_fps", 4.897000, 52.371000, 392815.792409, 6007058.470101, "+proj=mbt_fps +ellps=WGS84 +units=m"); + test_forward

("mbt_s", 4.897000, 52.371000, 389224.301381, 5893467.204064, "+proj=mbt_s +ellps=WGS84 +units=m"); + test_forward

("mbtfpp", 4.897000, 52.371000, 345191.582111, 6098551.031494, "+proj=mbtfpp +ellps=WGS84 +units=m"); + test_forward

("mbtfpq", 4.897000, 52.371000, 371214.469979, 5901319.366034, "+proj=mbtfpq +ellps=WGS84 +units=m"); + test_forward

("mbtfps", 4.897000, 52.371000, 325952.066750, 6266156.827884, "+proj=mbtfps +ellps=WGS84 +units=m"); + test_forward

("merc", 4.897000, 52.371000, 545131.546415, 6833623.829215, "+proj=merc +ellps=WGS84 +units=m"); + test_forward

("mil_os", 4.897000, 52.371000, -1017212.552960, 3685935.358004, "+proj=mil_os +ellps=WGS84 +units=m"); + test_forward

("mill", 4.897000, 52.371000, 545131.546415, 6431916.372717, "+proj=mill +ellps=WGS84 +units=m"); + test_forward

("moll", 4.897000, 52.371000, 360567.451176, 6119459.421291, "+proj=moll +ellps=WGS84 +units=m"); + test_forward

("murd1", 4.897000, 52.371000, 333340.993642, 5839071.944597, "+proj=murd1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_forward

("murd2", 4.897000, 52.371000, 317758.821713, 6759296.097305, "+proj=murd2 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_forward

("murd3", 4.897000, 52.371000, 331696.409000, 5839224.186916, "+proj=murd3 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_forward

("natearth", 4.897000, 52.371000, 409886.629231, 5862282.218987, "+proj=natearth +ellps=WGS84 +units=m"); + test_forward

("nell", 4.897000, 52.371000, 454576.246081, 5355027.851999, "+proj=nell +ellps=WGS84 +units=m"); + test_forward

("nell_h", 4.897000, 52.371000, 438979.742911, 5386970.539995, "+proj=nell_h +ellps=WGS84 +units=m"); + test_forward

("nicol", 4.897000, 52.371000, 360493.071000, 5836451.532406, "+proj=nicol +ellps=WGS84 +units=m"); + test_forward

("nsper", 4.897000, 52.371000, 0.521191, 7.919806, "+proj=nsper +ellps=WGS84 +units=m +a=10 +h=40000000"); + test_forward

("nzmg", 174.783333, -36.850000, 2669448.884228, 6482177.102194, "+proj=nzmg +ellps=WGS84 +units=m"); + test_forward

("ob_tran", 4.897000, 52.371000, 8688996.467740, -3348342.663884, "+proj=ob_tran +ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50"); + test_forward

("ocea", 4.897000, 52.371000, 14168517.320298, -923135.204172, "+proj=ocea +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e"); + test_forward

("oea", 4.897000, 52.371000, 545723.850088, 5058869.127694, "+proj=oea +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e +m=1 +n=1"); + test_forward

("omerc", 4.897000, 52.371000, 1009705.329154, 5829437.254923, "+proj=omerc +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e"); + test_forward

("ortel", 4.897000, 52.371000, 360906.947408, 5829913.052335, "+proj=ortel +ellps=WGS84 +units=m"); + test_forward

("ortho", 4.897000, 52.371000, 332422.874291, 5051361.531375, "+proj=ortho +ellps=WGS84 +units=m"); + test_forward

("pconic", -70.400000, -23.650000, -2240096.398139, -6940342.146955, "+proj=pconic +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_0=60W"); + test_forward

("qsc", 4.897000, 52.371000, 543871.545186, 7341888.620371, "+proj=qsc +ellps=WGS84 +units=m"); + test_forward

("poly", 4.897000, 52.371000, 333274.269648, 5815908.957562, "+proj=poly +ellps=WGS84 +units=m"); + test_forward

("putp1", 4.897000, 52.371000, 375730.931178, 5523551.121434, "+proj=putp1 +ellps=WGS84 +units=m"); + test_forward

("putp2", 4.897000, 52.371000, 351480.997939, 5942668.547355, "+proj=putp2 +ellps=WGS84 +units=m"); + test_forward

("putp3", 4.897000, 52.371000, 287673.972013, 4651597.610600, "+proj=putp3 +ellps=WGS84 +units=m"); + test_forward

("putp3p", 4.897000, 52.371000, 361313.008033, 4651597.610600, "+proj=putp3p +ellps=WGS84 +units=m"); + test_forward

("putp4p", 4.897000, 52.371000, 351947.465829, 6330828.716145, "+proj=putp4p +ellps=WGS84 +units=m"); + test_forward

("putp5", 4.897000, 52.371000, 320544.316171, 5908383.682019, "+proj=putp5 +ellps=WGS84 +units=m"); + test_forward

("putp5p", 4.897000, 52.371000, 436506.666600, 5908383.682019, "+proj=putp5p +ellps=WGS84 +units=m"); + test_forward

("putp6", 4.897000, 52.371000, 324931.055842, 5842588.644796, "+proj=putp6 +ellps=WGS84 +units=m"); + test_forward

("putp6p", 4.897000, 52.371000, 338623.512107, 6396742.919679, "+proj=putp6p +ellps=WGS84 +units=m"); + test_forward

("qua_aut", 4.897000, 52.371000, 370892.621714, 5629072.862494, "+proj=qua_aut +ellps=WGS84 +units=m"); + test_forward

("robin", 4.897000, 52.371000, 394576.507489, 5570940.631371, "+proj=robin +ellps=WGS84 +units=m"); + test_forward

("rouss", 4.897000, 52.371000, 412826.227669, 6248368.849775, "+proj=rouss +ellps=WGS84 +units=m"); + test_forward

("rpoly", 4.897000, 52.371000, 332447.130797, 5841164.662431, "+proj=rpoly +ellps=WGS84 +units=m"); + test_forward

("sinu", 4.897000, 52.371000, 333528.909809, 5804625.044313, "+proj=sinu +ellps=WGS84 +units=m"); + test_forward

("somerc", 4.897000, 52.371000, 545131.546415, 6833623.829215, "+proj=somerc +ellps=WGS84 +units=m"); + test_forward

("stere", 4.897000, 52.371000, 414459.621827, 6255826.749872, "+proj=stere +ellps=WGS84 +units=m +lat_ts=30n"); + test_forward

("sterea", 4.897000, 52.371000, 121590.388077, 487013.903377, "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m"); + test_forward

("tcc", 4.897000, 52.371000, 332875.293370, 5841186.022551, "+proj=tcc +ellps=WGS84 +units=m"); + test_forward

("tcea", 4.897000, 52.371000, 332422.874291, 5841186.022551, "+proj=tcea +ellps=WGS84 +units=m"); + test_forward

("tissot", 4.897000, 52.371000, 431443.972539, 3808494.480735, "+proj=tissot +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_forward

("tmerc", 4.897000, 52.371000, 333425.492136, 5815921.814396, "+proj=tmerc +ellps=WGS84 +units=m"); + test_forward

("tpeqd", 4.897000, 52.371000, 998886.128891, 873800.468721, "+proj=tpeqd +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=0 +lon_2=30e"); + test_forward

("tpers", 4.897000, 52.371000, -1172311.936260, 6263306.090352, "+proj=tpers +ellps=WGS84 +units=m +tilt=50 +azi=20 +h=40000000"); + test_forward

("ups", 4.897000, 52.371000, 2369508.503532, -2312783.579527, "+proj=ups +ellps=WGS84 +units=m"); + test_forward

("urm5", 4.897000, 52.371000, 522185.854469, 5201544.371625, "+proj=urm5 +ellps=WGS84 +units=m +n=.3 +q=.3 +alpha=10"); + test_forward

("urmfps", 4.897000, 52.371000, 439191.083465, 5919500.887257, "+proj=urmfps +ellps=WGS84 +units=m +n=0.50"); + test_forward

("utm", 4.897000, 52.371000, 220721.998929, 5810228.672907, "+proj=utm +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_forward

("vandg", 4.897000, 52.371000, 489005.929978, 6431581.024949, "+proj=vandg +ellps=WGS84 +units=m"); + test_forward

("vandg2", 4.897000, 52.371000, 488953.592205, 6434578.861895, "+proj=vandg2 +ellps=WGS84 +units=m"); + test_forward

("vandg3", 4.897000, 52.371000, 489028.113123, 6430309.983824, "+proj=vandg3 +ellps=WGS84 +units=m"); + test_forward

("vandg4", 4.897000, 52.371000, 360804.549444, 5831531.435618, "+proj=vandg4 +ellps=WGS84 +units=m"); + test_forward

("vitk1", 4.897000, 52.371000, 338522.044182, 5839611.656064, "+proj=vitk1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_forward

("wag1", 4.897000, 52.371000, 348059.961742, 6344311.295111, "+proj=wag1 +ellps=WGS84 +units=m"); + test_forward

("wag2", 4.897000, 52.371000, 388567.174132, 6112322.636203, "+proj=wag2 +ellps=WGS84 +units=m"); + test_forward

("wag3", 4.897000, 52.371000, 447014.436776, 5829913.052335, "+proj=wag3 +ellps=WGS84 +units=m"); + test_forward

("wag4", 4.897000, 52.371000, 365021.547713, 6300040.998324, "+proj=wag4 +ellps=WGS84 +units=m"); + test_forward

("wag5", 4.897000, 52.371000, 379647.914735, 6771982.379506, "+proj=wag5 +ellps=WGS84 +units=m"); + test_forward

("wag6", 4.897000, 52.371000, 446107.907415, 5523551.121434, "+proj=wag6 +ellps=WGS84 +units=m"); + test_forward

("wag7", 4.897000, 52.371000, 366407.198644, 6169832.906560, "+proj=wag7 +ellps=WGS84 +units=m"); + test_forward

("weren", 4.897000, 52.371000, 402668.037596, 7243190.025762, "+proj=weren +ellps=WGS84 +units=m"); + test_forward

("wink1", 4.897000, 52.371000, 438979.742911, 5829913.052335, "+proj=wink1 +ellps=WGS84 +units=m"); + test_forward

("wink2", 4.897000, 52.371000, 472810.645318, 6313461.757868, "+proj=wink2 +ellps=WGS84 +units=m"); + test_forward

("wintri", 4.897000, 52.371000, 365568.851909, 5830576.163507, "+proj=wintri +ellps=WGS84 +units=m"); + + test_inverse

("aea", 334609.583974, 5218502.503686, 4.897000, 52.371000, "+proj=aea +ellps=WGS84 +units=m +lat_1=55 +lat_2=65"); + test_inverse

("aeqd", 384537.462363, 5809944.807548, 4.897000, 52.371000, "+proj=aeqd +ellps=WGS84 +units=m"); // F/I: 883.080918 + test_inverse

("aitoff", 384096.182830, 5831239.274680, 4.897000, 52.371000, "+proj=aitoff +ellps=WGS84 +units=m"); + test_inverse

("alsk", 7002185.416415, -3700467.546545, -84.389819, 33.754911, "+proj=alsk +ellps=WGS84 +units=m +lon_0=-150W"); // F/I: 19.398478 + test_inverse

("bipc", 3693973.674143, -8459972.647559, 4.897000, 52.371000, "+proj=bipc +ellps=WGS84 +units=m"); + test_inverse

("bonne", 333291.091896, 274683.016972, 4.897000, 52.371000, "+proj=bonne +ellps=WGS84 +units=m +lat_1=50"); + test_inverse

("cass", 333274.431072, 5815921.803069, 4.897007, 52.371001, "+proj=cass +ellps=WGS84 +units=m"); // F/I: 0.460628 + test_inverse

("cc", 545131.546415, 8273513.720038, 4.897000, 52.371000, "+proj=cc +ellps=WGS84 +units=m"); + test_inverse

("cea", -738753.247401, 5031644.669407, 4.897000, 52.371000, "+proj=cea +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_inverse

("collg", 280548.640940, 6148862.475491, 4.897000, 52.371000, "+proj=collg +ellps=WGS84 +units=m"); + test_inverse

("crast", 340944.220871, 5874029.522010, 4.897000, 52.371000, "+proj=crast +ellps=WGS84 +units=m"); + test_inverse

("eck1", 356112.818167, 5371202.270688, 4.897000, 52.371000, "+proj=eck1 +ellps=WGS84 +units=m"); + test_inverse

("eck2", 320023.223588, 6697754.654662, 4.897000, 52.371000, "+proj=eck2 +ellps=WGS84 +units=m"); + test_inverse

("eck3", 417367.858470, 4923223.990430, 4.897000, 52.371000, "+proj=eck3 +ellps=WGS84 +units=m"); + test_inverse

("eck4", 383678.300021, 6304427.033917, 4.897000, 52.371000, "+proj=eck4 +ellps=WGS84 +units=m"); + test_inverse

("eck5", 387191.346304, 5142132.228246, 4.897000, 52.371000, "+proj=eck5 +ellps=WGS84 +units=m"); + test_inverse

("eck6", 342737.885307, 6363364.830847, 4.897000, 52.371000, "+proj=eck6 +ellps=WGS84 +units=m"); + test_inverse

("eqc", 545131.546415, 5829913.052335, 4.897000, 52.371000, "+proj=eqc +ellps=WGS84 +units=m"); + test_inverse

("eqdc", 307874.536263, 5810915.646438, 4.897000, 52.371000, "+proj=eqdc +ellps=WGS84 +units=m +lat_1=60 +lat_2=0"); + test_inverse

("etmerc", 333425.492123, 5815921.814393, 4.897000, 52.371000, "+proj=etmerc +ellps=WGS84 +units=m"); + test_inverse

("euler", 338753.024859, 5836825.984893, 4.897000, 52.371000, "+proj=euler +ellps=WGS84 +units=m +lat_1=60 +lat_2=0"); + test_inverse

("fahey", 388824.354103, 5705638.873094, 4.897000, 52.371000, "+proj=fahey +ellps=WGS84 +units=m"); + test_inverse

("fouc", 268017.369817, 6272855.564674, 4.897000, 52.371000, "+proj=fouc +ellps=WGS84 +units=m"); + test_inverse

("fouc_s", 545131.546415, 5051361.531375, 4.897000, 52.371000, "+proj=fouc_s +ellps=WGS84 +units=m"); + test_inverse

("gall", 385466.213109, 5354217.135929, 4.897000, 52.371000, "+proj=gall +ellps=WGS84 +units=m"); + test_inverse

("geocent", 545131.546415, 5829913.052335, 4.897000, 52.371000, "+proj=geocent +ellps=WGS84 +units=m"); + test_inverse

("geos", 313594.638994, 4711397.361812, 4.897000, 52.371000, "+proj=geos +ellps=WGS84 +units=m +h=40000000"); + test_inverse

("gn_sinu", 326082.668183, 6264971.711917, 4.897000, 52.371000, "+proj=gn_sinu +ellps=WGS84 +units=m +m=0.5 +n=1.785"); + test_inverse

("gnom", 546462.815658, 8303824.612633, 4.897000, 52.371000, "+proj=gnom +ellps=WGS84 +units=m"); + test_inverse

("goode", 360567.451176, 5782693.787691, 4.897000, 52.371000, "+proj=goode +ellps=WGS84 +units=m"); + test_inverse

("gs48", 4904886.323054, 12421187.782392, -84.387019, 33.726470, "+proj=gs48 +ellps=WGS84 +units=m +lon1=-48"); // F/I: 3176.559347 + test_inverse

("gs50", 3190310.148850, -564230.076744, -84.389678, 33.754825, "+proj=gs50 +ellps=WGS84 +units=m +lon1=-50"); // F/I: 35.589174 + test_inverse

("gstmerc", 333173.875017, 5815062.181746, 4.897000, 52.371000, "+proj=gstmerc +ellps=WGS84 +units=m"); + test_inverse

("hatano", 383644.128560, 6290117.704632, 4.897000, 52.371000, "+proj=hatano +ellps=WGS84 +units=m"); + test_inverse

("healpix", 1469886.5704, 6042138.5098, 4.897000, 52.371000, "+proj=healpix +ellps=WGS84 +units=m"); + test_inverse

("rhealpix", -11477441.24814, 13972970.8457, 4.897000, 52.371000, "+proj=rhealpix +ellps=WGS84 +units=m"); + test_inverse

("imw_p", 318784.808056, 3594184.939568, 4.897000, 52.371000, "+proj=imw_p +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=5"); + test_inverse

("kav5", 383646.088858, 5997047.888175, 4.897000, 52.371000, "+proj=kav5 +ellps=WGS84 +units=m"); + test_inverse

("kav7", 407769.043907, 5829913.052335, 4.897000, 52.371000, "+proj=kav7 +ellps=WGS84 +units=m"); + test_inverse

("krovak", -743286.779768, -1043498.912060, 14.417630, 50.084517, "+proj=krovak +ellps=WGS84 +units=m"); // F/I: 148.642889 + test_inverse

("laea", 371541.476735, 5608007.251007, 4.897000, 52.371000, "+proj=laea +ellps=WGS84 +units=m"); + test_inverse

("latlon", 0.085469, 0.914046, 4.897000, 52.371000, "+proj=latlon +ellps=WGS84 +units=m"); + test_inverse

("latlong", 0.085469, 0.914046, 4.897000, 52.371000, "+proj=latlong +ellps=WGS84 +units=m"); + test_inverse

("lcc", 319700.820572, 5828852.504871, 4.897000, 52.371000, "+proj=lcc +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_inverse

("lcca", 363514.402883, 2555324.493896, 4.897000, 52.371000, "+proj=lcca +ellps=WGS84 +units=m +lat_0=30n +lat_1=55n +lat_2=60n"); + test_inverse

("leac", 249343.870798, 6909632.226405, 4.897000, 52.371000, "+proj=leac +ellps=WGS84 +units=m"); + test_inverse

("lee_os", 7657412.020774, 4716426.185485, -84.390000, 33.755000, "+proj=lee_os +ellps=WGS84 +units=m"); + test_inverse

("longlat", 0.085469, 0.914046, 4.897000, 52.371000, "+proj=longlat +ellps=WGS84 +units=m"); + test_inverse

("lonlat", 0.085469, 0.914046, 4.897000, 52.371000, "+proj=lonlat +ellps=WGS84 +units=m"); + test_inverse

("loxim", 462770.371742, 5829913.052335, 4.897000, 52.371000, "+proj=loxim +ellps=WGS84 +units=m"); + test_inverse

("lsat", 16342543.294793, -2092348.169198, -84.390000, 33.755000, "+proj=lsat +ellps=WGS84 +units=m +lsat=1 +path=1"); // F/I: 0.001160 + test_inverse

("mbt_fps", 392815.792409, 6007058.470101, 4.897000, 52.371000, "+proj=mbt_fps +ellps=WGS84 +units=m"); + test_inverse

("mbt_s", 389224.301381, 5893467.204064, 4.897000, 52.371000, "+proj=mbt_s +ellps=WGS84 +units=m"); + test_inverse

("mbtfpp", 345191.582111, 6098551.031494, 4.897000, 52.371000, "+proj=mbtfpp +ellps=WGS84 +units=m"); + test_inverse

("mbtfpq", 371214.469979, 5901319.366034, 4.897000, 52.371000, "+proj=mbtfpq +ellps=WGS84 +units=m"); + test_inverse

("mbtfps", 325952.066750, 6266156.827884, 4.897000, 52.371000, "+proj=mbtfps +ellps=WGS84 +units=m"); + test_inverse

("merc", 545131.546415, 6833623.829215, 4.897000, 52.371000, "+proj=merc +ellps=WGS84 +units=m"); + test_inverse

("mil_os", -1017212.552960, 3685935.358004, 4.897000, 52.371000, "+proj=mil_os +ellps=WGS84 +units=m"); + test_inverse

("mill", 545131.546415, 6431916.372717, 4.897000, 52.371000, "+proj=mill +ellps=WGS84 +units=m"); + test_inverse

("moll", 360567.451176, 6119459.421291, 4.897000, 52.371000, "+proj=moll +ellps=WGS84 +units=m"); + test_inverse

("murd1", 333340.993642, 5839071.944597, 4.897000, 52.371000, "+proj=murd1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_inverse

("murd2", 317758.821713, 6759296.097305, 4.897000, 52.371000, "+proj=murd2 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_inverse

("murd3", 331696.409000, 5839224.186916, 4.897000, 52.371000, "+proj=murd3 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_inverse

("natearth", 409886.629231, 5862282.218987, 4.897000, 52.371000, "+proj=natearth +ellps=WGS84 +units=m"); + test_inverse

("nell", 454576.246081, 5355027.851999, 4.897000, 52.371000, "+proj=nell +ellps=WGS84 +units=m"); + test_inverse

("nell_h", 438979.742911, 5386970.539995, 4.897000, 52.371000, "+proj=nell_h +ellps=WGS84 +units=m"); + test_inverse

("nsper", 0.521191, 7.919806, 4.897000, 52.371000, "+proj=nsper +ellps=WGS84 +units=m +a=10 +h=40000000"); + test_inverse

("nzmg", 2669448.884228, 6482177.102194, 174.783333, -36.850000, "+proj=nzmg +ellps=WGS84 +units=m"); + test_inverse

("ob_tran", 8688996.467740, -3348342.663884, 4.897000, 52.371000, "+proj=ob_tran +ellps=WGS84 +units=m +o_proj=moll +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50"); + test_inverse

("ocea", 14168517.320298, -923135.204172, 4.897000, 52.371000, "+proj=ocea +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e"); + test_inverse

("oea", 545723.850088, 5058869.127694, 4.897000, 52.371000, "+proj=oea +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e +m=1 +n=1"); + test_inverse

("omerc", 1009705.329154, 5829437.254923, 4.897000, 52.371000, "+proj=omerc +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e"); + test_inverse

("ortho", 332422.874291, 5051361.531375, 4.897000, 52.371000, "+proj=ortho +ellps=WGS84 +units=m"); + test_inverse

("pconic", -2240096.398139, -6940342.146955, -70.400000, -23.650000, "+proj=pconic +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_0=60W"); // F/I: 4424863.377843 + test_inverse

("qsc", 543871.545186, 7341888.620371, 4.897000, 52.371000, "+proj=qsc +ellps=WGS84 +units=m"); + test_inverse

("poly", 333274.269648, 5815908.957562, 4.897000, 52.371000, "+proj=poly +ellps=WGS84 +units=m"); + test_inverse

("putp1", 375730.931178, 5523551.121434, 4.897000, 52.371000, "+proj=putp1 +ellps=WGS84 +units=m"); + test_inverse

("putp2", 351480.997939, 5942668.547355, 4.897000, 52.371000, "+proj=putp2 +ellps=WGS84 +units=m"); + test_inverse

("putp3", 287673.972013, 4651597.610600, 4.897000, 52.371000, "+proj=putp3 +ellps=WGS84 +units=m"); + test_inverse

("putp3p", 361313.008033, 4651597.610600, 4.897000, 52.371000, "+proj=putp3p +ellps=WGS84 +units=m"); + test_inverse

("putp4p", 351947.465829, 6330828.716145, 4.897000, 52.371000, "+proj=putp4p +ellps=WGS84 +units=m"); // F/I: 0.003779 + test_inverse

("putp5", 320544.316171, 5908383.682019, 4.897000, 52.371000, "+proj=putp5 +ellps=WGS84 +units=m"); + test_inverse

("putp5p", 436506.666600, 5908383.682019, 4.897000, 52.371000, "+proj=putp5p +ellps=WGS84 +units=m"); + test_inverse

("putp6", 324931.055842, 5842588.644796, 4.897000, 52.371000, "+proj=putp6 +ellps=WGS84 +units=m"); + test_inverse

("putp6p", 338623.512107, 6396742.919679, 4.897000, 52.371000, "+proj=putp6p +ellps=WGS84 +units=m"); + test_inverse

("qua_aut", 370892.621714, 5629072.862494, 4.897000, 52.371000, "+proj=qua_aut +ellps=WGS84 +units=m"); + test_inverse

("robin", 394576.507489, 5570940.631371, 4.897000, 52.371000, "+proj=robin +ellps=WGS84 +units=m"); + test_inverse

("rouss", 412826.227669, 6248368.849775, 4.959853, 52.433747, "+proj=rouss +ellps=WGS84 +units=m"); // F/I: 8188.459174 + test_inverse

("sinu", 333528.909809, 5804625.044313, 4.897000, 52.371000, "+proj=sinu +ellps=WGS84 +units=m"); + test_inverse

("somerc", 545131.546415, 6833623.829215, 4.897000, 52.371000, "+proj=somerc +ellps=WGS84 +units=m"); + test_inverse

("sterea", 121590.388077, 487013.903377, 4.897000, 52.371000, "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m"); + test_inverse

("tcea", 332422.874291, 5841186.022551, 4.897000, 52.371000, "+proj=tcea +ellps=WGS84 +units=m"); + test_inverse

("tissot", 431443.972539, 3808494.480735, 4.897000, 52.371000, "+proj=tissot +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_inverse

("tmerc", 333425.492136, 5815921.814396, 4.897000, 52.371000, "+proj=tmerc +ellps=WGS84 +units=m"); + test_inverse

("tpeqd", 998886.128891, 873800.468721, 4.897000, 52.371000, "+proj=tpeqd +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=0 +lon_2=30e"); + test_inverse

("tpers", -1172311.936260, 6263306.090352, 4.897000, 52.371000, "+proj=tpers +ellps=WGS84 +units=m +tilt=50 +azi=20 +h=40000000"); + test_inverse

("ups", 2369508.503532, -2312783.579527, 4.897000, 52.371000, "+proj=ups +ellps=WGS84 +units=m"); + test_inverse

("urmfps", 439191.083465, 5919500.887257, 4.897000, 52.371000, "+proj=urmfps +ellps=WGS84 +units=m +n=0.50"); + test_inverse

("utm", 220721.998929, 5810228.672907, 4.897000, 52.371000, "+proj=utm +ellps=WGS84 +units=m +lon_0=11d32'00E"); + test_inverse

("vandg", 489005.929978, 6431581.024949, 4.897000, 52.371000, "+proj=vandg +ellps=WGS84 +units=m"); + test_inverse

("vitk1", 338522.044182, 5839611.656064, 4.897000, 52.371000, "+proj=vitk1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n"); + test_inverse

("wag1", 348059.961742, 6344311.295111, 4.897000, 52.371000, "+proj=wag1 +ellps=WGS84 +units=m"); + test_inverse

("wag2", 388567.174132, 6112322.636203, 4.897000, 52.371000, "+proj=wag2 +ellps=WGS84 +units=m"); + test_inverse

("wag3", 447014.436776, 5829913.052335, 4.897000, 52.371000, "+proj=wag3 +ellps=WGS84 +units=m"); + test_inverse

("wag4", 365021.547713, 6300040.998324, 4.897000, 52.371000, "+proj=wag4 +ellps=WGS84 +units=m"); + test_inverse

("wag5", 379647.914735, 6771982.379506, 4.897000, 52.371000, "+proj=wag5 +ellps=WGS84 +units=m"); + test_inverse

("wag6", 446107.907415, 5523551.121434, 4.897000, 52.371000, "+proj=wag6 +ellps=WGS84 +units=m"); + test_inverse

("weren", 402668.037596, 7243190.025762, 4.897000, 52.371000, "+proj=weren +ellps=WGS84 +units=m"); // F/I: 0.003779 + test_inverse

("wink1", 438979.742911, 5829913.052335, 4.897000, 52.371000, "+proj=wink1 +ellps=WGS84 +units=m"); + + + // Badly behaving inverse projections, to be reported to Gerald Evenden + // other (probably because it is in Southern Hemisphere and inverse turns up in Northern... + //test_inverse

("stere", 828919.243654, 12511653.499743, 2.183333, 41.383333, "+proj=stere +ellps=WGS84 +units=m +lat_ts=30n"); // F/I: 1238647.010132 // DIFFERENCE proj4/ggl: 4588423, (0.000000, 0.000000) +} + +int test_main(int, char* []) +{ + //test_all(); + //test_all(); + //test_all(); + //test_all(); + //test_all >(); + //test_all >(); + //test_all >(); + + // Leave only one here, because this divides compilation time with 6 or 7 + test_all >(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projections_combined.cpp b/src/boost/libs/geometry/test/srs/projections_combined.cpp new file mode 100644 index 000000000..b4fd0958f --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projections_combined.cpp @@ -0,0 +1,169 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2017, 2018. +// Modifications copyright (c) 2017-2018, 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) + + +#if defined(_MSC_VER) +#pragma warning( disable : 4305 ) // truncation double -> float +#endif // defined(_MSC_VER) + +#define BOOST_GEOMETRY_SRS_ENABLE_STATIC_PROJECTION_HYBRID_INTERFACE + +#include + +#include + +#include +#include + +#include +#include +#include + +#include "proj4.hpp" + +namespace srs = bg::srs; + +template +bool check_expected(P const& p1, P const& p2) +{ + return bg::math::abs(bg::get<0>(p1) - bg::get<0>(p2)) <= 1.0 + && bg::math::abs(bg::get<1>(p1) - bg::get<1>(p2)) <= 1.0; +} + +template +void test_forward(std::string const& id, GeoPoint const& geo_point, CartPoint const& cart_point, + StaticParams const& params, std::string const& proj4 = "") +{ + try + { + srs::projection prj = params; + + CartPoint xy; + prj.forward(geo_point, xy); + + bool ok = check_expected(xy, cart_point); + + BOOST_CHECK_MESSAGE(ok, + " id: " << id + << " point: " << bg::wkt(xy) + << " different than expected: " << bg::wkt(cart_point)); + + if (! proj4.empty()) + { + srs::projection<> prj2 = srs::proj4(proj4); + + CartPoint xy2; + prj2.forward(geo_point, xy2); + + bool eq2 = bg::equals(xy, xy2); + + BOOST_CHECK_MESSAGE(eq2, + " id: " << id << " result of static: " + << bg::wkt(xy) << " different than dynamic: " << bg::wkt(xy2)); + +#ifdef TEST_WITH_PROJ4 + pj_projection prj3(proj4); + + CartPoint xy3; + prj3.forward(geo_point, xy3); + + bool eq3 = bg::equals(xy, xy3); + + BOOST_CHECK_MESSAGE(eq3, + " id: " << id << " result: " + << bg::wkt(xy) << " different than proj4: " << bg::wkt(xy3)); +#endif // TEST_WITH_PROJ4 + } + } + catch(bg::projection_exception const& e) + { + std::cout << "Exception in " << id << " : " << e.code() << std::endl; + } + catch(...) + { + std::cout << "Exception (unknown) in " << id << std::endl; + } +} + +template +void test_forward(std::string const& id, GeoPoint const& geo_point, CartPoint const& cart_point, + std::string const& proj4 = "") +{ + test_forward(id, geo_point, cart_point, StaticParams(), proj4); +} + +template +void test_all() +{ + typedef bg::model::point > geo_point_type; + typedef bg::model::point cart; + + geo_point_type amsterdam = bg::make(4.8925, 52.3731); + geo_point_type utrecht = bg::make(5.1213, 52.0907); + + geo_point_type anchorage = bg::make(-149.90, 61.22); + geo_point_type juneau = bg::make(-134.42, 58.30); + + geo_point_type auckland = bg::make(174.74, -36.84); + geo_point_type wellington = bg::make(177.78, -41.29); + + geo_point_type aspen = bg::make(-106.84, 39.19); + geo_point_type denver = bg::make(-104.88, 39.76); + + using namespace srs::spar; + + // IGH (internally using moll/sinu) + { + typedef parameters params_t; + std::string sparams = "+proj=igh +ellps=sphere +units=m"; + test_forward("igh-am", amsterdam, cart(1489299.1509520211, 5776413.4260336142), sparams); + test_forward("igh-ut", utrecht, cart(1498750.6627020084, 5747394.3313896423), sparams); + test_forward("igh-as", aspen, cart(-11708973.126426676, 4357727.1232166551), sparams); + test_forward("igh-de", denver, cart(-11536624.264589204, 4421108.2015589233), sparams); + test_forward("igh-au", auckland, cart(18658819.353676274, -4096419.1686476548), sparams); + test_forward("igh-we", wellington, cart(18733710.557981707, -4591140.1631184481), sparams); + test_forward("igh-an", anchorage, cart(-14275110.630537530, 6648284.9393376000), sparams); + test_forward("igh-ju", juneau, cart(-13421076.123140398, 6368936.3597440729), sparams); + } + + // Using moll + { + typedef parameters, units_m, o_lat_p<>, o_lon_p<> > params_t; + params_t params = params_t(proj_ob_tran(), ellps_wgs84(), o_proj(), units_m(), o_lat_p<>(10), o_lon_p<>(90)); + std::string sparams = "+proj=ob_tran +ellps=WGS84 +o_proj=moll +units=m +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50"; + test_forward("obt-m-am", amsterdam, cart(8688778.3518596273, -3348126.4518623645), params, sparams); + test_forward("obt-m-ut", utrecht, cart(8693109.5205437448, -3379708.1134765535), params, sparams); + test_forward("obt-m-as", aspen, cart(3691751.3259231807, 2371456.9674431868), params, sparams); + test_forward("obt-m-de", denver, cart(3764685.2104777521, 2185616.0182080171), params, sparams); + } + + // Using sinu + { + // In Proj4 >= 5.0.0 ob_tran projection doesn't overwrite the ellipsoid's parameters to make sphere in underlying projection + // So in order to use spherical sinu projection WGS84-compatible sphere has to be set manually. + typedef parameters, es<>, o_proj, units_m, o_lat_p<>, o_lon_p<> > params_t; + params_t params = params_t(proj_ob_tran(), a<>(6378137), es<>(0), o_proj(), units_m(), o_lat_p<>(10), o_lon_p<>(90)); + std::string sparams = "+proj=ob_tran +a=6378137 +es=0 +o_proj=sinu +units=m +o_lat_p=10 +o_lon_p=90 +o_lon_o=11.50"; + test_forward("obt-s-am", amsterdam, cart(9220221.4221933037, -3059652.3579233172), params, sparams); + test_forward("obt-s-ut", utrecht, cart(9216281.0977674071, -3089427.4415689218), params, sparams); + test_forward("obt-s-as", aspen, cart(4010672.3356677019, 2150730.9484995930), params, sparams); + test_forward("obt-s-de", denver, cart(4103945.8062708224, 1979964.9315176210), params, sparams); + } +} + +int test_main(int, char* []) +{ + test_all(); + + return 0; +} diff --git a/src/boost/libs/geometry/test/srs/projections_static.cpp b/src/boost/libs/geometry/test/srs/projections_static.cpp new file mode 100644 index 000000000..86e243951 --- /dev/null +++ b/src/boost/libs/geometry/test/srs/projections_static.cpp @@ -0,0 +1,290 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2017, 2018. +// Modifications copyright (c) 2017-2018, 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) + + +#if defined(_MSC_VER) +#pragma warning( disable : 4305 ) // truncation double -> float +#endif // defined(_MSC_VER) + +#include + +#include + +#include +#include + +#include +#include +#include + + +template